Views:

Behavior:
The DocuWare fulltext does not support every document type or languages, so that these documents can’t be found via DocuWare fulltext search.


Solution:
Therefore DocuWare offers with the Service Pack 1 for Version 5.1c the possibility via GAPI, to store documents, with external delivered fulltext information.

First a document object must be created, which is filled with the external delivered information via the IModifyMetaDataCommand.SetFulltext() method and afterwards, it has to be stored via GAPI.

In general there are two possibilites to set the fulltext on a document:

  • On IUnfiledDocument
  • On IUnfiledDocumentSection


Set the fulltext on whole document:

//Create your UnfiledDocument and a storageCommand (IFileCabinet Object required)
DocuWare.Gapi.Document.IUnfiledDocument myNewDocument = myGapiClient.GetDocument(filename);
DocuWare.Gapi.Command.FileCabinet.IFileCabinetStorageCommand myStorageCommand = MyUsedFileCabinet.Commands.newStorage();

//Create a ModifyMetaDataCommand (now the whole document is used)
DocuWare.Gapi.Command.Document.IModifyMetaDataCommand myModifyCommand = myNewDocument.Commands.newModifyMetaData();

//Fill the command with the fulltext information
myModifyCommand.SetFulltext(fulltext);

//Execute the command, so that the IUnfiledDocument MetaData is changed
myModifyCommand.Execute();

//Reference the just filled document on the IStorageCommand and execute it, to store the document
myStorageCommand.UnfiledDocument = myNewDocument;
myStorageCommand.Execute();


Set the fulltext on specific page (section):

//Create your UnfiledDocument and a storageCommand (IFileCabinet Object required)
DocuWare.Gapi.Document.IUnfiledDocument myNewDocument = myGapiClient.GetDocument(filename);
DocuWare.Gapi.Command.FileCabinet.IFileCabinetStorageCommand myStorageCommand = MyUsedFileCabinet.Commands.newStorage();

//Reference the ModifyCommand on the according Section of the document
myModifyFulltextCommand = myUnfiledDocument.Sections[0].Commands.newModifyMetaData();

//Now fill the command, with the fulltext, which should be transferred and execute it
myModifyFulltextCommand.SetFulltext(fulltext);
myModifyFulltextCommand.Execute();

//Reference the just filled document on the IStorageCommand and execute it, to store the document
myStorageCommand.UnfiledDocument = myNewDocument;
myStorageCommand.Execute();


Using this methods, the document is stored in the according DocuWare file cabinet and the fulltext information are written into the ftm table.


But before this document can be found within a DocuWare fulltext search, the fulltext information has to be written into the fulltext catalog, which is done by the DocuWare fulltext workflow. This means, that the workflow has to run at least one time after document storage and then you can search for this document in a fulltext search.


If you change a document, which was stored with fulltext information via GAPI, afterwards, the document will be marked as changed and will be re-indexed during the next fulltext workflow run, so that the fulltext information delivered by GAPI are lost!