Configure the sample portlets in the server environment

Deploying the WebSphere Commerce sample portal application configures the portlet application on the WebSphere Portal server. Deploying a portlet makes it available to portal users. Adding a portlet to a page makes the portlet accessible to users with the appropriate rights.About this task

Previous step

  1. Open the WebSphere Portal administration console using the WebSphere Portal administrator ID and password. For information on the WebSphere Portal administration console, refer to Start and stopping WAS and WebSphere Portal.

  2. When the portlet is launched, log in as the WebSphere Portal administration user. For example, wpsadmin.

  3. Select Administration from the top of the pane to access the WebSphere Portal administration console.

  4. Assign access to the portlet:

    1. Select Portlet Management>Web Modules and then select File names startswith as the Search by option. Type the name of the WAR file that you have installed. For example, MVCPortlet.

    2. Click the Web Module link by Name and select MVCPortlet.war. The title of the WebSphere Commerce sample application is "WebSphere Commerce Portlet".

    3. Click the Assign Access to portlet application icon to review the Roles assigned to this portlet. For example, to assign registered Portal user access to the portlet...

      1. Select the Edit Role icon for the User roles.

      2. Click Add and select All Authenticated Portal Users.

      3. Click OK to confirm the selection.

      4. Click the link to the WebSphere Commerce Portlet.

      5. Click Done to save the configuration.

    4. Optional: To assign Anonymous user access to the required portlets:

      1. Select the WebSphere Commerce - Product portlet.

      2. Select the Assign Access to portlet icon.

      3. Select the Edit Role icon for the User roles.

      4. Click Add and select Anonymous Portal user.

      5. Click the link to the portlet below the Add button.

      6. Click Done to save the configuration.

      7. Repeat these steps for the WebSphere Commerce - My Cart portlet.

        To allow anonymous access to these portlets, add these portlets to a page that allows anonymous user access. Additional updates are needed within the WebSphere Portal configuration. For more information refer to Portal configuration services page, and click on the "Navigator Service" link.

      8. Restart the WAS, and the WebSphere Portal server.

  5. Add the portlet to a page:

    1. Select Portal User Interface > Manage Pages.

    2. Create a new page or locate an existing page where you want to add the WebSphere Commerce portlets. For example Content Root>Home>WebSphere Commerce. For more information on creating a new page, refer to Manage pages in the WebSphere Portal Information Center.

    3. Click the Edit Page Layout button (the pencil icon).

    4. Click the Add portlets button.

    5. Use the following search criteria to locate the appropriate portlet:

      1. Select Title contains as the search type, and type Commerce.

      2. Click Search.

    6. Select the check box for each portlet found by the search.

    7. Click Done to save the changes.

  6. Optional: Add the portlets to the page for anonymous shoppers:

    1. Select Portal User Interface > Manage Pages.

    2. Create a new page or locate an existing page where you want to add the WebSphere Commerce portlets. For example Content Root>Home>WebSphere Commerce. For more information on creating a new page, refer to Manage pages in the WebSphere Portal Information Center. In order to enable the anonymous shopper, pick a page which the anonymous WebSphere Portal user can access.

    3. Click the Edit Page Layout button (the pencil icon).

    4. Click the Add portlets button.

    5. Use the following search criteria to locate the appropriate portlet:

      1. Select Title contains as the search type, and type Commerce.

      2. Click Search.

    6. Select the check box for the WebSphere Commerce - Product and WebSphere Commerce - My Cart portlets only.

    7. Click Done to save the changes.

  7. Arrange the portlets:

    1. Select Portal User Interface > Manage Pages.

    2. Locate the page where you have added the WebSphere Commerce portlets. For example Content Root>Home>WebSphere Commerce.

    3. Click the Edit Page Layout button (the pencil icon) and move the portlets into the following recommended arrangement:

      • In the first column: WebSphere Commerce - Search, WebSphere Commerce - Catalog

      • In the second column: WebSphere Commerce - Product, WebSphere Commerce - Cashier

      • In the third column: WebSphere Commerce - My Cart, WebSphere Commerce - My Order, WebSphere Commerce - My Account

    4. Click Done to save the changes.

  8. Set up the Wires for the new portlet:

    1. Click Portal User Interface > Manage Pages.

    2. Click the Edit Page Layout button (the pencil icon) for that portlet that you want to configure.

    3. Select the Wires tab.

    4. Specify the appropriate information in the following columns: Notes:

      • Set the Wire Type to Public.

      • The default Target page name is MVCPortlet. If you have created your own page and want to add wires to that page, select that name from the Target page list.

      • When the Source Portlet is set to "WebSphere Commerce - MyCart" the Sending dropdown list contains 2 orderIDs. Select the first orderID for "WebSphere Commerce - My Account" to create the first wire, and the second for "WebSphere Commerce - Cashier" to create the second wire.

      • The number of portlet wires that must be configured depends on your page configuration. The wire configurations suggested on this page apply only to the suggested page layout. The number of wires vary depending on the number of portlets you have placed on a given page. For example, if your page does not have the "WebSphere Commerce - My Order" portlet, then you are not able to configure the portlet wires related to the "WebSphere Commerce - My Order" portlet.

      Source Portlet Sending Target page Target portlet Receiving Wire Type
      WebSphere Commerce - Catalog catalogId MVCPortlet WebSphere Commerce - Product Catalog_Product,catalogId Public
      WebSphere Commerce - Catalog catGroupId MVCPortlet WebSphere Commerce - Product Catalog_Product,catGroupId Public
      WebSphere Commerce - Cashier catEntryId MVCPortlet WebSphere Commerce - Product Cashier_Product,catEntryId Public
      WebSphere Commerce - My Cart orderId MVCPortlet WebSphere Commerce - My Account MyCart_MyAccount,orderId Public
      WebSphere Commerce - My Cart orderId MVCPortlet WebSphere Commerce - Cashier MyCart_Cashier,orderId Public
      WebSphere Commerce - My Cart catEntryId MVCPortlet WebSphere Commerce - Product MyCart_Product,catEntryId Public
      WebSphere Commerce - My Order catEntryId MVCPortlet WebSphere Commerce - Product MyOrder_Product,catEntryId Public
      WebSphere Commerce - Search criteria MVCPortlet WebSphere Commerce - Product Search_Product,criteria Public

    5. Click the "+" button to update the page.

    6. Click Done.

  9. Configure the default store ID from the WebSphere Portal administration console:

    For more information on configuring WebSphere Commerce store assets, refer to WebSphere Commerce Portal integration and WebSphere Commerce stores.

    1. Click Portlet Management > Portlets.

    2. Use the following search criteria to locate the appropriate portlet:

      1. Select Title contains as the search type, and type Commerce.

      2. Click Search.

    3. Select each WebSphere Commerce sample portlet, and click Configure Portlet. Define the default storeID for the .ContextDefault-storeId field. If you have not published a store for the WebSphere Portal integration, you must publish that store now. Your new storeID is located in the STOREENT.STOREENT_ID entry of the WebSphere Commerce database. The storeID was recorded when you reviewed the prerequisites page.

      If your WebSphere Commerce storeID is 10001 you are not required to complete this step.

    4. Click OK to complete your changes.

    5. Repeat these steps for each sample portlet.

  10. If your WebSphere Commerce storeID is not 10001, complete the following steps:

    If you have not published a store for the WebSphere Portal integration, publish that store now. Your new storeID is located in the STOREENT.STOREENT_ID entry of the WebSphere Commerce database. The storeID was recorded when you reviewed the prerequisites page.

    1. Navigate to the MVCPortlet/WebContent/WEB-INF/config directory.

    2. Open the store-directory.properties file in a text editor. For more information on the store-directory.properties file, refer to WebSphere Commerce Portal integration and WebSphere Commerce stores.

    3. Search for 10001 and change the value that you find to match your storeID. If you are not using the default directory, update this entry as well. For example, when the storeID is 10001, and the default directory is /ConsumerDirect, this entry is:
      10001 = /ConsumerDirect

    4. Save the file and exit.

  11. Use the WAS to manage the Web services URL endpoint binding:

    1. Log on to the WAS server1 console using your WebSphere Portal secure user. For example, wpsbind. For more information on launching the WAS server1 console, refer to Start and stopping WAS and WebSphere Portal.

    2. Click Applications > Enterprise Applications.

    3. Select the enterprise application that has the "Catalog_Se_" prefix and then select Web Modules.

    4. Select the MVCPortlet.war file, and then click Web services client bindings.

    5. For each of the Web services listed, click the Edit link in the Port Information column.

    6. Change the Overridden EndPoint URL for each Web service.

    7. Update the following URLs:

      Web service Endpoint URL
      OrderServices http://hostname:8007/webapp/wcs/component/order/services/OrderServices
      MemberServices http://hostname:8007/webapp/wcs/component/member/services/MemberServices
      ContractServices http://hostname:8007/webapp/wcs/component/contract/services/ContractServices
      CatalogServices http://hostname:8007/webapp/wcs/component/catalog/services/CatalogServices
      BusinessContextServiceWrapperService https://hostname:8000/Enablement-BusinessContextWebServicesRouter/services/BusinessContextServiceWrapper

      Where:

      >
      hostname
      Is the hostname of the machine that serves the WebSphere Commerce related static content files, such as the WebSphere Commerce web server. An example of the WebSphere Commerce related static content file is an image file of a product in the WebSphere Commerce catalog.

  12. Optional: If you have enable anonymous users, a public session will be created for anonymous shoppers. To prevent the following warning statements from being logged in the SystemOut.log file on the Portal server:
    [4/3/07 12:45:16:953 EDT] 0000007a SessionContex W SESN0066E: Response is already committed to client. Session cookie cannot be set.
    [4/3/07 12:45:16:968 EDT] 0000007a SRTServletRes W WARNING: Cannot set session cookie. Response already committed.
    

    1. Click WP NavigatorService. Under Additional Properties select Custom Properties.

    2. Click New to create new custom properties.

    3. In the Name field, type public.session.

    4. In the Value field, type true.

    5. Click OK to confirm the changes.

    6. Save the configuration.

      For more information refer to the topic Portal configuration services.

  13. Within the WAS server1 administrative console secure the BCS Web service at the transport layer:

    1. Copy the DummyServerKeyFile.jks keyfile and the DummyServerTrustFile.jks keyfile from the WC_ProfileDir/etc of WebSphere Commerce Node to the WebSphere Portal machine.

      If you are using a WebSphere Portal clustered environment, the key pari will not syncronize between the deployment manager, and each node. Copy the key file into the exact same location on each node, including the deployment manager node.

    2. In the WebSphere Application Serve console, select Security > SSL.

    3. Click on New JSSE Repertoire to create a new repertoire using the key file and trust file from the WebSphere Commerce Server.

    4. In the Alias field, enter an alias. For example, WCSSL.

    5. In the Provider field, click the Predefined JSSE provider, and select IBMJSSE2.

    6. In the Protocol field, select SSL.

    7. In the Key file section complete the following fields:

      • Key file name: Input the full file path to DummyServerKeyFile.jks keyfile on the WebSphere Portal machine.

      • Key file password: Input the password for the key file. The default password is WebAS.

      • Key file Format: JKS.

    8. In the Trust File section complete the following fields:

      • Trust file name: Input the full file path to DummyServerTrustFile.jks keyfile on the WebSphere Portal machine

      • Key file password: Input the password to the trust file. The default password is WebAS.

      • Key file Format: JKS.

    9. Click Apply and save the configuration change.

    10. Click Applications > Enterprise Applications.

    11. Select the enterprise application that has the "Catalog_Se_" prefix and then select Web Modules.

    12. Select the MVCPortlet.war file and click Web services: Client security bindings.

    13. For the BusinessContextServiceWrapperService select the Edit button in the HTTP SSL Configuration column.

    14. Select the HTTP SSL Enable check box.

    15. Select the new repertoire alias from the HTTP SSL configuration list.

    16. Click Apply then Save.

    17. Click Save to save the configuration changes.

  14. Import the WebSphere Commerce Web server certificate into the trust server keys. For more information refer to Import signer certificates.

    • WebSphere Portal key: DummyServerTrustFile.jks This WebSphere Commerce Server trust file was copied to the WebSphere Portal server from WebSphere Commerce in step 10.

  15. Register the static content URL reference prefix with WAS:

    1. From the WAS administration console, select Resources > URL Providers > Default URL Provider.

      Ensure that the scope is set at the node level for the stand alone WebSphere Portal server, or at the cluster level for a WebSphere Portal clustered environment.

    2. Click Additional Properties > URLs

    3. Add a new URL reference by clicking the New button. Complete the following fields:

      • Name: External Content

      • JNDI name: url/com/ibm/commerce/foundation/client/portal/ExternalContent

      • spec: http://hostname:port/wcsstore

      Where:

      >
      hostname
      Is the host name of the WebSphere Commerce machine.

      This hostname must match the format that was used when defining the hostnames.

      port
      Is the HTTP port number for the store related HTTP requests.

    4. Click Apply then Save.

    5. Click Save to save the configuration changes.

  16. Restart the WebSphere Portal Server.

  17. Optional: During a typical shopping flow, sensitive information such as credit card numbers and mailing addresses can be passed between the WebSphere Portal server and the user's web browser. To protect this information it is important that the connection between the web browser and the WebSphere Portal server is secured. You can secure the connection at two different stages:

    • You can secure the connection at the time that the user logs in. This is the recommended approach, as it allows the user to be redirected to a secure connection using the HTTPS protocol. For more information refer to Configure SSL only for the login process.

    • Alternatively, you can secure the connection at a specific point in the shopping flow. For example, when checking out, or when displaying user profile information. Complete the following steps:

      • Enable SSL port redirection on the WebSphere Portal server. This is done by setting the host.port.https custom property in WP ConfigService. Refer to Portal configuration services for more information.

      • Update the portlet JSP files to allow secure redirection when calling an action or render URL. For example, add the following code:
        <portlet:actionURL var="AddAddressActionURL" secure="true">
         <portlet:param name="actionName" value="AddAddress" /> 
         <portlet:param name="renderName" value="AddressBookDisplay" /> 
         <portlet:param name="faultRenderName" value="AddressErrorDisplay" /> 
        </portlet:actionURL>
        


Related concepts

WebSphere Commerce integration with WebSphere Portal WebSphere Commerce Portal integration and WebSphere Commerce stores Portlet packaging structure WebSphere Commerce Portal Integration maintenance


Related reference

WebSphere Commerce portlet samples - - -