Document content blob format?
Submitted by Guest on Wed, 15/07/2015 - 10:57
I am looking for a problem in a jrxml file (I am seeing lots of "WARN JRBoxFactory,http-8080-12:92 - The 'topBorder' attribute is deprecated. Use the <pen> tag instead." messages in the openvpms.log file
I do not know what report was being run, so I cannot just use Templates|View to download the content.
I have an sql query that outputs all the contents blobs to a file (see below), but I am confident that the data is compressed.
a) it is indeed compressed
b) any suggestions about how to return it to test so that I can search it for 'topBorder'
Regards, Tim G
The sql is:
select d.name,d.contents into outfile '/temp/timtest1' from documents d
where d.mime_type = 'text/xml';
I can see the names in clear text but the contents part is scrambled.
Re: Document content blob format?
Documents are compressed using DeflaterOutputStream, so you probably can't decompress the contents from within MySQL. MySQL does have an uncompress() function which I *think* uses the same algorithm, but the uncompressed size appears to be expressed in 4 bytes at the start of the blob. E.g, do an "Open Value in Viewer" for the results of select compress("foo").
So if the algorithms are the same, and you can prepend the doc_size to the blob (in the correct endianness...), you might be in luck with the uncompress() function.
If not, then you'll need to download each template manually or write a tool to extract them.
Re: Document content blob format?
Tim A - thanks. I will stick with the original plan [find the person who was logged in as nurse at 0545 this morning and grill them to find out what report they were running]. Unfortunately they had gone off shift when I rang at 0730.
Regards, Tim G
Re: Document content blob format?
Turns out it is possible. Try the following:
Re: Document content blob format?
Fixed it. I found the problem by looking for acts with start time within a minute of the timestamp of the WARN JrBoxFactory problem. This show payments and so I looked at the receipt templates. Turned out that both Receipt and Receipt Items.jrxml contained the deprecated stuff.
However, if you use Jasper Studio to examine the reports both look good - because as it loads the report it strips the deprecated stuff. You have to use a simple editor to look at the jrxml file to see that it contains the %Border items. But you need to use Studio to save the updated jrxml and then edit the template to reload the uopdated jrxml.
Given that the other 'system' documents (ie estimate, counter sales, etc) were probably created at the same time as the receipt I am about to unload those and check them also.
Regards, Tim G