Actions at the top of the content completion list
Having trouble deploying Oxygen XML Web Author? Got a bug to report? Post it all here.
-
- Posts: 240
- Joined: Wed Jun 17, 2015 12:46 pm
Actions at the top of the content completion list
Hello,
We are using Author web 25.1 version.
We add some actions in the contentCompletion menu with this configuration in the framework file:
It works but is it possible to get some actions always at the top of the content completion list?
Thanks for your help,
Johann
We are using Author web 25.1 version.
We add some actions in the contentCompletion menu with this configuration in the framework file:
Code: Select all
<field name="contextualItems">
<contextProvider>
<field name="items">
<contextItem-array>
<contextItem>
<field name="targets">
<list>
<Integer>0</Integer>
</list>
</field>
<field name="actionID">
<String>my.action</String>
</field>
<field name="alias">
<String>My alias</String>
</field>
<field name="replacementFor">
<null/>
</field>
<field name="replacedElementNs">
<String/>
</field>
<field name="displayOnlyWhenElementAllowed">
<Boolean>false</Boolean>
</field>
<field name="useReplaceElementName">
<Boolean>false</Boolean>
</field>
</contextItem>
</contextItem-array>
</field>
<field name="removeItems">
<null/>
</field>
</contextProvider>
</field>
Thanks for your help,
Johann
-
- Posts: 517
- Joined: Thu Sep 04, 2014 4:22 pm
Re: Actions at the top of the content completion list
Post by cristi_talau »
Hello,
You can customize the order of the elements presented by the Content Completion Assistant by increasing their priority values. To do this, you should implement the methods exposed in the ContentCompletionSortPriorityAssigner API: https://www.oxygenxml.com/InstData/Edit ... igner.html .
Best,
Cristian
You can customize the order of the elements presented by the Content Completion Assistant by increasing their priority values. To do this, you should implement the methods exposed in the ContentCompletionSortPriorityAssigner API: https://www.oxygenxml.com/InstData/Edit ... igner.html .
Best,
Cristian
-
- Posts: 240
- Joined: Wed Jun 17, 2015 12:46 pm
Re: Actions at the top of the content completion list
Hello Cristian,
Thanks for you reply.
I do not see where to declare the implementation of the ContentCompletionSortPriorityAssigner class.
Can you give me an example?
Regards,
Johann
Thanks for you reply.
I do not see where to declare the implementation of the ContentCompletionSortPriorityAssigner class.
Can you give me an example?
Regards,
Johann
-
- Site Admin
- Posts: 172
- Joined: Tue Mar 20, 2018 5:28 pm
Re: Actions at the top of the content completion list
Post by Bogdan Dumitru »
Hello Johann,
The ContentCompletionSortPriorityAssigner instance can be returned from a WebappExtensionsProvider implementation, by implementing the WebappExtensionsProvider.getSortPriorityAssigner method.
The WebappExtensionsProvider instance can be returned from an ExtensionsBundle implementation, by implementing the ExtensionsBundle.getWebappExtensionsProvier method.
For the ExtensionsBundle implementation, you might find useful this sample project
The ContentCompletionSortPriorityAssigner instance can be returned from a WebappExtensionsProvider implementation, by implementing the WebappExtensionsProvider.getSortPriorityAssigner method.
The WebappExtensionsProvider instance can be returned from an ExtensionsBundle implementation, by implementing the ExtensionsBundle.getWebappExtensionsProvier method.
For the ExtensionsBundle implementation, you might find useful this sample project
Bogdan Dumitru
http://www.oxygenxml.com
http://www.oxygenxml.com
-
- Posts: 240
- Joined: Wed Jun 17, 2015 12:46 pm
Re: Actions at the top of the content completion list
Hello,
I managed to implement the needed classes.
But, when I log all the CCItemProxy ccItems in the getImposedSortPriority method, it never displays my action.
However, I do see it well in the contentCompletion menu.
Is it due to the way my action is created?
It is both present on the framework side:
But also defined on the js side:
Thank you,
Johann
I managed to implement the needed classes.
But, when I log all the CCItemProxy ccItems in the getImposedSortPriority method, it never displays my action.
However, I do see it well in the contentCompletion menu.
Is it due to the way my action is created?
It is both present on the framework side:
Code: Select all
<field name="actionDescriptors">
<action-array>
<action>
<field name="id">
<String>angular-media-insert.action</String>
</field>
<field name="name">
<String>Insert media</String>
</field>
<field name="description">
<String>Open a modal</String>
</field>
<field name="largeIconPath">
<String>${framework}/images/Image24.png</String>
</field>
<field name="smallIconPath">
<String>${framework}/images/Image16.png</String>
</field>
<field name="accessKey">
<String/>
</field>
<field name="accelerator">
<null/>
</field>
<field name="actionModes">
<actionMode-array>
<actionMode>
<field name="xpathCondition">
<String>oxy:allows-global-element()</String>
</field>
<field name="argValues">
<serializableOrderedMap/>
</field>
<field name="operationID">
<String/>
</field>
</actionMode>
</actionMode-array>
</field>
<field name="enabledInReadOnlyContext">
<Boolean>false</Boolean>
</field>
</action>
</action-array>
</field>
Code: Select all
<field name="contextualItems">
<contextProvider>
<field name="items">
<contextItem-array>
<contextItem>
<field name="targets">
<list>
<Integer>0</Integer>
</list>
</field>
<field name="actionID">
<String>angular-media-insert.action</String>
</field>
<field name="alias">
<null/>
</field>
<field name="replacementFor">
<null/>
</field>
<field name="replacedElementNs">
<String/>
</field>
<field name="displayOnlyWhenElementAllowed">
<Boolean>false</Boolean>
</field>
<field name="useReplaceElementName">
<Boolean>false</Boolean>
</field>
</contextItem>
</contextItem-array>
</field>
<field name="removeItems">
<null/>
</field>
</contextProvider>
</field>
Code: Select all
goog.events.listen(workspace, sync.api.Workspace.EventType.EDITOR_LOADED, function (e) {
let currentEditor = e.editor;
let actionId = 'angular-media-insert.action';
currentEditor.getActionsManager().registerAction(actionId, new IllusListingAction(currentEditor));
});
Johann
-
- Site Admin
- Posts: 172
- Joined: Tue Mar 20, 2018 5:28 pm
Re: Actions at the top of the content completion list
Post by Bogdan Dumitru »
Hello Johann,
The ContentCompletionSortPriorityAssigner API works only for elements, see the JavaDoc: "Extension that can be used to assign sorting priorities for elements". Unfortunately, actions like yours that do not replace elements from content completion aren't affected by this API. Try replacing an element from content completion with this action.
The ContentCompletionSortPriorityAssigner API works only for elements, see the JavaDoc: "Extension that can be used to assign sorting priorities for elements". Unfortunately, actions like yours that do not replace elements from content completion aren't affected by this API. Try replacing an element from content completion with this action.
Bogdan Dumitru
http://www.oxygenxml.com
http://www.oxygenxml.com
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