Validation Results Panel Customization

Post here questions and problems related to oXygen frameworks/document types.
abhik
Posts: 17
Joined: Tue Sep 05, 2023 12:14 am

Validation Results Panel Customization

Post 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
Result_Panel.png (331.71 KiB) Viewed 1241 times
Is there an API available for Oxygen plugin to customize this field?

Thanks & Regards,
Abhi_K
alex_jitianu
Posts: 1009
Joined: Wed Nov 16, 2005 11:11 am

Re: Validation Results Panel Customization

Post 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
abhik
Posts: 17
Joined: Tue Sep 05, 2023 12:14 am

Re: Validation Results Panel Customization

Post 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
alex_jitianu
Posts: 1009
Joined: Wed Nov 16, 2005 11:11 am

Re: Validation Results Panel Customization

Post 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
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Validation Results Panel Customization

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Validation Results Panel Customization

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
abhik
Posts: 17
Joined: Tue Sep 05, 2023 12:14 am

Re: Validation Results Panel Customization

Post 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
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Validation Results Panel Customization

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
abhik
Posts: 17
Joined: Tue Sep 05, 2023 12:14 am

Re: Validation Results Panel Customization

Post by abhik »

Hi Radu,

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

Regards,
Abhi_K
Post Reply