Page 1 of 1
CSS control to open profiling dialog!
Posted: Tue Jun 29, 2021 6:10 pm
by mu258770
Hi team,
We are using Oxygen Eclipse 23.1 and Web Author 23.0. We would like to know whether it would it be technically feasible to have a button in the Oxygen Author CSS that would open the "Edit Profiling Attributes" dialog and allow to define the conditional attributes? Currently the "Edit Profiling Attributes" option is used as a context menu item, but we need to provide this new option as well.
Regards.
Shabeer
Re: CSS control to open profiling dialog!
Posted: Wed Jun 30, 2021 11:50 am
by Gabriel Titerlea
Hello,
The "Edit Profiling Attributes" action cannot be used from Oxygen XML Web Author at the moment.
I've added your +1 to an existing feature request and we will update this forum post when it will be available.
Meanwhile you can implement your own "Edit Profiling Attributes" action in a plugin [1] and you can add a button in the document that will invoke it. Here's how:
1. Implement a javascript action [2] that shows a dialog [3] where you will present the profiling attributes for an element & when the user submits their choice you can invoke "ro.sync.ecss.extensions.commons.operations.ChangeAttributesOperation" to change the attribute values.
2. Add an oxy_button [4] in your CSS, the button should invoke the action you created at step 1.
3. Force the oxy_button to be shown only in Web Author [5].
Best,
Gabriel
[1]
https://www.oxygenxml.com/doc/versions/ ... lugin.html
[2]
https://www.oxygenxml.com/maven/com/oxy ... ction.html
[3]
https://www.oxygenxml.com/maven/com/oxy ... ialog.html
[4]
https://www.oxygenxml.com/doc/versions/ ... ditor.html
[5]
https://www.oxygenxml.com/doc/versions/ ... ation_tips
Re: CSS control to open profiling dialog!
Posted: Wed Jun 30, 2021 12:01 pm
by mu258770
Hi Gabriel,
Thank you for the update.
Is it possible in Eclipse Oxygen 23.0? That is is would it be technically feasible to have a button in the Oxygen Eclipse Author CSS that would open the "Edit Profiling Attributes" dialog and allow to define the conditional attributes
Regards,
Shabeer
Re: CSS control to open profiling dialog!
Posted: Thu Jul 01, 2021 9:52 am
by alex_jitianu
Hi Shabeer,
Yes, it can be done. You can do it with a
JSOperation that invokes our Java-based API. Here's how I did it:
1. In the framework directory I've created a
commons.js file and I've put this function in it:
Code: Select all
function editAttributes() {
var allActions = authorAccess.getEditorAccess().getActionsProvider().getAuthorCommonActions();
var action = allActions.get("Author/Edit_Profiling_Attributes");
if (typeof action.actionPerformed === "function") {
action.actionPerformed(null);
} else if (typeof action.run === "function") {
action.run();
}
}
2. In one of the framework CSSs I've added a button form control that invokes the previously defined function, like this:
Code: Select all
*[class~='topic/p']:after {
content: oxy_action(
name, 'Edit profiling attributes',
operation, 'JSOperation',
arg-script, 'function doOperation() { editAttributes();}'
)
}
Best regards,
Alex
Re: CSS control to open profiling dialog!
Posted: Mon Oct 16, 2023 3:44 pm
by mihaela
Hello,
We just wanted to let you know that version 26 of Oxygen XML Web Author includes the "Edit Profiling Attributes" feature:
https://www.oxygenxml.com/xml_web_autho ... 6.0.0.html
Best Regards,
Mihaela