Packaging and deploying custom widgets (deprecated)

You can package your custom widgets to prepare them for use in a runtime environment. You can also deploy the widgets to add them to the server.

Before you begin

Check that the following things are ready:
  • The iWidget definition file for your custom widget
  • Optional: Some or all of the implementation files for your custom widget. You can complete the implementation by updating your widget.
  • The iWidget and any implementation packaged into an enterprise application (EAR)
  • Optional: The documentation plugin containing the widget help files
  • The widget registration definition for the custom widget to an existing catalog file or a created catalog file

The installBusinessSpaceWidgets and updateBusinessSpaceWidgets commands mentioned in this topic are run using the AdminTask object of the wsadmin scripting client.

The following conditions must be met:

  • Run the commands on the deployment manager node.
  • Run the commands in the connected mode, that is, do not use the wsadmin -conntype none option.
  • You must connect with a user ID that has WebSphere® Application Server administrator privileges.

Start the wsadmin scripting client from the deployment_manager_profile/bin directory.

About this task

Packaging and deploying widgets is usually an iterative process. The steps in the procedure describe how to package and deploy a widget for the first time. If you are updating an existing widget, the steps are similar with the following exceptions:
  • Use the updateBusinessSpaceWidgets command instead of the installBusinessSpaceWidgets command.
  • Skip step 1 if you did not update the EAR files, step 2 if you did not update the catalog file, and skip step 3 if you did not update the help files. Alternatively, you can include the files but use the -noWidgets, -noCatalogs, and -noHelp parameters to control what you are updating. If you are updating an EAR file, you must include the complete EAR.

Complete the following steps for each Business Space environment.

Procedure

  1. Create an ear directory. Copy the EAR files containing the widget definition file and implementation files for your custom widgets. Copy the EAR files into the ear directory.
  2. Create a catalog directory and copy the catalog XML (widget registration) file into it.
  3. If there are any documentation plug-ins, create a help directory and copy the help plug-ins into it.
  4. Compress the ear, catalog, endpoints, and help directories. Ensure that the structure of the .zip file contains the following items:
    • ear\widgets_name.ear (one or more EAR files)
    • catalog\catalog_name.xml
    • help\eclipse\plugins\*
    • endpoints\endpoints_name.xml
  5. At a command prompt, change directories to the profile_root/bin or cluster_root/bin directory.
  6. Enter wsadmin.bat -conntype NONE and then enter the appropriate command:
    • For a non-clustered environment:
      • Jython command:
        AdminTask.installBusinessSpaceWidgets('{-nodeName node -serverName server -widgets fullpath}')
      • Jacl command:
        $AdminTask installBusinessSpaceWidgets {-nodeName node -serverName server -widgets fullpath}
    • For a clustered environment:
      • Jython command:
        AdminTask.installBusinessSpaceWidgets('{-clusterName cluster -widgets fullpath}')
      • Jacl command:
        $AdminTask installBusinessSpaceWidgets {-clusterName cluster -widgets fullpath}
    Fullpath is the name and location of the .zip file that you created.
    For more information about installBusinessSpaceWidgets, see installBusinessSpaceWidgets command. If you are updating existing widgets, use updateBusinessSpaceWidgets instead. For information about updateBusinessSpaceWidgets, see updateBusinessSpaceWidgets command.
    Tip: Keep a backup copy of the .zip file. The backup copy will make it easier to update or delete the widget because you will not have to recreate the .zip file. That is, instead of creating the directories and files in steps 1 to 4, you can just edit the backup copy to make your changes.
  7. Enter the following command:
    • Jython command:
      AdminConfig.save
    • Jacl command:
      $AdminConfig save
  8. Enter Exit.
  9. If your environment has an HTTP server or proxy server set up, check the module mapping to ensure that your custom widget modules are mapped to the HTTP server or proxy server:
    1. Log in to the administrative console as an administrative user.
    2. Click Applications > Application Types > WebSphere enterprise applications.
    3. From the Enterprise Applications panel, click the name of the widget application.
    4. On the Configuration tab, under Modules, click Manage Modules.
    5. On the Manage Modules page for your application, make sure that the web server is one of the selected targets for each of your modules.
      • In the table, check the Server column for each module to make sure that the web server is one of the selected targets for each of your modules.
      • If you need to add the web server, select the check box next to the name of the module. Then, in the Clusters and servers list, use the Ctrl key to select multiple targets. For example, to have a web server serve your application, press the Ctrl key and then select the application server cluster and the web server together. Click Apply, OK and Save to save any changes.
  10. If you redeployed an existing widget that you changed, to see the changes in the browser, log out of Monitor dashboards, clear the cache in the browser, and then log into Monitor dashboards.