com.ibm.commerce.common.beans
Class StoreDataBean

java.lang.Object
  |
  +--com.ibm.ivj.ejb.runtime.AbstractEntityAccessBean
        |
        +--com.ibm.commerce.common.objects.StoreAccessBean
              |
              +--com.ibm.commerce.common.beans.StoreDataBean

public class StoreDataBean
extends StoreAccessBean

This data bean represents a Store

See Also:
Serialized Form

Field Summary
static java.lang.String COPYRIGHT
          Copyright
static java.lang.String URL_PATH_SEPARATOR
          The URL separator
 
Constructor Summary
StoreDataBean()
          Creates an empty StoreDataBean.
StoreDataBean( StoreAccessBean abStore)
          Creates a StoreDataBean from a StoreAccessBean
 
Method Summary
  CommandContext getCommandContext()
          Gets the command context set within this bean.
 java.lang.String getFilePath()
          Returns the path that has to be prepended to the front of a static assets for a store
 java.lang.String getFilePath(java.lang.String filename)
          Returns the path that has to be prepended to the front of a static assets for a store.
 java.lang.String getJspPath()
          Returns the path that has to be prepended to the front of a store related JSP
 java.lang.String getJspPath(java.lang.String filename)
          Returns the path that has to be prepended to the front of a store related JSP.
 java.lang.String getJspStoreDirFilePath()
          Returns the path that has to be prepended to the front of a static assets for a store
  TypedProperty getRequestProperties()
          Gets the request property set within this bean.
 java.util.ResourceBundle getResourceBundle(java.lang.String resourceName)
          Gets a property resource bundle from a store directory.
 java.util.ResourceBundle getResourceBundle(java.lang.String resourceName, java.lang.Integer languageId)
          Gets a property resource bundle from a store directory.
  CatalogDataBean[] getStoreCatalogs()
          Returns a list of beans that represent catalogs in the store
static java.lang.String getStoreContextPath()
          Returns the context path for the store servlet.
 java.lang.String getStoreId()
          Gets the store ID that represents the primary key for this store
 void populate()
          Fetches and populates information needed by the bean.
 void setCommandContext( CommandContext commandContext)
          Sets the command context within this bean.
 void setFilePath(java.lang.String filePath)
          Sets the path for static resources
 void setJspPath(java.lang.String jspPath)
          Sets the path for jsps.
 void setRequestProperties( TypedProperty requestProperty)
          Sets the request property within this bean.
 void setStoreId(java.lang.String storeId)
          Sets the store ID that represents the primary key for this store
 
Methods inherited from class com.ibm.commerce.common.objects. StoreAccessBean
commitCopyHelper, defaultJNDIName, fetchAssociatedObjects, findAll, findByAdministrator, findByAdministratorAndMemberGroup, findByCatalog, findByCreatedByContract, findByDistinguishedName, findByStatus, findByStoreCategory, findByStoreType, fulfills, getAllocationGoodFor, getAllocationGoodForInEJBType, getAvailableMaxPrecedenceOffers, getAvailableMaxPrecedenceOffers, getAvailableMaxPrecedenceOffers, getAvsAcceptCodes, getBopmpadFactor, getBopmpadFactorInEJBType, getCatalogs, getCreatedByContract, getCurrency, getCurrency, getDefaultBoOffset, getDefaultBoOffsetInEJBType, getDefaultContractId, getDefaultContractIdInEJBType, getDefaultCurrency, getDescription, getDirectory, getField1, getField2, getFulfillmentCenter, getFulfillmentCenterId, getFulfillmentCenterIdInEJBType, getFulfillmentCenterSelectionFlags, getFulfillmentCenterSelectionFlagsInEJBType, getGroupingAttributeValue, getIdentifier, getLanguageId, getLanguageIdInEJBType, getLastUpdateStatus, getMarkForDelete, getMasterCatalog, getMaxBoOffset, getMaxBoOffsetInEJBType, getMemberId, getMemberIdInEJBType, getOID, getOwner, getPriceList, getPriceLists, getPriceRefFlags, getPriceRefFlagsInEJBType, getQuoteGoodFor, getQuoteGoodForInEJBType, getRejectedOrderExpiry, getRejectedOrderExpiryInEJBType, getRelatedStores, getReturnFFMCenterId, getReturnFFMCenterIdInEJBType, getRMAGoodFor, getRMAGoodForInEJBType, getStatus, getStatusInEJBType, getStoreCategoryId, getStoreCategoryIdInEJBType, getStoreDefault, getStoreEntityId, getStoreEntityIdInEJBType, getStoreGroup, getStoreGroupId, getStoreGroupIdInEJBType, getStoreLevel, getStorePath, getStoresForRelatedStore, getStoreType, getSupportedLanguageIds, getTaxCategory, getType, instantiateEJB, instantiateEJBByPrimaryKey, refreshCopyHelper, setAllocationGoodFor, setAllocationGoodFor, setAvsAcceptCodes, setBopmpadFactor, setBopmpadFactor, setCreatedByContract, setDefaultBoOffset, setDefaultBoOffset, setDefaultCurrency, setDirectory, setField1, setField2, setFulfillmentCenterId, setFulfillmentCenterId, setFulfillmentCenterSelectionFlags, setFulfillmentCenterSelectionFlags, setIdentifier, setInitKey_storeEntityId, setLanguageId, setLanguageId, setLastUpdateStatus, setMarkForDelete, setMaxBoOffset, setMaxBoOffset, setMemberId, setMemberId, setOID, setPriceRefFlags, setPriceRefFlags, setQuoteGoodFor, setQuoteGoodFor, setRejectedOrderExpiry, setRejectedOrderExpiry, setReturnFFMCenterId, setReturnFFMCenterId, setRMAGoodFor, setRMAGoodFor, setStatus, setStatus, setStoreCategoryId, setStoreCategoryId, setStoreGroupId, setStoreGroupId, setStoreLevel, setStoreType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail
public static final java.lang.String COPYRIGHT
Copyright
See Also:
Constant Field Values

URL_PATH_SEPARATOR

public static final java.lang.String URL_PATH_SEPARATOR
The URL separator
See Also:
Constant Field Values
Constructor Detail

StoreDataBean

public StoreDataBean()
Creates an empty StoreDataBean.

StoreDataBean

public StoreDataBean(StoreAccessBean abStore)
              throws java.rmi.RemoteException,
                     javax.ejb.FinderException,
                     javax.naming.NamingException,
                     javax.ejb.CreateException
Creates a StoreDataBean from a StoreAccessBean
Parameters:
abStore - com.ibm.commerce.common.objects.StoreAccessBean
Throws:
java.rmi.RemoteException - The java.rmi.RemoteException exception
javax.ejb.FinderException - The javax.ejb.FinderException exception
javax.naming.NamingException - The javax.naming.NamingException exception
javax.ejb.CreateException - The javax.ejb.CreateException exception
Method Detail

getCommandContext

public CommandContext getCommandContext()
Gets the command context set within this bean.
Returns:
The command context set within this bean.

getFilePath

public java.lang.String getFilePath()
                             throws java.lang.Exception
Returns the path that has to be prepended to the front of a static assets for a store
Returns:
The path for files
Throws:
java.lang.Exception - The java.lang.Exception

getFilePath

public java.lang.String getFilePath(java.lang.String filename)
                             throws java.lang.Exception
Returns the path that has to be prepended to the front of a static assets for a store.

If a file is added/removed/changed in a store directory, and the store has 'com.ibm.commerce.view' store relationships, then the StoreRegistry for the corresponding store must be refreshed before retrieving the resource using this method.

If an alias for the store is defined, this method will return the store alias followed by the store directory as the file path. If the alias is not defined, it will just return the store directory.

If the store does not have any active 'com.ibm.commerce.view' store relationships, then this store's directory is used in the path. Otherwise, if the file exists in this store's public directory, then this store's directory is used in the path. Otherwise, the store directory in the request properties is used in the path.

e.g. If the store alias is "storeAlias", and the store directory is "storeDir", and this store has no 'com.ibm.commerce.view' store relationships, the result is "/storeAlias/storeDir/filename".

e.g. If the store alias is "storeAlias", and the store directory is "storeDir", and this store has the 'com.ibm.commerce.view' store relationships, and the file does not exist in this store's directory, and the request properties has a ECConstants.EC_JSP_STORE_DIR parameter value "jspStoreDir", then the result is "/storeAlias/jspStoreDir/filename"

Parameters:
filename - The name of the file
Returns:
The web path to the file
Throws:
java.lang.Exception - The java.lang.Exception exception

getJspPath

public java.lang.String getJspPath()
                            throws java.lang.Exception
Returns the path that has to be prepended to the front of a store related JSP
Returns:
The path for JSPs
Throws:
java.lang.Exception - The java.lang.Exception exception

getJspPath

public java.lang.String getJspPath(java.lang.String filename)
                            throws java.lang.Exception
Returns the path that has to be prepended to the front of a store related JSP.

If a JSP is added/removed/changed in a store directory, and the store has 'com.ibm.commerce.view' store relationships, then the StoreRegistry for the corresponding store must be refreshed before retrieving the resource using this method.

If the store does not have any active 'com.ibm.commerce.view' store relationships, then this store's directory is used in the path. Otherwise, if the file exists in this store's public directory, then this store's directory is used in the path. Otherwise, the store directory in the request properties is used in the path.

e.g. If the store directory is "storeDir", and this store has no 'com.ibm.commerce.view' store relationships, the result is "/storeDir/filename".

e.g. If the store directory is "storeDir", and this store has the 'com.ibm.commerce.view' store relationships, and the file does not exist in this store's directory, and the request properties has a ECConstants.EC_JSP_STORE_DIR parameter value "jspStoreDir", then the result is "/jspStoreDir/filename"

Parameters:
filename - the name of the JSP
Returns:
the path to the JSP
Throws:
ECException
java.lang.Exception

getJspStoreDirFilePath

public java.lang.String getJspStoreDirFilePath()
                                        throws java.lang.Exception
Returns the path that has to be prepended to the front of a static assets for a store

The jspStoreDir request attribute value is used when building this path.

Returns:
A store directory
Throws:
java.lang.Exception - The java.lang.Exception exception

getResourceBundle

public java.util.ResourceBundle getResourceBundle(java.lang.String resourceName)
                                           throws ECException
Gets a property resource bundle from a store directory.

If a properties file is added/removed/changed in a store directory, then the StoreRegistry for the corresponding store must be refreshed before retrieving the resource using this method.

The store path for the 'com.ibm.commerce.view' relationship type is used as the basis for the search of the resource.

For each store, the search consists of searching for ".properties" files with the locale as set in the command context. If a file with the command context locale cannot be found, then a file with no locale is searched for.

eg. The command context locale is "en_US", and there are two stores in the store path with directories "storeA" and "storeB". The search order is:

storeA/resourceName_en_US.properties storeA/resourceName.properties storeB/resourceName_en_US.properties storeB/resourceName.properties

Parameters:
resourceName - The name of the resource, using '.' as the namespace delimiter
Returns:
A resource bundle
Throws:
ECException - The com.ibm.comerce.exception.ECException exception

getResourceBundle

public java.util.ResourceBundle getResourceBundle(java.lang.String resourceName,
                                                  java.lang.Integer languageId)
                                           throws ECException
Gets a property resource bundle from a store directory.

If a properties file is added/removed/changed in a store directory, then the StoreRegistry for the corresponding store must be refreshed before retrieving the resource using this method.

The store path for the 'com.ibm.commerce.view' relationship type is used as the basis for the search of the resource.

For each store, the search consists of searching for ".properties" files with the locale as set in the command context. If a file with the locale of the specified language cannot be found, then a file with no locale is searched for.

eg. The locale for the specified language id is "en_US", and there are two stores in the store path with directories "storeA" and "storeB". The search order is:

storeA/resourceName_en_US.properties storeA/resourceName.properties storeB/resourceName_en_US.properties storeB/resourceName.properties

Parameters:
resourceName - The name of the resource, using '.' as the namespace delimiter
languageId - The language ID
Returns:
A resource bundle
Throws:
ECException - The com.ibm.commerce.exception.ECException exception

getRequestProperties

public TypedProperty getRequestProperties()
Gets the request property set within this bean.
Returns:
The request property set within this bean.

getStoreCatalogs

public CatalogDataBean[] getStoreCatalogs()
                                   throws ECException
Returns a list of beans that represent catalogs in the store
Returns:
An array of CatalogDataBeans
Throws:
ECException - The com.ibm.commerce.exception.ECException

getStoreId

public java.lang.String getStoreId()
Gets the store ID that represents the primary key for this store
Returns:
The store ID

populate

public void populate()
              throws java.lang.Exception
Fetches and populates information needed by the bean.
Throws:
java.lang.Exception - The java.lang.Exception exception

setCommandContext

public void setCommandContext(CommandContext commandContext)
Sets the command context within this bean.

setFilePath

public void setFilePath(java.lang.String filePath)
Sets the path for static resources
Parameters:
filePath - The file path

setJspPath

public void setJspPath(java.lang.String jspPath)
Sets the path for jsps.
Parameters:
jspPath - The JSP path

setRequestProperties

public void setRequestProperties(TypedProperty requestProperty)
                          throws ECException
Sets the request property within this bean.
Parameters:
requestProperty - The request property to set within this bean.
Throws:
javax.ejb.CreateException - The javax.ejb.CreateException exception
java.rmi.RemoteException - The java.rmi.RemoteException exception
javax.naming.NamingException - The javax.naming.NamingException exception
javax.ejb.FinderException - The javax.ejb.FinderException exception
ECException

setStoreId

public void setStoreId(java.lang.String storeId)
Sets the store ID that represents the primary key for this store
Parameters:
storeId - The store ID

getStoreContextPath

public static java.lang.String getStoreContextPath()
                                            throws java.lang.Exception
Returns the context path for the store servlet.
Returns:
The context path for store servlet
Throws:
java.lang.Exception - The java.lang.Exception