Path of topic nodes inside the DITA MAPS manager

Post here questions and problems related to oXygen frameworks/document types.
vishwavaranasi
Posts: 144
Joined: Fri Feb 28, 2020 4:02 pm

Path of topic nodes inside the DITA MAPS manager

Post by vishwavaranasi »

Hello Team ,
is there any API to get the local path of the topic nodes inside the DITA MAPS manager?
for example , i see the below

AuthorNode[] selectedNodes = ditaMapEditorPage.getSelectedNodes(true);

and i wanted the secetedNodes -local path , for example , if i selected topic "Reload Service Name " from below , how to get the local path or how can i read the properties or any API how to retrieve the same using API?
image.png
image.png (19.11 KiB) Viewed 513 times
Thanks,
vishwa
Thanks,
vishwa
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Path of topic nodes inside the DITA MAPS manager

Post by Radu »

Hi,
To get the URLs of the selected nodes you could use directly the API "WSDITAMapEditorPage.getCurrentSelectedURLs(boolean, boolean)".
Other than that, if you use the "ditaMapEditorPage.getSelectedNodes(true);" API, for each AuthorNode you can do something like:

Code: Select all

    AuthorNode sel = selectedNodes[0];
    if(sel instanceof ro.sync.ecss.extensions.api.node.AuthorElement) {
      AuthorElement selElement = (AuthorElement) sel;
      AttrValue hrefAttrValue = selElement.getAttribute("href");
      if(hrefAttrValue != null) {
        //The value of the "href" attribute
        String href = hrefAttrValue.getValue();
        //The base URL in which the topicref exists.
        URL base = selElement.getXMLBaseURL();
        //From these two you can compute the absolute referenced path.
      }
    }
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply