Documents that are checked into the Content Engine require a class. A document can be classified manually, by selecting the document's class, or it can be classified automatically when the document is checked in. The Content Engine provides an extensible framework that enables an incoming document of a specified MIME type to be automatically assigned to a target document class, and sets selected properties of that target class based on values that are found in the incoming document. A classification component, or classifier, does the work of assigning a document class. One such classifier that is packaged with the Content Engine is the XML classifier. For information, see Classification Flowchart and Understanding the XML Classifier.
Custom Classifier Requirements
To plug a custom classifier into the document classification framework, follow these tasks:
the applicable class to the
Documentobject that is passed to it. Typically, this effort involves extracting metadata from the content of the
Documentobject and mapping it to the class properties inherited by the object. You can implement your classifier to support one or multiple MIME types.
For a classifier that is implemented with Java, you can package the class in a JAR file, and check in your class or JAR file as a CodeModule object in a Content Engine object store. Alternatively, you can specify the classifier in the class path of the application server where the Content Engine is running. A document classifier runs asynchronously on the Content Engine.
- Create a DocumentClassificationAction object. You instantiate
an object with the Factory.DocumentClassificationAction
createInstancemethod, then set the following required properties:
- The display name of the document classification action to identify it (DisplayName property).
- The MIME type to associate documents of a certain content type
with a classifier implemented to handle documents of that type (MimeType
property). A MIME type can map only to one classifier; therefore,
the MimeType property of one
DocumentClassificationActionobject must be different from the MimeType property of other
- The program ID (ProgId property) that identifies the classifier
store a classifier that is implemented for Java, you must also set the
DocumentClassificationActionobject's CodeModule property.
For code examples on implementing a document classifier and
on creating a
see Working with Document
Classification-related Objects. For more information, see Action Handlers.
Document Check-in Process
can automatically classify documents with a content type that matches
the MIME type property of an existing
To automatically classify a new document, you create a Document object and follow these tasks:
- Set the
Documentobject's MimeType property to match the value of the
DocumentClassificationAction's MimeType property. Although the
Documentobject's MimeType property is not required, it is recommended that you set it to ensure that the intended document classifier is started. If you don't set the MimeType property, the Content Engine maps the content element's file extension to the MIME type, and the result might be different from what you anticipate. See About MIME Types.
- Call the
checkinmethod of the
Documentobject, specifying the
Document object is checked into the object
store with an initial class, and the object's ClassificationStatus property is set to
Document classification is an asynchronous action; therefore, the
auto-classification request is queued, represented by a DocumentClassificationQueueItem object.
The Classification Manager is responsible for dequeuing
a classification request and processing it. The Classification Manager
obtains the MIME type from the target document, locates the
that is registered for that MIME type, and starts the classifier that
is identified in the
A classifier operates with the same access permissions of the user
who initiates the document check-in.
When document classification
is complete, the
Document object's ClassificationStatus
property is updated to indicate success or failure. If classification
fails, the initial class that is assigned to the document remains.
If classification succeeds, a new class is assigned to the document
and a ClassifyCompleteEvent object is triggered.