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)
how to access metadata of a DCR in a TPL file
srvijayanandh
In my preview page, i need to show one of the metadata info of the DCR. For that i need to know how to get the metadata value of the DCR from tpl file.
one possible solution i thought of was, to use extendedattirbute command line tool, but again for that we need to know the current DCR filename. So the question can be "can we get the filename of the DCR that we are accessing to generate the preview page?"
Find more posts tagged with
Comments
Adam Stoller
Have you looked at the on-line documentation for iw_perl - if not, please do so . I think you'll find your answer there.
http://teamsite-server-name/iw/help/tst/pt
--fish
(Interwoven Senior Technical Consultant)
TextIN.dsc
Migrateduser
srvijayanandh,
If I understand your question properly, I'll add to Adam's "iw_perl" suggestion. The name of the DCR is the 18th parameter ($ARGV[17]) passed into the .tpl during a "preview". Paste the following code at the top of your .tpl and do a preview:
<iw_perl>
<![CDATA[
foreach my $param (
@ARGV)
{
iwpt_output("$param<br>");
}
]]>
</iw_perl>
You'll see a list of all of the parameters. The one you want is the last one.
Also...I think it's parameter 13 ($ARGV[12]) during a "generate".
Dan Pike
Portland General Electric
dan_pike@pgn.com
gzevin
Dan
fish is suggesting to read the manual. I suggest you read the same html page fish is referring to. iw_perl does have a much easier way of finding current DCR name with 1 function call.
I deliberately don't mention the function...
Greg Zevin
Independent Interwoven Consultant/Architect
Sydney, AU
Adam Stoller
Yes indeed - in fact (pardon me for making an example of you Dan) - you definitely do NOT want to assume anything about the order or number of arguments passed in to the command - that can and will change over the course of time.
--fish
(Interwoven Senior Technical Consultant)
Migrateduser
Learn something new every day, I always say. Thanks for making it clear.
srvijayanandh - Please disregard my previous post. You definitely want to use the iw_perl function that Fish refers to.
Thanks, guys.
Dan Pike
Portland General Electric
dan_pike@pgn.com
srvijayanandh
thanks a lot for your suggestions. And sorry for the late response.
I managed to find out the way of doing it. Thanks Fish for encouraging to go through the Manual.
i used the function iwpt_get_dcr_name(); to get the dcr name.
thanks again for your suggestions.