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 generate multiple files from 1 DCR/TPL
waldemar
I'm trying to figure out how I can generate MORE files than the regular "iwpt_get_ofile_name"-file from within ONE template with ONE DCR. Is this possible at all?
I did not very much documentation nor threads about this, but a very promising command "iw_ostream". Can anyone please give me a hint on how to approach this subject? I appreciate it.
Regards
waldemar
argo-tec
Find more posts tagged with
Comments
waldemar
alright I found it ;-)
waldemar
esolut
KTR
Hi,
If you are done with that, could you pls post the ample code for reference ...
Thanks in advance,
KT
iwovGraduate
Have you looked at
http://<YOUR_TS_SERVER>/iw/help/tst/pt
?
Its also somewhere on the IWOV support site.
That has a very comprehensive documentation on templating with numerous examples.
waldemar
Well there's actually some posts here refering to printer-friendly versions of some output file being generated at the same time as the display version. Anyway...
I'm still having problems with this issue. This is the code:
$strFilename=iwpt_get_ofile_name('dirname').'\navileft' . $module;
$strFilename =~ s/ //g;
$strFilename =~ s/\.//g;
$strFilename .= '.php';
iwpt_output ($strFilename . "\n");
]]><iw_ostream file_val="strFilename">testsdfsdf</iw_ostream><![CDATA[
For some reason I receive a Templating/Generation-Error with this code while "hard-coding" the filename with "file='test.html'" seems to work. I also tried to $strFile in that file_name attribute - no luck. As well as with the substitution with {iw_value.....}.
What's the problem with that file_val???
(example strFilename would be Y:\default\main\myBranch\WORKAREA\test\navileft\navileftCS71.php)
Puzzled...
waldemar
esolut
KTR
if you have the access to support site, you can fine th useful info for <iw_ostream>, link as follows:
https://support.interwoven.com/library/devel/tst/pt/5_01/TeamSite__PT__iw_ostream.asp
you can post your code, so that I can check and let you know.
waldemar
Well the above lines would be my actual code...:-)
(A collegue of mine said that the page you mentioned is not very much different from the documentation in thel help\tp-directory...)
I still wonder... I saw similar code posted here - people using file_val (sometimes even with $ prefix before the variable name)...
waldemar
esolut
Migrateduser
One of my coworkers says that if you use iw_ostream you may not be able to preview. Also there are apparently some bugs in various ways of using iw_ostream. I think you are better off calling iwpt_compile.ipl or writing files directly.
Johnny
There is a confirmed bug regarding proxy redirections. It doesnt relate to whether or not you use ostreams, but the behaviour is due to proxy workarounds for multiple ostreams.
If you do not use proxy redirections, you should not have any problems previewing all ostream files as the proxy is designed to handle that.
I do use ostream extensively and have found them to be very powerful, (especially as iwpt_compile includes them in its manifest results).
John Cuiuli
waldemar
Yes, conceptualy this ostream looks very interesting; still couldn't get using a variable as a filename to work... veeery strange (even without paths, no chance).
For the time being I'm using regular perl filesystem commands; open, print and close; that also does the trick.
Thanks for your comments, guys!
waldemar
esolut
Migrateduser
Just curious what you or anyone including Interwoven uses the manifest for?
Johnny
Just about everywhere Ive been we've implemented page generation via workflow external tasks.
If you are using ostreams (I use them alot for news type templates navigation etc) then there is no way of finding out what has been generated other than the ofile parameter passed into iwgen.
using iwpt_compile, you can create an xml manifest listing all files that were generated and with that I attach them to the workflow for deployment, submitting etc.
That is why I think ostreams are much much better than going in your own direction and use PERL commands to create files. If there is a practical IWOV alternative then use it
Remember kiddies to set the TST extended attributes if you use iwpt_compile.
Since ostream is a standard feature, I think the manifest should be bumped up to iwgen.
John Cuiuli
MikaV
Same problem here. file_val works (On Solaris and TS552) if strFilename is something without slashes dots (like "foobar").
Mika Vilkko
IT Optimo
Finland