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 on close
System
I know there has been some discussion on this but I am wondering if anyone has a working solution they would be willing to post.
When a user closes the template they want the output file that they had originally selected for edit to be automatically regenerated (without prompting for the output location).
Find more posts tagged with
Comments
Migrateduser
I got this working. This one uses a JSP that uses a package I wrote to handle the regeneration. I can't figure out how to avoid hard-coding the category and type passed to the JSP (I couldn't even find documentation on how to get the workarea).
sunil_j
Hi,
Even I am also looking to achieve this feature. Can you let me know how got that working, if possible kindly send the relevant code as attachment.
Thanx
Sunil
Migrateduser
I did it with JSP and no OpenAPI. The code is attached to my previous post. This uses a Java API that I can't really post here, but maybe will lead you in some direction. Are you comfortable with Java or do you have to use Perl? I have given up on Perl and probably can't help you much with that approach.
The custom code reads templating.cfg to determine what presentation templates should be used to generate files with what extensions (I enhance templating.cfg so each presentation template has an "autogen" attribute of t or f indicating if that tpl should be used to automatically generate output files). The system also has a rule for determining the output file location(s) for a given DCR based on templating.cfg (for instance /templatedata/category/type/data/dir1/file1 generates /dir1/file1.xml).
Interwoven, this should be an option for every template.
Regards,
-John
Migrateduser
I think the category and type are in top.gTDT. Since this is not documented I would create a function available to all templates that returns this, so if they change the implementation you just change this function. Same for workarea.
function getCategoryAndType()
{
return( top.gTDT );
}
function getCategory()
{
return( top.getCategoryAndType().substring( 0, getCategoryAndType().indexOf( "/" )));
}
function getType()
{
return( getCategoryAndType().substring( getCategoryAndType().indexOf( "/" ) + 1 ));
}
function getWorkarea()
{
return( top._dcWin.gWorkarea );
}
Migrateduser
Actually, this only seems to work for existing DCRs, not new DCRs (it seems that whatever JavaScript variable IWDCRInfo.getDCRName() uses to store the file name is not populated when onSaveDone is triggered?).
So yet another hack:
function generateTimeout()
{
setTimeout( "generate()", 300 );
return( true );
}
IWEventRegistry.addFormHandler( "onSaveDone", generateTimeout );