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)
script-generated data content records
Kay
We are going to need to create over 200 pages using a single template. Since the different pages of data are coming out of a database, we have developed a script to generate the DCRs in the appropriate /data directory. However, when we try to generate pages off these pseudo-DCRs, TeamSite pops up an error message that these are not valid DCR files, even though the syntax and format are correct. What else needs to be done to make TeamSite accept these script-generated DCRs as valid?
Find more posts tagged with
Comments
Migrateduser
Did you set the appropriate extended attributes on the dcr's after you generated them?
Also, how do you know that the dcr's are in a valid format (how are you generating the xml)? Are you using the TeamSite:
CRnode or TeamSite:
CRparser libraries to read/write your xml files (highly recommended to use these libraries if you are not already):
bf_example.jar
BfExampleOneTbo.java
gzevin
Here is a copy of one of the articles from my and Powell Trussler's templating document:
How to create a DCR without using the TeamSite Templating GUI
Synopsis
Sometimes you want to populate a data capture form automatically, or you want to create an XML based file which is going to act as a data capture form without going through the teamsite gui to create a data record. Here's how to "imprint" the DCR file so that the templating subsystem recognizes it.
Details
If you create a DCR without going through the templating UI, you'll find that the DCR isn't recognized as such. However, you can turn an DCR formatted XML file into one that the template system recognizes as one of its own by adding special extended attributes to the file:
In the example below "Generic/Story" is the category/type of the template. This is a snippet of Perl.
$assignment_vpath = TeamSite::CGI_lite::escape_html_data("/default/main/client400/WORKAREA/myworkarea");
$cmd = "$iwhome/bin/iwextattr -s TeamSite/Templating/DCR/Type=Generic/Story $assignment_vpath" . "/templatedata/Generic/Story/data/". $file;
`$cmd`;
In words, the command above sets an extended attribute key/value pair on $file, where the key is "TeamSite/Templating/DCR/Type", the value is "Generic/Story", and this key/value pair is being applied to the file "/default/main/client400/WORKAREA/myworkarea/templatedata/Generic/Story/data/$file". When the template system sees this key/value pair, it recognizes this file as a DCR.
Greg Zevin
Independent Interwoven Consultant/Architect
Sydney, AU