public class ContentObject extends TieSystemObject
ContentObject content is set using a ContentObjectDefinition. A ContentObjectDefinition supports setting content from a variety of sources, including a local file and an InputStream. One uses a ContentObjectDefinition both for creating a new document and updating an existing one.
ContentObjectDefinition
Modifier and Type | Field and Description |
---|---|
static String |
CHARACTERSET_ATTRIBUTE
The Java name of the character encoding of the content (if applicable).
|
static String |
CLASS_NAME
This class name for this class.
|
static String |
CONTENT_ATTRIBUTE
The row id pointing to the content for this ContentObject
in Media's database table.
|
static String |
CONTENTCONTROLLER_ATTRIBUTE
The ContentController object that describes the state and options related to
content storage.
|
static String |
CONTENTSIZE_ATTRIBUTE
The size of the content.
|
static String |
CONTENTVAULTENTRY_ATTRIBUTE
The ContentVaultEntry object that describes the row in content storage.
|
static String |
FORMAT_ATTRIBUTE
The Format that describes the content.
|
static String |
LANGUAGE_ATTRIBUTE
The Oracle name of the language of the content (if applicable).
|
static String |
LASTMODIFYDATE_ATTRIBUTE
The date and time (in GMT) when the content associated with
this object was last modified.
|
static String |
MEDIA_ATTRIBUTE
The Media instance where the content is stored.
|
static String |
READONLY_ATTRIBUTE
An indicator if the content is read-only or updateable.
|
static String |
STORAGEGROUP_ATTRIBUTE
The StorageGroup used to set the PARTITIONVALUE column of the content
table row.
|
ACTIVE_ATTRIBUTE, POLICYBUNDLE_ATTRIBUTE, POLICYLISTS_ATTRIBUTE, PROPERTYBUNDLE_ATTRIBUTE
DOMAIN_UNIQUENAME_DEFAULT_DELIMITER, m_ClassId, m_Id, m_Session, NAME_ATTRIBUTE
Modifier | Constructor and Description |
---|---|
protected |
ContentObject(LibrarySession session,
Long id,
Long classId,
S_LibraryObjectData data)
Construct a ContentObject object - standard variant.
|
Modifier and Type | Method and Description |
---|---|
protected static ContentObject |
constructContentObject(LibrarySession sess,
S_LibraryObjectData data)
Constructs a ContentObject object from the
S_LibraryObjectData object.
|
protected static Vector |
constructContentObjectVector(LibrarySession sess,
Vector vector)
Returns ContentObject Vector from a Vector of ContentObject objects.
|
static int |
deleteUnreferenced(LibrarySession session,
int batchSize)
Delete all ContentObjects that are no longer referenced
by one or more Documents.
|
void |
filterContent(boolean plaintext,
LibraryObject refObj)
Generates an HTML or plaintext version of the content, via the
InterMedia INSO filters.
|
void |
generateSummary(String pointOfView,
long sizeAsPercent,
long sizeAsNumParagraphs,
String summaryLevel,
LibraryObject refObj)
Generates one or more summaries for this content by submitting a
request to InterMedia to generate summaries.
|
void |
generateThemes(boolean fullThemes,
LibraryObject refObj)
Generates the Themes for this content by submitting a request to
InterMedia Text to generate Themes.
|
String |
getCharacterSet()
Gets the Iana character set in which this content is encoded,
or null if the character set is not specified.
|
static Long |
getClassId(LibrarySession session)
Get the ID of the ClassObject representing CONTENTOBJECT.
|
RandomAccessor |
getContentByRandomAccess(Document refObj)
Gets a RandomAccessor for randomly reading the content of this
ContentObject.
|
ContentController |
getContentController()
Gets the ContentController object that describes the storage and state
of the content.
|
Date |
getContentModificationDate()
Returns the date the content associated with this object
was last modified.
|
Reader |
getContentReader(LibraryObject refObj)
Gets the content as an
Reader . |
long |
getContentRowId()
Gets Content row ID.
|
long |
getContentSize()
Gets the size of the content.
|
InputStream |
getContentStream(LibraryObject refObj)
Gets the content as an
InputStream . |
ContentVaultEntry |
getContentVaultEntry()
Gets the ContentVaultEntry object that describes the row in content storage
that is currently active.
|
Reader |
getFilteredContent(LibraryObject refObj)
Gets the plaintext or HTML content of the document, previously
generated by a call to filterContent()
|
Format |
getFormat()
Gets the Format object.
|
String |
getLanguage()
Gets the language of this content,
or null if language not specified.
|
Date |
getLastAccessDate()
Gets when the content of this ContentObject was most recently written
or read.
|
Media |
getMedia()
Gets the Media object.
|
Long |
getPartitionValue()
Gets the partition value for this ContentObject.
|
RandomAccessContentInterface |
getRandomAccessContent(boolean canWrite,
boolean shouldLock,
LibraryObject refObj)
Deprecated.
CM SDK 10gR2: use getContentByRandomAccess or
updateContentByRandomAccess on Document
|
StorageGroup |
getStorageGroup()
Gets the StorageGroup used to set the PARTITIONVALUE column of the
content table row.
|
Reader |
getSummary(String pointOfView,
LibraryObject refObj)
Gets a specific summary of this content, previously generated by a
call to generateSummary().
|
ContextTheme[] |
getThemes(LibraryObject refObj)
Gets the Themes for this content, previously generated by a call to
generateThemes().
|
boolean |
isReadByUser()
Returns true if the current user has read this content.
|
boolean |
isReadOnly()
Returns true if the content is read-only.
|
void |
setManualTextIndexingStream(Reader reader)
Sets the text reader to use for manual text indexing.
|
void |
setReadByUser(boolean readState,
LibraryObject refObj)
Sets read indication (for the current user) for this content.
|
void |
setReadOnly(boolean readonly)
Sets the read-only state of the content.
|
protected static ContentObject |
vectorContentObjectElement(Vector vector,
int index)
Returns a ContentObject element from the Vector of ContentObject
objects at the specified index.
|
protected static ContentObject[] |
vectorToContentObjectArray(Vector vector)
Constructs an array of ContentObject objects from a Vector.
|
addCategory, constructSystemObject, constructSystemObjectVector, free, freeCategories, getCategories, getCategories, getCategories, getCategories, getPolicyBundle, getPolicyLists, handleCreate, hasPropertyBundleAttribute, isActive, postCreate, postUpdate, preCreate, preUpdate, putPolicy, removeAllPolicies, removePolicy, removePolicy, setActive, setPolicyBundle, setPolicyLists
added, addSimpleProperty, addSimpleProperty, applyProperties, auditCreated, auditUpdated, canPurge, checkIfPropertyBundleSupported, checkRequiredAttributeSet, clearCopyContext, clearFreeContext, clearUpdateContext, compareTo, constructIdArray, constructIdArray, constructLibraryObject, constructLibraryObjectVector, createDedicatedPropertyBundle, createInstance, deriveDomainUniqueName, dispose, equals, equals, free, freeAll, get, getAttribute, getAttributeByUpperCaseName, getAttributes, getAttributesByUpperCaseNames, getAuditDomainContext, getAuditEventFolderContext, getClassId, getClassname, getClassName, getClassObject, getCommonName, getCommonNameAndClass, getCopyContext, getCreateContext, getData, getDefinition, getDefinitionForSimplePropertyUpdates, getEffectivePolicyListElements, getEventualAttributeByUpperCaseName, getFreeContext, getId, getLabel, getName, getObjectReferenceAttribute, getOperationActionSpecificationContext, getPropertyBundle, getPropertyValue, getPublicObjectAttribute, getResourceString, getResourceString, getSchemaObjectAttribute, getSession, getSessionInterface, getSharedStateFactory, getSimpleObjectAttribute, getSimpleProperties, getSimpleProperty, getSimplePropertyValue, getStringIdentifier, getSystemObjectAttribute, getTraceLogger, getUpdateContext, handleAdminModeChange, handleEvent, handleFree, handleUpdate, hashCode, hasNameAttribute, invalidateState, invokeOperation, invokeOperation, invokeServerMethod, isConnected, isCoreEventPostingEnabled, isInstanceOf, isPersistent, isTraced, isValidEventType, lockRows, lookupInstanceLabel, performPostCreateExtensions, performPostFreeExtensions, performPostUpdateExtensions, performPreCreateExtensions, performPreFreeExtensions, performPreUpdateExtensions, postEvent, postEvent, postFree, preFree, prePostAuditEvent, putProperty, putProperty, removeAllProperties, removeAllSimpleProperties, removeAllSimpleProperties, removed, removeProperty, removeSimpleProperty, removeSimpleProperty, renderAsRandomAccessContent, renderAsReader, renderAsStream, setAttribute, setAttribute, setAttributes, setAttributes, setCopyContext, setFreeContext, setId, setName, setPropertyBundle, setPropertyValue, setUpdateContext, toString, trace, trustHandleCreate, trustHandleCreateAsAdmin, trustHandleFree, trustHandleFreeAsAdmin, trustHandleUpdate, trustHandleUpdateAsAdmin, update, updateAndExposeDefinition, validatePropertyValues, vectorLibraryObjectElement, vectorToLibraryObjectArray, verifyAdministrationMode, verifyConnected, verifyPersistent, verifySystemUserAccess, verifyTargetObject
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getAttributeByUpperCaseName, getClassId, getId, getSessionInterface
getTraceLogger, isTraced, trace
public static final String CLASS_NAME
public static final String FORMAT_ATTRIBUTE
public static final String MEDIA_ATTRIBUTE
public static final String STORAGEGROUP_ATTRIBUTE
public static final String CONTENT_ATTRIBUTE
public static final String CONTENTSIZE_ATTRIBUTE
public static final String CHARACTERSET_ATTRIBUTE
public static final String LANGUAGE_ATTRIBUTE
public static final String READONLY_ATTRIBUTE
public static final String LASTMODIFYDATE_ATTRIBUTE
public static final String CONTENTCONTROLLER_ATTRIBUTE
public static final String CONTENTVAULTENTRY_ATTRIBUTE
protected ContentObject(LibrarySession session, Long id, Long classId, S_LibraryObjectData data) throws IfsException
session
- the sessionid
- the idclassId
- the class iddata
- the ContentObject dataIfsException
- if the operation failspublic static Long getClassId(LibrarySession session) throws IfsException
session
- the session contextIfsException
- if the operation failspublic Media getMedia() throws IfsException
IfsException
- if the operation fails.public StorageGroup getStorageGroup() throws IfsException
IfsException
- if the operation failspublic Long getPartitionValue() throws IfsException
A ContentObject's partition value is indirectly set when a ContentObject is created or updated. It is stored in the PARTITIONVALUE column of the content table row associated with that ContentObject. If desired, a database administrator can partition the content table by this column.
When a ContentObject is created, if a STORAGEGROUP is specified, the new ContentObject's partition value is set to the then-current value of the PARTITIONVALUE attribute of that StorageGroup.
The partition value of an existing ContentObject is updated when any of the following occur:
Changing the PARTITIONVALUE attribute of a StorageGroup does not, however, change the partition value of a ContentObject already in that StorageGroup.
IfsException
- if the operation failspublic Date getLastAccessDate() throws IfsException
Requires the session to be in administration mode.
IfsException
- if the operation failspublic Format getFormat() throws IfsException
IfsException
- if the operation fails.public long getContentSize() throws IfsException
IfsException
- if the operation fails.public ContentController getContentController() throws IfsException
IfsException
- if operation failspublic ContentVaultEntry getContentVaultEntry() throws IfsException
IfsException
- if operation failspublic long getContentRowId() throws IfsException
IfsException
- if the operation fails.public String getCharacterSet() throws IfsException
IfsException
- if the operation fails.public String getLanguage() throws IfsException
IfsException
- if the operation fails.public boolean isReadOnly() throws IfsException
IfsException
- if the operation fails.public void setReadOnly(boolean readonly) throws IfsException
readonly
- true if content is readonly, false otherwiseIfsException
- if the operation fails.public InputStream getContentStream(LibraryObject refObj) throws IfsException
InputStream
.refObj
- the LibraryObject which
refers to this ContentObject and can verify access.IfsException
- if the operation fails.public Reader getContentReader(LibraryObject refObj) throws IfsException
Reader
. For most media, this
method only works if the content object has an associated
CharacterSet.refObj
- the LibraryObject which
refers to this ContentObject and can verify access.IfsException
- if the operation fails.public RandomAccessor getContentByRandomAccess(Document refObj) throws IfsException
refObj
- a Document that references this ContentObjectIfsException
- if the operation failspublic RandomAccessContentInterface getRandomAccessContent(boolean canWrite, boolean shouldLock, LibraryObject refObj) throws IfsException
canWrite
- whether content is writable.shouldLock
- ignoredrefObj
- the Document which refers to this ContentObject
and can verify access.IfsException
- if the operation fails.public boolean isReadByUser() throws IfsException
IfsException
- if the operation fails.public void setReadByUser(boolean readState, LibraryObject refObj) throws IfsException
readState
- desired read indication for current
user on this ContentObject's contentrefObj
- the LibraryObject which refers to this
ContentObject and can verify access.IfsException
- if the operation fails.public Date getContentModificationDate() throws IfsException
IfsException
- if operation fails.public void generateThemes(boolean fullThemes, LibraryObject refObj) throws IfsException
Each Theme may either be a single Theme word/phrase or a hierarchical list of parent Themes. If fullThemes is set to TRUE, every Theme will also have the full hierarchy of its parent Themes generated.
fullThemes
- generates theme hierarchy information if TRUErefObj
- the LibraryObject which refers to this
ContentObject and can verify access.IfsException
- if the operation fails.public ContextTheme[] getThemes(LibraryObject refObj) throws IfsException
Content may have up to fifty Themes. Each Theme may either be a single Theme word/phrase or a string of parent Themes, separated by colons (':').
There is a Weight associated with every Theme. A Weight is a numerical value that measures the importance of the Theme relative to other Themes for the content.
refObj
- the LibraryObject which refers to this ContentObject
and can verify access (typically a Document).IfsException
- if the operation fails.public void generateSummary(String pointOfView, long sizeAsPercent, long sizeAsNumParagraphs, String summaryLevel, LibraryObject refObj) throws IfsException
If GENERIC is passed for pointOfView, then InterMedia will generate a single generic summary of the document, based on all the document Themes. If a specific Theme is passed for pointOfView, then InterMedia will generate a summary based on that Theme. Only the Themes generated for the document by a previous call to generateThemes() may be used as input for pointOfView. If a null value is passed for pointOfView, then InterMedia will generate a generic summary of the document, in addition to up to 50 other summaries, each based on one of Themes of the document. Only the Themes generated for the document by a previous call to generateThemes() may be used as input for pointOfView.
Summaries are generated either by selecting specific sentences from the document, or by selecting specific paragraphs from the document. If summaryLevel is set to "S", then InterMedia generates a sentence-level summary of the document. If summaryLevel is set to "P", then InterMedia generates a paragraph-level summary of the document.
The size of the summary generated for a document may be specified through the parameters sizeAsPercent and sizeAsNumParagraphs.
The parameter sizeAsPercent specifies the maximum number of paragraphs (or sentences) that will be included in the summary, as a percentage of the total number of paragraphs (or sentences) present in the content. The default is 10. To use the default value, pass 0 for sizeAsPercent.
The parameter sizeAsNumParagraphs specifies the maximum number of paragraphs (or sentences) that will be included in the summary. The default is 16. To use the default value, pass 0 for sizeAsNumParagraphs.
When both sizeAsNumParagraphs and sizeAsPercent are specified, the parameter that yields a smaller summary size will be used.
pointOfView
- the specific Theme(s) based on which the summary
is generatedsizeAsPercent
- size of summary as a percentage of document sizesizeAsNumParagraphs
- size of summary specified as number of
paragraphs or sentencessummaryLevel
- specifies whether summary is generated by
selecting paragraphs or sentencesrefObj
- the LibraryObject which
refers to this ContentObject and can verify access.IfsException
- if the operation fails.public Reader getSummary(String pointOfView, LibraryObject refObj) throws IfsException
pointOfView
- get the summary that is
based on this particular point of viewrefObj
- the LibraryObject which
refers to this ContentObject and can verify access.IfsException
- if the operation fails.public void filterContent(boolean plaintext, LibraryObject refObj) throws IfsException
plaintext
- when TRUE, indicates that a plaintext version of
the document must be generated, otherwise an HTML version will be
generatedrefObj
- the LibraryObject which
refers to this ContentObject and can verify access.IfsException
- if the operation fails.public Reader getFilteredContent(LibraryObject refObj) throws IfsException
refObj
- the LibraryObject which
refers to this ContentObject and can verify access.IfsException
- if the operation fails.public void setManualTextIndexingStream(Reader reader) throws IfsException
reader
- the Reader representing the textIfsException
- if the operation failspublic static int deleteUnreferenced(LibrarySession session, int batchSize) throws IfsException
Invokes free
on all ContentObjects that are no longer
referenced in a separate transaction for each.
Performs the search for candidate ContentObjects in batch.
Ignores "object not found" exceptions, and logs all other exceptions.
Returns the count of all ContentObjects freed.
session
- the session contextbatchSize
- the batch size to use; if 0 is specified
a reasonable default is usedIfsException
- if the operation failsprotected static Vector constructContentObjectVector(LibrarySession sess, Vector vector) throws IfsException
sess
- current LibrarySessionvector
- vector of LibraryObjectData objectsIfsException
- if the operation failsprotected static ContentObject constructContentObject(LibrarySession sess, S_LibraryObjectData data) throws IfsException
sess
- current LibrarySessiondata
- data componentIfsException
- if the operation failsprotected static ContentObject[] vectorToContentObjectArray(Vector vector)
vector
- Vector of ContentObject objectsprotected static ContentObject vectorContentObjectElement(Vector vector, int index)
vector
- Vector of ContentObject objectsindex
- index into VectorCopyright © 2023. All rights reserved.