com.ibm.commerce.contract.commands

Class StoreCreationWizardCmdImpl

  • java.lang.Object
    • com.ibm.websphere.command.CacheableCommandImpl
      • com.ibm.commerce.command.MeasuredCacheableCommandImpl
        • 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:
    com.ibm.commerce.command.AccCommand, com.ibm.commerce.command.ControllerCommand, com.ibm.commerce.command.ECCommand, com.ibm.commerce.command.ECTargetableCommand, StoreCreationWizardCmd, com.ibm.commerce.security.Protectable, com.ibm.commerce.tools.command.ToolsControllerCommand, com.ibm.websphere.command.CacheableCommand, com.ibm.websphere.command.Command


    public class StoreCreationWizardCmdImpl
    extends com.ibm.commerce.tools.command.ToolsControllerCommandImpl
    implements StoreCreationWizardCmd
    This is the default implementation of the StoreCreationWizardCmd tools controller command.

    Input parameters:

    Name XPath Description
    CatalogProfileStore %CATALOG_PROFILE_STORE% The catalog profile store name. Optional.
    DefaultCurrency %HOSTED_STORE_DEFAULT_CURRENCY% The store's default currency. Mandatory.
    DefaultLocale %HOSTED_STORE_DEFAULT_LOCALE% The store's default locale. Optional.
    ISPOrgDN %SERVICE_PROVIDER_ORG_DISTINGUISHED_NAME% The full distinguished name of the service provider organization.
    This can be found in the dn column of the orgentity table. Optional.
    ISPStoreIdentifier %SERVICE_PROVIDER_STORE_IDENTIFIER% The store identifier of service provider's store. Optional.
    IstrStoreHomepageURL %HOSTED_STORE_HOMEPAGE_URL% The istrStoreHomepageURL to set. Optional.
    OwnerDN %HOSTED_STORE_OWNER_DISTINGUISHED_NAME% The distinguished name of the owner of the hosted store.
    This can be found in the dn column of the users table. Optional.
    OwnerEmail %HOSTED_STORE_OWNER_EMAIL_ADDRESS% The owner's e-mail address. Mandatory.
    ProfileOrgDN %PROFILE_ORG_DISTINGUISHED_NAME% The full distinguished name of the profile stores organization.
    This can be found in the dn column of the orgentity table. Optional.
    ProfileStore %HOSTED_STORE_PROFILE_STORE% The unique name of the hosted store profile store. Optional.
    RequestProperties null The request properties. Possible include: paymentOverride, EC_XMLObject. Mandatory.
    StoreCategory %HOSTED _STORE_CATEGORY% The store category. Optional.
    StoreDescription %HOSTED_STORE_DESCRIPTION% The store description. Mandatory.
    StoreDir %HOSTED_STORE_DIRECTORY_NAME% The name of folder to keep hosted store file assets. Optional.
    StoreDisplayName %HOSTED_STORE_DISPLAY_NAME% The store display name. Mandatory.
    StoreIdentifier %HOSTED_STORE_IDENTIFIER% The store's identifier. Mandatory.
    StoreOrgId null The full distinguished name of the hosted store organization.
    This can be found in the dn column of the orgentity table. Mandatory.

    Output parameters:

    Name Description
    PaymentsList A Vector of hashtables of all payment list.
    IstrStoreHomepageURL The store homepage URL.
    Resources The access vector accessed by this command.

    Behaviour:

      Reads the XML template file for the right profile store (for example: TemplateHostingContractRPS.xml) and substitutes with user specified values.
      The steps are:
    • Put strings to be substituted in a Vector.
    • Read XML input template and substitute with values from the Vector.
    • Check for "Active" state from the template.
    • Add/Remove Payments information.
    • Add/Remove Fulfillments information.
    • Remove catalog profile store elements if necessary.
    • Calls ContractImportApprovedVersionCmd and returns a contract Id.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      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.
      static boolean getFlagForStagProp()
      Get the config from wc-component xml
      java.lang.String getIstrStoreHomepageURL()
      Returns the istrStoreHomepageURL.
      java.util.Vector getPaymentsList()
      Returns the payment list.
      com.ibm.commerce.accesscontrol.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.
      boolean judgeTriggerWhetherExists(java.lang.String triggerName)
      Judge the trigger(avoid hardCode trigger dump) is whether exists Note, the feature maybe should enhance further,there is a limit: if there is a similar function with the current trigger, there will dump In the current periord, the feature ask the client to check the triggers if they need to add a similar tirgger related the staglog
      boolean judgeTriggerWhetherExists(java.lang.String action, java.lang.String tableName)
      Judge the trigger(same triggerEvent and tableName) is whether exists
      void performExecute()
      performExecute does the follow:
      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 istrStoreHomepageURLIn)
      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(com.ibm.commerce.datatype.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 Parameters from request.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • 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, checkResourcePermission, createCommandExecutionEvent, execute, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getObjectSize, getPostInvokeParameters, getPreInvokeParameters, getStoreId, getUser, getUserId, isReadyToCallExecute, reset, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
      • 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, getExceptionInvokeParameters, getPostInvokeParameters, getPreInvokeParameters, getStoreId, getUser, getUserId, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
      • Methods inherited from interface com.ibm.commerce.security.Protectable

        fulfills, getOwner
    • Field Detail

      • COPYRIGHT

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

        public java.util.Map problemTriggers
      • STAGING_FOR_CREATESTORE_CONFIGURATION_FLAG

        public static final java.lang.String STAGING_FOR_CREATESTORE_CONFIGURATION_FLAG
        Flag for judge whether is using the stagingProp in create new store StagingEnable: make sure it is a staging env SwitchForCreateStore: make sure the StagProp function in storeCreation is access,only a flag
        See Also:
        Constant Field Values
      • SWITCH_TO_CREATESTORE

        public static final java.lang.String SWITCH_TO_CREATESTORE
        See Also:
        Constant Field Values
      • SWITCH_TO_CREATESTORE_TRUE

        public static final java.lang.String SWITCH_TO_CREATESTORE_TRUE
        See Also:
        Constant Field Values
    • Constructor Detail

      • StoreCreationWizardCmdImpl

        public StoreCreationWizardCmdImpl()
    • Method Detail

      • createCustomXMLElement

        public org.w3c.dom.Document createCustomXMLElement(org.w3c.dom.Document adocRoot)
                                                    throws com.ibm.commerce.exception.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 parameter. 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:
        com.ibm.commerce.exception.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
      • getFlagForStagProp

        public static boolean getFlagForStagProp()
        Get the config from wc-component xml
      • getIstrStoreHomepageURL

        public java.lang.String getIstrStoreHomepageURL()
        Returns the istrStoreHomepageURL.
        Returns:
        String
      • 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
      • getResources

        public com.ibm.commerce.accesscontrol.AccessVector getResources()
                                                                 throws com.ibm.commerce.exception.ECException
        Gets the access vector accessed by this command. The default implementation returns OrganizationAccessBean of the hosted store organization.

        Specified by:
        getResources in interface com.ibm.commerce.command.ECCommand
        Overrides:
        getResources in class com.ibm.commerce.command.AbstractECTargetableCommand
        Returns:
        AccessVector - a vector of resource action pairs
        Throws:
        com.ibm.commerce.exception.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
      • judgeTriggerWhetherExists

        public boolean judgeTriggerWhetherExists(java.lang.String triggerName)
        Judge the trigger(avoid hardCode trigger dump) is whether exists Note, the feature maybe should enhance further,there is a limit: if there is a similar function with the current trigger, there will dump In the current periord, the feature ask the client to check the triggers if they need to add a similar tirgger related the staglog
        Parameters:
        action -
        tableName -
        Returns:
      • judgeTriggerWhetherExists

        public boolean judgeTriggerWhetherExists(java.lang.String action,
                                                 java.lang.String tableName)
        Judge the trigger(same triggerEvent and tableName) is whether exists
        Parameters:
        action -
        tableName -
        Returns:
      • performExecute

        public void performExecute()
                            throws com.ibm.commerce.exception.ECException
        performExecute does the follow:
        Specified by:
        performExecute in interface com.ibm.commerce.command.ECCommand
        Overrides:
        performExecute in class com.ibm.commerce.command.AbstractECTargetableCommand
        Throws:
        com.ibm.commerce.exception.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
      • 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.
      • setDefaultCurrency

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

        public void setDefaultLocale(java.lang.String astrDefaultLocale)
        Sets store's default locale.
        Parameters:
        astrDefaultLocale - The store's default locale.
      • 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.
      • setISPStoreIdentifier

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

        public void setIstrStoreHomepageURL(java.lang.String istrStoreHomepageURLIn)
        Sets the istrStoreHomepageURL.
        Parameters:
        istrStoreHomepageURLIn - The istrStoreHomepageURL to set
      • 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.
      • 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.
      • 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.
      • setRequestProperties

        public void setRequestProperties(com.ibm.commerce.datatype.TypedProperty aRequestProperties)
                                  throws com.ibm.commerce.exception.ECApplicationException
        Gets the input parameters from the requestProperties object and sets each parameter to a local variable.
        Specified by:
        setRequestProperties in interface com.ibm.commerce.command.ControllerCommand
        Overrides:
        setRequestProperties in class com.ibm.commerce.tools.command.ToolsControllerCommandImpl
        Parameters:
        aRequestProperties - The input parameters that are received by the command.
        Throws:
        com.ibm.commerce.exception.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.
      • 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.
      • setStoreDir

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

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

        public void setStoreIdentifier(java.lang.String astrStoreIdentifier)
        Sets store's identifier.
        Parameters:
        astrStoreIdentifier - The store's identifier.
      • 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.
      • validateParameters

        public void validateParameters()
                                throws com.ibm.commerce.exception.ECException,
                                       com.ibm.commerce.exception.ECApplicationException
        Validate Parameters from request.
        Resolve Store Organization DN, Owner's member Id, Profile Store Identifier, Profile Store DN, Store Type,
        Specified by:
        validateParameters in interface com.ibm.commerce.command.ECCommand
        Overrides:
        validateParameters in class com.ibm.commerce.command.AbstractECTargetableCommand
        Throws:
        com.ibm.commerce.exception.ECException
        com.ibm.commerce.exception.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. If an error occurred while generating the input template file name, it does too.
        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 fulfillment 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.