Create a report command.



An InDesign document has to be analyzed. A use case for this is that an InDesign document is imported via a hot folder and the linked images should be replaced with images from assets. Therefore it is necessary to have a report of the InDesign document so that the image paths can be read.

Implementation of a report command for the censhare Render-Client

The command is needed to request the XML report from an open document.

Syntax:

<command asset_id="218591" document_ref_id="1" method="open"/>
<command document_ref_id="1" method=“report” expand=“minimal” structure=“structure”/>
<command document_ref_id="1" method="close"/>
CODE


Result:
The report XML is hooked into the result XML of the render call.

<report document_ref_id="1">
   <document doc_version="8.0" docname="censhare5 Layout.indd">
    <slug>       <asset id="10414" version="1"/>       <version-info tags="vfs" version="4.7"/>     </slug>
     …
   </document>
 </report>
CODE

The new command
“report”
Parameter - document_ref_id: ID of the document to be reported as specified in the open command.
“expand”
Like regular report command. Detail level of the report [minimal|maximal|geometry]. Default "geometry".
“structure” Detail level of XML structure included into the report [minimal|structure|content].
Like regular report command.
“filter”
Like regular report command.


A "report" command is applied to the referenced InDesign document with these parameters.. The report XML is hooked into the result XML of the render call.

Example:

<command document_ref_id="1" method=“report” expand=“geometry” structure=“structure”/>
CODE

Result:

<cmd> 
... 
<report document_ref_id="1"> 
<document doc_version="8.0" docname="censhare5 Layout.indd"> 
<slug> 
<asset id="10414" version="1"/> 
</slug> 
... 
<data_links> 
<data_link uri="file:/..." state="available"/> 
</data_links> 
</document> 
</report> 
</cmd>
CODE