author action - value parameter question(s)

Dear list, this is my first dabble with a document type framework and with the list, so please be lenient. a) I want to create an author mode action in order to change a certain attribute. I am using the ro.sync.ecss.extensions.commons.operations.ChangeAttributeOperation operation and have set the value attribute to ${ask('break=',combobox,('yes';'no';'maybe';'':'null'),'')} Now I would like to set the default value not to some static default but to what is currently present in the attribute. Is there some way to get the value of this attribute in the action's parameter definition? b) On a related note, is there a Operation in place that would allow me to just edit whatever is there as attributes in the current element - as one long, free-text string? The ChangeAttributeOperation seems to be able to change only one attribute, so for editing several attributes of one and the same element I have to define different actions and trigger them separately...? c) Finally, I would like to use i18n inside of the ask() variable, say for the message part. Is that possible? Sorry for asking three questions at once, I just hope they are so closely related that it makes sense to do it this way. Thanks and all the best, Andreas -- Dr. Andreas Wagner Project "The School of Salamanca" Academy of Sciences and Literature, Mainz and Institute of Philosophy Goethe University Frankfurt http://salamanca.adwmainz.de Grüneburgplatz 1 (Pf 116, R. 2.455) 60629 Frankfurt am Main Tel. +49 (0)69/798-32774 Fax +49 (0)69/798-32794

Hi Andreas, About question (b): But if your goal is to allow users to edit all attributes anyway why are you not using our Attributes view or our in-place attributes editor dialog (ALT-ENTER keyboard shortcut)? Unfortunately our editor variables support is quite limited so you cannot do (a) and (c) using editor variables. So you would have to implement a custom operation in Java which would look at the current attribute value, show a dialog to the user and then use our API to set the attribute on the element: http://www.oxygenxml.com/doc/ug-oxygen/index.html#tasks/addCustomActionHowTo... If you implement a custom operation on the other hand you can also use the internationalization support provided by our API: http://www.oxygenxml.com/doc/ug-oxygen/index.html#topics/localizing_framewor... Of course if you implement a custom Java operation you can gather all attributes from the element and present them in a serialized form in a text field and then set them back using the API, so you could also fix (b) this way. Regards, Radu Radu Coravu <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com On 10/23/2013 12:25 PM, Andreas Wagner wrote:
Dear list,
this is my first dabble with a document type framework and with the list, so please be lenient.
a) I want to create an author mode action in order to change a certain attribute. I am using the ro.sync.ecss.extensions.commons.operations.ChangeAttributeOperation operation and have set the value attribute to ${ask('break=',combobox,('yes';'no';'maybe';'':'null'),'')}
Now I would like to set the default value not to some static default but to what is currently present in the attribute. Is there some way to get the value of this attribute in the action's parameter definition?
b) On a related note, is there a Operation in place that would allow me to just edit whatever is there as attributes in the current element - as one long, free-text string? The ChangeAttributeOperation seems to be able to change only one attribute, so for editing several attributes of one and the same element I have to define different actions and trigger them separately...?
c) Finally, I would like to use i18n inside of the ask() variable, say for the message part. Is that possible?
Sorry for asking three questions at once, I just hope they are so closely related that it makes sense to do it this way.
Thanks and all the best,
Andreas

Hi Radu, * Oxygen XML Editor Support dixit [2013-10-23 13:48]:
Unfortunately our editor variables support is quite limited so you cannot do (a) and (c) using editor variables. So you would have to implement a custom operation in Java which would look at the current attribute value, show a dialog to the user and then use our API to set the attribute on the element:
I see. I admit I had hoped to get around writing a custom Java operation but it seems sooner or later I will have to have a look into it anyway. I will probably postpone it somewhat but then try the route you have suggested. Regarding the in-place attributes editor dialog and the attributes view: thanks a lot, I simply did not think of them and the in-place editor is just what I wanted. Thanks a lot for your help. Andreas -- Dr. Andreas Wagner Project "The School of Salamanca" Academy of Sciences and Literature, Mainz and Institute of Philosophy Goethe University Frankfurt http://salamanca.adwmainz.de Grüneburgplatz 1 (Pf 116, R. 2.455) 60629 Frankfurt am Main Tel. +49 (0)69/798-32774 Fax +49 (0)69/798-32794
participants (2)
-
Andreas Wagner
-
Oxygen XML Editor Support