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)
Synchronizing DCR and Output File Names?
ThrogMI
We have a considerable amount of content on our intranet and we have tried to encourage our users to use directories to organize things logically. Our ongoing problem is that they seem to struggle to keep the names of their pages and their DCRs named consistently.
Hence, we would like alter our templates using Form API so that the template "remembers" which directory structure and file name they used when saving their DCR inside templatedata and automatically use that as the directory / file name for the resultant page. We have a one-to-one relationship between our pages and DCRs so tying them together isn't going to cause any problems with overwrites etc.
Is this possible? I can work out how to manipulate the DCR name - indeed the TS 6.0 Form API documentation provides an example, but I can't see how to influence the name of the output file. I'm sure this must be feasible because when you edit by selecting a page (rather than a DCR) TeamSite seems to know the name of the file to regenerate.
Any assistance, tips etc. would be most gratefully received. Thanks in advance.
Find more posts tagged with
Comments
Migrateduser
Disable generate from with the DCT. Use an onSaveDone trigger to callServer to call a custom CGI to generate the output file according to the rules (of course then changes may occur to output files before generation is desired). I usually base the rules on custom attributes in templating.cfg - autogen="t" or "f" and basepath="/whatever" (so users don't have to navigate deeply within templatedata, if they navigate there at all). Use the same rules to attach the output file when a user workflows a DCR. You could put a readonly field with a callout that does the generation if you wanted to allow save without generate, it could even popup a preview just like the normal gen.
It seems like every Interwoven customer wants something like this - rather than giving us examples why don't they make the product work the way it should? It is SO EASY to do simple things like this, it's like they just want to sell consulting dollars instead of fixing the product.
ThrogMI
John, thanks for this. I think I follow what you're suggesting but I just need to clarify a few things.
When you say "call a custom CGI", can I get that to call whatever it is that parses the DCR against the presentation template? I presume a crude method of doing this is to call the command line tool (iwregen? I can't remember off the top of my head) and then find some way of getting the CGI to pop up a window with the resultant page in it?
Given that we are now on TS 6.0, I'd like to hang all of this off of the finish button. The icing on the cake would be to trigger a workflow to submit and deploy the page. I would guess it's possible to do that from the CGI as well?
I wholeheartedly agree with your final comment!
Migrateduser
If you use callServer you have to call something that can be accessed through HTTP, which means at least a simple CGI wrapper to iwregen (you will have to pass a parameter to the CGI to tell it what file to regenerate). Or you could pass the DCR and have the CGI script parse templating.cfg or howevery you define the rules and generate the corresponding response. For the popup, the CGI would probably do that as well - if it is able to successfully regenerate the file it should write some javascript to popup and redirect to it, otherwise alert that there was an error. That part is a little more complicated. I don't have time at the moment but I can send you some sample code for this (but it's JSP, not CGI) if needed.
I don't know about workflow integration or 6.x. I try to avoid workflow CGITasks because they can only have one owner which is generally not acceptable to the client. I don't know what the finish button is.
LastPageSP5.dcpackage.zip
output.pdf
ThrogMI
Thanks, you've given me enough to get started, that's the main thing.
The "finish" button in TS 6.0 appears at the bottom of the data capture form and, according to our pre TS 6.0 presentation from Interwoven, was supposed to be a "single-click, does-everything" button that saves and generates in one go. As you may gather, it doesn't seem to do that!
Migrateduser
I have another client that needs the autogenerate functionality. Their users are already familiar with TeamSite 5.0 but they want to restrict where output files are generated. I would like to use the generate button (so it's similar to what they did in the past), but have it call a custom CGI that does the automated generation and presents them with a list of the generated pages so they can preview any of them (or just redirects to the generated page if it is only generating one). I THINK this would work with an onSaveDone trigger, but that will only intercept the event if the data has changed - if they first save, then generate it won't trap it. Is there any other way to control what happens when they press generate? The only other thing I can thinkof is a callout on a hidden field or something to replace the generate button (disable the default).
Any suggestions?
gzevin
I personally do not like hacking core functionality to that degree. I'd make a small 'generation' workflow that would be laucnhed on close of the DCT and it would just generate files and attach them. Having this in a workflow would also help yo generate multiple files from multiple DCRs...
Greg Zevin, Ph.D. Comp. Sc.
Independent Interwoven Consultant/Architect
Sydney, AU
Migrateduser
I would like the custom generation process to present the user with a list of links to the various ways the data will be presented on the sight. The delay and limitations of workflowing every change seem like overkill. I don't see any documented way to use FormAPI to determine if a save is required and the save function is useless because it doesn't call the triggers, so I can't call that. I guess I could have a "preview" tpl that calls the other PTs and generates a list of links to the generated files, and configure it not to allow generation somehow.
Edited by john on 11/03/03 08:58 AM (server time).
carnix
I don't know about TS 6 (I have TS 5.5.2) and from the beginning (TS 5.0) of our TeamSite use, business users have never been allowed to "Generate" files. The button is still there, but I go beat anyone with a stick for using in (heh). Instead, the workflow handles everything. They edit the file, save the DCR according to a predefined naming convention (which they stick to most of the time... it really doesn't matter though).
Then, after the approval phase of the workflow is complete and the final approver accepts it, the control is passed to a Perl script that, though my magical voodoo, checks the category and data type, assign a file name based on the DCR name and generate the output file dynamically then submits the DCR and new web file (It also does some Perl DBI work as well, depending on the category).
The only problem with this method is that silly generate button just won't go away.... I managed to hack it away by editing the JSP file, but that's a whole other post...
-mike
Michael Langford, Webmaster - CARE USA
151 Ellis Street, Atlanta, GA, 30303
http://www.care.org/