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)
extract workarea path
Trina
How can I extract workarea path and at the same time display this path to dcreditform. Using either <inline command or <cgi-callout>. Is this achievable? if so, would someone kindly show me how. Thanks heaps in advance.
Find more posts tagged with
Comments
Migrateduser
From a CGI callout, there is no direct way to get the workarea. However, you can extract the workarea from the iw_dcr_vpath parameter, if the DCR has already been saved at least once. This parameter would have the entire vpath of the DCR on the last save, so you would strip off everything from the templatedata directory on.
In inline callout, the workarea should be available via the IW_WORKAREA environment param.
Migrateduser
I am not sure how the server could get it (I think you can set the callout temporarily to show_env.ipl and see if it is passed) but I think in JavaScript you can get it with opener.top._dcWin.gWorkarea. If you need it on the server side you could have the process post to itself with all required parameters including this one.
Since I think this variable is undocumented and therefore it may change with a future release (although this seems unlikely), I usually make a global function available to all templates:
function getWorkarea()
{
return( top._dcWin.gWorkarea );
}
Migrateduser
I did the show_env thing and it looks to me like it is passed as area_path, even for unsaved DCRs? Certain things may only work in some versions of TeamSite though...
Trina
Got it workout...The code for it...is:
my $workarea_path = $ENV{IW_WORKAREA};
Thanks everyone.