Page 1 of 1

Setting rootmap

Posted: Sun Jun 30, 2024 8:41 pm
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)"/>

Re: Setting rootmap

Posted: Mon Jul 01, 2024 6:57 am
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

Re: Setting rootmap

Posted: Mon Jul 01, 2024 8:46 am
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)"/>

Re: Setting rootmap

Posted: Mon Jul 01, 2024 10:45 am
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

Re: Setting rootmap

Posted: Mon Jul 01, 2024 2:32 pm
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>

Re: Setting rootmap

Posted: Mon Jul 01, 2024 8:26 pm
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.

Re: Setting rootmap

Posted: Tue Jul 02, 2024 7:47 am
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

Re: Setting rootmap

Posted: Tue Jul 02, 2024 8:25 pm
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

Re: Setting rootmap

Posted: Wed Jul 03, 2024 7:01 am
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