Inline Callout in Autonomy Interwoven Teamsite

<inline>: Provides a method for making server-side inline callout programs that return multiple XML elements to the data capture form. It is like include method in any other anguage.

Syntax of  inline callout in Teamsite:

<inline command="command name" />

Example of inline callout in Teamsite:

<select>
<inline command="command name" />
</select>

The inline callout program should return a well-formed XML document. The document’s outermost element should be a <substitution> element. It should contain any XML that is valid according to datacapture.dtd. That <substitution> element will contain six <option> elements as follow

<?xml version="1.0" encoding="UTF-8"?>
<substitution>
	<option value="Lead" label="Lead"/>
	<option value="Tin" label="Tin"/>
	<option value="Silicon" label="Silicon"/>
	<option value="Plastic" label="Plastic"/>
	<option value="Paper" label="Paper"/>
	<option value="Glass" label="Glass"/>
</substitution>

This simple callout outputs a static result. A more sophisticated callout program could query a database and return the query results as <option> elements. When a server-side inline callout program is executed, it inherits the following  environment variables:„

  • IW_DCT: The server-inclusive vpath to the datacapture.cfg in use (for example, //servername/default/main/development/WORKAREA/username/templatedata/press/events/datacapture.cfg).
  • „IW_ROLE: The role of the current data capture user (for example, editor).
  • IW_USER: The domain and full user name of the current templating user (for example, domain\username).
  • „ IW_WORKAREA: The vpath to the current workarea (for example, //servername/default/main/development/WORKAREA/username).

The exit status from a server-side inline callout should be 0 to indicate a successful execution. Normally an inline callout should not return a non-zero value. However, an example where a non-zero value may be needed to indicate an error condition is if you are populating a <select> menu by making a database query and the database is offline. Rather than displaying a form with no choices, you may prefer an exception be displayed.

Calling Perl file Using inline command:

<inline command="<path-to-iwperl Command> <path/to/perl/filename.ipl parameter1 parameter2" />

Here first we need to pass the commnad that execute the perl file code and second is the path to the perl file to be executed. Perl file should return well-formed XML as per above example. Perl file can return any number of example.

Getting passed parameter value in perl variable:

You can set first parameter value to perl variable as follow

my $var1 = $ARGV[0];

Second Parameter as

my $var2 = $ARGV[1];

Like this you can get any number of parameter passed using $ARGV.

You can get IW Home, IW Mount, Current Workarea path and DCT Path as follow:

my $iwhome = TeamSite::Config::iwgethome();
my $iwmount = TeamSite::Config::iwgetmount();
my $wapath = $ENV{IW_WORKAREA};
my $dct = $ENV{IW_DCT};

You can extract Server, Store, Branch, Workarea name, Category and Datatype in one line code as follow:

($iwserver, $store, $branch, $waname, $category, $datatype) = $dct =~ m#^\/\/([^/]+)\/([^/]+)\/(.*)\/WORKAREA\/([^/]+)\/templatedata\/([^/]+)\/([^/]+).*$#;

Please comment if this information is useful to you or any you have any queries.