Setting rootmap

Post here questions and problems related to oXygen frameworks/document types.
SathyaOX
Posts: 35
Joined: Wed Oct 26, 2016 8:19 pm
Location: India

Setting rootmap

Post by SathyaOX »

Hi, I have a customized XML refactoring that copies metadata from the DITA map to its topics. This works well in Oxygen XML. I have a few projects running in Ixiasoft ccms. There it doesnt recognize the root map as it is from Dita Map view. I also tried using Oxygen perspective > DITA Map Manager > Selected Context map. Still it doesnt recognize the root map. Is there any other way tp select Ditamap so that the refactoring can run the mapped topics.

<xsl:param name="map-meta" select="document(DITAAccess:getRootMapURL())/(map|bookmap)/(topicmeta|bookmeta)/(prodinfo)"/>
-Sathya
Radu
Posts: 9431
Joined: Fri Jul 09, 2004 5:18 pm

Re: Setting rootmap

Post by Radu »

Hi Sathya,

I assume you are using the Oxygen Eclipse plugin integrated with the Ixiasoft CMS to run the custom XML Refactoring actions. Ixiasoft has its own Dita Map view installed in the Eclipse environment so the "DITAAccess:getRootMapURL()" Oxygen API has no way to access that.
About this remark:
I also tried using Oxygen perspective > DITA Map Manager > Selected Context map. Still it doesnt recognize the root map.
Ixiasoft also uses our APIs to change the way in which keys are gathered so I do not think there is a way to make the "DITAAccess:getRootMapURL()" API work when the Oxygen Eclipse plugin is integrated with the Ixiasoft Eclipse plugins.
Maybe in such cases you can make that certain parameter configurable in the XML Refactoring action's XML description file so that you can force set a certain value to it before running the XML refactoring.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
SathyaOX
Posts: 35
Joined: Wed Oct 26, 2016 8:19 pm
Location: India

Re: Setting rootmap

Post by SathyaOX »

Thanks, Radu.
I am a beginner. Just learning XSL.
I have updated the descriptor file to force ask Map ID. And it worked. The refactoring processes the map and topics associated to it.
However, it doesnt copy the metadata from the mentioned map. What am I missing here?
I want to copy the prodinfo from the mentioned map ID and paste it to the associated Topics.

<xsl:param name="map-meta" select="document(map|bookmap)/(topicmeta|bookmeta)/(prodinfo)"/>
-Sathya
Radu
Posts: 9431
Joined: Fri Jul 09, 2004 5:18 pm

Re: Setting rootmap

Post by Radu »

Hi Sathya,
What do you mean by "Map ID"? Can you paste your XML Refactoring action's descriptor XML file's contents in a reply on this thread?
In the "Scope and filters" page from the XML Refactoring dialog what scope did you choose?
If all else fails maybe you can pass a value for the "map-meta" parameter directly from the XML refactoring action, allow the end users to paste in the XML refactoring configuration dialog the precise value to use instead of having it being read automatically from the DITA Map.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
SathyaOX
Posts: 35
Joined: Wed Oct 26, 2016 8:19 pm
Location: India

Re: Setting rootmap

Post by SathyaOX »

Here is the xml content:

Code: Select all

<script type="XSLT" href="copy-metadata.xsl"/>
<category>DITA Map</category>
<parameters>
<description>params</description>
<parameter type="TEXT" name="map-id" label="Map ID:">
<description>Map ID</description>
</parameter>
</parameters>
Here is the xsl content:

Code: Select all

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:DITAAccess="java:ro.sync.ecss.dita.DITAAccess" exclude-result-prefixes="#all" version="3.0">

<xsl:param name="map-meta" select="document(DITAAccess:getRootMapURL())/(map|bookmap)/(topicmeta|bookmeta)/(prodinfo)"/>

<xsl:template match="node() | @*">
<xsl:copy>
<xsl:apply-templates select="node() | @*"/>
</xsl:copy>
</xsl:template>

<xsl:template match="topic">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates select="title"/>
<xsl:if test="not(//prolog) and $map-meta">
<prolog>
<metadata>
<xsl:copy-of select="$map-meta" copy-namespaces="no"/>
</metadata>
</prolog>
</xsl:if>
<xsl:apply-templates select="* except title"/>
</xsl:copy>
</xsl:template>
-Sathya
SathyaOX
Posts: 35
Joined: Wed Oct 26, 2016 8:19 pm
Location: India

Re: Setting rootmap

Post by SathyaOX »

Hi Radu, in CCMS selecting Map ID did process the topics associated with it. The preview showed all the topics in the map. Just that the Prolog was not copied, it just created an additional <metadata>.
I need to copy the prolog>prodinfo from the selected map/bookmap and paste in its topics.
-Sathya
Radu
Posts: 9431
Joined: Fri Jul 09, 2004 5:18 pm

Re: Setting rootmap

Post by Radu »

Hi Sathya,

If you define in the XML refactoring descriptor file a parameter like this:

Code: Select all

<parameter type="TEXT" name="map-id" label="Map ID:">
<description>Map ID</description>
</parameter>
then the corresponding XSLT styleesheet could take its value defined by the user with an xsl:param like this:

Code: Select all

<xsl:param name="map-id"/>
But I do not know what "Map ID" means, maybe it's a CMS specific term, Oxygen is just the editing part of the equation.
in CCMS selecting Map ID did process the topics associated with it. The preview showed all the topics in the map. Just that the Prolog was not copied, it just created an additional <metadata>.
So you used a CCMS specific action to modify multiple topics? Something equivalent to Oxygen's XML Refactoring action?
I need to copy the prolog>prodinfo from the selected map/bookmap and paste in its topics.
Maybe the CCMS has its own means of making multiple changes in topics, how about if you ask them?

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
SathyaOX
Posts: 35
Joined: Wed Oct 26, 2016 8:19 pm
Location: India

Re: Setting rootmap

Post by SathyaOX »

Hi Radu,
Map/bookmap ID is the same as we have in Oxygen. However, in CCMS, they create a unique ID for each object.
image.png
I added the <xsl:param name="map-id"/> to define the "map-id".
It still creates an empty metadata entry but doesnt copy Prolog from map/bookmap to Topics.
image.png
You do not have the required permissions to view the files attached to this post.
-Sathya
Radu
Posts: 9431
Joined: Fri Jul 09, 2004 5:18 pm

Re: Setting rootmap

Post by Radu »

Hi,
The "id" attribute value inside a DITA Map is just an ID value, it does not tell the XSLT stylesheet from where to load the DITA Map.
An XSLT function like "document(.....)" requires a document URL as a parameter with the URL having a value something like "file:/path/to/my.ditamap". I do not know if you can find out the URL of the DITA Map in the Ixiasoft system or if the XSLT stylesheet can obtain content from it.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply