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)
Using IW-OSTREAM
mickdundee
Gidday from Downunder,
I use IW_OSTREAM to generate a newsletter in html and text format each time I generate my press release index page. The newsletters are named according to the day the index page was generated.
e.g
20021030.htm and 20021030.txt
I have a problem if two separtate users edit the press release index page on a particular day, it won't re-generate the newsletters if they were generated by another user.
The same person can edit and re-generate the index page and the newsletters will also be re-generated.
What I'd like to do is if a newsletter has already been created for that day then delete it and replace with the latest edition.
Any help appreciated.
Thank You
Colin
Find more posts tagged with
Comments
MartinAtCitat
Hello Collin,
my guess is that you have a permission problem.
Make sure that the files created from IW_OSTREAM have the correct permission set. I can recall having a similar problem, and solved it by explicitly setting the file permissions from the .tpl after the file was created.
Best Regards
Martin
Citat Solutions AB
Stockholm, Sweden
mickdundee
Thank You Martin,
Yes we thought it was a permissions problem. Do you think we should use PERL to change the permissions or the ownership of those files or is their something else I should do?
MartinAtCitat
Dont know what OS you are on, I use the chmod command.
The snippet below shows it illustrated from a presentation template, similar code would do from a workflow task.
Here's the snippet (note the whitespaces):
< iw_perl>< ![CDATA[
$ofile = TeamSite:
T::iw_xml::get_ofile_name($iw_parser);
$s_Command = "chmod 775 " . $ofile;
$s_Result = system($s_Command);
]]>< /iw_perl>
I good way of testing the template is to run it through the CLT iwpt_compile.ipl
__IW_HOME__//bin/iwpt_compile.ipl -pt __PRESENTATION_TEMPLATE_PATH__ -iw_pt-dcr __DCR_FILE_PATH__ -ofile __OUTPUT_FILE_PATH__ -iw_include-location __WORKAREA_PATH__
Depending on the mode of the ostream, don't forget the iw_include_location flag.
See
http://teamsite_server/iw/help/tst/pt/
Good luck
/ Martin
Citat Solutions AB
Stockholm, Sweden
mickdundee
Martin,
Thanks again for your help, one problem
$ofile returns the filename of the index page and not the filenames produced iw_ostream, I'll keep trying unless you have any other ideas. Thanks to your help I might still be able to pull the rabbit out of the hat with this one.
Colin
20110621.zip
Adam Stoller
As was mentioned - look at the documentation on your TeamSite server - iw_ostream accepts certain optional parameters which can be used to define the name to which the iw_ostream buffer will be written.
I don't want to just say RTFM - but ...
--fish
(Interwoven Information Guy)
mickdundee
This forum should be for people to ask any question no matter how silly without reproach from those of you who think they know more than the rest of us. I wonder how your superiors at Interwoven would regard your attitude.
I RTFM nowhere does the documentation talk about how I go about re-setting the permissions, without martins help which Im very grateful for I wouldn't have solved this.
Migrateduser
Actually, I think Fish's reply was gentle enough, I think you misinterpreted his reply. The docs on iw_ostream are pretty clear when it comes to setting the names of the output files. Agreed, there's nothing there explicitly about setting permissions during templating, but that's because there's tons of ways of doing that too, and permission-setting isn't typically something done by a TPL--but of course it can be.
Adam Stoller, AKA Fish, has done more to establish these forums as a useful community of TeamSite developers than anyone else, bar none. Don;t take his RTFM reminder as a personal slam--I know Adam, and it wasn't meant that way. Adam's not subtle, if he wants to slam someone, it's quite evident. :-)
bw
Bob Walden [bob.walden@interwoven.com]
Interwoven Education Group
IM: Yahoo, MSN bob_walden
Adam Stoller
$ofile returns [...] not the filenames produced iw_ostream [...]
[...] iw_ostream accepts [...] parameters [...] to define the name to which the iw_ostream buffer will be written. [...] RTFM
This forum should be for people to ask any question no matter how silly without reproach from those of you who think they know more than the rest of us. I wonder how your superiors at Interwoven would regard your attitude.
I RTFM nowhere does the documentation talk about how I go about re-setting the permissions, without martins help which Im very grateful for I wouldn't have solved this.
I'm sorry, you seem to have misread / misinterpreted my response. I was not reproaching anything.
You
asked a question.
I
indicated
where
you would find the answer along with a
clue
as to what the answer was. I was answering the question that was last posted and not the original question about re-setting permissions.
--fish
(Interwoven Information Guy)
MartinAtCitat
You should assign $ofile the value of the path to your newly created file (used in the < ostream> tag) - for example /full/path/to/TODAYSDATE.html
Regards
Martin
Citat Solutions AB
Stockholm, Sweden
mickdundee
Thanks Martin,
Thats exactly what I did (see below).
It works like a dream.
No Worries Mate
$ofile = "/.iwmnt/default/main/wwwdet/WORKAREA/detnews".$outputFileName2;
$s_Command = "chmod 664 " . $ofile;
$s_Result = system($s_Command);
MartinAtCitat
Great, I'm just glad I can help.
Regards
Martin
Citat Solutions AB
Stockholm, Sweden