Custom page examples
Several examples in the default services.xml file illustrate how to use the IBM Spectrum LSF Application Center page customization framework to create new custom pages in IBM Spectrum LSF Application Center. Use the examples to build your own custom pages in IBM Spectrum LSF Application Center.
Try out the example pages from this URL:
http://pac_host:8080/platform/service/pageFactoryAction.action?serviceId=menu
View the services.xml file source from the example page from this URL:
http://pac_host:8080/platform/service/pageFactoryAction.action?serviceId=viewsource
Multiple step job submission form (serviceId=submitjob)
This example demonstrates basic job submission and LSF® job
submission output display. After you submit a job, click Data List to see a
list of data files (this calls serviceId=data
).
In the example source, this example has serviceId=submitjob
.
Access Step 1, the first page of the example, at this URL: http://pac_host:8080/platform/service/pageFactoryAction.action?serviceId=submitjob
Job submission form with redirect to another form (serviceId=serviceflow)
In this example, clicking Submit navigates to a separate form
(serviceId=formelements), which then submits a job to the single page job
submission form (serviceId=flow_it10
).
In the example source, this example has serviceId=serviceflow
.
Access the example at this URL: http://pac_host:8080/platform/service/pageFactoryAction.action?serviceId=serviceflow
Single page job submission form with local file upload (serviceId=formelements)
This example demonstrates a page for submitting a job to an application and how to upload a local file. It illustrates code for all supported field types that you can implement, and shows you how to display the location of the file upload.
In the example source, this example has serviceId=formelements
.
Access the example at this URL: http://pac_host:8080/platform/service/pageFactoryAction.action?serviceId=formelements
Submit a job and go to the job details page (serviceId=JOB_CUSTOM_Sample_Service)
This example demonstrates how to submit a job through a job submission form, and display the job details page after submission. It also demonstrates how to create drop-down fields in the submission form.
Access the example at this URL: http://pac_host:8080/platform/service/pageFactoryAction.action?serviceId=JOB_CUSTOM_Sample_Service
Submit a job in a job group and go to the job group details page (serviceId= JOBGROUP_CUSTOM_Sample_Service)
This example demonstrates how to submit a job that is associated with a job group and display the job group details page after submission.
When you create your own custom pages, you use <jobgroup-submit>
to display
the Job Group Details page.
Access the example at this URL: http://pac_host:8080/platform/service/pageFactoryAction.action?serviceId=JOBGROUP_CUSTOM_Sample_Service
AJAX call and parameter passing (serviceId=ajaxcall)
This example demonstrates how to pass parameters that are entered on a form through an AJAX call and display the value of the passed parameters in a text field.
In the example code, the function blah is triggered through an AJAX call, and
the parameters are passed through an array list named arr
. Inside the
blah function, each name/value pair in arr
is converted into an
environment variable.
The Show Info button displays the text input values.
In the example source, this example has serviceId=ajaxcall
.
Access the example at this URL: http://pac_host:8080/platform/service/pageFactoryAction.action?serviceId=ajaxcall
Cache data and results with AJAX (serviceId=ajaxspooler)
This example demonstrates how to create a temporary spooler file with AJAX, writing data to a file, and retrieving data from the file.
The example writes the output of the hostname command in the file, and retrieves data from the file.
Click Save host name to name.txt to create the spooler and write the hostname command output to file name.txt.
Click Show name.txt to display the contents of name.txt.
In the example source, this example has serviceId=ajaxspooler
.
Access the example at this URL: http://pac_host:8080/platform/service/pageFactoryAction.action?serviceId=ajaxspooler
Call a service and pass parameters (serviceId=callservice)
The callservice page redirects to service with parameters. In the example, the
variable $PAC_SPOOLER_URI is automatically generated by IBM Spectrum LSF Application Center when
${PAC_SPOOLER_DIR} is defined in the <pac:spooler>
tag.
Click the Jack link, and the parameter value is sent to another service
(serviceId=receive
).
The redirected page receives the parameters from the service callservice and displays the input as follows:
http://pac_host:8080/platform/service/pageFactoryAction.action?serviceId=receive&name=Jack
The input value is displayed in a text element labeled Name.
In the example source, this example has serviceId=callservice
.
Access the example at this URL: http://pac_host:8080/platform/service/pageFactoryAction.action?serviceId=callservice
Update a page from the spooler (serviceId=fromspooler)
This example demonstrates how to retrieve information from the spooler and how refreshing a page
with updated spooler data. Click Get Image to retrieve an image file from the
spooler, and show it on the same page. In the example source, this example has
serviceId=fromspooler
.
Access the example at this URL: http://pac_host:8080/platform/service/pageFactoryAction.action?serviceId=fromspooler
Trigger a job flow (serviceId=JOBFLOW_CUSTOM_Sample_Service)
This example demonstrates how to trigger a job flow through a job submission form and shows examples of submission form drop-down fields.
After you set the submission parameters on the page, click Trigger to trigger the job flow.
The application script must return a flow-details element. For example,
<pac:flow-details id="10" redirect='$JOBFLOW_DETAIL_URL?insId=${FLOWID}'
/>
Submission sets <pac:action>
to <result="text/xml">
.
In the example source, this example has
serviceId=JOBFLOW_CUSTOM_Sample_Service
.
Access the example at this URL: http://pac_host:8080/platform/service/pageFactoryAction.action?JOBFLOW_CUSTOM_Sample_Service
Job data file list (serviceId=data)
This example demonstrates how to manage job data files in a list table. It implements a Delete button that executes a delete action on selected files. In the example source, the built-in action /platform/service/getDataListAction.action is supported to manage all job data.
In the example source, this example has serviceId=data
.
Access the example at this URL: http://pac_host:8080/platform/service/pageFactoryAction.action?serviceId=data
Convert a string to a JSON object (serviceid= jsonStrToObj)
This example demonstrates how to convert a string to a JSON object and display the value in a text field.
Access the example at this URL: http://pac_host:8080/platform/service/pageFactoryAction.action?serviceId=jsonStrToObj