oracle.ifs.beans
Class Document


java.lang.Object

  |

  +--oracle.ifs.beans.LibraryObject

        |

        +--oracle.ifs.beans.TieLibraryObject

              |

              +--oracle.ifs.beans.PublicObject

                    |

                    +--oracle.ifs.beans.TiePublicObject

                          |

                          +--oracle.ifs.beans.Document

All Implemented Interfaces:
IfsEventHandler, LibraryObjectInterface, PublicObjectInterface, Traceable
Direct Known Subclasses:
TieDocument

public class Document
extends TiePublicObject

The Document class is a subclass of PublicObject that supports getting and setting Content. Content is any unstructured data. This is facilitated by referring to a ContentObject. ContentObjects allow getting and setting of content, as well as supporting content meta data. This class contains convenience covers to make using a content object easier. Document content is set using a ContentObject Definition, although it can also be set by using a DocumentDefinition. A DocumentDefinition supports setting content from a variety of sources, including a local file and an InputStream. You use a DocumentDefinition both for creating a new document and updating an existing one.

See Also:
ContentObject, DocumentDefinition

Field Summary
static java.lang.String CLASS_NAME
          This class name for this class.
static java.lang.String CONTENTOBJECT_ATTRIBUTE
          The ContentObject that contains this document's content.
static java.lang.String READBYOWNER_ATTRIBUTE
          An indicator of whether the Document Owner has read the current content.
 
Fields inherited from class oracle.ifs.beans.PublicObject
ACL_ATTRIBUTE, ADMINISTRATIONGROUP_ATTRIBUTE, CREATEDATE_ATTRIBUTE, CREATOR_ATTRIBUTE, DELETOR_ATTRIBUTE, DESCRIPTION_ATTRIBUTE, EXPIRATIONDATE_ATTRIBUTE, FAMILY_ATTRIBUTE, FLAGS_ATTRIBUTE, LASTMODIFIER_ATTRIBUTE, LASTMODIFYDATE_ATTRIBUTE, LOCKEDFORSESSION_ATTRIBUTE, LOCKSTATE_ATTRIBUTE, LOCKSTATE_HARDLOCK, LOCKSTATE_SESSIONLOCK, LOCKSTATE_SOFTLOCK, LOCKSTATE_UNLOCK, LOCKSTATE_USERLOCK, NAME_ATTRIBUTE, OWNER_ATTRIBUTE, POLICYBUNDLE_ATTRIBUTE, PROPERTYBUNDLE_ATTRIBUTE, RESOLVEDPUBLICOBJECT_ATTRIBUTE, SECURINGPUBLICOBJECT_ATTRIBUTE
 
Method Summary
 void filterContent(boolean plaintext)
          Generates a HTML or plaintext version of the document, via the Context INSO filters.
 java.lang.String generateFilename()
          Generates a filename which is the objectname plus the format extension.
 void generateSummary(java.lang.String pointOfView, long sizeAsPercent, long sizeAsNumParagraphs, java.lang.String summaryLevel)
          Generates one or more summaries for a document by submitting a request to Context to generate summaries.
 void generateThemes(boolean fullThemes)
          Generates the Themes for this Document by submitting a request to Context to generate Themes.
 java.lang.String getCharacterSet()
          Returns the ContentObject's character encoding, or null if not specified.
 ContentObject getContentObject()
          Gets the content for this Document.
 java.io.Reader getContentReader()
          Gets the document content as a Reader
 long getContentSize()
          Gets the size of this document's content.
 java.io.InputStream getContentStream()
          Gets the document content as an InputStream.
 java.io.Reader getFilteredContent()
          Gets the plaintext or HTML content of the document, previously generated by a call to filterContent()
 Format getFormat()
          Gets the format for this Document.
 java.lang.String getLanguage()
          Gets the ContentObject's language identifier, or null if not specified.
 java.io.Reader getSummary(java.lang.String pointOfView)
          Gets a specific summary of a document, previously generated by a call to generateSummary().
 ContextTheme[] getThemes()
          Gets the Themes for a document, previously generated by a call to generateThemes().
 boolean isReadByOwner()
          Returns true if the owner of the document has read the content via this document.
 boolean isReadByUser()
          Returns true if the current user has read the content to which this document refers.
 void setCharacterSet(java.lang.String charset)
          Sets the characterset for the content referred to by this Document.
 void setContent(DocumentDefinition def)
          Sets the content of this Document.
 void setFormat(Format format)
          Sets the format for this Document.
 void setLanguage(java.lang.String language)
          Sets the language for the content referred to by this Document.
 void setReadByUser(boolean readState)
          Sets read indication (for the current user) for the content referred to by this Document.
 
Methods inherited from class oracle.ifs.beans.PublicObject
addCategory, addRelationship, checkEffectiveAccess, checkEffectiveAccess, copy, getAcl, getAllFolderPaths, getAllFolderPaths, getAnyFolderPath, getAnyFolderPath, getCategories, getCategories, getCreateDate, getCreator, getDefaultAccessLevel, getDescription, getEffectiveAccessLevel, getEffectiveAccessLevel, getExpirationDate, getFamily, getFlags, getFolderReferencesSortSpecification, getLastModifier, getLastModifyDate, getLeftwardRelationshipObjects, getLeftwardRelationshipObjects, getLeftwardRelationships, getLeftwardRelationships, getLockedState, getLockState, getLockStateLabel, getOwner, getPolicyBundle, getPropertyBundle, getResolvedPublicObject, getRightwardRelationshipObjects, getRightwardRelationshipObjects, getRightwardRelationships, getRightwardRelationships, getSecuringPublicObject, grantAccess, handleEvent, hasNameAttribute, isLocked, isLockedForSession, isLockedForSessionByCurrentSession, isVersionable, isVersioned, lock, putPolicy, putProperty, putProperty, removeAllPolicies, removeAllProperties, removePolicy, removePolicy, removeProperty, removeRelationship, revokeAccess, revokeAllAccess, setAcl, setDescription, setExpirationDate, setFlags, setFolderReferencesSortSpecification, setOwner, setPolicyBundle, setPropertyBundle, setSecuringPublicObject, toLockStateLabel, toLockStateLabel, toLockStateLabel, unlock
 
Methods inherited from class oracle.ifs.beans.LibraryObject
equals, free, free, getAttribute, getAttributeByUpperCaseName, getAttributes, getAttributesByUpperCaseNames, getClassId, getClassObject, getDefinition, getId, getLabel, getName, getSession, invokeServerMethod, isInstanceOf, isTraced, lookupInstanceLabel, postEvent, postEvent, renderAsReader, renderAsStream, setAttribute, setAttribute, setAttributes, setAttributes, setName, toString, trace, update
 
Methods inherited from interface oracle.ifs.common.LibraryObjectInterface
getId
 
Methods inherited from interface oracle.ifs.common.Traceable
getTraceLogger, isTraced, trace
 

Field Detail


CLASS_NAME


public static final java.lang.String CLASS_NAME
This class name for this class. Useful for methods that take a class name argument.

CONTENTOBJECT_ATTRIBUTE


public static final java.lang.String CONTENTOBJECT_ATTRIBUTE
The ContentObject that contains this document's content.

READBYOWNER_ATTRIBUTE


public static final java.lang.String READBYOWNER_ATTRIBUTE
An indicator of whether the Document Owner has read the current content.
Method Detail

getContentObject


public ContentObject getContentObject()
                               throws IfsException
Gets the content for this Document.
Returns:
the ContentObject
Throws:
IfsException - if operation fails.

setFormat


public void setFormat(Format format)
               throws IfsException
Sets the format for this Document.
Parameters:
Format - the desired Format object.
Throws:
IfsException - if operation fails.

getFormat


public Format getFormat()
                 throws IfsException
Gets the format for this Document.
Returns:
the Format object.
Throws:
IfsException - if operation fails.

getCharacterSet


public java.lang.String getCharacterSet()
                                 throws IfsException
Returns the ContentObject's character encoding, or null if not specified.
Returns:
the character encoding
Throws:
if - the operation fails

setCharacterSet


public void setCharacterSet(java.lang.String charset)
                     throws IfsException
Sets the characterset for the content referred to by this Document. Note that this affects all documents referring to the same content.
Parameters:
charset - JAVA name for the new charcterset.
Throws:
IfsException - if operation fails.

getLanguage


public java.lang.String getLanguage()
                             throws IfsException
Gets the ContentObject's language identifier, or null if not specified.
Returns:
the language identifier
Throws:
IfsException - if the operation fails

setLanguage


public void setLanguage(java.lang.String language)
                 throws IfsException
Sets the language for the content referred to by this Document. Note that this affects all documents referring to the same content.
Parameters:
language - JAVA name for the new language.
Throws:
IfsException - if operation fails.

getContentSize


public long getContentSize()
                    throws IfsException
Gets the size of this document's content. It returns 0 (zero) if the content is zero length or if this document has a null ContentObject
Returns:
the size of the underlying content.
Throws:
IfsException - if operation fails.

getContentStream


public java.io.InputStream getContentStream()
                                     throws IfsException
Gets the document content as an InputStream.
Returns:
an InputStream of the content or null if this document does not have content
Throws:
IfsException - if operation fails.

getContentReader


public java.io.Reader getContentReader()
                                throws IfsException
Gets the document content as a Reader
Returns:
a Reader of the content or null if this document does not have content
Throws:
IfsException - if operation fails.

isReadByUser


public boolean isReadByUser()
                     throws IfsException
Returns true if the current user has read the content to which this document refers. Note that this will return true for all documents refering to the same content.
Returns:
true if current user has read the content referred by this Document.
Throws:
IfsException - if operation fails.

isReadByOwner


public boolean isReadByOwner()
                      throws IfsException
Returns true if the owner of the document has read the content via this document. This attribute is maintained per document.
Returns:
true if the owner has read the content refrerred by this document.
Throws:
IfsException - if operation fails.

setReadByUser


public void setReadByUser(boolean readState)
                   throws IfsException
Sets read indication (for the current user) for the content referred to by this Document. Note that this affects all documents referring to the same content.
Parameters:
readState - desired read indication for current user on this Document's content
Throws:
IfsException - if operation fails.

generateFilename


public java.lang.String generateFilename()
                                  throws IfsException
Generates a filename which is the objectname plus the format extension. This can be used as a default filename for operations such as getContent or checkOut. Note that this method does not prepend a path to the filename. Also note that this method will return null if this document has no content. Lastly, note that this method can produce long file names.
Returns:
a generated filename
Throws:
IfsException - if operation fails.

generateThemes


public void generateThemes(boolean fullThemes)
                    throws IfsException
Generates the Themes for this Document by submitting a request to Context to generate Themes.

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.

Parameters:
fullThemes - generates theme hierarchy information if TRUE
Throws:
IfsException - if operation fails.

getThemes


public ContextTheme[] getThemes()
                         throws IfsException
Gets the Themes for a document, previously generated by a call to generateThemes().

A document 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 document.

Returns:
an array of objects encapsulating a Context Theme and its associated Weight
Throws:
IfsException - if operation fails.

generateSummary


public void generateSummary(java.lang.String pointOfView,
                            long sizeAsPercent,
                            long sizeAsNumParagraphs,
                            java.lang.String summaryLevel)
                     throws IfsException
Generates one or more summaries for a document by submitting a request to Context to generate summaries.

If GENERIC is passed for pointOfView, then Context will generate a single generic summary of the document, based on all the document Themes. If a specific Theme is passed for pointOfView, then Context 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 Context 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 Context generates a sentence-level summary of the document. If summaryLevel is set to "P", then Context 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 document paragraphs (or sentences) that will be included in the summary, as a percentage of the total number of paragraphs (or sentences) present in the document. The default is 10. To use the default value, pass 0 for sizeAsPercent.

The parameter sizeAsNumParagraphs specifies the maximum number of document 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.

Parameters:
pointOfView - the specific Theme(s) based on which the summary is generated
sizeAsPercent - size of summary as a percentage of document size
sizeAsNumParagraphs - size of summary specified as number of paragraphs or sentences
summaryLevel - specifies whether summary is generated by selecting document paragraphs or sentences
Throws:
IfsException - if operation fails.

getSummary


public java.io.Reader getSummary(java.lang.String pointOfView)
                          throws IfsException
Gets a specific summary of a document, previously generated by a call to generateSummary().
Parameters:
pointOfView - get the summary that is based on this particular point of view
Returns:
a Reader for fetching the summary
Throws:
IfsException - if operation fails.

filterContent


public void filterContent(boolean plaintext)
                   throws IfsException
Generates a HTML or plaintext version of the document, via the Context INSO filters. The format of the document to be filtered must be supported by the Context filters.
Parameters:
plaintext - when TRUE, indicates that a plaintext version of the document must be generated, otherwise an HTML version will be generated
Throws:
IfsException - if operation fails.

getFilteredContent


public java.io.Reader getFilteredContent()
                                  throws IfsException
Gets the plaintext or HTML content of the document, previously generated by a call to filterContent()
Returns:
a Reader for fetching the plaintext or HTML content
Throws:
IfsException - if operation fails.

setContent


public void setContent(DocumentDefinition def)
                throws IfsException
Sets the content of this Document. This method is a cover on top of LibraryObject.update.
Parameters:
def - DocumentDefinition object describing desired updates.
Throws:
IfsException - if operation fails.