public class ContentObjectDefinition extends SystemObjectDefinition
There are at least five ways to specify content: by local file path, by String, by InputStream, by Reader, or by existing content. Setting any one of these will override any other previously set content on the definition. Note that LocalFile means local relative to the machine on which the beans API is running.
If you extend ContentObjectDefinition in order to provide for a different type of content (e.g., Float), then the setContent() method must convert the content into one of the supported types. The supported types are InputStream, Reader, String, Existing ContentObject, or path to a file to which the API has access.
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 |
---|
ContentObjectDefinition(LibrarySessionInterface session)
Construct a definition explicitly capturing the
session.
|
ContentObjectDefinition(LibrarySessionInterface session,
String className)
Construct a definition, explicitly capturing the
session and setting the initial classobject.
|
Modifier and Type | Method and Description |
---|---|
String |
getContent()
Gets the content String as set in this definition,
or null if the content was not specified as a String.
|
String |
getContentBfileReferenceFileName()
Deprecated.
11.1+: use
getContentReference |
String |
getContentBfileReferenceParentFolderPath()
Deprecated.
11.1+: use
getContentReference |
String |
getContentNameOption()
Get the name of the document that will end up using this content.
|
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 content will be loaded.
|
String |
getContentReference()
Gets the content as a string reference that is interpreted by the Media
instance.
|
Long |
getContentRowReference()
Gets the pointer to the explicit row in the content table
to which this contentobject points.
|
AttributeValue |
getContentSizeValue()
Gets the previously set media (of null if none set).
|
InputStream |
getContentStream()
Gets the InputStream from which this content will be loaded.
|
AttributeValue |
getCopiedContent()
Gets the content as a reference to an existing ContentObject.
|
Boolean |
getEncrypted()
Gets indication of whether the content should be encrypted.
|
Format |
getFormat(LibrarySession sess)
Deprecated.
CM SDK 10gR2: use getAttribute("FORMAT")
|
Media |
getMedia()
Deprecated.
CM SDK 10gR2: use getAttribute
|
AttributeValue[] |
getMediaOptions()
Gets name/value pairs whose semantics are specific to the ContentObject's
MEDIA.
|
AttributeValue |
getMediaValue()
Deprecated.
CM SDK 10gR2: use getAttribute
|
AttributeValue |
getSharedContent()
Gets the content shared as an existing ContentObject.
|
boolean |
isContentSpecified()
Return true if content has been specified in any form.
|
boolean |
isEmptyContent()
Return true if empty content has been specified via the
setEmptyContent() method.
|
void |
removeContent()
Removes any content previously set in this ContentObjectDefinition.
|
void |
setContent(String content)
Sets the content as a String.
|
void |
setContentBfileReference(String parentFolderPath,
String fileName,
Long contentSize)
Deprecated.
11.1+: use
setContentReference |
void |
setContentNameOption(String name)
Set the name of the document that will end up using this content.
|
void |
setContentPath(String contentPath)
Sets the path of the local file from which this
content will be loaded/created.
|
void |
setContentReader(Reader contentReader)
Sets the content Reader
from which the content will be loaded/created.
|
void |
setContentReference(String contentReference,
Long contentSize)
Sets the content as a string reference that is interpreted by the Media
instance.
|
void |
setContentRowReference(Long contentId)
This method indicates to the server that content should be created,
pointing to an existing row in the underlying content tables.
|
void |
setContentRowReference(Long contentId,
Format format,
Media media,
long contentSize)
This method indicates to the server that content should be created,
pointing to an existing row in the underlying content tables
This is used internally by the files to ECM upgrade for performance
reasons.
|
void |
setContentStream(InputStream contentStream)
Sets the content InputStream
from which the content will be loaded/created.
|
protected void |
setContentStreamSerializer(ContentStreamSerializer css)
Sets the content as a ContentStreamSerializer.
|
void |
setCopiedContent(AttributeValue av)
Sets the content as a reference to an existing ContentObject.
|
void |
setEmptyContent()
This method indicates to the server that content should be created,
but with zero length.
|
void |
setEncrypted(Boolean encrypt)
Sets indication of whether the content should be encrypted
|
void |
setFormat(Format format)
Deprecated.
CM SDK 10gR2: use setAttribute(
"FORMAT", AttributeValue.newAttributeValue(format));
|
void |
setMedia(Media media)
Deprecated.
CM SDK 10gR2: use setAttribute
|
void |
setMediaOptions(AttributeValue[] avs)
Sets name/value pairs whose semantics are specific to the ContentObject's
MEDIA.
|
void |
setMediaValue(AttributeValue av)
Deprecated.
CM SDK 10gR2: use setAttribute
|
void |
setSharedContent(AttributeValue av)
Sets the content by sharing an existing ContentObject.
|
static ContentObjectDefinition |
toContentObjectDefinition(LibraryObjectDefinition lodef)
Casts the specified LibraryObjectDefinition to a ContentObjectDefinition.
|
static ContentObjectDefinition |
toContentObjectDefinition(LibraryObjectDefinition lodef,
boolean enforceCompat)
Casts the specified LibraryObjectDefinition to a ContentObjectDefinition.
|
addCategoryDefinition, addCategoryDefinitionForUpdate, addCategoryDefinitions, addCategoryForDelete, applySettings, getCategoriesForDelete, getCategoryDefinitions, getCategoryDefinitionsForUpdate, getCreateCategoriesServerSideOption, removeCategoriesForDelete, removeCategoryDefinitions, removeCategoryDefinitionsForUpdate, setCategoryDefinitions, setCreateCategoriesServerSideOption, toSystemObjectDefinition, toSystemObjectDefinition
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, prepareForDefinitionObject, 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 ContentObjectDefinition(LibrarySessionInterface session) throws IfsException
session
- the current sessionIfsException
- if the operation failspublic ContentObjectDefinition(LibrarySessionInterface session, String className) throws IfsException
session
- the current sessionclassName
- the initial class nameIfsException
- if the operation failspublic void setFormat(Format format) throws IfsException
format
- the desired Format object.IfsException
- if the operation fails.public Format getFormat(LibrarySession sess) throws IfsException
sess
- current LibrarySessionIfsException
- if the operation fails.public void setMedia(Media media) throws IfsException
media
- the Media type for the contentIfsException
- if the operation failspublic void setMediaValue(AttributeValue av) throws IfsException
av
- the Media type value for the contentIfsException
- if the operation failspublic Media getMedia() throws IfsException
IfsException
- if the operation failspublic AttributeValue getMediaValue() throws IfsException
IfsException
- if the operation failspublic AttributeValue getContentSizeValue() throws IfsException
IfsException
- if the operation failspublic void setContentNameOption(String name) throws IfsException
used to derive the correct format and media in the event that this content is saved in a DefinitionObject.
name
- the name that will be used for the contentIfsException
- if operation fails.public String getContentNameOption() throws IfsException
Used to derive the correct format and media in the event that this content is saved in a DefinitionObject.
IfsException
- if operation fails.public void setMediaOptions(AttributeValue[] avs) throws IfsException
avs
- the name/value pairs, or nullIfsException
- if the operation failspublic AttributeValue[] getMediaOptions() throws IfsException
IfsException
- if the operation failspublic void setEncrypted(Boolean encrypt) throws IfsException
encrypt
- the desired encryption stateIfsException
- if the operation failspublic Boolean getEncrypted() 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 the operation fails.public void setContentStream(InputStream contentStream) throws IfsException
contentStream
- an InputStream from which content will be loaded/created.IfsException
- if the operation fails.public void setContentBfileReference(String parentFolderPath, String fileName, Long contentSize) throws IfsException
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
public void setContentReference(String contentReference, Long contentSize) throws IfsException
This operation requires administration mode.
contentReference
- the content referencecontentSize
- the content size, in bytes, or null if unknownIfsException
- if the operation failspublic void setContentReader(Reader contentReader) throws IfsException
contentReader
- an Reader from which content will be loaded/created.IfsException
- if the operation fails.public void setContent(String content) throws IfsException
content
- A String which contains the content that will be loaded
into the new content object.IfsException
- if the operation fails.public void setCopiedContent(AttributeValue av) throws IfsException
av
- the value of an existing ContentObjectIfsException
- if the operation fails.public void setSharedContent(AttributeValue av) throws IfsException
av
- the value of an existing ContentObjectIfsException
- if the operation fails.public void setEmptyContent() throws IfsException
IfsException
- if the operation fails.public void setContentRowReference(Long contentId) throws IfsException
This operation requires administration mode.
IfsException
- if the operation fails.public void setContentRowReference(Long contentId, Format format, Media media, long contentSize) throws IfsException
This operation requires administration mode.
contentId
- id of the content rowformat
- format of the contentmedia
- media where content existscontentSize
- size of the contentIfsException
- if the operation fails.protected void setContentStreamSerializer(ContentStreamSerializer css) throws IfsException
Only used by DefinitionObject
css
- the contentIfsException
- if the operation fails.public void removeContent() throws IfsException
IfsException
- if the operation failspublic boolean isContentSpecified() throws IfsException
IfsException
- if the operation fails.public boolean isEmptyContent() throws IfsException
IfsException
- if the operation fails.public String getContentPath() throws IfsException
IfsException
- if the operation fails.public AttributeValue getCopiedContent() throws IfsException
IfsException
- if the operation fails.public AttributeValue getSharedContent() throws IfsException
IfsException
- if the operation fails.public String getContent() throws IfsException
IfsException
- if the operation fails.public InputStream getContentStream() throws IfsException
IfsException
- if the operation fails.public String getContentBfileReferenceFileName() throws IfsException
getContentReference
IfsException
- if the operation failspublic String getContentBfileReferenceParentFolderPath() throws IfsException
getContentReference
IfsException
- if the operation failspublic String getContentReference() throws IfsException
IfsException
- if the operation failspublic Reader getContentReader() throws IfsException
IfsException
- if the operation fails.public Long getContentRowReference() throws IfsException
IfsException
- if the operation fails.public static ContentObjectDefinition toContentObjectDefinition(LibraryObjectDefinition lodef) throws IfsException
Returns null if the specified definition is not a ContentObjectDefinition, or if the specified definition is null.
lodef
- the definitionIfsException
- is not currently thrownpublic static ContentObjectDefinition toContentObjectDefinition(LibraryObjectDefinition lodef, boolean enforceCompat) throws IfsException
Returns the ContentObjectDefinition, or null if the specified definition
is null. If the cast fails, returns null if enforceCompat
is false or throws IfsException if enforceCompat
is true.
lodef
- the definition to castenforceCompat
- whether to throw an exception if the cast failsIfsException
- (IFS-10822) if the operation failsCopyright © 2023. All rights reserved.