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)
Create DCRs using a script
dlsoderberg
Has anyone out there used a PERL script to read a directory of xml files to create TeamSite DCRs from them? I am creating templates for an existing set of 175 xml files and wanted to know if there was a way to automatically create the DCRs using a script that would read through them and grab content based on the tags.
This will save me hours of manually re-entering all of the DCRs.
Any help would be greatly appreciated!!
Find more posts tagged with
Comments
Migrateduser
Yeah, I seem to remember doing a very similar thing 3 years ago with 5.5.2. It's a huge timesaver to write a script, like you're saying, and compose XML DCR's based on whatever files you're looking at. Of course, you'll need to remember to assign appropriate extended attributes after each file is created.
In the meantime, did you have any specific questions about this?
Dave
Current Environment(s):
(1) TS 6.1 SP1 on W2K3
(2) TS 6.1 SP2 on W2K
(3) TS 6.1 on W2K
two-toned_series_birt.jpg
gzevin
in this
link
there are some example of what you need to do. not exactly, but feel free to ask questions.
Greg Zevin, Ph.D. Comp. Sc.
Independent Interwoven Consultant/Architect
Sydney, AU
dlsoderberg
Thanks for the help so far...the other article gave me a portion of what I need. I'm not much of a PERL scripter...I just know that it is the language to use to accomplish what I want to do. Can anyone either point me to a snippet of code that would help me write the part of the script that will read the directory and give me an idea of how to set it up to key on the specific tags in my xml files?
Thanks again!
Adam Stoller
While it may seem to you that you're not asking for much - you're asking for a lot of work to be provided to you for free here.
You should either hire a consultant who can develop a solution based on your requirements - or you should get a few more Perl books and learn to do more of this yourself.
Reading a directory is trivial - there's been code posted for this in the forums several times - however I'll point you in the proper direction here:
perldoc -f opendir
perldoc -f readdir
perldoc -f closedir
As for parsing XML - there are far too many possible choices out there to begin listing them here. Interwoven provides a few modules for doing this (again, referenced many times in these forums) and CPAN provides a plethora of such modules as well (some of which Interwoven ships with iwperl, some of which you'd have to download and install yourself).
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
gzevin
reading directory is an easy thing, just yesterday Fish has helped to fix a code that read a dir.
however, to read XML and produce DCRs one needs to have a command of either XML:
OM or Teamsite:
CRnode to [**** XML.
in my best practice document that I co-authored, there is some mention of the XML:
OM technique, but unless you are very fluent in perl, you'll find it hard to implement. You might be better off if you get someine to write a script for you.
Greg Zevin, Ph.D. Comp. Sc.
Independent Interwoven Consultant/Architect
Sydney, AU
gzevin
Fish,
you did have a link to the best practice templating document somewhere.. I kind of keep my copy, but it's not oficial..
you might want to post it here... If it could be of help
Greg Zevin, Ph.D. Comp. Sc.
Independent Interwoven Consultant/Architect
Sydney, AU
Adam Stoller
I don't have the lin off-hand - I searched for it and found it.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
encycsrvr10.20516.la-dev.pds.com.2009FEB26_15_21_40_PST.1.txt
nipper
Here it is:
fish's doc
Adam Stoller
I didn't think that was the document being referred to.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
nipper
I try to give your WP some free advertising and you complain.
How about
this link
Adam Stoller
Hey - I appreciate having my documents re-circulated - but the second link is probably closer to what Greg was talking about (though possibly not the actual document he was thinking of)
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
gzevin
no, it's still not it....
this is how easy is to navigate and find something in the tech library.....
Greg Zevin, Ph.D. Comp. Sc.
Independent Interwoven Consultant/Architect
Sydney, AU
nipper
I know the one you are talking about, called Advanced Templating Concepts or someting like that,
Has a lot XML examples.
Cannot find it either.
iwovGraduate
How about this one -
KB: 48599 Templating Tutorial for TeamSite 5.X
quote of the moment: "Search engines are no good unless you know what you are looking for"
nipper
Yea, well, search engines are no good if the documents are mis-named.
Here is a link not on the support site
click here
gzevin
good..
I have bookmarked it
interesting, my and Powel Trussler's names are gone.....
Greg Zevin, Ph.D. Comp. Sc.
Independent Interwoven Consultant/Architect
Sydney, AU
Send_BIRT_Proj.zip
dlsoderberg
Thanks everyone for your help with this...I have put together a script and I'm pretty close, but am getting an error when trying to apply TeamSite's extended attributes.
gzevin...I grabbed the code from the example you linked to above, but I'm getting the following error message:
Undefined subroutine &TeamSite::CGI_lite::escape_html_data called at create_dcrs.ipl line 43, <FILE> chunk 15.
I'm not sure if I'm missing something that I need to add to my script, or what. Here is that section of my script:
# assign the proper vpath
$assignment_vpath = TeamSite::CGI_lite::escape_html_data("/default/main/sanford/WORKAREA/load");
# apply the proper extended attributes to the DCR
$cmd = "$iwhome/bin/iwextattr -s TeamSite/Templating/DCR/Type=sharpie/afeEvents $assignment_vpath" . "/templatedata/sharpie/afeEvents/da
ta/". $file;
I think if I get through this one, I'll just about be there...any help you could give me would be great! Thanks again!!!
iwovGraduate
Perhaps you forgot
use TeamSite::CGI_lite;
statement ?
Usually its at the begining.
dlsoderberg
That was exactly it...I had it commented out. Thanks everyone for the help.