BEA Systems, Inc.

com.beasys.commerce.axiom.document
Interface DocumentRemote


public interface DocumentRemote
extends ContentRemote, Document

The public interface for a Document.

This is the EJB interface to Documents.

Documents are a specialized type of Content which are generally controlled by a Document Management System (DMS). The Document interface contains explicit attributes common to most types of documents and DMS's. Additionally, the Document interface has a method to retrieve the raw bytes of the actualy document itself (e.g. the images data of a GIF, the text of an HTML document_. Document's inherit the identifier and mimeType attribute from the Content interface. Also, all other implicit attributes (i.e. metadata) about the document will be available.

The reference implementation document management system included in the PersonalizationServer does not support creation or modification of Documents via the EJB interfaces. However, other implementations might.

 Primary Key = com.beasys.commerce.axiom.document.DocumentPk
 
Attribute: description Attribute: size Attribute: modifiedBy Attribute: modifiedDate Attribute: creationDate Attribute: version Attribute: author Attribute: lockedBy Attribute: comments Attribute: name

When constructing queries for Documents, the above property/attribute names will compare against the explicit attributes on the Document interface. For example, to find document whose size is less than 1024 bytes, you could use a query string like "size < 1024".

See Also:
Search, DocumentPk, DocumentHome, DocumentImpl, DocumentValue

Fields inherited from interface com.beasys.commerce.foundation.ConfigurableEntity
RESERVED_SCOPE_NAME
 
Fields inherited from interface com.beasys.commerce.foundation.ConfigurableEntity
RESERVED_SCOPE_NAME
 
Fields inherited from interface com.beasys.commerce.foundation.ConfigurableEntity
RESERVED_SCOPE_NAME
 
Method Summary
 java.lang.String getAuthor()
          Get the identifier of the invididual who created the document.
 java.lang.String getComments()
          Get any text comments about the document.
 byte[] getContent()
          Return the bytes of the document's content.
 byte[] getContentBlock(long start, long size)
          Get a block of the bytes of the document's content.
 java.sql.Timestamp getCreationDate()
          Get the time/date of when the document was created.
 java.lang.String getDescription()
          Get the text description of the document.
 DocumentValue getDocumentByValue()
          Get all of Document's attributes.
 java.lang.String getLockedBy()
          Get the identifier of the individual who has a lock on the document.
 java.lang.String getModifiedBy()
          Get the identifier of the individual who last modified the document.
 java.sql.Timestamp getModifiedDate()
          Get time and date of when the document was last modified.
 java.lang.String getName()
          Get the name of the document.
 long getSize()
          Get the size of the document in bytes.
 long getVersion()
          Get the version number of the document.
 void setAuthor(java.lang.String author)
          Set the author of the document.
 void setComments(java.lang.String comments)
          Set the comments about the document.
 void setCreationDate(java.sql.Timestamp creationDate)
          Set the time/date of when the document was created.
 void setDescription(java.lang.String description)
          Set the document description.
 void setDocumentByValue(DocumentValue value)
          Set all of Document's attributes to the passed in value.
 void setLockedBy(java.lang.String lockedBy)
          Set the who has a lock on the document.
 void setModifiedBy(java.lang.String modifiedBy)
          Set the identifier of the individual who last modified the document.
 void setModifiedDate(java.sql.Timestamp modifiedDate)
          Set the time/date of when the document was last modified.
 void setName(java.lang.String name)
          Set the name of the document.
 void setSize(long size)
          Set the size of the document.
 void setVersion(long version)
          Set the version number.
 
Methods inherited from interface com.beasys.commerce.axiom.content.ContentRemote
getContentByValue, getIdentifier, getMimeType, setContentByValue, setMimeType
 
Methods inherited from interface javax.ejb.EJBObject
getEJBHome, getHandle, getPrimaryKey, isIdentical, remove
 
Methods inherited from interface com.beasys.commerce.foundation.RemoteRelationalReference
get__classIdentifier, get__containingBelonging, get__containingEntity, get__mapKey, get__sequenceNumber, set__containingBelonging, set__containingEntity, set__mapKey
 

Method Detail

getDocumentByValue

public DocumentValue getDocumentByValue()
                                 throws java.rmi.RemoteException
Get all of Document's attributes.
Specified by:
getDocumentByValue in interface Document
Returns:
DocumentValue the Document value object
Throws:
java.rmi.RemoteException - thrown on an error.

setDocumentByValue

public void setDocumentByValue(DocumentValue value)
                        throws java.rmi.RemoteException
Set all of Document's attributes to the passed in value. Note: Primary key attributes are not set.
Specified by:
setDocumentByValue in interface Document
Parameters:
DocumentValue - the Document value object
Throws:
java.rmi.RemoteException - thrown on an error.

getDescription

public java.lang.String getDescription()
                                throws java.rmi.RemoteException
Get the text description of the document.
Specified by:
getDescription in interface Document
Returns:
the description or null if none.
Throws:
java.rmi.RemoteException - thrown on an error.

setDescription

public void setDescription(java.lang.String description)
                    throws java.rmi.RemoteException
Set the document description.
Specified by:
setDescription in interface Document
Parameters:
description - description to be added
Throws:
java.rmi.RemoteException - thrown on an error.

getSize

public long getSize()
             throws java.rmi.RemoteException
Get the size of the document in bytes.

For now, since the document content itself is represented a byte array, the size returned should not be larger than Integer.MAX_VALUE. However, in the future, larger documents will be supported.

Specified by:
getSize in interface Document
Returns:
the size, 0 or less if no bytes associated with the document.
Throws:
java.rmi.RemoteException - thrown on an error.

setSize

public void setSize(long size)
             throws java.rmi.RemoteException
Set the size of the document.
Specified by:
setSize in interface Document
Throws:
java.rmi.RemoteException - thrown on an error.

getModifiedBy

public java.lang.String getModifiedBy()
                               throws java.rmi.RemoteException
Get the identifier of the individual who last modified the document.
Specified by:
getModifiedBy in interface Document
Returns:
the identifier of the modifier, null if none.
Throws:
java.rmi.RemoteException - thrown on an error.

setModifiedBy

public void setModifiedBy(java.lang.String modifiedBy)
                   throws java.rmi.RemoteException
Set the identifier of the individual who last modified the document.
Specified by:
setModifiedBy in interface Document
Throws:
java.rmi.RemoteException - thrown on an error.

getModifiedDate

public java.sql.Timestamp getModifiedDate()
                                   throws java.rmi.RemoteException
Get time and date of when the document was last modified.
Specified by:
getModifiedDate in interface Document
Returns:
the modified date, or null if unknown.
Throws:
java.rmi.RemoteException - thrown on an error.

setModifiedDate

public void setModifiedDate(java.sql.Timestamp modifiedDate)
                     throws java.rmi.RemoteException
Set the time/date of when the document was last modified.
Specified by:
setModifiedDate in interface Document
Throws:
java.rmi.RemoteException - thrown on an error.

getCreationDate

public java.sql.Timestamp getCreationDate()
                                   throws java.rmi.RemoteException
Get the time/date of when the document was created.
Specified by:
getCreationDate in interface Document
Returns:
the creation date, or null if unknown.
Throws:
java.rmi.RemoteException - thrown on an error.

setCreationDate

public void setCreationDate(java.sql.Timestamp creationDate)
                     throws java.rmi.RemoteException
Set the time/date of when the document was created.
Specified by:
setCreationDate in interface Document
Throws:
java.rmi.RemoteException - thrown on an error.

getVersion

public long getVersion()
                throws java.rmi.RemoteException
Get the version number of the document.
Specified by:
getVersion in interface Document
Throws:
java.rmi.RemoteException - thrown on an error.

setVersion

public void setVersion(long version)
                throws java.rmi.RemoteException
Set the version number.
Specified by:
setVersion in interface Document
Throws:
java.rmi.RemoteException - thrown on an error.

getAuthor

public java.lang.String getAuthor()
                           throws java.rmi.RemoteException
Get the identifier of the invididual who created the document.
Specified by:
getAuthor in interface Document
Returns:
the author, or null if unknown.
Throws:
java.rmi.RemoteException - thrown on an error.

setAuthor

public void setAuthor(java.lang.String author)
               throws java.rmi.RemoteException
Set the author of the document.
Specified by:
setAuthor in interface Document
Throws:
java.rmi.RemoteException - thrown on an error.

getLockedBy

public java.lang.String getLockedBy()
                             throws java.rmi.RemoteException
Get the identifier of the individual who has a lock on the document.
Specified by:
getLockedBy in interface Document
Returns:
the locker's identifier, or null if unknown.
Throws:
java.rmi.RemoteException - thrown on an error.

setLockedBy

public void setLockedBy(java.lang.String lockedBy)
                 throws java.rmi.RemoteException
Set the who has a lock on the document.
Specified by:
setLockedBy in interface Document
Throws:
java.rmi.RemoteException - thrown on an error.

getComments

public java.lang.String getComments()
                             throws java.rmi.RemoteException
Get any text comments about the document.
Specified by:
getComments in interface Document
Returns:
the comments, or null if none.
Throws:
java.rmi.RemoteException - thrown on an error.

setComments

public void setComments(java.lang.String comments)
                 throws java.rmi.RemoteException
Set the comments about the document.
Specified by:
setComments in interface Document
Throws:
java.rmi.RemoteException - thrown on an error.

getName

public java.lang.String getName()
                         throws java.rmi.RemoteException
Get the name of the document.

In general, this should correspond to the original filename of the document, but is not guarenteed to. Additionally, the document's mimeType is not guarenteed to correspond to any extension on the filename.

This value should be used when prompting a user to save the file.

Specified by:
getName in interface Document
Returns:
the name, or null if unknown.
Throws:
java.rmi.RemoteException - thrown on an error.

setName

public void setName(java.lang.String name)
             throws java.rmi.RemoteException
Set the name of the document.
Specified by:
setName in interface Document
Throws:
java.rmi.RemoteException - thrown on an error.

getContentBlock

public byte[] getContentBlock(long start,
                              long size)
                       throws java.rmi.RemoteException
Get a block of the bytes of the document's content.

This currently just calls getContent() and returns a subarray. However, this will support retrieving large files when large files are supported.

Specified by:
getContentBlock in interface Document
Parameters:
start - the starting index in the byte array.
size - the number of bytes to retrieve.
Throws:
java.rmi.RemoteException - thrown on an error.

getContent

public byte[] getContent()
                  throws java.rmi.RemoteException
Return the bytes of the document's content.

This currently doesn't support files larger than 2^31 bytes.

Specified by:
getContent in interface Document
Throws:
java.rmi.RemoteException - thrown on an error.

BEA Systems, Inc.

Copyright © 2000 BEA Systems, Inc. All Rights Reserved