An Annotation
object represents incidental information that can be attached to an object for
the purpose of annotating or footnoting that object. You can associate annotations
with custom objects, documents, and folders (Containable
objects). Characteristics of an annotation
include the following:
ContentElement
objects. However, unlike a persisted document whose content elements are frozen for a particular version, an annotation is non-versionable, and its content elements can be added to or deleted from. See Retrieving Annotations for a code example. For a general discussion of content, see Document Content in the Content Engine Administration help.createAnnotation
method.
For folders and custom objects, you use a Factory
method to create a new Annotation
object, then set its AnnotatedObject
property to the folder or custom object to be annotated.
For code examples, see Annotating a Document and Annotating a Folder.
Annotation
object on only one document, folder, or custom object.StorageArea
and
StoragePolicy
can be set. For a general discussion of storage areas and policies, see Content Storage in the Content Engine Administration help.StorageArea
to another. See Moving Content to a Different Storage Area for a code example.Link
interface for more information.ClassDescription
object as you would work with the class descriptions associated with other Content Engine objects. For example, you can:
Annotation
object, you might want to determine if the default
security is appropriate for your application or you might display the default
security in a user interface and allow the user to change the security. If you are using Workplace or Workplace XT, be aware that these applications limit permissions on annotations to the following simplified permission levels: Owner Control, Modify Content, and View Content. For more information, see the Available permission levels topic (in User Help > Actions, preferences and tools > Work with Security > Manage Security). These applications do not honor custom access rights that you set on annotations using the API.ClassDescription
object's property descriptions, which are metadata
objects that describe the Annotation
object's properties. For example, when
you create an annotation you might want to include code for retrieving a specific
annotation ClassDescription
, then for checking which custom properties require
setting.ClassDescription
object's properties. For example, you might want to
return the ClassDescription
object's DisplayName property to display in a user interface
from which the user can select a class.ClassDescription
objects containing the base class
and all subclasses.Annotation
class via the Enterprise Manager application or the Content Engine APIs. Note that the property description settings of the new class will apply to new instances of the class, but they will not apply to existing instances. For code examples, see Creating an Annotation Subclass.Annotation
class is the ISAnnotation
subclass that supports Content Federation Services for Image Services (CFS-IS). This subclass is installed via the CFS-IS Extensions feature addon. For more information about CFS-IS, see the IBM FileNet P8 Content Federation Services for Image Services Guidelines. To download IBM FileNet documentation from the IBM support page, see Accessing IBM FileNet documentation.The following Java pseudocode illustrates, at a high level, how to programmatically copy the annotation content and reset the IDs. The pseudocode is not a complete program and is not intended to be run as-is; you must make any modifications necessary for your environment before using this code:
// Create the Annotation object properties with the document com.filenet.wcm.api.Document doc; //this document has the annotation to be copied com.filenet.wcm.api.Properties props = ObjectFactory.getProperties(); //Get the Annotation class property com.filenet.wcm.api.Property prop = ObjectFactory.getProperty(Property.ANNOTATED_OBJECT); prop.setValue(doc); props.add(prop); // Get the annotation to be copied from the original document Annotation oldAnnotation; // get the annotation from the old document Document d = oldAnnotation.getXMLDoc(); Element root = d.getDocumentElement(); Element propDesc = WcmXMLUtil.getChildElement(root, PROPDESC); // Create a new Annotation object Annotation apiNote = (Annotation)objectStore.createObject(ClassDescription.ANNOTATION, props, oldAnnotation.getPermissions()); String newGUID = apiNote.getId(); // get the new ID // Set the new IDs and copy annotation content to a new document propDesc.setAttribute(F_ANNOTATEDID, newGUID); propDesc.setAttribute(F_ID, newGUID); apiNote.setContent(oldAnnotation.getContent());
For additional conceptual information, see Annotations in the Content Engine Administration Help.