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)
inserting data into DCRs.....
nipper
OK, so I have ~ 12K DCRs that are missing a field, cause we added it after the fact. Users said no problem. Now we want to add the data so it will get pushed out.
I can tell the users to open all 12K DCRs, then save. :-)
Or I can look at a perl script. I have written several to recursively go down a directory structure, slurp in a DCR, using DCRnode and DCRparser I have done some data validation (the DCRs were programmatically created/imported)
The question I have is that I know how to read the field:
$filesize=rootnode->value('filesize');
from perldoc it look slike I shoudl be able to use set_attrib but I am not certain.
Are there any sample peices of code out there ? DId not see anything in the articles. Will this behave differently if the field does not exist or if it is there, just blank.
Anyone familar with this ? I am going to play with it (on a test set of data)
TIA
Andy
Find more posts tagged with
Comments
gzevin
all the docs are on your server:
http://<server>/iw/help/tst/pt/TeamSite__DCRnode.html
Greg Zevin, Ph.D. Comp. Sc.
Independent Interwoven Consultant/Architect
Sydney, AU
MattP
I just did the same exact thing. I think it is too bad that a regenerate won't validate against the template. This is what I did. I can't say it is the most efficient method, but I used it on my production system on about 1,000 files. It took about 1 minute.
I read in each line and look for the </record> and replace it with my new item. I write the files out to a new directory as a safeguard.
Good luck
Matt
(attached as a txt)
Matthew Petitjean
BOC Group
Murray Hill, NJ 07974 USA