Here's what you need to do:
While logged into xmlpserver (BI Publisher), enter the Catalog, then do the following:
- Download the parent folder containing all the data models you will need.
Once downloaded, rename the downloaded .xdmz
file to a .zip
.
You can now view the "guts" of the files.
Write a script in Linux or Windows to recursively rename as .ZIP all the nested XDMZ files underneath the parent folder.
Extract all of the _datamodel.xdm
files underneath the data models' XDMZ files (now renamed as ZIP files).
Below is a sample _datamodel.xdm
file. (Scroll beneath it for steps 5, etc.)
Note that the Data Model's Data Set SQL is located between the <sql></sql>
tags:
<sql dataSourceRef="ApplicationDB_APP">
<![CDATA[select * from table]]>
</sql>
Sample _datamodel.xdm
file:
<?xml version = '1.0' encoding = 'utf-8'?>
<dataModel xmlns="http://xmlns.oracle.com/oxp/xmlp" version="2.0" xmlns:xdm="http://xmlns.oracle.com/oxp/xmlp" xmlns:xsd="http://wwww.w3.org/2001/XMLSchema" defaultDataSourceRef="demo">
<dataProperties>
<property name="include_parameters" value="true"/>
<property name="include_null_Element" value="false"/>
<property name="include_rowsettag" value="false"/>
<property name="xml_tag_case" value="upper"/>
</dataProperties>
<dataSets>
<dataSet name="asd" type="complex">
<sql dataSourceRef="ApplicationDB_APP">
<![CDATA[select * from table]]>
</sql>
</dataSet>
</dataSets>
<output rootName="DATA_DS" uniqueRowName="false">
<nodeList name="data-structure">
<dataStructure tagName="DATA_DS">
<group name="G_1" label="G_1" source="asd">
<element name="ENTITY_ID" value="ENTITY_ID" label="ENTITY_ID" dataType="xsd:double" breakOrder="" fieldOrder="1"/>
<element name="ENTITY_NUMBER" value="ENTITY_NUMBER" label="ENTITY_NUMBER" dataType="xsd:string" breakOrder="" fieldOrder="2"/>
**[...more XML defining the table generated by the SQL...]**
</group>
</dataStructure>
</nodeList>
</output>
<eventTriggers/>
<lexicals/>
<valueSets/>
<parameters/>
<bursting/>
<display>
<layouts>
<layout name="asd" left="280px" top="0px"/>
<layout name="DATA_DS" left="0px" top="32px"/>
</layouts>
<groupLinks/>
</display>
</dataModel>
- Now you need to parse these files to extract the SQL. (Use XPATH).
Or rather than writing a script to do this, you could do each file individually using copy/paste into your Eclipse.
I hope this helps.