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)
output separate file
System
I have a simple template and when I generate it I want it to generate a second file to the same folder as the first one, using some of the content I added to the template. Does anyone know how?
/j
http://jonk.svart.nu
Find more posts tagged with
Comments
Migrateduser
I'm sure there are a bunch of ways you could do this - you could just write to the file using an <iw_perl> block in the first presentation template. Or you could use another presentation template - have the presentation template that you use for preview call iwpt_compile.ipl passing in a bunch of parameters including the DCR it is parsing and the presentation template that generates the second output file (this presentation template doesn't even have to be listed in templating.cfg) - then set the extended attributes on the file so that when you edit it, it brings up the DCR. I probably have some examples if you need one, but I also imagine there's a better way.
Migrateduser
Thanks! I would really appreciate some examples, you see, I'm new to Teamsite...
/j
http://jonk.svart.nu
Migrateduser
The parameters that Interwoven passes to iwpt_compile.ipl can change with every release, so you might want to check that these are still the right ones. One way to do that is listed under
http://devnet.interwoven.com/forums/cgi-bin/showthreaded.pl?Cat=&Board=PRODUCTS_TEAMSITE&Number=8618&page=&view=&sb=&o=&vc=1#Post8618
. Here a code example for the TPL. Everything I have is in modules that I can't really send, so I just hacked this together. If you need help parsing the DCR path and setting extended attributes, let me know. Dirsep is set for NT in this example (usually this comes from a module, not hard-coded). Note that Perl generally doesn't care which way the slash goes but some NT command line tools do, so I set it accordingly.
use TeamSite::Config;
my ${iwhome} = TeamSite::Config::iwgethome();
my ${dcr} = iwpt_get_flag_param( '-iw_pt-dcr' );
# parse DCR to determine workarea, path to presentation template
my ${dirsep} = "\\";
my $cmd = join( " ", "${iwhome}${dirsep}iw-perl${dirsep}bin${dirsep}iwperl",
"${iwhome}${dirsep}bin${dirsep}iwpt_compile.ipl",
"-pt <path to presentation template>",
"-smartwrite",
"-ofile <path to output file>",
"-iw_include-location <path to workarea>",
"-iw_pt-dcr $dcr" );
# execute that command
# check for errors
# set extended attributes on output file
# check for errors
Migrateduser
I think I need more help. I don't really get it...
/j
http://jonk.svart.nu
Migrateduser
This is about all the time I have for this - hopefully it helps. If you don't know Perl I would suggest you find someone that does to help with this, or find another solution. See the attachment to this post.
This is totally untested and I'm sure it has some errors, but the URL in the post above might help with debugging.
Use View Source if the attachment opens in a browser window.
Edited by john on 02/07/03 05:09 AM (server time).
pawlr
can't you just use <iw_ostream> in your .tpl to output info to a second file? I use it all the time and its really painless (perlless)
Migrateduser
"PrimaryDCR=${out}"
That should say ${base}. Also note that anything in <> needs to be replaced with your specific stuff.
This is way too hard-coded for me.
Migrateduser
If you do it that way, does it automatically set the extended attributes so that if you edit that second file it brings up the DCR? Either way that's probably a much better solution, I've just never used it.
pawlr
Actually you're right.. one of the probs with <iw_ostream> is that it doesn't connect back to the dcr if you check and edit the secondary .html file. (It does work if you check and edit the primary output .html)
What the product *should* do (ha ha) is if the secondary .html file is checked and edited, the dcr is opened and any subsequent "generate" overwrites the right files. (doesn't make the secondary file the primary).
pawlr
Of course, I guess you could run some perl to set the ext. attr on the secondary output file after the </iw_ostream> tag
dctm_tools_1520722122137788516.log