BEA Systems, Inc.

com.beasys.commerce.axiom.document
Class DocumentImpl

java.lang.Object
  |
  +--com.beasys.commerce.foundation.EntityImpl
        |
        +--com.beasys.commerce.foundation.ConfigurableEntityImpl
              |
              +--com.beasys.commerce.axiom.content.ContentImpl
                    |
                    +--com.beasys.commerce.axiom.document.DocumentImpl

public class DocumentImpl
extends ContentImpl

An implementation of the Document interface.

This implementation of Document uses a SmartBMP to handle interfacing with the underlying document management system. This SmartBMP must follow the requirements of the Content SmartBMP (i.e. it must have a findBySearchParams(Search, EntityImpl) method). Additionally, for document content byte retrieval to work, the SmartBMP must have a getContent(String, EntityImpl) method which, given the identifier of the Document, will return the byte array of its content.

 Primary Key = com.beasys.commerce.axiom.document.DocumentPk
 

See Also:
Document, DocumentHome, DocumentValue, Serialized Form

Field Summary
 java.lang.String author
          The author/creator of the document.
 java.lang.String comments
          Any comments about the document.
 java.sql.Timestamp creationDate
          The date upon which the document was created.
 java.lang.String description
          The description of the document.
 java.lang.ref.Reference documentBytesRef
          A place to temporarily cache the bytes of the document.
 java.lang.String lockedBy
          The identifier of the person who has the file locked.
 java.lang.String modifiedBy
          The identifier of the last person to modify the document.
 java.sql.Timestamp modifiedDate
          The time/date of when the document was modified last.
 java.lang.String name
          The name of the document.
 long size
          The size of the document.
 long version
          The version number of the document.
 
Fields inherited from class com.beasys.commerce.axiom.content.ContentImpl
identifier, mimeType, PROPERTY_CASE_LOWER, PROPERTY_CASE_NONE, PROPERTY_CASE_UPPER, propertyCase
 
Fields inherited from class com.beasys.commerce.foundation.ConfigurableEntityImpl
DEFAULT_ENTITY_PROPERTY_MANAGER_HOME, DEFAULT_SCHEMA_GROUP_NAME, ENTITY_PROPERTY_MANAGER_HOME, propertyMap, SCHEMA_GROUP_NAME
 
Fields inherited from class com.beasys.commerce.foundation.EntityImpl
__classIdentifier, __containingEntity, __mapKey, __sequenceNumber, _ctx, _environmentNamingContext, _environmentPropertyCache, _isDirty, _smartBMP
 
Constructor Summary
DocumentImpl()
          Constructor.
 
Method Summary
protected  void bscInitializeAttributes(DocumentPk documentPk)
          Initialize the instance variables.
 void ejbActivate()
          Called when the bean is activated.
 DocumentPk ejbCreate(DocumentPk documentPk)
          Create a document.
 DocumentPk ejbFindByPrimaryKey(DocumentPk pk)
          Make sure the document exists.
 void ejbLoad()
          Called when the document should load its data.
 void ejbPassivate()
          Called when the bean is passivated.
 void ejbPostCreate(DocumentPk documentPk)
          Called after the bean is created.
 void ejbRemove()
          Called when the document should remove itself from persistant store.
 void ejbStore()
          Called when the document should store its data.
 java.lang.String getAuthor()
          Get the document author.
 java.lang.String getComments()
          Get the document comments.
 byte[] getContent()
          Get all the bytes of the document's content.
 byte[] getContentBlock(long start, long size)
          Get a block of the document's content.
 java.sql.Timestamp getCreationDate()
          Get the date the document was created.
 java.lang.String getDescription()
          Get the document description.
 DocumentValue getDocumentByValue()
          Get all of Document's attributes.
 java.lang.String getLockedBy()
          Get the document locker.
 java.lang.String getModifiedBy()
          Get the identifier of the last modifier.
 java.sql.Timestamp getModifiedDate()
          Get the date the document was last modified.
 java.lang.String getName()
          Get the document name.
 long getSize()
          Get the document size.
 long getVersion()
          Get the document version
 void setAuthor(java.lang.String author)
          Set the document author.
 void setComments(java.lang.String comments)
          Set the value of comments
 void setCreationDate(java.sql.Timestamp creationDate)
          Set the creation date of the Document.
 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 setEntityContext(javax.ejb.EntityContext ctx)
          Called when the bean is about to be used.
 void setLockedBy(java.lang.String lockedBy)
          Set the document locker.
 void setModifiedBy(java.lang.String modifiedBy)
          Set the identifier of the last modifier
 void setModifiedDate(java.sql.Timestamp modifiedDate)
          Set the date the document was last modified.
 void setName(java.lang.String name)
          Set the document name.
 void setSize(long size)
          Set the document size.
 void setVersion(long version)
          Set the document version.
 void unsetEntityContext()
          Called when the container is done with the bean.
protected  boolean useEntityPropertyManager()
          Override to not use the EntityPropertyManager.
 
Methods inherited from class com.beasys.commerce.axiom.content.ContentImpl
addCachedPropertyMapped, addCachedPropertyValue, addPropertyValue, addPropertyValueMapped, bscInitializeAttributes, convertExpression, convertKey, convertParams, ejbCreate, ejbFindByPrimaryKey, ejbFindBySearchParams, ejbPostCreate, getCachedProperty, getContentByValue, getIdentifier, getImplicitProperty, getMimeType, getProperty, removeCachedProperty, removeCachedPropertyMapped, removeCachedPropertyValue, removeProperty, removeProperty, removePropertyValue, removePropertyValueMapped, setCachedProperty, setContentByValue, setIdentifier, setMimeType, setProperty, setProperty
 
Methods inherited from class com.beasys.commerce.foundation.ConfigurableEntityImpl
addBusinessPolicy, buildPolicyKey, createMapKey, ejbCreate, ejbPostCreate, getBusinessPolicy, getPersistableHandle, getProperty, getProperty, getPropertyAsString, getPropertyAsString, getPropertyDefault, getPropertyMap, getPropertyNoDefault, getSuccessor, getUniqueId, removeBusinessPolicy, removeCachedProperties, removeCachedProperties, removeSuccessor, setSuccessor, upcaseFirst
 
Methods inherited from class com.beasys.commerce.foundation.EntityImpl
bscInitializeAttributes, clearRelationalBinding, clearRelationalBinding, clearRelationalBinding, clearRelationalBinding, doRelationalBinding, doRelationalBinding, doRelationalBindingOnElement, doRelationalBindingOnElement, doRelationalBindingOnElement, doRelationalBindingOnSingleton, doRelationalBindingOnSingleton, doRelationalBindingOnSingleton, doRelationalBindingWithMapKey, doRelationalBindingWithMapKey, doRelationalBindingWithMapKey, ejbFindAll, ejbFindByPrimaryKey, enumerateRelationalBinding, enumerateRelationalBinding, get__classIdentifier, get__containingBelonging, get__containingEntity, get__containingEntityReference, get__mapKey, get__sequenceNumber, getEntityContext, getEnvironmentNamingContext, getEnvironmentProperty, getEnvironmentProperty, getEnvironmentPropertyCache, getPersistenceHelperPlugin, getSmartBMP, initSmartBMP, isModified, set__classIdentifier, set__containingBelonging, set__containingEntity, set__containingEntityReference, set__mapKey
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

documentBytesRef

public transient java.lang.ref.Reference documentBytesRef
A place to temporarily cache the bytes of the document.

This is a place holder for the SmartBMP to cache the bytes of the document.


description

public java.lang.String description
The description of the document.

size

public long size
The size of the document.

modifiedBy

public java.lang.String modifiedBy
The identifier of the last person to modify the document.

modifiedDate

public java.sql.Timestamp modifiedDate
The time/date of when the document was modified last.

creationDate

public java.sql.Timestamp creationDate
The date upon which the document was created.

version

public long version
The version number of the document.

author

public java.lang.String author
The author/creator of the document.

lockedBy

public java.lang.String lockedBy
The identifier of the person who has the file locked.

comments

public java.lang.String comments
Any comments about the document.

name

public java.lang.String name
The name of the document.
Constructor Detail

DocumentImpl

public DocumentImpl()
             throws javax.ejb.CreateException
Constructor.
Method Detail

getDocumentByValue

public DocumentValue getDocumentByValue()
                                 throws java.rmi.RemoteException
Get all of Document's attributes.
Returns:
DocumentValue the Document value object

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.
Parameters:
DocumentValue - the Document value object

ejbCreate

public DocumentPk ejbCreate(DocumentPk documentPk)
                     throws javax.ejb.CreateException,
                            java.rmi.RemoteException
Create a document.

This delagates to the super class, which will invoke the SmartBMP's create() method.


bscInitializeAttributes

protected void bscInitializeAttributes(DocumentPk documentPk)
                                throws javax.ejb.CreateException,
                                       java.rmi.RemoteException
Initialize the instance variables.

ejbPostCreate

public void ejbPostCreate(DocumentPk documentPk)
                   throws javax.ejb.CreateException,
                          java.rmi.RemoteException
Called after the bean is created.

ejbLoad

public void ejbLoad()
             throws javax.ejb.EJBException
Called when the document should load its data.

This delagates to the super class, which will invoke the refresh() method on the SmartBMP.

Overrides:
ejbLoad in class ContentImpl

ejbStore

public void ejbStore()
              throws javax.ejb.EJBException
Called when the document should store its data.

This delagates to the super class, which will invoke the update() method on the SmartBMP.

Overrides:
ejbStore in class ContentImpl

ejbRemove

public void ejbRemove()
               throws javax.ejb.EJBException,
                      javax.ejb.RemoveException
Called when the document should remove itself from persistant store.

This delagates to the super class, which will invoke the remove() method on the SmartBMP.

Overrides:
ejbRemove in class ContentImpl
Tags copied from class: ContentImpl
Throws:
javax.ejb.RemoveException - thrown on removal an error.

ejbActivate

public void ejbActivate()
                 throws javax.ejb.EJBException
Called when the bean is activated.
Overrides:
ejbActivate in class ContentImpl
Tags copied from class: ContentImpl
Throws:
javax.ejb.EJBException - thrown on an error.

ejbPassivate

public void ejbPassivate()
                  throws javax.ejb.EJBException
Called when the bean is passivated.
Overrides:
ejbPassivate in class ContentImpl
Tags copied from class: ContentImpl
Throws:
javax.ejb.EJBException - thrown on an error.

setEntityContext

public void setEntityContext(javax.ejb.EntityContext ctx)
                      throws javax.ejb.EJBException
Called when the bean is about to be used.
Overrides:
setEntityContext in class ContentImpl
Tags copied from class: ContentImpl
Throws:
javax.ejb.EJBException - thrown on an error.

unsetEntityContext

public void unsetEntityContext()
                        throws javax.ejb.EJBException
Called when the container is done with the bean.
Overrides:
unsetEntityContext in class ContentImpl
Tags copied from class: ContentImpl
Throws:
javax.ejb.EJBException - thrown on an error.

ejbFindByPrimaryKey

public DocumentPk ejbFindByPrimaryKey(DocumentPk pk)
                               throws javax.ejb.FinderException,
                                      java.rmi.RemoteException
Make sure the document exists.

getDescription

public java.lang.String getDescription()
Get the document description.

setDescription

public void setDescription(java.lang.String description)
Set the document description.

getSize

public long getSize()
Get the document size.

setSize

public void setSize(long size)
Set the document size.

getModifiedBy

public java.lang.String getModifiedBy()
Get the identifier of the last modifier.

setModifiedBy

public void setModifiedBy(java.lang.String modifiedBy)
Set the identifier of the last modifier

getModifiedDate

public java.sql.Timestamp getModifiedDate()
Get the date the document was last modified.

setModifiedDate

public void setModifiedDate(java.sql.Timestamp modifiedDate)
Set the date the document was last modified.

getCreationDate

public java.sql.Timestamp getCreationDate()
Get the date the document was created.

setCreationDate

public void setCreationDate(java.sql.Timestamp creationDate)
Set the creation date of the Document.

getVersion

public long getVersion()
Get the document version

setVersion

public void setVersion(long version)
Set the document version.

getAuthor

public java.lang.String getAuthor()
Get the document author.

setAuthor

public void setAuthor(java.lang.String author)
Set the document author.

getLockedBy

public java.lang.String getLockedBy()
Get the document locker.

setLockedBy

public void setLockedBy(java.lang.String lockedBy)
Set the document locker.

getComments

public java.lang.String getComments()
Get the document comments.

setComments

public void setComments(java.lang.String comments)
Set the value of comments
Parameters:
comments - comments to be added

getName

public java.lang.String getName()
Get the document name.

setName

public void setName(java.lang.String name)
Set the document name.

getContentBlock

public byte[] getContentBlock(long start,
                              long size)
                       throws java.rmi.RemoteException
Get a block of the document's content.
Parameters:
start - the start index.
size - the number of bytes to get.
See Also:
getContent()

getContent

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

This will attempt to invoke, in this order, the following method on the SmartBMP:

If it finds one of those methods, it will invoke it and expect back a byte array of the Document's content bytes.


useEntityPropertyManager

protected boolean useEntityPropertyManager()
Override to not use the EntityPropertyManager.
Overrides:
useEntityPropertyManager in class ConfigurableEntityImpl

BEA Systems, Inc.

Copyright © 2000 BEA Systems, Inc. All Rights Reserved