Project

General

Profile

How to add a launch page » History » Version 4

Amber Herold, 08/15/2012 10:49 AM

1 1 Amber Herold
h1. How to add a job launch page to the Appion pipeline
2
3 4 Amber Herold
# *Add a php page with the basic appion template*
4
Most of our launch pages are php files with at leat 2 functions, one to create a form for the user to fill out, and another to build a job command when the user submits the form. You can copy an existing PHP file such as runSimple.php to create your new launch page. To give your page the Appion processing page look and feel with the header and side menu, be sure the functions processing_header($title,$heading,$javascript) and processing_footer() are called. 
5
## Modifying the createForm() function
6
The create form function outputs the html needed for your form. The myami/myamiweb/processing/inc/forms directory holds reusable form classes based on the basicForm.inc class. Any combination of these can be used to add parameters to your form with little knowlege of html. You may also create a new form class to define the parameters specific to your job command. More on that later.
7
# *Add a link to your page in the menuprocessing.php file or from another page*
8
The menuprocessing file is a bit tricky to work with.
9
# *Create a new form class for your package specific parameters*
10
You can copy simpleParamsForm.inc as a template for your own form parameters. There are 2 primary functions to define.
11
## Define the constructor
12
This is where all your parameters are listed. Values passed into the constructor become default values. Validations can be added to any of the parameters.
13
## Define the generateForm() function
14
This function outputs html. There are many predefined parameter fields that can be used to build your form.
15
# *Add pop-up help messages to help.js*
16
Located at myami/myamiweb/processing/js/help.js.
17
## Add a new namespace for your form, you can copy the 'simple' section. Don't forget any commas.
18
## add a help string for each of the parameter keys in your form
19
## make sure $javascript .= writeJavaPopupFunctions(); is in your createForm() function in your php launch page prior to the processing header function.
20
# *Add a publication reference for the package you are using*
21
## Edit /myami/myamiweb/processing/inc/publicationList.inc to include an entry for any references you need to add to your launch page.
22
## publications can be added to a page with the following code:
23 3 Amber Herold
<pre>
24 4 Amber Herold
	$pub = new Publication('appion'); 
25
	echo $pub->getHtmlTable(); //returns the html reference to the "appion" publication
26 3 Amber Herold
</pre>