Novell exteNd
Director 5.2 API

com.sssw.cm.api
Interface EbiAddDocumentParams

All Superinterfaces:
Serializable

public interface EbiAddDocumentParams
extends Serializable

Objects that implement this interface define the set of parameters that are passed in to the EbiContentManager.addDocument method. The following are the parameters that are mandatory for the successful creation of a new Document, although certain defaults may be used (see below):

The following defaults are applied by the Content Management API if the values are not provided:

Other defaults are:

Example-1:

 EbiContentMgmtDelegate cmgr = com.sssw.cm.client.EboFactory.getDefaultContentMgmtDelegate();
 EbiAddDocumentParams params = cmgr.createAddDocumentParams();
 EbiDocType docType = cmgr.getDocumentTypeByName(context, "MovieReview");
 params.setAuthor("jsmith");
 params.setTitle("The Matrix");
 params.setDocTypeID(docType.getDocTypeID());
 params.setMimeType("text/xml");
 params.setContent(byteArrayContent);
 params.setComment("Initial revision.");
 params.setPublishImmediately(true);
 cmgr.addDocument(context, params);
 
Example-2:
 EbiContentMgmtDelegate contentMgr = com.sssw.cm.client.EboFactory.getDefaultContentMgmtDelegate();
 EbiAddDocumentParams params = contentMgr.createAddDocumentParams();
 String docFromXML = "C:\\tmp\\contentmgmt-document_4_0_sample.xml";
 org.w3c.dom.Document docProps = EboXmlUtil.createDocument(new FileInputStream(docFromXML));
 org.w3c.dom.Element elem = docProps.getDocumentElement();
 params.fromXML(context, contentMgr, elem);
 EbiDocument document = contentMgr.addDocument(context, params);
 

See Also:
EbiContentMgmtDelegate

Method Summary
 void clear()
          Clears out any information set into the object via the setter methods.
 void fromXML(EbiContext context, EbiContentMgmtDelegate cmgr, Node node)
          Populates this object with values from an XML Node describing a CM Document per contentmgmt-document_4_0.dtd.
 void fromXML(EbiContext context, EbiContentMgmtDelegate cmgr, Node node, EbiXmlDataOptions options)
          Populates this object with values from an XML Node describing a CM Document.
 String getAbstract()
          Gets the Document Abstract.
 Acl getAcl()
          Gets the ACL set into the params object
 String getAuthor()
          Gets the Author.
 String[] getCategoryIDs()
          Gets the list of the Category IDs.
 boolean getCheckOut()
          Gets the value of the 'check out' option.
 String getComment()
          Gets the Comment parameter
 byte[] getContent()
          Gets the Content, if any, that was set into the params object
 Timestamp getCreated()
          Gets the Creation Date/Time
 String getDocID()
          Gets the UUID of the Document.
 String getDocTypeID()
          Gets the ID of the Document Type
 Timestamp getExpirationDate()
          Gets the Expiration Date/Time.
 EbiDocExtnMeta getExtensionMetaData()
          Gets the Extension Metadata Fields info, if set.
 String getFolderID()
          Gets the ID of the Parent Folder
 EbiDocLayoutSet getLayoutSet()
          Gets the Document Layout Set, if specified.
 String getLockedBy()
          Gets the ID of the user to whom the newly added Document is to be checked out.
 String getMimeType()
          Gets the MIME type of the Content, if any specified.
 String getName()
          Gets the Name of the Document
 boolean getOverwrite()
          Gets the 'overwrite' option.
 String getParentDocID()
          Gets the ID of the Parent Document
 Timestamp getPublishDate()
          Gets the Publish Date/Time.
 boolean getPublishImmediately()
          Gets the value of the 'publish immediately' option.
 String getStatus()
          Gets the Status from the params object.
 String getSubtitle()
          Gets the Subtitle.
 String getTitle()
          Gets the Title.
 Timestamp getUpdateTime()
          Gets the Update Time.
 String getUpdateUser()
          Gets the Update User.
 void populate(EbiContext context, EbiDocument doc, int docParts)
          Populates this object with values from the specified Document.
 void setAbstract(String docAbstract)
          Sets the Abstract.
 void setAcl(Acl acl)
          Sets the Access Control List for the Document (optional).
 void setAuthor(String author)
          Sets the Author.
 void setCategories(String[] categoryIDs)
          Specifies the set of Categories, if any, to which the newly added Document will belong.
 void setCheckOut(boolean checkOut)
          Sets the 'check out' option.
 void setComment(String comment)
          Sets the Comment for the newly created Content, e.g.
 void setContent(byte[] content)
          Specifies the Content of the Document (optional).
 void setCreated(Timestamp created)
          Sets the Creation Date/Time
 void setDocID(String docID)
          Sets the UUID for the Document.
 void setDocTypeID(String docTypeID)
          Sets the Document Type ID.
 void setExpirationDate(Timestamp expirationDate)
          Sets the Expiration Date, i.e.
 void setExtensionMetaData(EbiDocExtnMeta extnMetaData)
          Sets the Extension Metadata Fields values for this Document.
 void setFolderID(String folderID)
          Sets the Parent Folder ID.
 void setLayoutSet(EbiDocLayoutSet layoutSet)
          Sets the Document Layout Set (optional).
 void setLockedBy(String lockedBy)
          Sets the ID of the user to whom the newly added Document is to be checked out.
 void setMimeType(String mimeType)
          Specifies the MIME type of the Document's contents.
 void setName(String name)
          Sets the Document's name.
 void setOverwrite(boolean overwrite)
          Sets the 'overwrite' option.
 void setParentDocID(String parentDocID)
          Sets the Parent Document ID (optional).
 void setPublishDate(Timestamp publishDate)
          Sets the Publish Date.
 void setPublishImmediately(boolean publishImmed)
          Sets the 'publish immediately' option.
 void setStatus(String status)
          Sets the Status (optional).
 void setSubtitle(String subtitle)
          Sets the Subtitle.
 void setTitle(String title)
          Sets the Title.
 void setUpdateTime(Timestamp updateTime)
          Sets the update time for the newly added Document.
 void setUpdateUser(String userID)
          Sets the update user for the newly added Document.
 

Method Detail

setDocID

public void setDocID(String docID)
Sets the UUID for the Document. Calling this method is optional. If no UUID is provided in EbiAddDocumentParams, a UUID is generated for the new Document by the system.
Parameters:
docID - the UUID for the Document

setName

public void setName(String name)
Sets the Document's name. This method must be called prior to passing EbiAddDocumentParams into EbiContentManager.addDocument
Parameters:
name - the name for the Document; must not contain the '/' character due to the fact that it is used as the separator in Directory Entry paths

setDocTypeID

public void setDocTypeID(String docTypeID)
Sets the Document Type ID. This method must be called prior to passing EbiAddDocumentParams into EbiContentManager.addDocument
Parameters:
docTypeID - the Document Type ID

setParentDocID

public void setParentDocID(String parentDocID)
Sets the Parent Document ID (optional). Pass in the value of null to indicate that the document being added has no Parent Document; or do not call this method (the default is "no parent").
Parameters:
parentDocID - the ID of the Parent Document

setUpdateTime

public void setUpdateTime(Timestamp updateTime)
Sets the update time for the newly added Document. By default, the system fills in this information at the time of Document's creation.
Parameters:
updateTime - the update time for the newly added Document

setUpdateUser

public void setUpdateUser(String userID)
Sets the update user for the newly added Document. By default, the system fills in this information at the time of Document's creation, based on the context that is passed into the addDocument method.
Parameters:
userID - the update user for the newly added Document

setFolderID

public void setFolderID(String folderID)
Sets the Parent Folder ID. This method must be called prior to passing EbiAddDocumentParams into EbiContentManager.addDocument
Parameters:
folderID - the Parent Folder ID

setCategories

public void setCategories(String[] categoryIDs)
Specifies the set of Categories, if any, to which the newly added Document will belong.
Parameters:
categoryIDs - the list of Category IDs

setAuthor

public void setAuthor(String author)
Sets the Author.
Parameters:
author - the Author

setCreated

public void setCreated(Timestamp created)
Sets the Creation Date/Time
Parameters:
created - the Creation Date/Time

setTitle

public void setTitle(String title)
Sets the Title.
Parameters:
title - the Title

setSubtitle

public void setSubtitle(String subtitle)
Sets the Subtitle.
Parameters:
subtitle - the Subtitle

setAbstract

public void setAbstract(String docAbstract)
Sets the Abstract.
Parameters:
docAbstract - the Abstract

setPublishDate

public void setPublishDate(Timestamp publishDate)
Sets the Publish Date. The value of null implies that the Document is to be published immediately. Use the value specifying a point in relatively distant future if you don't want the Document to be published immediately but are not sure yet what the date should be. If this method is not called, the value is assumed to be null.
Parameters:
publishDate - the Publish Date/Time

setExpirationDate

public void setExpirationDate(Timestamp expirationDate)
Sets the Expiration Date, i.e. the date when the Document is to expire and be taken out of the "live" area. The value of null implies "never expire". If this method is not called, the value is assumed to be null.
Parameters:
expirationDate - the Expiration Date/Time

setLockedBy

public void setLockedBy(String lockedBy)
Sets the ID of the user to whom the newly added Document is to be checked out. Note: if the "check out" option is set to true, then the "locked by" value is overridden and the Document is checked out to the user whose context is passed in to the addDocument method.
Parameters:
lockedBy - the user ID

setExtensionMetaData

public void setExtensionMetaData(EbiDocExtnMeta extnMetaData)
Sets the Extension Metadata Fields values for this Document. If the document belongs to a Document Type that has at least one associated Extension Metadata Field, then the creator of the Document must provide values for the fields via this method.
Parameters:
extnMetaData - the Extension Metadata

setLayoutSet

public void setLayoutSet(EbiDocLayoutSet layoutSet)
Sets the Document Layout Set (optional).
Parameters:
layoutSet - the Layout Set

setStatus

public void setStatus(String status)
Sets the Status (optional). Sets the original Status of the Document, which is application-specific, e.g. "created" or "submitted".
Parameters:
status - the Status of the Document

setMimeType

public void setMimeType(String mimeType)
Specifies the MIME type of the Document's contents. Both the MIME type and the content byte array must be specified in order for the content to be added.
Parameters:
mimeType - the MIME type of the contents

setContent

public void setContent(byte[] content)
Specifies the Content of the Document (optional). Both the MIME type and the content byte array must be specified in order for the Content to be added.
Parameters:
content - the Content

setComment

public void setComment(String comment)
Sets the Comment for the newly created Content, e.g. "initial revision" or "created"
Parameters:
comment - the Comment

setAcl

public void setAcl(Acl acl)
Sets the Access Control List for the Document (optional). If the ACL is not supplied, the ACL of the Parent Folder is used; if the Parent Folder has no ACL, then no ACL is set on the Document.
Parameters:
acl - the Access Control List

setPublishImmediately

public void setPublishImmediately(boolean publishImmed)
Sets the 'publish immediately' option. The default is not to publish immediately.
Parameters:
publishImmed - if true, the newly added Document is published immediately, otherwise not published

setCheckOut

public void setCheckOut(boolean checkOut)
Sets the 'check out' option. The default is not to check out.
Parameters:
checkOut - if true, check out the newly added Document to the user whose context is passed in to the addDocument method, if false, don't check out

setOverwrite

public void setOverwrite(boolean overwrite)
Sets the 'overwrite' option. The default is not to overwrite.
Parameters:
overwrite - if true and a Document is found with the same name as the one being added in the specified folder, then the existing Document is overwritten with the new one; if false and already exists, an exception is thrown

getDocID

public String getDocID()
Gets the UUID of the Document.
Returns:
the UUID of the Document, or null if not set

getName

public String getName()
Gets the Name of the Document
Returns:
Document Name

getDocTypeID

public String getDocTypeID()
Gets the ID of the Document Type
Returns:
the Document Type ID; null if not specified

getParentDocID

public String getParentDocID()
Gets the ID of the Parent Document
Returns:
Parent Document ID; null if not specified

getFolderID

public String getFolderID()
Gets the ID of the Parent Folder
Returns:
the ID of the Parent Folder; null if not specified

getCategoryIDs

public String[] getCategoryIDs()
Gets the list of the Category IDs.
Returns:
the list of the Category IDs, or null if not set

getAuthor

public String getAuthor()
Gets the Author.
Returns:
Author, null if not set

getCreated

public Timestamp getCreated()
Gets the Creation Date/Time
Returns:
the Creation Date/Time

getTitle

public String getTitle()
Gets the Title.
Returns:
the Title, null if not set

getSubtitle

public String getSubtitle()
Gets the Subtitle.
Returns:
the Subtitle, null if not set

getAbstract

public String getAbstract()
Gets the Document Abstract.
Returns:
the Document Abstract

getPublishDate

public Timestamp getPublishDate()
Gets the Publish Date/Time.
Returns:
the Publish Date/Time, null if not set

getExpirationDate

public Timestamp getExpirationDate()
Gets the Expiration Date/Time.
Returns:
the Expiration Date/Time, null if not set

getLockedBy

public String getLockedBy()
Gets the ID of the user to whom the newly added Document is to be checked out. Note: if the 'check out' option is set to true, then the 'locked by' value is overridden and the Document is checked out to the user whose context is passed in to the addDocument method.
Returns:
the user ID or null if not specified

getExtensionMetaData

public EbiDocExtnMeta getExtensionMetaData()
Gets the Extension Metadata Fields info, if set.
Returns:
the Extension Field metadata

getLayoutSet

public EbiDocLayoutSet getLayoutSet()
Gets the Document Layout Set, if specified.
Returns:
the Layout Set, or null if not specified

getStatus

public String getStatus()
Gets the Status from the params object.
Returns:
the Status, or null if not set

getUpdateTime

public Timestamp getUpdateTime()
Gets the Update Time.
Returns:
the Update Time or null if not specified

getUpdateUser

public String getUpdateUser()
Gets the Update User.
Returns:
the user ID of the Update User or null if not specified

getMimeType

public String getMimeType()
Gets the MIME type of the Content, if any specified.
Returns:
the MIME type, or null if not set

getContent

public byte[] getContent()
Gets the Content, if any, that was set into the params object
Returns:
the Content; null if none set

getComment

public String getComment()
Gets the Comment parameter
Returns:
the Comment text, null if not set

getAcl

public Acl getAcl()
Gets the ACL set into the params object
Returns:
the ACL set into the params object

getPublishImmediately

public boolean getPublishImmediately()
Gets the value of the 'publish immediately' option.
Returns:
true if the newly added Document is to be published immediately, false if not

getCheckOut

public boolean getCheckOut()
Gets the value of the 'check out' option.
Returns:
true if the newly added Document is to be checked out to the user whose context is passed in to the addDocument method, false otherwise

getOverwrite

public boolean getOverwrite()
Gets the 'overwrite' option.
Returns:
true if the newly added Document is to overwrite any existing Document with the same name in the specified Folder, false otherwise

clear

public void clear()
Clears out any information set into the object via the setter methods.

populate

public void populate(EbiContext context,
                     EbiDocument doc,
                     int docParts)
              throws EboUnrecoverableSystemException,
                     EboSecurityException,
                     EboItemExistenceException
Populates this object with values from the specified Document.
 params.populate(context, doc, EbiDocument.DOC_PART_META | EbiDocument.DOC_PART_CONTENT);
 
Parameters:
context - context
doc - the Document with values
docParts - which parts to copy, use the EbiDocument.DOC_PART_xxxx constants

fromXML

public void fromXML(EbiContext context,
                    EbiContentMgmtDelegate cmgr,
                    Node node)
             throws EboUnrecoverableSystemException,
                    EboSecurityException
Populates this object with values from an XML Node describing a CM Document per contentmgmt-document_4_0.dtd.
Parameters:
context - context
cmgr - the Content Manager Delegate
node - root-element node in the DOM tree for the XML document, obtained by an earlier document.getDocumentElement() call.

fromXML

public void fromXML(EbiContext context,
                    EbiContentMgmtDelegate cmgr,
                    Node node,
                    EbiXmlDataOptions options)
             throws EboUnrecoverableSystemException,
                    EboSecurityException
Populates this object with values from an XML Node describing a CM Document.
Parameters:
context - context
cmgr - the Content Manager Delegate
node - root-element node in the DOM tree for the XML document, obtained by an earlier document.getDocumentElement() call.
options - options for extracting data from XML

Novell exteNd
Director 5.2 API