WebSphere Commerce Enterprise

Publishing business accounts and contracts

Some of the store database assets, (business accounts, and contracts) cannot be loaded by the loading utilities. You can publish these database assets by using the Administration Console or from the command line, as part of the Publish process, or you can publish business accounts and contracts using their corresponding commands.

About this task

The following commands are used to publish business accounts and contracts:
AccountImport
Creates business accounts from the businessaccount.xml file in the store archive.
ContractImportApprovedVersion
Creates a contract from the contract.xml file. If the contract is in active state, the command creates and deploys the contract. Even if the contract.xml file contains more than one contract the command only needs to be called once.

Business account assets are included in the form of XML files in some of the starter store archives provided with WebSphere Commerce. However, it is recommended that you create business account assets using the tools provided, rather than creating XML files for these assets. The instructions for publishing business accounts are included in the following sections, in case you choose to publish the corresponding XML files provided with the starter store archives, or create your own.

If you are not using Administration Console to publish the business accounts or contracts, the store and catalog assets must be published before you can publish business accounts, and contracts. In particular, you need the store and catalog identifiers, as well as the ID for the organization that owns the store, as well as the IDs for any buyer organizations associated with the contract. If the terms and conditions of your contract do not specify a particular catalog, you do not need to publish a catalog before publishing a business account or contract. If you publish these assets using Administration Console or the command line publish, ensure that you select the catalog option, or that your store already has a published catalog. If you publish these assets using the corresponding commands, ensure that you have already loaded the assets listed above into the database.

You can publish business accounts and contracts using the Publish wizard, or using the PublishStore utility. In order to publish the business accounts and contracts using either the Administration Console or the command line, the assets must be packaged in the store archive format.

Procedure

  • Publishing business accounts and contracts using commands
    If you prefer not to package your assets as a store archive, you can still publish the business accounts and contracts using the corresponding commands:
    AccountImport
    Creates business accounts from the businessaccount.xml file in the store archive.
    ContractImportApprovedVersion
    Imports an approved or active contract into WebSphere Commerce Server from an XML file. Before importing the contract, the command ensures that the contract being imported contains the necessary terms and conditions and is a valid contract.
  • Publishing business account assets
    1. Copy ForeignKeys.dtd to the following location:
      • WC_eardir/xml/trading/dtd
      ForeignKeys.dtd contains the entity values referenced by businessaccount.xml.
    2. Copy businessaccount.xml to the following location:
      • WC_eardir/xml/trading/xml
    3. Open the Administration Console. Login as an administrator.
    4. In a browser, type the following URL:
      https:// host_name:8002/webapp/wcs/admin/servlet/AccountImport?fileName=businessaccount.xml&
      URL= The URL to redirect to upon successful completion
  • Publishing contract assets. To publish the contract assets obtained from the starter stores:
    1. Copy ForeignKeys.dtd to the following location:
      • WC_eardir/xml/trading/dtd
      ForeignKeys.dtd contains the entity values referenced by businessaccount.xml.
    2. Copy contract.xml to the following location:
      • WC_eardir/xml/trading/xml
    3. Open the Administration Console. Login as an administrator.
    4. In a browser, type the following URL:
      • https:// host_name:8002/webapp/wcs/admin/servlet/ContractImportApprovedVersion?fileName=contract.xml&xsd=false&URL=ContractDisplay
    5. If your store contains multiple contract.xml files (for example, locale-specific contract files), repeat steps 1 to 4 for each contract.xml file.

    If you are using an LDAP enabled systems and want to publish contract assets based on a WebSphere Commerce starter store archive (SAR file), note the distinguished name (DN) in LDAP and in the contract.xml file. Specifically, if the root organization in LDAP is different from what is specified in the contract.xml file of the SAR file, change the contract.xml file to point to the DN as specified in LDAP.

    For example, the contract.xml file may contains this string:

    
    <User distinguishName ="uid=wcsadmin,o=Root Organization" /> 
    

    The LDAP entry may contain this information:

    
    uid=wcsadmin,dc=ibm,dc=com 
    

    Note that the DN may be mismatched in more than one place in the contract.xml file. Ensure that you change all references. If the root organization in LDAP is different from what is specified in the contract.xml file of the SAR file, the following error occurs:

    
    4273dcd SystemOut U parseErrorDoc: msg = SQLException
    A SQL Exception was received [IBM][CLIDriver][DB2/NT
    SQL0530N The insert or update value of 
    the FOREIGN KEY"PSADMIN.FFMCENTER.F_317"is not equal 
    to any value of the parent key of the parent
    table. SQLSTATE=23503 on record [ffmcenter:
    [FFMCENTER_ID=10051][MEMBER_ID=10001][NAME=NewFashion
    Home][DEFAULTSHIPOFFSET=0][MARKFORDELETE=0]]. [sqlcode:
    -530, sqlstate: 23503] 
    

    To rectify this problem, change the contract.xml file so that it matches the LDAP entry, as follows:

    
    <User distinguishName ="uid=wcsadmin,dc=ibm,dc=com" />