Page 1 of 1
DITA profiled content
Posted: Wed Oct 02, 2024 1:21 pm
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
Re: DITA profiled content
Posted: Thu Oct 03, 2024 4:28 pm
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
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
This is from
Web Author:
aaaaa.png
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
Re: DITA profiled content
Posted: Thu Oct 03, 2024 5:12 pm
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
Re: DITA profiled content
Posted: Thu Oct 03, 2024 5:21 pm
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
Re: DITA profiled content
Posted: Thu Oct 03, 2024 5:34 pm
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
Re: DITA profiled content
Posted: Fri Oct 04, 2024 2:41 pm
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
Re: DITA profiled content
Posted: Mon Oct 07, 2024 10:58 am
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
Re: DITA profiled content
Posted: Tue Oct 08, 2024 12:24 pm
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
Re: DITA profiled content
Posted: Tue Oct 08, 2024 6:28 pm
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
Re: DITA profiled content
Posted: Wed Oct 09, 2024 5:08 pm
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
Inspect-styles.png
In the right view, select the 'After(1000014)' option.
inspect-styles2.png
inspect-styles3.png
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