com.ibm.commerce.contract.commands
Class StoreCreationWizardCmdImpl

java.lang.Object
  |
  +--CacheableCommandImpl
        |
        +--com.ibm.commerce.command.AbstractECTargetableCommand
              |
              +--com.ibm.commerce.command.ControllerCommandImpl
                    |
                    +--com.ibm.commerce.tools.command.ToolsControllerCommandImpl
                          |
                          +--com.ibm.commerce.contract.commands.StoreCreationWizardCmdImpl
All Implemented Interfaces:
AccCommand, ControllerCommand, ECCommand, ECTargetableCommand, StoreCreationWizardCmd, ToolsControllerCommand

public class StoreCreationWizardCmdImpl
extends ToolsControllerCommandImpl
implements StoreCreationWizardCmd

Read the XML template file for the right profile store (e.g.: TemplateHostingContractRPS.xml) and substitutes with user specified values.

See Also:
Serialized Form

Field Summary
static java.lang.String COPYRIGHT
          IBM copyright notice field.
 
Fields inherited from class com.ibm.commerce.command. ControllerCommandImpl
requestProperties, responseProperties, retriable, viewReqProperties
 
Fields inherited from class com.ibm.commerce.command. AbstractECTargetableCommand
commandContext
 
Fields inherited from interface com.ibm.commerce.contract.commands. StoreCreationWizardCmd
defaultCommandClassName
 
Fields inherited from interface com.ibm.commerce.tools.command. ToolsControllerCommand
NAME
 
Constructor Summary
StoreCreationWizardCmdImpl()
           
 
Method Summary
 org.w3c.dom.Document createCustomXMLElement(org.w3c.dom.Document adocRoot)
          Override this method to customize the XML template read by the command.
 java.lang.String createHostedStoreHomepageURL()
          Override this method to specify the hosted store home page URL.
 java.lang.String getIstrStoreHomepageURL()
          Returns the istrStoreHomepageURL.
 java.util.Vector getPaymentsList()
          Returns the payment list.
  AccessVector getResources()
          Gets the access vector accessed by this command.
 boolean isUsAscii(java.lang.String parameterValue)
          String utility that checks if String is UTF8 value.
 void performExecute()           performExecute does the follow: Put strings to be substituted in a Vector.
 void setCatalogProfileStore(java.lang.String astrCatalogProfStore)
          Sets unique name of the catalog profile store.
 void setDefaultCurrency(java.lang.String astrDefaultCurr)
          Sets store's default currency.
 void setDefaultLocale(java.lang.String astrDefaultLocale)
          Sets store's default locale.
 void setISPOrgDN(java.lang.String astrISPOrgDN)
          Sets the full distinguished name of the service provider organization.
 void setISPStoreIdentifier(java.lang.String astrISPStoreIdentifier)
          Sets service provider store's identifier.
 void setIstrStoreHomepageURL(java.lang.String istrStoreHomepageURL)
          Sets the istrStoreHomepageURL.
 void setOwnerDN(java.lang.String astrOwnerDN)
          Sets full distinguished name of the owner of the hosted store.
 void setOwnerEmail(java.lang.String astrOwnerEmail)
          Sets e-mail address for message notifications.
 void setProfileOrgDN(java.lang.String astrProfileOrgDN)
          Sets the full distinguished name of the profile stores organization.
 void setProfileStore(java.lang.String astrProfileStore)
          Sets unique name of the hosted store profile store.
 void setRequestProperties( TypedProperty aRequestProperties)
          Gets the input parameters from the requestProperties object and sets each parameter to a local variable.
 void setStoreCategory(java.lang.String astrStoreCategory)
          Sets store's category.
 void setStoreDescription(java.lang.String astrStoreDesc)
          Sets store's description.
 void setStoreDir(java.lang.String astrStoreDir)
          Sets name of folder to keep hosted store file assets.
 void setStoreDisplayName(java.lang.String astrStoreDisplayName)
          Sets store display name.
 void setStoreIdentifier(java.lang.String astrStoreIdentifier)
          Sets store's identifier.
 void setStoreOrgId(java.lang.String astrStoreOrgId)
          Sets the full distinguished name of the hosted store organization.
 void validateParameters()
          Validate Paramaters from request.
 
Methods inherited from class com.ibm.commerce.tools.command. ToolsControllerCommandImpl
getViewInputProperties
 
Methods inherited from class com.ibm.commerce.command. ControllerCommandImpl
checkPermission, fulfills, getForUserId, getGeneric, getOwner, getRequestProperties, getResolvedRequestProperties, getResourceOwners, getResponseProperties, getRetriable, isGeneric, isRetriable, mergeProperties, setForUserId, setGeneric, setOwner, setResponseProperties, setRetriable, setViewInputProperties
 
Methods inherited from class com.ibm.commerce.command. AbstractECTargetableCommand
accessControlCheck, checkIsAllowed, checkParameters, checkResourcePermission, createCommandExecutionEvent, execute, finalize, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getStoreId, getUser, getUserId, isReadyToCallExecute, reset, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ibm.commerce.command. ControllerCommand
checkPermission, execute, getGeneric, getRequestProperties, getResolvedRequestProperties, getResponseProperties, getRetriable, getViewInputProperties, isGeneric, isRetriable, mergeProperties, setGeneric, setRetriable, setViewInputProperties
 
Methods inherited from interface com.ibm.commerce.command. AccCommand
accessControlCheck, getAccCheck, getForUserId, getResourceOwners, setAccCheck, setForUserId, setOwner
 
Methods inherited from interface com.ibm.commerce.command. ECCommand
checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getStoreId, getUser, getUserId, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
 

Field Detail
public static final java.lang.String COPYRIGHT
IBM copyright notice field.
See Also:
Constant Field Values
Constructor Detail

StoreCreationWizardCmdImpl

public StoreCreationWizardCmdImpl()
Method Detail

getResources

public AccessVector getResources()
                          throws ECException
Gets the access vector accessed by this command. The default implementation returns OrganizationAccessBean of the hosted store organization.
Specified by:
getResources in interface ECCommand
Overrides:
getResources in class AbstractECTargetableCommand
Returns:
AccessVector - a vector of resource action pairs
Throws:
ECException
See Also:
AbstractECTargetableCommand.getResources()

isUsAscii

public boolean isUsAscii(java.lang.String parameterValue)
String utility that checks if String is UTF8 value.
Parameters:
parameterValue - The input Sting to check
Returns:
Returns true if it is UTF8

createCustomXMLElement

public org.w3c.dom.Document createCustomXMLElement(org.w3c.dom.Document adocRoot)
                                            throws ECApplicationException
Override this method to customize the XML template read by the command. This function is called before the XML object is passed to ContractImportApprovedVersionCmd. The current Document object of the XML is passed in as paramenter. The method should return a Document object when new XML elements are added. This method can be used for adding new payment methods, XML elements, or any required modifications before the XML object is imported. For getting list of payment methods, see the getPaymentsList() method.
Specified by:
createCustomXMLElement in interface StoreCreationWizardCmd
Parameters:
adocRoot - The XML document root
Returns:
Document object after modifications.
Throws:
ECApplicationException - the exception to throw if the custom code needs to throw an exception

createHostedStoreHomepageURL

public java.lang.String createHostedStoreHomepageURL()
Override this method to specify the hosted store home page URL.
Specified by:
createHostedStoreHomepageURL in interface StoreCreationWizardCmd
Returns:
The URL. Returns _HOSTED_STORE_HOMEPAGE_URL ("/webapp/wcs/stores/servlet/StoreView?storeId=%STORE_ID%") by default

getPaymentsList

public java.util.Vector getPaymentsList()
Returns the payment list.
Specified by:
getPaymentsList in interface StoreCreationWizardCmd
Returns:
A Vector of hashtables of all payment list

performExecute

public void performExecute()
                    throws ECException
performExecute does the follow:
  1. Put strings to be substituted in a Vector.
  2. Read XML input template and substitute with values from the Vector.
  3. Check for "Active" state from the template.
  4. Add/Remove Payments information.
  5. Add/Remove Fulfillments information.
  6. Remove catalog profile store elements if necessary.
  7. Calls ContractImportApprovedVersionCmd and returns a contract Id.
Specified by:
performExecute in interface ECCommand
Overrides:
performExecute in class AbstractECTargetableCommand
Throws:
ECException - threw with message _ERR_SCW_ERROR_STORE_STATE if "Store" element's "state" attribute from input template is not "Active". threw with message _ERR_DUPLICATED_CONTRACT_NAME if Store display name already exists in database. threw with message _ERR_CONTRACT_SYS_GENERIC if there are other system errors

setRequestProperties

public void setRequestProperties(TypedProperty aRequestProperties)
                          throws ECApplicationException
Gets the input parameters from the requestProperties object and sets each parameter to a local variable.
Specified by:
setRequestProperties in interface ControllerCommand
Overrides:
setRequestProperties in class ToolsControllerCommandImpl
Parameters:
aRequestProperties - request properties
Throws:
ECApplicationException - threw with message _ERR_MISSING_CMD_PARAMETER if storeId is missing. threw with message _ERR_CMD_INVALID_PARAM if paymentOverride parameter is not a boolean. threw with message _ERR_CMD_INVALID_PARAM if storeId or XML object is invalid. threw with message _ERR_SCW_MISSING_PAYMENT_METHOD if Payment Method Name is missing from Custom Offline. threw with message _ERR_SCW_MISSING_BRAND if brand is missing from Offline Card. threw with message _ERR_SCW_MISSING_CURRENCY if currency is missing from Offline Card.

validateParameters

public void validateParameters()
                        throws ECException,
ECApplicationException
Validate Paramaters from request. Resolve Store Organization DN, Owner's member Id, Profile Store Identifier, Profile Store DN, Store Type,
Specified by:
validateParameters in interface ECCommand
Overrides:
validateParameters in class AbstractECTargetableCommand
Throws:
ECException
ECApplicationException - threw with message _ERR_SCW_ERROR_STORE_DN if the system cannot get store organization DN using the store organization's Id. threw with message _ERR_SCW_ERROR_OWNER_DN if the system cannot get store owner's DN using userId from command context. threw with message _ERR_SCW_ERROR_PROFILE_STORE_IDENTIFIER if the system cannot get profile store identifier using profile store id. threw with message _ERR_SCW_ERROR_PROFILE_STORE_TYPE if the system cannot get profile store type using profile store id, or an error occurred while generating the input template file name. threw with message _ERR_SCW_ERROR_PROFILE_STORE_DN if the system cannot get profile store DN using profile store id. threw with message _ERR_SCW_ERROR_CAT_PROF_STORE_IDENTIFIER if the system cannot get catalog profile store identifier using catalog profile store id. threw with message _ERR_SCW_ERROR_CAT_PROF_STORE_DN if the system cannot get catalog profile store DN using catalog profile store id. threw with message _ERR_SCW_ERROR_SUB_ORG_NAME if the system cannot generate a sub organization for the store. threw with message _ERR_SCW_ERROR_ISP_ORG_DN if the system cannot get the service provider's DN using the store Id parameter passed in. threw with message _ERR_SCW_STORE_IDENTIFIER_EXISTS if store identifier already exist for user's sub-organization. threw with message _ERR_SCW_FFMC_EXISTS if fulfillemnt center name already exist for user's organization. threw with message _ERR_SCW_EMAIL_NOT_UTF8 if E-mail is in multibyte format. threw with message _ERR_SCW_ERROR_GETTING_LOCALE if there's an error getting locale from command context. threw with message _ERR_CONTRACT_SYS_GENERIC for other system exceptions.

setStoreOrgId

public void setStoreOrgId(java.lang.String astrStoreOrgId)
Sets the full distinguished name of the hosted store organization. This can be found in the dn column of the orgentity table. An example is o=Acme Organization,o=Reseller Organization,o=Root Organization
Parameters:
astrStoreOrgId - The full distinguished name of the hosted store organization.

setOwnerDN

public void setOwnerDN(java.lang.String astrOwnerDN)
Sets full distinguished name of the owner of the hosted store. This can be found in the dn column of the users table. An example is uid=Me,o=Acme Organization,o=Reseller Organization,o=Root Organization
Parameters:
astrOwnerDN - The full distinguished name of the owner of the hosted store.

setOwnerEmail

public void setOwnerEmail(java.lang.String astrOwnerEmail)
Sets e-mail address for message notifications.
Parameters:
astrOwnerEmail - The owner's e-mail address.

setStoreDisplayName

public void setStoreDisplayName(java.lang.String astrStoreDisplayName)
Sets store display name.
Parameters:
astrStoreDisplayName - The store display name.

setStoreDir

public void setStoreDir(java.lang.String astrStoreDir)
Sets name of folder to keep hosted store file assets.
Parameters:
astrStoreDir - The store directory.

setISPOrgDN

public void setISPOrgDN(java.lang.String astrISPOrgDN)
Sets the full distinguished name of the service provider organization. This can be found in the dn column of the orgentity table. An example is ou=PCD Organization,o=Manufacturer Organization,o=Root Organization
Parameters:
astrISPOrgDN - The distinguished name of the service provider organization.

setProfileOrgDN

public void setProfileOrgDN(java.lang.String astrProfileOrgDN)
Sets the full distinguished name of the profile stores organization. This can be found in the dn column of the orgentity table. An example is ou=Profile Organization,o=Manufacturer Organization,o=Root Organization
Parameters:
astrProfileOrgDN - The distinguished name of the profile stores organization.

setCatalogProfileStore

public void setCatalogProfileStore(java.lang.String astrCatalogProfStore)
Sets unique name of the catalog profile store. This can be found in the identifier column of the storeent table
Parameters:
astrCatalogProfStore - The catalog profile store name.

setProfileStore

public void setProfileStore(java.lang.String astrProfileStore)
Sets unique name of the hosted store profile store. This can be found in the identifier column of the storeent table
Parameters:
astrProfileStore - The profile store name.

setDefaultLocale

public void setDefaultLocale(java.lang.String astrDefaultLocale)
Sets store's default locale.
Parameters:
astrDefaultLocale - The store's default locale.

setDefaultCurrency

public void setDefaultCurrency(java.lang.String astrDefaultCurr)
Sets store's default currency.
Parameters:
astrDefaultCurr - The store's default currency.

setStoreCategory

public void setStoreCategory(java.lang.String astrStoreCategory)
Sets store's category.
Parameters:
astrStoreCategory - The store category

setStoreDescription

public void setStoreDescription(java.lang.String astrStoreDesc)
Sets store's description.
Parameters:
astrStoreDesc - The store description.

setStoreIdentifier

public void setStoreIdentifier(java.lang.String astrStoreIdentifier)
Sets store's identifier.
Parameters:
astrStoreIdentifier - The store's identifier.

setISPStoreIdentifier

public void setISPStoreIdentifier(java.lang.String astrISPStoreIdentifier)
Sets service provider store's identifier.
Parameters:
astrISPStoreIdentifier - The store identifier of service provider's store.

getIstrStoreHomepageURL

public java.lang.String getIstrStoreHomepageURL()
Returns the istrStoreHomepageURL.
Returns:
String

setIstrStoreHomepageURL

public void setIstrStoreHomepageURL(java.lang.String istrStoreHomepageURL)
Sets the istrStoreHomepageURL.
Parameters:
istrStoreHomepageURL - The istrStoreHomepageURL to set