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)
Calling Inline Commands using TYPE?
matbrown
When using the <inline> subelement to call an xml file.
<inline command="type c:\iw-home\script\file.xml">
However I can't get this to work on windows 2000 even though type c:\iw-home\script\file.xml runs from the command line correctly
previously I did it on a unix server and I put
<inline command="/usr/bin/cat pathTo/file.xml">
what am I doing wrong?
Thanks
Any help will be much appreciated.
Mat
Find more posts tagged with
Comments
Johnny
What is the message that you receive?.
Are you sure that the xml conforms to the spec?
All inlines must start with a <substitution> tag.
If you cut and paste the contents of the include (minus the substitution tag) does it work?
John Cuiuli
gzevin
ok, you could write someting like this perl script.
invoke it like this:
<inline command="c:\iw-home\iw-perl\bin\iwperl c:\iw-home\custom\binl\include_template.ipl c:iw-home\custom\config\somefile.txt"/>
your text file should not contain <substitution> tags . This script could be expanded further if you want to produce select lists, etc
----------------------
use strict;
my $fileToOpen = shift;
open FILEHANDLE, $fileToOpen or die "Could not open file $fileToOpen: $!";
print "<substitution>";
while (<FILEHANDLE>)
{
print $_;
}
print "</substitution>";
------------------------------
Greg Zevin, Ph.D. Comp. Sc.
Independent Interwoven Consultant/Architect
Sydney, AU
james1
I believe that "type" is a built-in function of the Windows command-line shell, it is not an executable program. An inline command must refer to an actual executable program. You need to find an .exe that performs a similar function, or, a gzevin suggested, you can write a Perl script to do it. You might be able to run "cmd.exe" with some args to have it invoke "type".
-- James
--
James H Koh
Interwoven Engineering
Migrateduser
You will get better performance if you use a .cmd file instead of a .ipl script (though the .cmd won't be portable to Unix). I do something like this:
@echo
off
for /f %%i in ( 'iwgethome' ) do set iwhome=%%i
set loc=%iwhome%\custom\config\DCT
type %loc%\InlineHeader.dct
for %%p in ( %* ) do type %loc%\%%p.dct
type %loc%\InlineFooter.dct
Where InlineHeader.dct contains:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<substitution>
And InlineFooter contains:
</substitution>
The DCT actually looks something like this:
<inline command="HARD_CODED_IWHOME\custom\bin\InlineFile.cmd UserMetadata Includes" />
This will insert the contents of those two .dct files at the location of the inline.
There is no known way (as of 5.5.2) to avoid hard-coding IWHOME in the DCT as the PATH environment variable is not defined (this is claimed to be for security reasons).
Edited by john on 11/04/03 07:01 AM (server time).