Hello Konstantin,
Like I've previously mentioned, the server does not know where the client-side caret is. The server receives the client-sides caret position whenever an editing action is performed (E.g. inserting text or invoking an action). So I'm afraid that you can't do these changes from a different plugin. What you can do is to invoke Author Operations [1] from the client side using javascript. An operation that can help you with setting an attribute is ChangeAttributeOperation. The API for invoking this action also allows you to give it parameters:
Code: Select all
editor.getActionsManager().invokeOperation(
'ro.sync.ecss.extensions.commons.operations.ChangeAttributeOperation',
{
'name': 'conkeyref',
'value': 'chunk_xxx/p_topic_body_p_5_1'
}
);
You can look at our tutorial for adding a custom operation to the webapp toolbar for more information [2]
If the default operations aren't enough for a given situation, you can develop a custom Author Operation and add it to the DITA framework [3]. Make sure you annotate this operation as being Webapp compatible:
Code: Select all
@WebappCompatible
public class InsertFragmentOperation implements AuthorOperation {
}
Once this operation is in the framework, you can invoke it just as before.
The advantage of using this method is that you won't need to refresh the content of the editor, it will be refreshed as needed automatically.
If you will be implementing custom actions in the DITA framework you will need to add the updated framework to Web Author [4].
About the API to send the caret position to the server. We still have not decided whether we will include such API. And if we do it will take a while until it's available.
Let me know if you have other questions,
Gabriel
[1]
http://oxygenxml.com/doc/versions/18.0/ ... tions.html
[2]
https://www.oxygenxml.com/maven/com/oxy ... ction.html
[3]
http://oxygenxml.com/doc/versions/18.0/ ... HowTo.html
[4]
https://www.oxygenxml.com/doc/versions/ ... ,framework