Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
INLINE on Windows
Chad_Hayton
I'm trying to make an INLINE call to another file to populate the body of a datacapture. I have done this in a Unix environment like this:
<inline command="cat /iwmnt/default/main/qualcomm/common/STAGING/templatedata/dct_bodies/standard/home/home_dct_body.xml"/>
and would like to do the same sort of thing in Windows but the following command doesn't work:
<inline command="type Y:\default\main\Intranet\Common\WORKAREA\CommonWA\templatedata\department\FormBuilder\FormBuilder_dct_body.xml"/>
I guess I could write a script that opens the file referred to in the file path and returns the result, but I was hoping to use some kind of system command like I did on Unix.
Does anyone have any suggestions?
Thanks,
Chad--
Find more posts tagged with
Comments
Migrateduser
It'd probably be best to write a script for this, but have you tried using the "more" command? Also, it's good practice to write the full path to the command, rather than the command itself.
Dave
Current Environment(s):
(1) TS 6.1 SP1 on W2K3
(2) TS 6.1 SP1 on W2K
(3) TS 5.5.2 SP2 on Win2K
Chad_Hayton
Thanks for this suggestion. I tried it but still get the same error message, so I threw together a Perl script. Here is how I am calling the inline on a TS 5.5.2 machine running on W2k:
-------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<data-capture-requirements type="content" name="home">
<!-- data-capture-requirements elements contain area elements -->
<ruleset name="Form Builder">
<!-- Call the body code for this datacapture -->
<inline command="E:\Apps\Interwoven\iw-home\custom\bin\openFile.ipl Y:\default\main\Intranet\HR\WORKAREA\WellawareWA\templatedata\department\FormBuilder\test.xml" />
</ruleset>
</data-capture-requirements>
-------------------------------------------------------------
The Perl file it calls expects to be passed a file path and when run from the command line it works fine. The Perl looks like this:
-------------------------------------------------------------
my $path = $ARGV[0];
$path =~ tr/\\/\//;
if (open(FILE, $path)){
print <FILE>;
close FILE;
} else {
die "Could not find file specified in path";
}
exit();
-------------------------------------------------------------
And here is the the substitution XML in the file called.
-------------------------------------------------------------
<?xml version="1.0" encoding='UTF-8'?>
<substitution>
<item name="Header">
<description>
Enter the word(s) that should appear in the page header
</description>
<text size="30" maxlength="30" />
<label>Banner Text</label>
</item>
</substitution>
-------------------------------------------------------------
This worked fine for me on Solaris when I just called it using cat but Windows is giving me fits. What am I missing?
Thanks,
Chad--
Adam Stoller
Instead of calling "type file" try 'cmd -c "type file"'
The command "type" may not be on the PATH when being run as an inline - but "cmd" should be - and you should be able to run anything via "cmd -c" that you would be able to run from the command line in a DOS Prompt window.
Instead of calling "scriptname.ipl parameters" try calling "path-to-iwperl scriptname.ipl parameters"
Unfortunately iwperl is not necessrilly on the PATH and ".ipl" is proably not on the system PATHEXT so just trying to run a perl script by calling it directly in this context on Windows just doesn't tend to work - instead you need to provide the full path to the iwperl exectuable and provide *it* the path to your script.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
Chad_Hayton
Adding iwperl at the beginning of the command did the trick. Thanks for pushing me in the right direction on that ... I guess I'm going to have to overcome some of my Unix instincts with TeamSite.
Calling 'cmd -c "type file"' didn't work, but as long as I can grab the contents with the script, I don't need that. It would have been nice to use a system command instead of a script so I'd have one less file to worry about, but this works for me. :-)
Thanks again to Fish and Dave's for their help with this.
Chad--
Bill Klish
You were pretty close. To get it to work on windows do the following:
cmd /C type filename