Page 1 of 1

Validation Results Panel Customization

Posted: Mon Oct 30, 2023 7:19 pm
by abhik
Hello Team,

We have a requirement where we want to customize the display name for the entries of 'Resource' column in 'Results' panel after performing the 'DITA Map Completeness Check'.
Currently it is showing reference from resource url. Please check the screenshot attached for more details.

Result_Panel.png
Is there an API available for Oxygen plugin to customize this field?

Thanks & Regards,
Abhi_K

Re: Validation Results Panel Customization

Posted: Thu Nov 02, 2023 9:39 am
by alex_jitianu
Hello,

Unfortunately, we don't have an API for this and I can't think of an easy or feasible way of doing it. What exactly do you want to present there, perhaps a nav title? Maybe we can register a future improvement.

Best regards,
Alex

Re: Validation Results Panel Customization

Posted: Thu Nov 02, 2023 8:43 pm
by abhik
Hi Alex,

We want to customize the display string as per our requirements. Based on some conditions we want to display the title/filename for the resource url. We are looking for an API similar to https://www.oxygenxml.com/InstData/Edit ... ng.String) where we can customize the display string for a given reference/resource url.

Yes, please register a future improvement. It will help us to develop further.

Thanks & Regards,
Abhi_K

Re: Validation Results Panel Customization

Posted: Fri Nov 03, 2023 10:53 am
by alex_jitianu
Hi,

So you want to read the title from the topic and present that instead of the file name? The available API for the results area can be seen here. Right now, at most, you can contribute an action in the contextual menu that will present that additional information.

Best regards,
Alex

Re: Validation Results Panel Customization

Posted: Tue Nov 07, 2023 8:26 am
by Radu
Hi,
A workaround for this would be to use our ValidationProblemsFilter API to prepend the resource name in the "Description" column:
https://www.oxygenxml.com/InstData/Edit ... ilter.html
So although the Resource column cannot be customized, the value in the "Description" column could be changed to prepend to the message there maybe the resource name. If you are interested in this workaround I could try to give you more details.

Regards,
Radu

Re: Validation Results Panel Customization

Posted: Thu Nov 09, 2023 10:27 am
by Radu
One more workaround, you have custom URLs which look like:

Code: Select all

aem://author-p107674-e1009809.adobeaemcloud.com/GUID-e575763f-9487-4ad4-b71f-69b08fb05150-en.dita
Maybe you can also place in the URL resource name also a more human friendly version like:

Code: Select all

aem://author-p107674-e1009809.adobeaemcloud.com/Installing_application_GUID-e575763f-9487-4ad4-b71f-69b08fb05150-en.dita
and in your custom URL protocol handler you can remove from the resource name the human readable version to extract and use further the GUID unique value to locate the resource in the CMS and obtain an input stream from it.
In this way Oxygen would display in the Resource column something like:
Installing_application_GUID-e575763f-9487-4ad4-b71f-69b08fb05150-en.dita

Re: Validation Results Panel Customization

Posted: Wed Nov 15, 2023 4:30 pm
by abhik
Hi Radu,

Thank you for providing details and workaround solutions. We are checking the provided suggestions.

Also, we would like to explore the ValidationProblemsFilter API. Please provide more details to prepend the resource name in the "Description" column. It will help us to develop the plugin for our customers.

Thanks and Regards,
Abhi_K

Re: Validation Results Panel Customization

Posted: Thu Nov 16, 2023 11:32 am
by Radu
Hi,
The Java code for a workspace access plugin which changes the message in the error messages would look something like this:

Code: Select all

    @Override
    public void applicationStarted(StandalonePluginWorkspace pluginWorkspaceAccess) {
     pluginWorkspaceAccess.addEditorChangeListener(new WSEditorChangeListener() {
       public void editorOpened(URL editorLocation) {
         WSEditor ditamap = pluginWorkspaceAccess.getEditorAccess(editorLocation, StandalonePluginWorkspace.DITA_MAPS_EDITING_AREA);
         ditamap.addValidationProblemsFilter(new ValidationProblemsFilter() {
          @Override
          public void filterValidationProblems(ValidationProblems validationProblems) {
            List<DocumentPositionedInfo> problemsList = validationProblems.getProblemsList();
            if(problemsList != null && ! problemsList.isEmpty()) {
              for (DocumentPositionedInfo documentPositionedInfo : problemsList) {
                String urlSystemID = documentPositionedInfo.getSystemID();
                String initialMessage = documentPositionedInfo.getMessage();
                documentPositionedInfo.setMessage(URLUtil.extractFileName(urlSystemID) + " - " + initialMessage);
              }
              validationProblems.setProblemsList(problemsList);
            }
          }
         });
       };
     }, StandalonePluginWorkspace.DITA_MAPS_EDITING_AREA);
    }
From the "urlSystemID" you would need to come up with a more friendly resource name using your plugin.
Regards,
Radu

Re: Validation Results Panel Customization

Posted: Fri Nov 17, 2023 4:43 pm
by abhik
Hi Radu,

Thank you for your valuable response. Your insight is helping us to develop further.

Regards,
Abhi_K