Adding custom document types

Aware IM comes with a number of predefined document types: - Report, MS Word, Text, MS Excel, HTML. These documents types should be sufficient for most applications. If, however, an application uses other document formats new document types can be added to Aware IM.

Note that adding new document types is only necessary if you want to include tags in documents and you want Aware IM to replace tags with specific attribute values at run time. If you want to use documents without modifying them you can just attach a document in any format to a form of a business object that has an attribute of the Document type defined and Aware IM will store the document in the database. In this case Aware IM does not need to know about the internal structure of the document.

To add a new document type to Aware IM follow the steps below:

  1. Write the code for the component that will work with documents of the new type on the client side (see Implementing Client Side Component for details).
  2. Write the code for the component that will work with documents of the new type on the server side (see Implementing Server Side Component for details).
  3. Compile the source code of your components and package them in a jar file(s). Make sure that the jar file resides in the AwareIM/CustomJars directory (see section 2).
  4. Add the definition of a new document type to the BASServer.props file located in the BIN directory of your Aware IM installation. You have to modify the line that sets the DocumentEngines property to add the fully qualified name of your server side component. For example (note text com.mypackage.MyServerDocEngine):
    DocumentEngines=com.bas.basserver.documents.JasperReportsEngine,com.bas.basserver.documents.MSWordDocumentEngine,com.bas.basserver.documents.TextDocumentEngine,com.bas.basserver.documents.HtmlDocumentEngine,com.bas.basserver.documents.MSExcelDocumentEngine,com.mypackage.MyServerDocEngine

Note that you have to make sure that the jar file with your server side component as well as the modifications to BASServer.props file are available to the Aware server that hosts your application (see Aware IM Installation Guide for details).

If everything has been done correctly the new document type must appear in the list of document types displayed by the Document Template Property Editor (see Adding/Editing Document Templates).

  • Last modified: 2023/04/05 09:06