BEA Systems, Inc.

com.beasys.commerce.axiom.content
Class ContentImpl

java.lang.Object
  |
  +--com.beasys.commerce.foundation.EntityImpl
        |
        +--com.beasys.commerce.foundation.ConfigurableEntityImpl
              |
              +--com.beasys.commerce.axiom.content.ContentImpl
Direct Known Subclasses:
DocumentImpl

public class ContentImpl
extends ConfigurableEntityImpl

The PersonalizationServer implementation of a Content entity bean.

Subclasses of Content can use this as a based class to gain access to much of the foundation intfrastructure.

Since many content management systems are case-insensitive, the Content impl can be configured to turn all keys passed as aguments to either upper or lower case. This is specified via the "PropertyCase" EJB environment value. If the value is "upper", all keys are turned to upper case. If the value is "lower", all keys are turned to lower case. If the value is anything or not specified, all keys are left unmodified.

This implementation of Content utilizes a SmartBMP object to handle the creation, modification, and removal of Content objects. Additionally, for the findBySearchParams() method to operate correctly, the SmartBMP this is configured for must have a findBySearchParams(Search) method which returns an Enumeration the appropriate primary key classes.

 Primary Key = com.beasys.commerce.axiom.content.ContentPk
 

See Also:
Content, ContentHome, ContentValue, Serialized Form

Field Summary
 java.lang.String identifier
          The unique identifier of the Content.
 java.lang.String mimeType
          The mimeType of the content.
static int PROPERTY_CASE_LOWER
          Constant for lower case property keys.
static int PROPERTY_CASE_NONE
          Constant for no modification to property keys.
static int PROPERTY_CASE_UPPER
          Constant for upper case property keys.
 int propertyCase
          How this bean modifies property keys.
 
Fields inherited from class com.beasys.commerce.foundation.EntityImpl
__classIdentifier, __containingEntity, __mapKey, __sequenceNumber, _ctx, _isDirty
 
Constructor Summary
ContentImpl()
          Constructor.
 
Method Summary
 void addCachedPropertyMapped(java.lang.String scope, java.lang.String key, java.lang.String mapKey, java.lang.Object val)
          Override to possibly modified the case of the key.
 void addCachedPropertyValue(java.lang.String scope, java.lang.String key, java.lang.Object val)
          Override to possibly modified the case of the key.
 void addPropertyValue(java.lang.String scope, java.lang.String key, java.lang.Object prop)
          Override to possibly modified the case of the key.
 void addPropertyValueMapped(java.lang.String scope, java.lang.String key, java.lang.String mapKey, java.lang.Object value)
          Override to possibly modified the case of the key.
 Expression convertExpression(Expression expr)
          Convert an expression to the bean's preferred case.
 java.lang.String convertKey(java.lang.String key)
          Convert a string to the beans preferred case.
 Search convertParams(Search params)
          Convert search parameters to the bean's case.
 void ejbActivate()
          Called when the bean is activated.
 ContentPk ejbCreate(ContentPk contentPk)
          Create an instance of a Content object.
 ContentPk ejbFindByPrimaryKey(ContentPk pk)
          Find a bean by its primary key.
 java.util.Enumeration ejbFindBySearchParams(Search params)
          Return the list of PK objects which match the search parameters.
 void ejbLoad()
          Called when the bean should load its data.
 void ejbPassivate()
          Called when the bean is passivated.
 void ejbPostCreate(ContentPk contentPk)
          Called after a create finishes.
 void ejbRemove()
          Called when the bean should remove it self from the persistant store.
 void ejbStore()
          Called when the bean should update its persistant store with its data.
 java.lang.Object getCachedProperty(java.lang.String scope, java.lang.String key)
          Override to possibly modified the case of the key.
 ContentValue getContentByValue()
          Get all of Content's attributes.
 java.lang.String getIdentifier()
          Get the value of the identifier.
 java.lang.String getMimeType()
          Get the value of mimeType
 java.lang.Object getProperty(java.lang.String key)
          Override to possibly modified the case of the key.
 java.lang.Object removeCachedProperty(java.lang.String scope, java.lang.String key)
          Override to possibly modified the case of the key.
 java.lang.Object removeCachedPropertyMapped(java.lang.String scope, java.lang.String key, java.lang.String mapKey)
          Override to possibly modified the case of the key.
 void removeCachedPropertyValue(java.lang.String scope, java.lang.String key, java.lang.Object val)
          Override to possibly modified the case of the key.
 java.lang.Object removeProperty(java.lang.String key)
          Override to possibly modified the case of the key.
 java.lang.Object removeProperty(java.lang.String scope, java.lang.String key)
          Override to possibly modified the case of the key.
 void removePropertyValue(java.lang.String scope, java.lang.String key, java.lang.Object prop)
          Override to possibly modified the case of the key.
 java.lang.Object removePropertyValueMapped(java.lang.String scope, java.lang.String key, java.lang.String mapKey)
          Override to possibly modified the case of the key.
 void setCachedProperty(java.lang.String scope, java.lang.String key, java.lang.Object value)
          Override to possibly modified the case of the key.
 void setContentByValue(ContentValue value)
          Set all of Content's attributes to the passed in value.
 void setEntityContext(javax.ejb.EntityContext ctx)
          Called before any operations are performed on the bean.
 void setIdentifier(java.lang.String value)
          Set the value of the identifier for this bean.
 void setMimeType(java.lang.String mimeType)
          Set the value of mimeType
 void setProperty(java.lang.String key, java.lang.Object prop)
          Override to possibly modified the case of the key.
 void setProperty(java.lang.String scope, java.lang.String key, java.lang.Object prop)
          Override to possibly modified the case of the key.
 void unsetEntityContext()
          Called when the bean is done.
 
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
clearRelationalBinding, clearRelationalBinding, clearRelationalBinding, clearRelationalBinding, ejbFindAll, ejbFindByPrimaryKey, get__classIdentifier, get__containingBelonging, get__containingEntity, get__containingEntityReference, get__mapKey, get__sequenceNumber, getEntityContext, isModified, set__containingBelonging, set__containingEntity, set__containingEntityReference, set__mapKey
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTY_CASE_NONE

public static int PROPERTY_CASE_NONE
Constant for no modification to property keys.

PROPERTY_CASE_LOWER

public static int PROPERTY_CASE_LOWER
Constant for lower case property keys.

PROPERTY_CASE_UPPER

public static int PROPERTY_CASE_UPPER
Constant for upper case property keys.

propertyCase

public int propertyCase
How this bean modifies property keys.

This value should one of: PROPERTY_CASE_NONE, PROPERTY_CASE_LOWER, or PROPERTY_CASE_UPPER. It will be initialize in the setEntityContent() method.


identifier

public java.lang.String identifier
The unique identifier of the Content.

mimeType

public java.lang.String mimeType
The mimeType of the content.
Constructor Detail

ContentImpl

public ContentImpl()
            throws javax.ejb.CreateException
Constructor.
Throws:
javax.ejb.CreateException - thrown on an error creating the bean instance.
Method Detail

getContentByValue

public ContentValue getContentByValue()
                               throws java.rmi.RemoteException
Get all of Content's attributes.
Returns:
ContentValue the Content value object
Throws:
java.rmi.RemoteException - thrown on an error.

setContentByValue

public void setContentByValue(ContentValue value)
                       throws java.rmi.RemoteException
Set all of Content's attributes to the passed in value.

Note: Primary key attributes are not set.

Parameters:
ContentValue - the Content value object
Throws:
java.rmi.RemoteException - thrown on an error.

ejbCreate

public ContentPk ejbCreate(ContentPk contentPk)
                    throws javax.ejb.CreateException,
                           java.rmi.RemoteException
Create an instance of a Content object.
Throws:
java.rmi.RemoteException - thrown on an error.
javax.ejb.CreateException - thrown on a creation error.

ejbPostCreate

public void ejbPostCreate(ContentPk contentPk)
                   throws javax.ejb.CreateException,
                          java.rmi.RemoteException
Called after a create finishes.

This just delagates to the super class.

Throws:
java.rmi.RemoteException - thrown on an error.
javax.ejb.CreateException - thrown on a creation error.

ejbLoad

public void ejbLoad()
             throws java.rmi.RemoteException
Called when the bean should load its data.

This delagates to the super class, which should invokethe SmartBMP's refresh() method.

Overrides:
ejbLoad in class ConfigurableEntityImpl
Throws:
java.rmi.RemoteException - thrown on an error.

ejbStore

public void ejbStore()
              throws java.rmi.RemoteException
Called when the bean should update its persistant store with its data.

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

Overrides:
ejbStore in class ConfigurableEntityImpl
Throws:
java.rmi.RemoteException - thrown on an error.

ejbRemove

public void ejbRemove()
               throws java.rmi.RemoteException,
                      javax.ejb.RemoveException
Called when the bean should remove it self from the persistant store.
Overrides:
ejbRemove in class ConfigurableEntityImpl
Throws:
java.rmi.RemoteException - thrown on an error.
javax.ejb.RemoveException - thrown on removal an error.

ejbActivate

public void ejbActivate()
                 throws java.rmi.RemoteException
Called when the bean is activated.
Overrides:
ejbActivate in class ConfigurableEntityImpl
Throws:
java.rmi.RemoteException - thrown on an error.

ejbPassivate

public void ejbPassivate()
                  throws java.rmi.RemoteException
Called when the bean is passivated.
Overrides:
ejbPassivate in class ConfigurableEntityImpl
Throws:
java.rmi.RemoteException - thrown on an error.

setEntityContext

public void setEntityContext(javax.ejb.EntityContext ctx)
                      throws java.rmi.RemoteException
Called before any operations are performed on the bean.

This method configures the propertyCase of the bean from the "PropertyCase" EJB environment value.

Overrides:
setEntityContext in class EntityImpl
Throws:
java.rmi.RemoteException - thrown on an error.

unsetEntityContext

public void unsetEntityContext()
                        throws java.rmi.RemoteException
Called when the bean is done.
Overrides:
unsetEntityContext in class EntityImpl
Throws:
java.rmi.RemoteException - thrown on an error.

ejbFindByPrimaryKey

public ContentPk ejbFindByPrimaryKey(ContentPk pk)
                              throws javax.ejb.FinderException,
                                     java.rmi.RemoteException
Find a bean by its primary key.
Throws:
java.rmi.RemoteException - thrown on an error.
javax.ejb.FinderException - thrown on an error.

getMimeType

public java.lang.String getMimeType()
Get the value of mimeType
Returns:
mimeType.

setMimeType

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

getIdentifier

public java.lang.String getIdentifier()
Get the value of the identifier.

setIdentifier

public void setIdentifier(java.lang.String value)
Set the value of the identifier for this bean.

ejbFindBySearchParams

public java.util.Enumeration ejbFindBySearchParams(Search params)
                                            throws javax.ejb.FinderException
Return the list of PK objects which match the search parameters.

This will attempt to invoke the FindBySearchParams(Search) method on the bean's SmartBMP instance.

Throws:
javax.ejb.FinderException - thrown on an error.

getProperty

public java.lang.Object getProperty(java.lang.String key)
                             throws java.rmi.RemoteException
Override to possibly modified the case of the key.
Throws:
java.rmi.RemoteException - thrown on an error.

setProperty

public void setProperty(java.lang.String key,
                        java.lang.Object prop)
                 throws java.rmi.RemoteException
Override to possibly modified the case of the key.
Overrides:
setProperty in class ConfigurableEntityImpl
Throws:
java.rmi.RemoteException - thrown on an error.

removeProperty

public java.lang.Object removeProperty(java.lang.String key)
                                throws java.rmi.RemoteException
Override to possibly modified the case of the key.
Overrides:
removeProperty in class ConfigurableEntityImpl
Throws:
java.rmi.RemoteException - thrown on an error.

setProperty

public void setProperty(java.lang.String scope,
                        java.lang.String key,
                        java.lang.Object prop)
                 throws java.rmi.RemoteException
Override to possibly modified the case of the key.
Overrides:
setProperty in class ConfigurableEntityImpl
Throws:
java.rmi.RemoteException - thrown on an error.

removeProperty

public java.lang.Object removeProperty(java.lang.String scope,
                                       java.lang.String key)
                                throws java.rmi.RemoteException
Override to possibly modified the case of the key.
Overrides:
removeProperty in class ConfigurableEntityImpl
Throws:
java.rmi.RemoteException - thrown on an error.

addPropertyValue

public void addPropertyValue(java.lang.String scope,
                             java.lang.String key,
                             java.lang.Object prop)
                      throws java.rmi.RemoteException
Override to possibly modified the case of the key.
Overrides:
addPropertyValue in class ConfigurableEntityImpl
Throws:
java.rmi.RemoteException - thrown on an error.

removePropertyValue

public void removePropertyValue(java.lang.String scope,
                                java.lang.String key,
                                java.lang.Object prop)
                         throws java.rmi.RemoteException
Override to possibly modified the case of the key.
Overrides:
removePropertyValue in class ConfigurableEntityImpl
Throws:
java.rmi.RemoteException - thrown on an error.

addPropertyValueMapped

public void addPropertyValueMapped(java.lang.String scope,
                                   java.lang.String key,
                                   java.lang.String mapKey,
                                   java.lang.Object value)
                            throws java.rmi.RemoteException
Override to possibly modified the case of the key.
Overrides:
addPropertyValueMapped in class ConfigurableEntityImpl
Throws:
java.rmi.RemoteException - thrown on an error.

removePropertyValueMapped

public java.lang.Object removePropertyValueMapped(java.lang.String scope,
                                                  java.lang.String key,
                                                  java.lang.String mapKey)
                                           throws java.rmi.RemoteException
Override to possibly modified the case of the key.
Overrides:
removePropertyValueMapped in class ConfigurableEntityImpl
Throws:
java.rmi.RemoteException - thrown on an error.

setCachedProperty

public void setCachedProperty(java.lang.String scope,
                              java.lang.String key,
                              java.lang.Object value)
                       throws java.rmi.RemoteException
Override to possibly modified the case of the key.
Overrides:
setCachedProperty in class ConfigurableEntityImpl
Throws:
java.rmi.RemoteException - thrown on an error.

getCachedProperty

public java.lang.Object getCachedProperty(java.lang.String scope,
                                          java.lang.String key)
                                   throws java.rmi.RemoteException
Override to possibly modified the case of the key.
Overrides:
getCachedProperty in class ConfigurableEntityImpl
Throws:
java.rmi.RemoteException - thrown on an error.

removeCachedProperty

public java.lang.Object removeCachedProperty(java.lang.String scope,
                                             java.lang.String key)
                                      throws java.rmi.RemoteException
Override to possibly modified the case of the key.
Overrides:
removeCachedProperty in class ConfigurableEntityImpl
Throws:
java.rmi.RemoteException - thrown on an error.

addCachedPropertyValue

public void addCachedPropertyValue(java.lang.String scope,
                                   java.lang.String key,
                                   java.lang.Object val)
                            throws java.rmi.RemoteException
Override to possibly modified the case of the key.
Overrides:
addCachedPropertyValue in class ConfigurableEntityImpl
Throws:
java.rmi.RemoteException - thrown on an error.

removeCachedPropertyValue

public void removeCachedPropertyValue(java.lang.String scope,
                                      java.lang.String key,
                                      java.lang.Object val)
                               throws java.rmi.RemoteException
Override to possibly modified the case of the key.
Overrides:
removeCachedPropertyValue in class ConfigurableEntityImpl
Throws:
java.rmi.RemoteException - thrown on an error.

addCachedPropertyMapped

public void addCachedPropertyMapped(java.lang.String scope,
                                    java.lang.String key,
                                    java.lang.String mapKey,
                                    java.lang.Object val)
                             throws java.rmi.RemoteException
Override to possibly modified the case of the key.
Overrides:
addCachedPropertyMapped in class ConfigurableEntityImpl
Throws:
java.rmi.RemoteException - thrown on an error.

removeCachedPropertyMapped

public java.lang.Object removeCachedPropertyMapped(java.lang.String scope,
                                                   java.lang.String key,
                                                   java.lang.String mapKey)
                                            throws java.rmi.RemoteException
Override to possibly modified the case of the key.
Overrides:
removeCachedPropertyMapped in class ConfigurableEntityImpl
Throws:
java.rmi.RemoteException - thrown on an error.

convertKey

public java.lang.String convertKey(java.lang.String key)
Convert a string to the beans preferred case.
See Also:
propertyCase

convertParams

public Search convertParams(Search params)
Convert search parameters to the bean's case.
Parameters:
params - the search parameters.
Returns:
params (this converts in place).
See Also:
convertExpression(com.beasys.commerce.foundation.expression.Expression)

convertExpression

public Expression convertExpression(Expression expr)
Convert an expression to the bean's preferred case.
Parameters:
expr - the expression.
Returns:
expr (this converts in place).

BEA Systems, Inc.

Copyright © 2000 BEA Systems, Inc. All Rights Reserved