Administer > Deploy > Deploying customized assets > Customized WebSphere Commerce Enterprise Application (EAR) assets > Package custom Java EE assets


Package J2EE assets for a partial application

Before you deploy the partial application, package it in a format that WebSphere Application Server understands. In a partial application update, many single file assets are combined into a ZIP file in a structure that matches the final deployment. Depending on the type of files, we will take a different approach to packaging the assets for deployment. The result of this package is a ZIP file of all the changed assets packaged for deployment.

Package for a partial application involves three stages:

All .xmi files must not be included when packaging J2EE assets for a partial application.

The following is more details on each stage. In the examples, /ExportTemp/partialApp is used as the directory to collect the partial application assets. Use any directory name you like.


Procedure

  1. Collect controller commands, data beans, or Java code

    If you are deploying controller commands, data beans, or Java code:

    1. Export and package the files as a JAR file. You cannot deploy custom commands, data beans, and Java code unless the files are first packaged into a JAR file.

    2. Place the JAR file in the directory that we will be using to build the deployment package. For example, /ExportTemp/partialApp. This directory represents the root of the target EAR file. Underneath this directory, the file must be in the correct path as it would be in the EAR.

  2. Collect store assets

    If you are deploying store assets JSP files, HTML files, images, property files, and other store assets), export the file from the WebSphere Commerce development environment:

    1. Open WebSphere Commerce Developer and switch to the Enterprise Explorer view.

    2. Right-click the Stores folder > Export > Export.

    3. In the Export wizard:

      1. Select File system and click Next.

      2. Select all of the resources that to deploy; that is, select all of the JSP files, HTML files, images, property files, and other store assets that need to be deployed.

      3. Select Create directory structure for files.

      4. In the Directory field, enter a temporary directory into which these resources will be placed. For example, enter...

        /ExportTemp/partialApp

      5. Click Finish.

    4. On the file system, make the following changes:

      1. Rename the Stores directory to Stores.war.

      2. Move the contents of the WebContent directory up into the Stores.war directory. For example, move this directory and file:

        Stores.war\WebContent\ ConsumerDirect_name\MyNewJSPTemplate.jsp

        ...into...

        Stores.war\ConsumerDirect_name\MyNewJSPTemplate.jsp

      3. Delete the now empty WebContent directory.

      4. Ensure the name of the store directory, for example, ConsumerDirect, matches the name of the store on the target machine.

  3. Collect assets stored outside of the WebSphere Commerce development environment workspace

    In WebSphere Commerce Developer, all store-related assets are stored in the Stores Web module and any Java or EJB assets are stored in the Rational Application Developer Workspace. Some assets are not stored in the workspace at all. For instance, XML configuration files and properties files are not stored inside the workspace; these files are used for customizing the tools framework. The following table illustrates the location in WebSphere Commerce Developer and the corresponding location inside the WebSphere Commerce Enterprise Application:

    Development environment path EAR path
    workspace_dir/wc/xml/ xml/
    workspace_dir/wc/properties/ properties/

    If you have customized a file in these directories, copy these assets to the directory you are using to build the deployment package. The structure under this directory must match the structure that you want inside the EAR, as indicated in the preceding table. For example, if you customized...

    workspace_dir/wc/xml/messaging/user_template.xml

    ...deploy it as...

    xml/messaging/user_template.xml


    Deleting assets from the EAR and including META-INF/ibm-partialapp-delete.props in the ZIP file

    Use either the WebSphere Application Server administrative console to add or update assets. However, deleting application files in a partial application update deployment scenario is accomplished by supplying a special metadata file called...

    META-INF/ibm-partialapp-delete.props

    ...in the partial application ZIP. This file can exist at the application scope or at any embedded archive scope including modules.

    For example, to delete files at the application level (outside of any module) add a file...

    /META-INF/ibm-partialapp-delete.props

    ...in the partial application ZIP file. Similarly, to delete files from a module (for example, MyWeb.war), add a file...

    /MyWeb.war/META-INF/ibm-partialapp-delete.props

    ...in the partial application ZIP file.

    To delete files from util.jar inside MyWeb.war, add a file... '

    /MyWeb.war/util.jar/META-INF/ibm-partialapp-delete.props

    To delete assets first create and include the metadata file called...

    META-INF/ibm-partialapp-delete.props

    ...in the partial application ZIP:

    1. Identify the files and the modules containing the files that to delete.

    2. Create a temporary directory on the file system for the assets to delete, for example...

      /exportTemp/partialApp

    3. For any EAR level files to delete:

      1. Create a file called...

        META-INF/ibm-partialapp-delete.props

      2. For each file to delete, add a line to that file giving the relative path to the file, including the file name. For example, to delete...

        WC_demo.ear/mydir/myfile.txt

        ...put...

        mydir/myfile.txt

        ...in the file on a line by itself.

    4. For each module that contains files to delete:

      1. Create a file called module/META-INF/ibm-partialapp-delete.props

      2. For each file to delete from that module, add a line to that file giving the relative path (relative to module) to the file , including the file name. For example, to delete...

        WC_demo.ear/Stores.war/mystore/file.txt

        ...put...

        mystore/file.txt

        ...in the file on a line by itself.

  4. Package the assets in a ZIP file

    After you have collected all of the assets, we will have a directory that has a structure underneath it that should match the production EAR file. For example, you can have a structure similar to this:

    /exportTemp/partialApp/
    /exportTemp/partialApp/WebSphereCommerceServerExtensionsLogic.jar
    /exportTemp/partialApp/Stores.war/myStore/index.jsp
    /exportTemp/partialApp/Stores.war/WEB-INF/lib/myUtilities.jar
    /exportTemp/partialApp/xml/messaging/user_template.xml

    The directory...

    /exportTemp/partialApp/

    ...represents the root of the production EAR file.

    Use a ZIP utility to create a zip file of all of the files and directories under...

    /exportTemp/partialApp/

    This ZIP file will then be used to update the WebSphere Commerce J2EE application.


Related tasks

Deploy J2EE assets for a partial application

Package custom J2EE assets


+

Search Tips   |   Advanced Search