Tutorials > Management Center > Add new search conditions in the advanced search of the Catalogs tool
Deploy the customized code
This section refers to deploying the customized code.
Before you start these deployment steps, have already created a store on the remote WebSphere Commerce Server that is based on the Consumer Direct starter storeconsumer direct sample store.
Once you complete and test the customization, you are ready to deploy the custom code to a target WebSphere Commerce Server to make the new function available to the business users. Deploying to the server involves exporting code from the WebSphere Commerce development environment and deploying code into the target WebSphere Commerce Server.
Since this scenario follows the scenario in Tutorial: Adding new fields in the Catalogs tool, you can choose to complete the deployment together after completing these two tutorials or you can deploy them separately, in sequence.
To reduce the deployment time and downtime of a production site, it is recommended that you complete one single deployment.
Procedure
- Export the LOBTools project:
- In the Enterprise Explorer view, expand .
- Right-click LOBTools and select Export > WAR file.
- Click Browse to select a destination.
- Click Finish.
- Optional: If you have not already deployed either Tutorial: Adding new properties to a WebSphere Commerce service using the data service layer or Tutorial: Adding new fields in the Catalogs tool, export the WebSphereCommerceServerExtensionsLogic project:
- Switch to the Enterprise Explorer view.
- Navigate to Other Projects > WebSphereCommerceServerExtensionsLogic.
- Right-click the WebSphereCommerceServerExtensionsLogic project and select Export. The Export wizard opens.
- In the Export wizard:
- Select JAR file and click Next. The WebSphereCommerceServerExtensionsLogic project is selected by default. Leave this value selected.
- In the right pane, ensure that resources that start with a period are not selected. For example:
- .classpath
- .classpath.template
- .project
- .runtime
- Ensure that Export generated class files and resources is selected.
- Do not select Export Java source files and resources.
- In the Select the export destination field, type the fully-qualified JAR file name to use. In this case, type Drive:\ExportTemp\WebSphereCommerceServerExtensionsLogic.jar.
- Click Finish.
- To export the data service layer (DSL) extension configuration files, copy the XML configuration files to the directory that you are using to build the deployment package:
- Navigate to the temporary directory, for example, drive:\ExportTemp.
- Create the xml\config\com.ibm.commerce.catalog-ext directory. The structure within this directory must match the structure that you want inside the EAR file.
- Copy the files from the drive:\WCDE_INSTALL\xml\config\com.ibm.commerce.catalog-ext directory to the drive:\ExportTemp\xml\config\com.ibm.commerce.catalog-ext directory. In this tutorial, these files include:
- wc-component.xml
- wc-business-object-mediator.xml
- wc-object-relational-metadata.xml
- query templates file
For example, wc-query-MyCompanyCatalogEntry-get.tpl.
- Create a compressed (zip) file that contains all of the files under the ExportTemp directory. Name the file partialApp.zip, for example, drive:\ExportTemp\partialApp.zip. The following example shows a sample structure of the zip file:
WebSphereCommerceServerExtensionsLogic.jar xml\config\com.ibm.commerce.catalog-ext/wc-component.xml xml\config\com.ibm.commerce.catalog-ext/wc-business-object-mediator.xml xml\config\com.ibm.commerce.catalog-ext/wc-object-relational-metadata.xml xml\config\com.ibm.commerce.catalog-ext/wc-query-MyCompanyCatalogEntry-get.tpl
- Deploy code into the target WebSphere Commerce Server. In this step, you create a temporary directory on the target WebSphere Commerce Server, and then copy the export assets into this directory
- In the WebSphere Application Server, select administrative console. Navigate to Applications > Enterprise Applications.
- In the Application Name field, specify the name of the application, for example, WC_demo, and click Update.
- Select Single module and change the specified path to the path.
- Click Next.
- In the next page, do not make any changes and click Next.
- Click Continue on the following page.
- To map the module to the server, select the Module, press Ctrl, select the Clusters and Servers that are running the WebSphere Commerce application, and then click Apply.
- Select Virtual host.
- Click Next, and then click OK.
- To deploy the WebSphereCommerceServerExtensionsLogic.jar file and the XML configuration files:
- Package the WebSphereCommerceServerExtensionsLogic.jar file and the xml directory into a zip file. For example, partialApp.zip.
- In the WebSphere Application Server administrative console, select Applications > Enterprise Applications.
- In the Application Name field, specify the name of the application, for example, WC_demo, and click Update.
- Select Partial Application.
- In the Upload the archive file with the new or replacement files section, select Local file system, click Browse, and then specify the path to the drive:\ImportTemp\partialApp.zip file.
- Click Next.
- Click OK.
- Save the changes:
- Click Save to Master Configuration.
The WebSphere Commerce application will restart. Your changes will be applied.
- Click Save.
In this tutorial, you have customized:
- Management Center user interface files to add new sections with extended properties in the Advanced Search dialog and Catalog Search Result list view
- Controller JSP files to transfer extended query parameters from the user interface to the search template in the expression builder
- The wc-component.xml and get-data-config.xml configuration files to extend the search template in the expression builder to handle the search with more conditions