- Info
Browser modifications
Return to the main index.
The iRODS web browser is bundled in the extrods1.1.0.1 package and is also available in more recent version of iRODS - but the version used here is that provided with extrods.
It is located in the clients/web subdirectory of extrods and is implemented using a mixture of PHP (and HTML) and JavaScript (it uses the Yahoo and extjs javascript libraries).
The main iRODS web browser files are (used in the following general order):
- index.php – the main launch file that includes login.js and brings up the login dialog.
- login.js – displays the login dialog – code here then launches browse.php.
- browse.php – the main browser php file includes browse.js and launches RodsBrowser (from browse.js).
- browse.js the main browser javascript file – contains functions to create all buttons, dialogs, button handlers and callbacks.
Other javascript files used variously are: yui-utilites.js, ext-yui-adaptor.js and ext-all.js.
In the clients/web/services directory are located PHP "services" which can be called by the browser to connect to the iRODS system and perform specific actions.
In the clients/web/images directory are located images for use by the browser buttons, etc.
Front end modifications.
It was necessary to add three buttons new buttons:
- "Run Test Rule"
- "Pattern Search"
- "Pattern Results"
For each button (all in browse.js within the RodsBrowser function):
- The button itself needs to be added (including image in /images subdirectory if necessary).
- The dialog window for the button [rulesDialog, patternSearchDialog, and viewPatternResultsDialog].
- The handler where appropriate is invoked when the dialog box was "OKed" - this handler then calls the appropriate service (below). [rulesHandler and patternSearchHandler - there is no active viewPatternResultsHandler because the viewPatternResultsDialog displays the results directly.]
- A callback was provided to get the response from the service and display the appropriate window (results or search complete).
The patternSearchDialog was made to display a confirmation
message and image of the query (query.jpg).
The
selected directories in the browser needed to be passed to myExecUserRuleSearch.php file so that the path can be selected path can be used.
Most changes to browse.js - had to add a div to browse.php.
Back end modifications.
The following PHP "service" files were created (in extrods-1.1.0.1beta/clients/web/services/):
- myExecUserRule.php -
this is a new file which is called by the functions in browse.js to
invoke a the add rule. It is called when the "Run Test Rule" button is
pressed and then uses the Prods RodsConn to invoke a rule to
use the calcilator service to add two numbers together retrieve the result.
- myExecUserRuleSearch.php - this is a new file which is called by the functions in browse.js to invoke a search rule. It is called when the "Pattern Search" button is pressed and then uses the Prods RodsConn to invoke a rule to use the search engine to search for the query pattern (in query.txt) then wait until the search is complete and retrieve the results and place them in the approriate directory as the results.txt file.
- fetchSearchResults.php - this is a new file which is called by the functions in browse.js to get the results file and return the contents. It is called when the "Pattern Results" button is pressed and then uses the Prods ProdsFile to get the results.txt file from iRODS and supply it to the browser for display.