public class DocumentDefinition extends PublicObjectDefinition
Document maintains Content via a reference to a ContentObject. Thus, to create Content a ContentObjectDefinition is used. This Definition has convenience methods to manipulate a ContentObjectDefinition; or you may access the ContentObjectDefinition directly.
Note that the only way to modify the attributes of a ContentObject (for non-admin users) is to pass a ContentObjectDefinition to a DocumentDefinition and call update on a Document to which you have access. For that reason, all ContentObjectDefinition methods have been implemented as wrappers in the DocumentDefinition class, thus eliminating the need to deal with ContentObjectDefinition directly.
LibraryObjectDefinition.EnumToIntegerCode, LibraryObjectDefinition.LookupByName
m_Attributes, m_ClassObjectName, m_ClassObjectValue, m_ContentSpecifications, m_DefinitionLists, m_Definitions, m_EnclosedDefinition, m_Id, m_Options, m_ReadOnly, m_ReferenceAttributes, m_Session, m_SystemOptions
Constructor and Description |
---|
DocumentDefinition(LibrarySessionInterface session)
Construct a definition explicitly capturing the
session.
|
DocumentDefinition(LibrarySessionInterface session,
String className)
Construct a definition, explicitly capturing the
session and setting the initial classobject.
|
Modifier and Type | Method and Description |
---|---|
void |
applySettings(AttributeValueTable avt)
Applies settings from the specified table.
|
String |
getCharacterSet(LibrarySession sess)
Deprecated.
CM SDK 10gR2: use getContentObjectDefinition() and use
getAttribute() on it to get Attribute settings
|
String |
getContent()
Gets the previously set String of content as set in this definition,
or null if no String was specified.
|
ContentObjectDefinition |
getContentObjectDefinition()
Gets the currently allocated ContentObjectDefinition, whether set
explicitly by setContentObjectDefinition, or allocated by one of the
content convenience methods.
|
String |
getContentPath()
Gets the path of the local file content,
or null if no local file was specified.
|
Reader |
getContentReader()
Gets the Reader from which this document will be loaded.
|
InputStream |
getContentStream()
Gets the InputStream from which this document will be loaded.
|
Boolean |
getEncrypted()
Gets indication of whether the content should be encrypted.
|
Format |
getFormat(LibrarySession sess)
Gets the format for this DocumentDefinition.
|
String |
getLanguage(LibrarySession sess)
Deprecated.
CM SDK 10gR2: use getContentObjectDefinition() and use
getAttribute() on it to get Attribute settings
|
Media |
getMedia()
Gets the previously set media (or null if none set).
|
AttributeValue |
getNextLifecyclePolicyEntryValue()
Gets the next LifecyclePolicyEntry to be used as the state
of the document.
|
ContentObjectDefinition |
getOrCreateContentObjectDefinition()
Gets an existing ContentObjectDefinition or creates a new one if one does
not already exist.
|
LibraryObject |
getReferringLibraryObject()
Deprecated.
CM SDK 10gR2: use getReferringLibraryObjectValue()
|
AttributeValue |
getReferringLibraryObjectValue()
Gets the referring LibraryObject through which access is granted to the
shared ContentObject
or null if no existing ContentObject was specified.
|
ContentObject |
getSharedContentObject()
Deprecated.
CM SDK 10gR2: use getSharedContentObjectValue()
|
AttributeValue |
getSharedContentObjectValue()
Gets the existing ContentObject with which this Document will share content.
|
boolean |
isContentSpecified()
Return indication as to whether content is specified
in the definition.
|
void |
prepareForDefinitionObject(LibrarySession sess)
Perform any changes to the definition prior to storing
it into a DefinitionObject.
|
void |
removeContentSpecifications()
Remove all content specifications from the definition.
|
void |
setCharacterSet(String charset)
Sets the characterset
of the content.
|
void |
setContent(String content)
Sets the content of the document that will be loaded/created.
|
void |
setContentBfileReference(String parentFolderPath,
String fileName,
Long contentSize)
Deprecated.
11.1+: use
ContentObjectDefinition.setContentReference |
void |
setContentObjectDefinition(ContentObjectDefinition cod)
Sets the ContentObjectDefinition of the document that will be used to create/update the content
object associated with this document.
|
void |
setContentPath(String contentPath)
Sets the path of the local file from which this
document will be loaded/created.
|
void |
setContentReader(Reader contentReader)
Sets the content Reader
from which the document will be loaded/created.
|
void |
setContentStream(InputStream contentStream)
Sets the content InputStream
from which the document will be loaded/created.
|
void |
setEmptyContent()
Creates content of zero length.
|
void |
setEncrypted(Boolean encypt)
Sets indication of whether the content should be encrypted.
|
void |
setFormat(Format format)
Sets the format describing the type
of content.
|
void |
setLanguage(String language)
Sets the language
of the content.
|
void |
setMedia(Media media)
Sets explicitly the media for a new document.
|
void |
setNextLifecyclePolicyEntryValue(AttributeValue av)
Sets the next LifecyclePolicyEntry to be used as the state
of the document.
|
void |
setNullContent()
Calling this method specifies that the target document should not have content.
|
void |
setSharedContentObject(ContentObject contentObject,
LibraryObject refObj)
Deprecated.
CM SDK 10gR2: use setSharedContentObjectValue()
|
void |
setSharedContentObjectValue(AttributeValue contentObjectValue,
AttributeValue refObjValue)
Shares the content of an existing object.
|
static DocumentDefinition |
toDocumentDefinition(LibraryObjectDefinition lodef)
Cast specified LibraryObjectDefinition to a DocumentDefinition.
|
static DocumentDefinition |
toDocumentDefinition(LibraryObjectDefinition lodef,
boolean enforceCompat)
Cast specified LibraryObjectDefinition to a DocumentDefinition.
|
addCategoryDefinition, addCategoryDefinition, addCategoryDefinitions, addCategoryDefinitions, getAddToFolderOption, getAddToFolderValue, getAutoFolderingActionSpecification, getCascadeCopyRelationshipsOption, getCascadeCopyRelationshipsOptionValue, getCategoryCopyOption, getCategoryDefinitions, getContentQuotaCopyOption, getCreateCategoriesServerSideOption, getExplicitCreateAndModifyAttributesOption, getExplicitCreateDate, getExplicitLastModifyDate, getFreeIfLastFolderReferenceOption, getKeepLastModifierOption, getKeepLastModifyDateOption, getLockEntryDefinition, getLockObject, getLockObjectDefinition, getLockObjectValue, getSecuringPublicObject, getSecuringPublicObjectValue, getUpdatedLockObjectDefinition, removeCategoryDefinitions, removeLockEntryDefinition, resolveAutoFolderingSettings, setAddToFolderOption, setAddToFolderValue, setAutoFolderingActionSpecification, setAutoFolderingActionSpecification, setCascadeCopyRelationshipsOption, setCategoryCopyOption, setCategoryDefinitions, setContentQuotaCopyOption, setCreateCategoriesServerSideOption, setExplicitCreateAndModifyAttributesOption, setExplicitCreateDate, setExplicitLastModifyDate, setFreeIfLastFolderReferenceOption, setKeepLastModifierOption, setKeepLastModifyDateOption, setLockEntryDefinition, setLockObject, setLockObjectDefinition, setLockObjectValue, setNullSecurity, setPrivateSecurity, setPublishedSecurity, setSecuringPublicObject, setSecuringPublicObjectValue, setUpdatedLockObjectDefinition, toPublicObjectDefinition, toPublicObjectDefinition
addDefinition, addDefinitions, addProperty, addPropertyDefinition, addPropertyDefinition, addPropertyDefinitions, addPropertyDefinitions, addSimplePropertyDefinition, addSimplePropertyDefinition, addSimplePropertyDefinitions, addSimplePropertyDefinitions, applyEnumSetting, applyEnumSetting, applyMapSetting, applyMapSetting, applyObjectArraySetting, applyObjectArraySetting, applyObjectSetting, applyObjectSetting, applySetting, applySetting, captureSession, captureSession, captureSession, clone, constructInstance, constructInstance, constructInstance, copyInto, deriveObjectArraySetting, deriveObjectSetting, getAttribute, getAttribute, getAttributes, getAttributes, getAttributesSorted, getClassId, getClassObject, getClassObjectValue, getContentSpecification, getContentSpecificationKeys, getCopiedObjectValue, getDefinition, getDefinitionClassName, getDefinitionKeys, getDefinitionListKeys, getDefinitions, getId, getLibrarySession, getName, getOption, getOptionAsAttributeValue, getOptionKeys, getPolicyMode, getPropertyDefinitions, getReferenceAttribute, getReferenceAttributes, getServerDefinition, getSession, getSimplePropertyDefinitions, getSLibrarySession, getStringAttribute, getSystemOption, getSystemOptionAsAttributeValue, getSystemOptionAsBoolean, getSystemOptionKeys, getWriteableInstance, isReadOnly, processSimplePropertiesForCreate, processSimplePropertiesForUpdate, removeAttribute, removeContentSpecification, removeDefinition, removeDefinitions, removeOption, removePropertyDefinitions, removeReferenceAttribute, removeSimplePropertyDefinitions, removeSystemOption, reset, resolve, setAttribute, setAttribute, setAttribute, setAttributeByUpperCaseName, setAttributeByUpperCaseName, setAttributePolicyMode, setAttributes, setClassId, setClassname, setClassObject, setClassObjectValue, setContentSpecification, setCopiedObjectValue, setDefinition, setDefinitions, setId, setName, setOption, setReadOnly, setReferenceAttribute, setReferenceAttribute, setSession, setSimplePropertyDefinitions, setSystemOption, unresolve, verifySession
public DocumentDefinition(LibrarySessionInterface session) throws IfsException
session
- the current sessionIfsException
- if the operation failspublic DocumentDefinition(LibrarySessionInterface session, String className) throws IfsException
session
- the current sessionclassName
- the initial class nameIfsException
- if the operation failspublic void applySettings(AttributeValueTable avt) throws IfsException
applySettings
in class PublicObjectDefinition
avt
- the table having the definition settingsIfsException
- if the operation failspublic void setFormat(Format format) throws IfsException
format
- the desired Format object.IfsException
- if operation fails.public void setEncrypted(Boolean encypt) throws IfsException
This is a convenience method that allocates a ContentObjectDefinition (if one is not already allocated) and delegates to it.
encypt
- the desired encryption stateIfsException
- if the operation failspublic Boolean getEncrypted() throws IfsException
This is a convenience method that delegates to the allocated ContentObjectDefinition (if any).
IfsException
- if the operation failspublic void setCharacterSet(String charset) throws IfsException
charset
- the java name of the desired character setIfsException
- if operation fails.public void setLanguage(String language) throws IfsException
language
- the Oracle name of the desired languageIfsException
- if operation fails.public void setMedia(Media media) throws IfsException
media
- the Media objectIfsException
- if the operation failspublic Media getMedia() throws IfsException
IfsException
- if the operation failspublic void setContentPath(String contentPath) throws IfsException
contentPath
- the file from which content will be loaded/created.IfsException
- if operation fails.public void setContentStream(InputStream contentStream) throws IfsException
contentStream
- an InputStream from which content will be loaded/created.IfsException
- if operation fails.public void setContentBfileReference(String parentFolderPath, String fileName, Long contentSize) throws IfsException
ContentObjectDefinition.setContentReference
This operation requires administration mode.
parentFolderPath
- absolute path of parent folder of external filefileName
- name of the external filecontentSize
- Size of the external file; If null, the size is
determined by the serverIfsException
- if the operation failspublic void setContentReader(Reader contentReader) throws IfsException
contentReader
- a Reader from which content will be loaded/created.IfsException
- if operation fails.public void setContent(String content) throws IfsException
content
- A String which contains the content which will be loaded
into the new document.IfsException
- if operation fails.public void setEmptyContent() throws IfsException
IfsException
- if operation fails.public void setSharedContentObject(ContentObject contentObject, LibraryObject refObj) throws IfsException
contentObject
- An existing ContentObject to which this new document
will refer.refObj
- An existing LibraryObject through which you are allowed
access to the existing ContentObject.IfsException
- if operation fails.public void setSharedContentObjectValue(AttributeValue contentObjectValue, AttributeValue refObjValue) throws IfsException
contentObjectValue
- An existing contentObject to which this
new document will refer.refObjValue
- An existing object through which you are
allowed access to the existingIfsException
- if operation fails.public void setContentObjectDefinition(ContentObjectDefinition cod) throws IfsException
cod
- a ContentObjectDefinition which contains the content
to be loaded into the new document.IfsException
- if operation fails.public ContentObjectDefinition getContentObjectDefinition() throws IfsException
IfsException
- if the operation failspublic ContentObjectDefinition getOrCreateContentObjectDefinition() throws IfsException
IfsException
- if the operation failspublic void setNullContent() throws IfsException
IfsException
- if operation fails.public Format getFormat(LibrarySession sess) throws IfsException
IfsException
- if the operation failspublic String getCharacterSet(LibrarySession sess) throws IfsException
IfsException
- if the operation failspublic String getLanguage(LibrarySession sess) throws IfsException
IfsException
- if the operation failspublic String getContentPath() throws IfsException
IfsException
- if the operation failspublic String getContent() throws IfsException
IfsException
- if the operation failspublic InputStream getContentStream() throws IfsException
IfsException
- if the operation failspublic Reader getContentReader() throws IfsException
IfsException
- if the operation failspublic ContentObject getSharedContentObject() throws IfsException
IfsException
- if the operation failspublic AttributeValue getSharedContentObjectValue() throws IfsException
IfsException
- if the operation failspublic LibraryObject getReferringLibraryObject() throws IfsException
IfsException
- if the operation failspublic AttributeValue getReferringLibraryObjectValue() throws IfsException
IfsException
- if the operation failspublic void setNextLifecyclePolicyEntryValue(AttributeValue av) throws IfsException
Should represent a null SystemObject value to indicate the initial lifecycle state. A null AttributeValue arg will clear the setting, and is not equivalent to specifying a null-valued AttributeValue.
IfsException
- if the operation failspublic AttributeValue getNextLifecyclePolicyEntryValue() throws IfsException
Should represent a null value to indicate the initial lifecycle state.
IfsException
- if the operation failspublic boolean isContentSpecified() throws IfsException
IfsException
- if operation fails.public void removeContentSpecifications() throws IfsException
IfsException
- if operation fails.public void prepareForDefinitionObject(LibrarySession sess) throws IfsException
prepareForDefinitionObject
in class LibraryObjectDefinition
sess
- The current session contextIfsException
- if operation fails.public static DocumentDefinition toDocumentDefinition(LibraryObjectDefinition lodef) throws IfsException
Return null if the specified definition is not a DocumentDefinition, or if the specified definition is null.
lodef
- the definition to be castedIfsException
- is not currently thrown.public static DocumentDefinition toDocumentDefinition(LibraryObjectDefinition lodef, boolean enforceCompat) throws IfsException
Return null if the specified definition is null. If non-null and unable to cast, return null if enforceCompat is false but throw an IfsException if the specified definition is not a DocumentDefinition.
lodef
- the definition to be castedenforceCompat
- whether to throw an exception if
a non-null definition cannot be castIfsException
- (IFS-10822) if operation fails.Copyright © 2023. All rights reserved.