DITA profiled content

Having trouble deploying Oxygen XML Web Author? Got a bug to report? Post it all here.
Johann
Posts: 235
Joined: Wed Jun 17, 2015 12:46 pm

DITA profiled content

Post by Johann »

Hello,

We are using Web Author version 26.1.

We have some questions about the profiled content display.

We have a DITA topic open in a DITA Map context, in which there is a subjectScheme.

Some topic content has profiling attributes, and we can therefore see this filtering directly in the Author view thanks to the green border + green background styles (by default).

We have several problems.

Firstly, the text added in the green background, in our case “if product is ‘XXXXXXXXXX’ or ‘YYYYYYYYYY’” can sometimes be very very long and clutter up the Author view.
I know it's possible to hide these profiling attributes in CSS, but isn't it possible to have them displayed on demand in a popup, for example?

Another concern is that in the “if product is ‘XXXXXXXXXX’ or ‘YYYYYYYYYYY’”, 'XXXXXXXXXX' or 'YYYYYYYYYY' correspond to the subjectdef/@keys attributes of the subjectscheme that was used, so we'd like to be able to display the topicmeta/navtitle associated with the subjetdef instead. In fact, we'd like to have the same labels as those displayed when using the Edit Profiling attributes popup.

To sum up, is there an API/method that can be used to control the content displayed in profiling attributes? For example, an API that, for a given @product, would return the associated subjectdef/@keys, subjectdef/topicmeta/navtitle?

Thank you for your help,

Johann
cosminef
Site Admin
Posts: 180
Joined: Wed Aug 30, 2023 2:33 pm

Re: DITA profiled content

Post by cosminef »

Hello,
Firstly, the text added in the green background, in our case “if product is ‘XXXXXXXXXX’ or ‘YYYYYYYYYY’” can sometimes be very very long and clutter up the Author view.
I know it's possible to hide these profiling attributes in CSS, but isn't it possible to have them displayed on demand in a popup, for example?
If you notice, when the profiling attributes are displayed in the editor, a little pencil appears at the end. If you click on it, a dialog opens where the possible profiling attributes and their values are presented
aaaaa.png
aaaaa.png (12.42 KiB) Viewed 465 times
Should we understand that you want a different approach? Could you explain your use case in detail?
Another concern is that in the “if product is ‘XXXXXXXXXX’ or ‘YYYYYYYYYYY’”, 'XXXXXXXXXX' or 'YYYYYYYYYY' correspond to the subjectdef/@keys attributes of the subjectscheme that was used, so we'd like to be able to display the topicmeta/navtitle associated with the subjetdef instead. In fact, we'd like to have the same labels as those displayed when using the Edit Profiling attributes popup.
Do you want the display of topicmeta/navtitle to be in the profiling attributes dialog or in the editor? The navtitle is already presented in the 'Edit profiling attributes' dialog, so should we understand that you also want the navtitle to be shown in the editor?
For example, if you have this:

Code: Select all

<subjectdef keys="X2000">
<topicmeta>
<navtitle>X2000 Phone Guide</navtitle>
</topicmeta>
</subjectdef>
instead of "X2000" you would like to display "X2000 Phone Guide" in the editor?

This is from Oxygen XML Editor:
bbbbb.png
bbbbb.png (11.09 KiB) Viewed 465 times
This is from Web Author:
aaaaa.png
aaaaa.png (12.42 KiB) Viewed 465 times
So, should we understand that you want the profiling attributes to be displayed according to the navtitle, like in Oxygen XML Editor (desktop)?

Best,
Cosmin
Cosmin Eftenie
www.oxygenxml.com
Johann
Posts: 235
Joined: Wed Jun 17, 2015 12:46 pm

Re: DITA profiled content

Post by Johann »

Hello Cosmin,
Should we understand that you want a different approach? Could you explain your use case in detail?
I take your example. Because the text "if product is 'X2000'" can be long in our context with a lot of selected profiles, we would like not display it in the editor. I will be displayed only on demand in a popup when clicking on a button.
For us, it is different from the pencil button which enables to edit the profiling attributes. The new button will be used to display the summary in a humanized way of the current selected profiling attributes.
So, should we understand that you want the profiling attributes to be displayed according to the navtitle, like in Oxygen XML Editor (desktop)?
We'd like to see Author Desktop and Author Web display similarly. In this case, we prefer the Author Desktop approach, with navtitle display in the editor.

Regards,

Johann
cosminef
Site Admin
Posts: 180
Joined: Wed Aug 30, 2023 2:33 pm

Re: DITA profiled content

Post by cosminef »

Hello,

Thank you for your details. I will discuss with my colegues and come back to you with a response.
Also, I wanted to clarify:
We'd like to see Author Desktop and Author Web display similarly. In this case, we prefer the Author Desktop approach, with navtitle display in the editor.
Is this requirement identical to the one in this post? (To which we will respond there as well) viewtopic.php?f=34&t=27022#:~:text=In%2 ... Desktop%3F
Cosmin Eftenie
www.oxygenxml.com
Johann
Posts: 235
Joined: Wed Jun 17, 2015 12:46 pm

Re: DITA profiled content

Post by Johann »

Hello,

Yes, you are right, the two posts are linked. And the part you highlighted is identical to what we discussed in this post.

Regards,

Johann
cosminef
Site Admin
Posts: 180
Joined: Wed Aug 30, 2023 2:33 pm

Re: DITA profiled content

Post by cosminef »

Hello,
I take your example. Because the text "if product is 'X2000'" can be long in our context with a lot of selected profiles, we would like not display it in the editor. I will be displayed only on demand in a popup when clicking on a button.
For us, it is different from the pencil button which enables to edit the profiling attributes. The new button will be used to display the summary in a humanized way of the current selected profiling attributes.
You can use the oxy_button form control [1] in which you can specify an action to open the dialog you mentioned

[1] https://www.oxygenxml.com/doc/versions/ ... ditor.html

Best,
Cosmin
Cosmin Eftenie
www.oxygenxml.com
Johann
Posts: 235
Joined: Wed Jun 17, 2015 12:46 pm

Re: DITA profiled content

Post by Johann »

Hello,

Yes, no problem for us to create the button and to open a dialog. It's how to feed this dialog that's missing :)

Regards,

Johann
mircea_b
Posts: 2
Joined: Fri Dec 08, 2023 12:51 pm

Re: DITA profiled content

Post by mircea_b »

Hello,

Here is a tutorial for presenting a custom dialog: https://www.oxygenxml.com/maven/com/oxy ... ialog.html. In this example, a similar task is performed: the name of the element at the caret location is shown in the dialog.

If you want to access the attributes of the node at the caret location, you can use something like:

Code: Select all

editor.getEditingSupport().getSelectionManager().getSelection().getNodeAtSelection().getAttributes()
This will return a map from each attribute to its value, for example:

Code: Select all

{
    "product": {
        "attributeValue": "X1000",
        "isDefaultValue": false,
        "isHidden": false
    },
    "class": {
        "attributeValue": "- topic/dd ",
        "isDefaultValue": true,
        "isHidden": false
    }
}
You can define a list of hardcoded profiling attributes, like ["product", "audience", etc.], iterate through the attributes of the element, and add them to your dialog.

To get the instance of the sync.api.Editor, you can use the BEFORE_EDITOR_LOADED event. See https://www.oxygenxml.com/maven/com/oxy ... ction.html.

All the best,
Mircea
Johann
Posts: 235
Joined: Wed Jun 17, 2015 12:46 pm

Re: DITA profiled content

Post by Johann »

Hello,

Thank you for this help!
Yes, no problem for us to create the button and to open a dialog.
Contrary to what I said, adding the new "display" button next to the "pencil" button (Edit profiling attributes) is not so easy.

What should be the CSS selector?
We want to add an oxy_button next to the "pencil" button so we want the same rules as the "pencil" button.

Regards,

Johann
cosminef
Site Admin
Posts: 180
Joined: Wed Aug 30, 2023 2:33 pm

Re: DITA profiled content

Post by cosminef »

Hello,

To help you get inspired more easily, you can use the "Inspect Styles" option in Web Author:
  • Hover the cursor over the pencil icon and right-click.
  • Go to "About element" option
  • Select "Inspect Styles"
Inspect-styles.png
Inspect-styles.png (36.68 KiB) Viewed 247 times
In the right view, select the 'After(1000014)' option.
inspect-styles2.png
inspect-styles2.png (8.4 KiB) Viewed 247 times
inspect-styles3.png
inspect-styles3.png (18.74 KiB) Viewed 247 times
You can also see the file (as well as the path to that file) where the oxy_button - (profiling.css) is applied
We hope this information is helpful to you. If you have any questions, feel free to ask us.

Best,
Cosmin
Cosmin Eftenie
www.oxygenxml.com
Post Reply