Simultaneous dialogs with ExecuteMultipleActionsOperation
Post here questions and problems related to oXygen frameworks/document types.
-
- Posts: 25
- Joined: Thu Aug 07, 2014 3:40 pm
Simultaneous dialogs with ExecuteMultipleActionsOperation
Post by Bruno.Ballarin »
Hi,
In order to allow in one single toolbar command to create a xref and then to edit the outputclass attribute, I use a ExecuteMultipleActionsOperation with actionIDs: xref.insert, xref.type.
The xref.insert calls an Action built with the InsertXrefOperation (that includes a built-in dialog to select the xref source).
The xref.type calls an Action built with the ChangeAttributeOperation with "name" = "outputclass" and "value" set through a custom dialog ${ask('xref type:',combobox,('':'Standard:';'number':'Index-only:';'title':'Title-only:';'#':'Digit-only:'),'')}
When I launch the ExecuteMultipleActionsOperation, I got both dialogs simultaneously, the built-in InsertXrefOperation dialog and the custom ChangeAttributeOperation.value dialog, like if the second Operation is launched before the first operation built-in dialog is even answered and closed.
Is it normal behavior?
Is there a way to force the completion of the InsertXrefOperation before running the ChangeAttributeOperation?
Cheers,
Bruno
In order to allow in one single toolbar command to create a xref and then to edit the outputclass attribute, I use a ExecuteMultipleActionsOperation with actionIDs: xref.insert, xref.type.
The xref.insert calls an Action built with the InsertXrefOperation (that includes a built-in dialog to select the xref source).
The xref.type calls an Action built with the ChangeAttributeOperation with "name" = "outputclass" and "value" set through a custom dialog ${ask('xref type:',combobox,('':'Standard:';'number':'Index-only:';'title':'Title-only:';'#':'Digit-only:'),'')}
When I launch the ExecuteMultipleActionsOperation, I got both dialogs simultaneously, the built-in InsertXrefOperation dialog and the custom ChangeAttributeOperation.value dialog, like if the second Operation is launched before the first operation built-in dialog is even answered and closed.
Is it normal behavior?
Is there a way to force the completion of the InsertXrefOperation before running the ChangeAttributeOperation?
Cheers,
Bruno
-
- Posts: 1016
- Joined: Wed Nov 16, 2005 11:11 am
Re: Simultaneous dialogs with ExecuteMultipleActionsOperation
Post by alex_jitianu »
Hello,
Unfortunately, it is an expected behavior. The dialog presented by InsertXrefOperation is not a modal dialog which means that after the dialog is presented, the action finishes and the ChangeAttributeOperation is invoked.
You'll have to use our Java-based API and set an AuthorDocumentFilter. Something like this:
Our SDK is a good starting point to create such extensions: https://www.oxygenxml.com/oxygen_sdk/download.html
You can take a look at the oxygen-sample-framework submodule, which also contains a sample filter implementation (simple.documentation.framework.filters.SDFDocumentFilter).
Best regards,
Alex
Unfortunately, it is an expected behavior. The dialog presented by InsertXrefOperation is not a modal dialog which means that after the dialog is presented, the action finishes and the ChangeAttributeOperation is invoked.
You'll have to use our Java-based API and set an AuthorDocumentFilter. Something like this:
Code: Select all
public void insertFragment(AuthorDocumentFilterBypass filterBypass, int offset, AuthorDocumentFragment frag) {
String value = EditorVariables.expandEditorVariables("${ask('Get the value')}", null);
// TODO Look inside the fragment and set the @outputclass attribute as needed.
List<AuthorNode> contentNodes = frag.getContentNodes();
if (contentNodes.size() > 1) {
for (AuthorNode authorNode : contentNodes) {
if (authorNode.getType() == AuthorNode.NODE_TYPE_ELEMENT
&& "xref".equals(authorNode.getName())) {
AuthorElement authorElement = (AuthorElement) authorNode;
}
}
}
super.insertFragment(filterBypass, offset, frag);
}
Our SDK is a good starting point to create such extensions: https://www.oxygenxml.com/oxygen_sdk/download.html
You can take a look at the oxygen-sample-framework submodule, which also contains a sample filter implementation (simple.documentation.framework.filters.SDFDocumentFilter).
Best regards,
Alex
Return to “SDK-API, Frameworks - Document Types”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service