Example: Obtaining task information while installing applications
The installInteractive command of the AdminApp object prompts you through a series of tasks when you install an application. You are presented with the title of the task, a description of the task, and the current contents of the task that you can modify.
- Use the install command instead of the installInteractive command, provide updates for each task, but provide all of the information on the command line. The task name specifies each task and the information you need to update the task. You can treat the task information as a two-dimensional array of string data. For example:
-taskname {{item1a item2a item3a} {item1b item2b item3b} ...}This example is a linear representation of rows and columns, where {item1a item2a item3a} represents the first row, and each row for the task name has three columns.The number and type of the columns in this list depend on the task you specify.
- Obtain information about the data needed for each task using the taskInfo command of the AdminApp object. For example, there is a task called MapWebModToVH used to map Web modules to virtual hosts. To specify this task as part of the option string on the command line, enter the following:
-MapWebModToVH {{"JavaMail Sample WebApp" mtcomps.war,WEB-INF/web.xml default_host}}Use the taskInfo command, you can see which of the items you can change for a task. Supply the columns for each row you modify, and the columns that you are not allowed to change must match one of the existing rows. In this case, taskInfo tells you that there are three items in each row, called webModule, uri, and virtualHost and the current column values for every row.- Obtain help while creating complex installation commands, by using a feature of the installInteractive command. Install the application interactively once and specify the updates that you need. Then look for message WASX7278I in the output log for the wsadmin tool. You can cut and paste the data in this message into a script, and modify it. For example:
WASX7278I: Generated command line: install c:/websphere/appserver/installableapps/jmsample.ear {-BindJndiForEJBNonMessageBinding {{deplmtest.jar MailEJBObject deplmtest.jar,META-INF/ejb-jar.xml ejb/JMSampEJB1 }} -MapResRefToEJB {{deplmtest.jar MailEJBObject deplmtest.jar,META-INF/ejb-jar.xml mail/MailSession9 javax.mail.Session mail/DefaultMailSessionX } {"JavaMail Sample WebApp" mtcomps.war,WEB-INF/web.xml mail/MailSession9 javax.mail.Session mail/DefaultMailSessionY }} -MapWebModToVH {{"JavaMail Sample WebApp" mtcomps.war,WEB-INF/web.xml newhost }} -nopreCompileJSPs -novalidateApp -installed.ear.destination c:/mylocation -distributeApp -nouseMetaDataFromBinary}