Automating Report Macro loading

I would like to automate the loading of a report macro so that it can be built automatically as part of the RxWorks to OPV conversion.

Macros are easy - just use dataload. However, Report Macros need to be linked to their document template and are thus more complicated.

I can use templateload to load the document templates. I can then use a Kettle step to extract information about the templates, and I can then in theory use another Kettle step to build the report macro.

However, the 'report' node of lookup.macroReport contains a massive xml expression as follows:

 <org.openvpms.component.business.domain.im.common.IMObjectReference>
  <archetypeId>
    <entityName>entity</entityName>
    <concept>documentTemplate</concept>
    <version>1.0</version>
    <qualifiedName>entity.documentTemplate.1.0</qualifiedName>
    <shortName>entity.documentTemplate</shortName>
  </archetypeId>
  <id>334</id>
  <linkId>54424374-3eb8-11e3-814f-5d1434ac47e6</linkId>
</org.openvpms.component.business.domain.im.common.IMObjectReference> 

where the id (334) is the entity_id and the linkId of the template in the acts file (which I can use some SQL in a Kettle step to get).

Q1 - is this the way to do it ?

Q2 - am I correct in thinking that the line feeds in the xml expression are just white space and I can use a big long string like '<org.openvpms.com.....><archetypeId><entityName><....'

Regards, Tim G

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Re: Automating Report Macro loading

Its probably the best way to do it at present.

You can generate the XML without whitespace and it will be parsed correctly.

Regards,

-Tim A

Syndicate content