Child pages
  • Integrating a Non-Java Program As An Algorithm

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0

...

The seventh page is the Template String page. The template string tells CIShell what command-line string to use when invoking your compiled program. It can contain placeholders that correspond to either values specified by the end-user (as input parameters) or the files chosen from the Data Manager by the end-user (as input data items). A placeholder is specified in the template string by the text _$

Code Block
{placeholder}

Wiki Markup_, where placeholder is either the \ _ID_ of an input parameter or _inFile\[input file number\]_. If you recall from earlier in this tutorial, we specified that our algorithm will accept one input parameter, which has the id of _user_file_, so the corresponding placeholder in a template string would be \ _$

Code Block
{user_file}

. In the previous page, we specified an input data item of type _text/nwb and an output data item with the name output.txt. Our input data item has the corresponding template string placeholder _$

...

, even though we did not specify that in the wizard. That is replaced by the _executable property. The template string is actually a command-line string that gets executed, which is why the executable is specified first (to invoke your program). That is also why everything is wrapped in sets of quotes (in case spaces are involved).

Wiki MarkupNotice that no input data is specified here, but output data is (the _outFile_ properties). The input (and output) data must be files for non-Java algorithms, and as such the only metadata relevant to it is the expected mime-type of each input data item. The mime types for all of your input data items are specified in the _service.properties_ file, which we will get to. _outFile_ can be thought of as an array of output data items, indexed into via C-style bracket notation (i.e. _outFile\[0\]_). Setting an _outFile_ to a file name declares the output data item. The label of each _outFile_ is what is displayed for the output data item in the Data Manager (in Network Workbench), and the _type_ tells the Data Manager what icon to use. The mime-type must also be specified for each _outFile_, but like the input data, that is done in _service.properties_.

Finally, open up service.properties. The service.pid property here must match the one specified in the Designate section in your gui.xml file. The in_data and out_data properties are the mime-types of the input and output data items mentioned above. They are merely comma-separated lists. The menu_path defines where your algorithm should be placed in the menu in Network Workbench, and the label property corresponds to the label in the menu. All of the other properties are metadata.

...