Actions
How to add a job launch page to the Appion pipeline¶
If you are adding a GUI to launch a python script that is based on the AppionLoop class found in appionLoop2.py, follow the directions for adding an AppionLoop GUI page.
- Add a php page with the basic appion template
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.
A starting template with documentation is available here to get you started:cp -v runAppionScript.php.template runMyProgram.php
- Add a link to your page in the menuprocessing.php file or from another page
The menuprocessing file is a bit tricky to work with.
- Create a new form class for your package specific parameters
You can copy simpleParamsForm.inc as a template for your own form parameters. There are 2 primary functions to define.- Define the constructor
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. - Define the generateForm() function
This function outputs html. There are many predefined parameter fields that can be used to build your form.
- Define the constructor
- Add pop-up help messages to help.js
Located at myami/myamiweb/processing/js/help.js.- Add a new namespace for your form, you can copy the 'simple' section. Don't forget any commas.
- add a help string for each 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
- Edit /myami/myamiweb/processing/inc/publicationList.inc to include an entry for any references you need to add to your launch page.
- publications can be added to a page with the following code:
$pub = new Publication('appion'); echo $pub->getHtmlTable(); //returns the html reference to the "appion" publication
- Use your new form class in your launch page
- Modify the launch page createForm() function
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.- Add a call to your form class generateForm() function, adding default values in the constructor.
$simpleParamsForm = new SimpleParamsForm('','','','CHECKED','','','10','30','','20','100','2','2','10','','0.8','40','3','3'); echo $simpleParamsForm->generateForm();
- Add a reference to your publication
$pub = new Publication('appion'); echo $pub->getHtmlTable();
- Add a call to your form class generateForm() function, adding default values in the constructor.
- Modify the launch page createCommand() function
- instantiate and validate your form parameters
$simpleParamsForm = new SimpleParamsForm(); $errorMsg .= $simpleParamsForm->validate( $_POST );
- Create your new command
/* ******************* PART 2: Create program command ******************** */ $command = "runSimpleCluster.py "; // add run parameters $command .= $runParametersForm->buildCommand( $_POST ); // add simple parameters $command .= $simpleParamsForm->buildCommand( $_POST );
- Add a reference to your publication in the header info
- Change the jobtype passed in showOrSubmitCommand()
- instantiate and validate your form parameters
- Modify the launch page createForm() function
Updated by Sargis Dallakyan over 10 years ago · 16 revisions