Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
inline callout question
nipper
I am upgrading a server from really old TS to 6.X, also moving from NT to Solaris.
The DCTs are coded like this (which works in NT):
<inline command="/usr/iw-home/iw-perl/bin/iwperl /usr/iw-home/httpd/iw-bin/script.ipl \\templatedata\\iw_include\\blah.txt"/>
The script reads command line and prints out XML. Only it cannot find the file in Unix.
The script does a quick open, so it is not prepending iwmnt/branch/workarea
So I am not certain how this was supposed to work ? A proxy setting should not do that.
Anyone see something like this before ? I can rewrite the script to prepend the info I need, but I
am curious how this worked.
TIA
Andy
Find more posts tagged with
Comments
iwovGraduate
Did you witness it working ?
I really doubt if the following statement worked in Windows
<inline command="/usr/iw-home/iw-perl/bin/iwperl /usr/iw-home/httpd/iw-bin/script.ipl \\templatedata\\iw_include\\blah.txt"/>
nipper
OK, so the paths were
but it was working in NT
My real question is what was mapping the \\templatedata\\iw-include\\blah.txt to a file in this WA ?
Johnny
post your script so we can look at it.
John Cuiuli
iwovGraduate
Hmmm, hard to say without looking at what magic is bestowed into that script. Can you post it ?
Adam Stoller
My real question is what was mapping the \\templatedata\\iw-include\\blah.txt to a file in this WA ?
Well - first of all - if you're moving to Unix - you need to change that to
/templatedata/iw-include/blah.txt
Secondly - the mapping probably occurred within the perl script - where, I'm assuming, it uses the $ENV{IW_WORKAREA} environment variable to determine the current areavpath and then appends the area-relative-path argument to that value.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
gzevin
Andy,
why don't you mail me the script? Most likely, the inline should do some env. variable processing to determine the templatedata full path.
Greg Zevin, Ph.D. Comp. Sc.
Independent Interwoven Consultant/Architect
Sydney, AU
nipper
I did not see anything like that, so I was wondering if there was something else happening
that I did not know about. I will hack the script up to work as it should, but I was just curious.
Andy
nipper
OK, found the issue. I am in Brazil so what few comments are in Portugese (which I do not speak) so are the variable names.
Anyway the script goes like this (relevant portions only)
$x = ARGV[0]
$p = ENV ("IW_DCT");
$p = s/WORKAREA/.*/STAGING/
subroutine ($p.$x)
local $x = $_
open ("$x")
with the varaibles named the same, (and IW_DCT not being set in 6.X) I missed the transformation.
Thanks
Andy
gzevin
Andy
as per 6.X docs:
When a server-side inline callout program is executed, it inherits the following
environment variables:
IW_DCT: The file system path to the datacapture.cfg in use (for example, /iwmnt/
default/main/development/WORKAREA/maudlin/templatedata/press/events/
datacapture.cfg).
IW_ROLE: The role of the current data capture user (for example, editor).
IW_USER: The full user name of the current templating user (for example, andre).
IW_WORKAREA: The vpath to the current workarea (for example, /default/main/
development/WORKAREA/chris).
so it should work.
Greg Zevin, Ph.D. Comp. Sc.
Independent Interwoven Consultant/Architect
Sydney, AU
gzevin
are you sure it's ENV, not $ENV?
it should be $ENV{IW_DCT}
Greg Zevin, Ph.D. Comp. Sc.
Independent Interwoven Consultant/Architect
Sydney, AU
nipper
strange.
yes it was $ENV, I was lazy and did not put that in the sample.
Anyway I checked sdiff (amazing what happens when you actually VC this stuff).
old:
$path= $ENV("IW_DCT");
new
$path= $ENV("IW_WORKAREA");
But now I also had to strip off the //servername/ from the beginning:
$path =~ s|//.*?/|/iwmnt/|;
when I dumped it to a file it was the form:
//tsserver/default/main/......
Since this code is 4.5 (roughly year 2000 or so) I guess the form of the ENV changed.
Andy
Adam Stoller
Yes - 6.x vpaths are [almost] always in the form of
//
servername
/
archive
/main/...
So - any code that is expecting to be able to use a fileystem path needs to do something like:
$vpath =~ s|^//[^/]+||;
- and actually -- if you want a file system path that's portable across platforms:
use TeamSite::Config;
my $iwmount = TeamSite::Config::iwgetmount();
(my $fspath = $ENV{...}) =~ s|^//[^/]+|$iwmount|;
# or
(my $fspath = $cgi->{form}{...}) =~ s|^//[^/]+|$iwmount|;
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
gzevin
this is how it is since 6.X.. some of my callout scripts needed to be changed to strip the server name...
Greg Zevin, Ph.D. Comp. Sc.
Independent Interwoven Consultant/Architect
Sydney, AU