How to add a launch page » History » Revision 4
Revision 3 (Amber Herold, 08/14/2012 03:28 PM) → Revision 4/16 (Amber Herold, 08/15/2012 10:49 AM)
h1. How to add a job launch page to the Appion pipeline # *Add h2. Add a php page with the basic appion template* template <pre> 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. ## Modifying the createForm() function </pre> The create form # createForm 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. # *Add a link to your page in the menuprocessing.php file or from another page* ## has appion header The menuprocessing file is a bit tricky to work with. ## has Appion Footer # *Create a new form class for your package specific parameters* runCommand function You can copy simpleParamsForm.inc as a template for your own form parameters. There are 2 primary functions to define. ## builds command ## Define the constructor This is where all your parameters are listed. Values passed into the constructor become default values. Validations can be added calls show or submit command h2. Add a link to any of the parameters. ## Define page from the generateForm() function This function outputs html. There are many predefined parameter fields that can be used to build your form. menu, or an existing page # *Add pop-up help messages to help.js* Located at myami/myamiweb/processing/js/help.js. ## menuprocessing.inc h2. Add a new namespace for your form, you can copy the 'simple' section. Don't forget any commas. ## add a help string for each guts of the parameter keys in your form ## make sure $javascript .= writeJavaPopupFunctions(); is in your createForm() function in your php launch page prior to the processing header function. # *Add a publication reference for the package you are using* run parameters ## Edit /myami/myamiweb/processing/inc/publicationList.inc to include an entry for any references you need to add to your launch page. <pre>require_once "inc/forms/runParametersForm.inc";</pre> ## publications can be added to a page with the following code: <pre> // add Processing Run Parameter fields $pub $runParametersForm = new Publication('appion'); RunParametersForm( $runname, $outdir ); echo $pub->getHtmlTable(); //returns the html reference to the "appion" publication $runParametersForm->generateForm(); </pre>