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)
Regenerate all generated pages
Priya_N
Hi
Is there a way using which we can find out the path+name of all the html pages an user has generated using a given tpl/dcr ?.
Example
Lets assume we have an tpl file called executivebios.tpl now we create a new data content record say "test"
Now the user generates ''n' different html files say a1.html a2.html ... upto a 'n'.html and saves each of these files to different different directories.
Now all the n pages have been created using the same dcr only.that is there are n copies of the same file , given this kind of a scenario is it possible to regenerate all the n pages whenever the user edits the content ?
regards
Priya
Find more posts tagged with
Comments
Jeremy
Hi,
I don't think there is any kind of out the box functionality to do this. You'll have to write a script yourself to read the extended attributes of all the files and check if it matches the .tpl that is being edited. If it does then regenerate it.
I don't think it will be an easy task!
Good luck!
Jeremy
Priya_N
Hi
Setting Extended attribute is fine as long as there is just one file. when you have multiple files this method also i guess fails.
I wrote something like this in my tpl
my $outputName = iwpt_get_ofile_name();
my $dcrName = iwpt_get_dcr_name();
my $cmd;
$cmd = "iwextattr -s HtmlLocation=$outputName $dcrName";
`$cmd`;
Thinking i could fetch the name of the html file in wft so that i can invoke iwregen. Now when i had multiple files generated this method also fails.
Any suggestions ?
Adam Stoller
Modify your PT's to create a trail from the DCR to the generated pages. This can be done via flat-file, DB, or as my current customer is doing it; by having the PTs add EA's to the DCR that contain the area-relative path to the generated page.
That way you can go from one generated page to the DCR to all generated pages with two calls to iwextattr (it may take more calls to iwextattr to set proper EAs on all the generated pages if you are using a PT that generates multiple output pages though)
--fish
(Interwoven Senior Technical Consultant)
Adam Stoller
You need to come up with a scalable naming scheme for the EA keys. If you have a PT that generates multiple pages, keep a counter handy and add a suffix to your keys - e.g.
my $cmd = qq(iwextattr -s "HtmlLocation$counter=$outputName" $dcrName);
Then, when you go to retrieve the generated pages from the DCR - load all the EA's into a hash and just utilize the keys that *begin* with "HtmlLocation"
If you use different PTs for generating different pages from the same DCR - use the name of the PT within the key (something like):
my $pt = iwpt_get_pt_name('basename');
my $outputName = iwpt_get_ofile_name();
my $dcrName = iwpt_get_dcr_name();
my $cmd = qq(iwextattr -s "HtmlLocation_$pt=$outputName" $dcrName);
qx($cmd);
If you have a combination of both - combine the above like:
my $cmd = qq(iwextattr -s "HtmlLocation_${pt}_$counter=$outputName" $dcrName);
--fish
(Interwoven Senior Technical Consultant)
Priya_N
I am trying to put the names the generated html files to a txt file. which can be used appropriately while the workflow is triggered