Triggering auto completion plugin
-
- Posts: 3
- Joined: Wed Mar 25, 2020 8:53 pm
Triggering auto completion plugin
Hello to all,
I use the TEI-Completer plugin (https://github.com/BCDH/TEI-Completer) in Oxygen XML Editor 21.1. This plugin performs a http request to populate the content completion suggestions. It works without problems. As far as I can see it is invoked whenever the opening quotation marks of an attribute value are inserted in the editor. My question is: Does Oxygen trigger the content completion plugin only when the quotation marks are inserted or is it possible to configure / implement that on every keystroke the plugin is invoked and a request to the server made?
Thank you for your help!
All the best,
Thomas
I use the TEI-Completer plugin (https://github.com/BCDH/TEI-Completer) in Oxygen XML Editor 21.1. This plugin performs a http request to populate the content completion suggestions. It works without problems. As far as I can see it is invoked whenever the opening quotation marks of an attribute value are inserted in the editor. My question is: Does Oxygen trigger the content completion plugin only when the quotation marks are inserted or is it possible to configure / implement that on every keystroke the plugin is invoked and a request to the server made?
grafik.png
I confess, I do not understand the plugin code completely, so maybe my question is based on a wrong understanding, of how the process works.Thank you for your help!
All the best,
Thomas
You do not have the required permissions to view the files attached to this post.
-
- Posts: 3
- Joined: Wed Mar 25, 2020 8:53 pm
Re: Triggering auto completion plugin
I think I should clarify what I mean with "keystroke". When I enter for example "An" for the value of the attribute I want to make a request to the API which delivers all names starting with "An". The goal is to get a smaller result set which does consume less resources.
Thank you!
Thomas
Thank you!
Thomas
-
- Posts: 1016
- Joined: Wed Nov 16, 2005 11:11 am
Re: Triggering auto completion plugin
Post by alex_jitianu »
Hi Thomas,
I took a look at the plugin myself. It uses the SchemaManagerFilter API to contribute possible values for attributes. Oxygen will call this API whenever it requires the proposals for an attribute value, fir example when the user types the opening quote for an attribute value.
I assume the plugin takes awhile to retrieve all the values and as a result Oxygen freezes a bit, right? The plugin's implementation of this API is called TeiCompleter. The invoked method is filterAttributeValues() and it receives a {{WhatPossibleValuesHasAttributeContext}} object as a parameter. This object has a methods getCurrentValuePrefix() which would return any text already written by the user in the attribute's value. So if you type "An" inside the attribute value and then press Ctrl + Space when the caret is after "An", the previously mentioned method will return "An" and you can use it to retrieve just a subset from server.
At a glance, I don't see the plugin using this information for anything in getAutoCompleteSuggestions(), so it probably just gets all the values from the server.
You'll still have some cases in which all attributes will be retrieved, like for example when typing the starting quote of an attribute value.
Best regards,
Alex
I took a look at the plugin myself. It uses the SchemaManagerFilter API to contribute possible values for attributes. Oxygen will call this API whenever it requires the proposals for an attribute value, fir example when the user types the opening quote for an attribute value.
I assume the plugin takes awhile to retrieve all the values and as a result Oxygen freezes a bit, right? The plugin's implementation of this API is called TeiCompleter. The invoked method is filterAttributeValues() and it receives a {{WhatPossibleValuesHasAttributeContext}} object as a parameter. This object has a methods getCurrentValuePrefix() which would return any text already written by the user in the attribute's value. So if you type "An" inside the attribute value and then press Ctrl + Space when the caret is after "An", the previously mentioned method will return "An" and you can use it to retrieve just a subset from server.
At a glance, I don't see the plugin using this information for anything in getAutoCompleteSuggestions(), so it probably just gets all the values from the server.
You'll still have some cases in which all attributes will be retrieved, like for example when typing the starting quote of an attribute value.
Best regards,
Alex
-
- Posts: 3
- Joined: Wed Mar 25, 2020 8:53 pm
Re: Triggering auto completion plugin
Hello Alex,
thank you very much for your reply.
I completely agree that it makes no sense to search for data which is a subset of information already retrieved.
Thank you again for the given information and the spent time.
Sincerely,
Thomas
thank you very much for your reply.
I completely agree that it makes no sense to search for data which is a subset of information already retrieved.
Thank you again for the given information and the spent time.
Sincerely,
Thomas
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