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)
Regex question
System
Hi,
We're using Open Deploy 5.6 on W2K. The upgrade from 5.0 made a change in deployment information stream format. We have a script that reads the information so it can take action based on a file deployment. The new format means the old regex searching for a file deployment doesn't work anymore. Here are the two lines of code:
if($line =~ m|<log_element .* response="Sending \[([^\]]*)\]|){
my $file = $1;
It works when we use the old-style format, meaning it obtains the name of the file being deployed when a line like this shows up:
<log_element target="" action="0" date="1051756634" result="4" response=" Sending directory [.] -- 225 entries
But the new style lines look like this:
<item path="21977-1.jpg" type="FILE" reason="missing-in-dest" action="NEW" status="COMPLETED" statusDetail="" srcDir="Y:\default\main\Custom\WORKAREA\development\images" trgDir="F:\Content"/>
How can I update the regex to match this new format? I'm not entirely sure of everything the old one was doing. Thanks,
David
Find more posts tagged with
Comments
Adam Stoller
First, I recommend that you look at parsing the information with an XML parsing module rather than using regex's - it makes it much easier to deal with changes in the order of attributes and such.
I'm not sure (haven't looked) but it's possible that the IWXML.pm module (in IWODHOME/solutions/perl/) *might* have been updated for this. If not, please file a request with Support for this.
Alternatively, you can specify that OpenDeploy should continue to use the 'log' format rather than the 'manifest' format - there's a setting in the odbase.xml for this (don't recall what it is off-hand - but you should be able to see it in the odbase.xml and it should be mentioned in the documentation)
--fish
(Interwoven Senior Technical Consultant)
Migrateduser
Thanks. That module is there and I'll investigate further. I changed the logging type back just to confirm this was the issue, but I like the new format and didn't want to keep it that way. The approach of reading the XML sounds like the best.