hirowla Posted November 29, 2010 Share Posted November 29, 2010 Hi,I was wondering how to do imports/exports without the version numbers being incremented whenever I do an import. What I'm trying to do is set our development environment back to what is in our production environment. But as soon as I do an import, all the version numbers increment and hence I cannot do the comparison. When I do the export, every file is different - only because of the version number.Is there any way to do this type of comparison easily, without version numbers getting in the way? Thanks, Ian Link to comment Share on other sites More sharing options...
tkavanagh Posted December 2, 2010 Share Posted December 2, 2010 The jsVersion value is different for each version of a released product (ie 3.5.0, 3.7.0, 3.7.1). But it sounds like you are refering to a different version number? Link to comment Share on other sites More sharing options...
hirowla Posted December 2, 2010 Author Share Posted December 2, 2010 I'm thinking of the version numbers that each object has, not the version of the product. It seems to increment these versions every time, which is annoying because I can no longer compare easily whether objects have changed (because after every import, they all have!). Link to comment Share on other sites More sharing options...
tkavanagh Posted December 6, 2010 Share Posted December 6, 2010 :-( Yes, that will make the compare difficult. Also there are new time stamps for each object when a new export is carried out... Link to comment Share on other sites More sharing options...
federico.cattozzi Posted December 8, 2010 Share Posted December 8, 2010 I had the same problem to version reports and i solved it with a script.I had to version my reports on IBM Rational ClearCase, but every export/import was different due to some values into jrxml and into other xml files, so also if two files were the same, everytime CC creates a new version of them.If you use iReport, it writes some useless properties into jrxml, read this to remove them.My script does it: export all reports from JasperServer into a dir (not a zip file) overwrite all <version> and <creationDate> tags into all *.xml files in all sub-directories with default values, I chose respectively "0" and "2010-01-01T00:00.000+00:00" (I used a sed command with Cygwin on Windows XP) now exported files and versioned files are different only for file timestamps (creation/modification date) and for real changes. To copy only files really changed into versioning directory I use a rsync command that compare files only using their checksum.If you want only to do a easy compare try diff softwares like WinMerge (freeware for Windows).With WinMerge: export all reports from development environment into a directory export all reports from production environment into another directory open WinMerge click on File -> Open... select Left (development ) and Right (production ) directories and click OK. You will see all differences between every pair of files Go to Tools -> Filters... and Linefilters tab create two line filters (New, write and Save and finally click OK): <version>(.*)</version> <creationDate>(.*)</creationDate> Go to Edit -> Options -> Compare -> "File Compare method:" and select "Full Contents" instead of "Quick Contents" Refresh view with F5 Link to comment Share on other sites More sharing options...
tkavanagh Posted December 11, 2010 Share Posted December 11, 2010 Very nice and useful post :-)It might be a good feature to add to the export. Something like "--skip-date-create" (which would skip these variable date values and any other values that vary in a similar way). Can make a request on the tracker which makes it easier to get into the queue. Link to comment Share on other sites More sharing options...
hirowla Posted December 16, 2010 Author Share Posted December 16, 2010 Thanks for the help. I'm glad I'm not the only dealing with this.Now all I have to get is WinMerge to help me do the diffs (I've set it up like you said but it has no effect).I think I'll end up writing some code to alter every single file to ensure the dates are the same, but I do any diffs etc. If you have your sed script handy that would be good too!Thanks,Ian Link to comment Share on other sites More sharing options...
federico.cattozzi Posted December 16, 2010 Share Posted December 16, 2010 Check attached images. It works for me.Anyway I'm sharing my code here below. Save it as myscript.sh and execute it using this command:bash myscript.sh "directory_path" Code: Post Edited by helyair at 12/16/2010 00:47 Link to comment Share on other sites More sharing options...
federico.cattozzi Posted January 20, 2011 Share Posted January 20, 2011 iReport saves useless data into jrxml, read this.If you want to be sure to do not consider iReport properties into your comparisons add the code below to the script. Code: Post Edited by helyair at 01/20/2011 09:44 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now