Page 1 of 1

Path of topic nodes inside the DITA MAPS manager

Posted: Mon Feb 05, 2024 7:58 pm
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
Thanks,
vishwa

Re: Path of topic nodes inside the DITA MAPS manager

Posted: Tue Feb 06, 2024 9:10 am
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