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)
ENV variable from templating
Fredrik
Hi,
I have upgraded to TS 6.0 and cannot "find" the ENV variable using callouts in my dcr. I need to get the ENV IW_WORKAREA.
Snipped form the callout:
# Get the area_path from the TS Templating variables
foreach $key (sort keys %ENV) {
$value=$ENV{$key};
if ($key eq IW_WORKAREA) {
$area_path = $value;
}
}
Anyone?
rgds
Fredrik
Find more posts tagged with
Comments
Michael
Hi Fredrik
Is your problem related to when you do an
inline
callout?
If so, this was documented as bug 47058 and was fixed in the TS 6.0.0L release. It is documented in the release note.
If you are not running TS 6.0.0L then upgrading to this version should sort you out.
Hope this helps?
Cheers, Michael
Fredrik
Michael,
It was actually an inline and you have saved me lots of frustration browsing the documentation.
Thanks!
Fredrik
Michael
No worries!
phbillard
Hi
Can you tell me where is this documentation. I'm using inline call-out with the $ENV variables, even with 6.0L is not working
Philippe
Michael
Hi Philippe
All the documentation is available from the Interwoven support site --
http://support.interwoven.com
.
If you are having trouble using environments variables then you can search in the forums and find some useful snippets which will output all available environment variables.
If you are still having problems post your script up on the forum and someone might be able to identify the problem.
Hope this helps.
Cheers,
Michael
phbillard
Hi Michael
Here is what it get :
Server is Solaris 8, it's a from scratch install, no upgrade
bash-2.03# ./iwversion
iwserver: 6.0.01 Build 29278 Interwoven 20031211
I wrote an example TPL just to check the $ENV variables :
]]>
<iw_perl>
foreach $key (sort keys %ENV) {
$value=$ENV{$key};
</iw_perl>
<![CDATA[
<H2>]]><iw_perl><![CDATA[iwpt_output($key);]]></iw_perl><![CDATA[</H2>
<H3>]]><iw_perl><![CDATA[iwpt_output($value);]]></iw_perl><![CDATA[</H3><hr></hr>
]]>
<iw_perl>
}
</iw_perl>
<![CDATA[
In the list I get, there are no IW_xxxx variables at all !
Where is the problem ?
I have access to the support site, so if you have a link to a specific page, fell free to send it.
Regards
Philippe
sample.pdf
Adam Stoller
The code you showed is from a PT not a callout (inline or cgi) - and thus you would need to use things like iwpt_get_dcr_name(), iwpt_get_pt_name(), or iwpt_get_ofile_name() and parse it to determine the workarea
(my $workarea = iwpt_get_dcr_name()) =~ s|^(.*/WORKAREA/[^/]+)/.*$|$1|;
(this will give you back a file system path I believe, so you may need to chop off the leading path specification to turn it into a vpath).
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
phbillard
Good point, this was in a TPL, using a callout like
print <<END;
<?xml version="1.0" encoding="UTF-8"?>
<substitution>
END
foreach my $key (sort keys %ENV)
{^M
print "<option value=\"$ENV{$key}\" label=\"$key\"/>\n" ;
}
print <<END;
</substitution>
worked, so the problem must come from somewhere else, still chasing ...
Thx
Philippe
phbillard
Working on it and found that
for the same architecture, for $ENV{IW_WORKAREA}
TS 5.5.2 SP3 gives something like
/Backingstoremain/branch/sub-branch/WORKAREA/wa_Name
where TS 6.0.1 gives
//server/Backingstore/main/branch/sub-branch/WORKAREA/wa_Name
and that's the same for the hidden value area_path in the DCT.
That's why none of my call out is working due to this difference of syntax.
Why isn't it consistent with previous version ? Do I have to open a case for that ?
Is it going to change again for TS 6.1, 6.5 to know if I have to make my callout script generic to handle several syntax.
Philippe
gzevin
can't you make it vpath-independent? I mean getting a vpath from a current ENV - something like Fish has suggested
Greg Zevin, Ph.D. Comp. Sc.
Independent Interwoven Consultant/Architect
Sydney, AU
tecthis
Not sure if someone ansered this, but it is a bug in TS 6.0. If you upgrade to 6.0L the ENV variables work.
A...
Alexander Correa
http://www.baxter.com