Home
Web CMS (TeamSite)
Inline command
System
I have been trying to populate a text box using an inline command within my data capture template without success.
I've utilised the perl code provided in technote 002152 and added the following line to my dcr:
<item name="LastModifiedBy">
<inline command="/iw-home/iw-perl/bin/iwperl.exe /iw-home/iw-perl/bin/user.ipl"/>
</item>
But when the code runs it generates the following error:
An exception was thrown: Error building the requirements: Can't find string terminator "EOF" anywhere before EOF at /iw-home/iw-perl/bin/user.ipl line 3.
Any ideas.?
Find more posts tagged with
Comments
Adam Stoller
We might have a better idea if you attached the script to your post... I realize you probably copied/pasted it from the TechNote - but without seeing what you actually managed to store within *your* copy of the script, it becomes difficult to debug.
As a rough guess - you may have introduced white-space (or some other non-printing character(s)) where they weren't intended.
print <<EOF; # <<EOF; not <<[space]EOF; nor <<EOF[space];
...
EOF # EOF not [space]EOF nor EOF[space]
--fish
(Interwoven Senior Technical Consultant)
Migrateduser
No problem. This is the actual code I'm referencing...
#!c:/iw-home/iw-perl/bin/iwperl.exe
$user = $ENV{IW_USER};
print <<EOF;
<substitution>
<text required="f">
<default>$user</default>
</text>
</substitution>
EOF
Simon Mann
eBusiness Support Analyst
The BOC Group
+44(0)1483 244052
Adam Stoller
Let's try again - please *attach* the *actual* script (as it exists on your local filesystem) to the post - do not copy/paste it into the post. I need to see the actual bits in the file in order to see if I can figure out what's going on.
Also - before we go too far here.
What version of TeamSite / TeamSite Templating (including SP)?
What platform (NT or W2K)?
What browser / version ?
This is a Templating DCT - yes? not iw-home/local/config/datacapture.cfg - right?
Have you tried putting "C:" before the paths to /iw-home in <command> element?
--fish
(Interwoven Senior Technical Consultant)
Migrateduser
OK, script file (user.ipl) attached.
TeamSite v5.5.2.1 11020 20020823 sp2
Paltform: Windows 2000
Browser: IE6.0
Yes, the datacapture.cfg is in y:\default\main\boc\...etc...templatedata\intranet\generic\
Yes I did try adding c: to the path so it read <inline command="c:/iw-home/iw-perl/bin/iwperl.exe c:/iw-home/iw-perl/bin/user.ipl"/>
Adam Stoller
Somewhere along the way - the code got indented.
The code currently looks like this (consider the '
|
' as the left-margin and '
_
' as leading white-space):
|
#!c:/iw-home/iw-perl/bin/iwperl.exe
|
$user = $ENV{IW_USER};
|
print <<EOF;
|
...
|
__
EOF
Remove those two leading spaces from the last line and the script will probably work.
--fish
(Interwoven Senior Technical Consultant)
Migrateduser
Still getting error "An internal problem was encountered trying to create a requirements object for type intranet/generic."
When I run the perl script from a DOS prompt I get the following message:
"Can't find string terminator "EOF" anywhere before EOF at user.ipl line 3."
Adam Stoller
Since I cannot see exactly what's happening on your machine - try this alternate way of coding it:
-----------------
#!c:/iw-home/iw-perl/bin/iwperl.exe
$user = $ENV{IW_USER};
print qq(
<substitution>
<text required="f">
<default>$user</default>
</text>
</substitution>
);
-----------------
--fish
(Interwoven Senior Technical Consultant)
Migrateduser
That works perfectly, thank you. Is there also a DATE variable we can use.?
Obviously it only works for new DCR's and doesn't update existing ones, but no doubt a FormAPI solution would be more flexible. I noticed in iw.cfg that we didn't have FormAPI available so now I've activated it I'll see what it can do.
Adam Stoller
Is there also a DATE variable we can use.?
Perl is a wonderful tool - try the following from the command line:
perldoc -f localtime
read...learn...enjoy...
--fish
(Interwoven Senior Technical Consultant)