Code Monkey home page Code Monkey logo

tei-completer's People

Contributors

adamretter avatar dependabot[bot] avatar marmoure avatar ttasovac avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tei-completer's Issues

"Search" button should clear the previous results

At the moment, when the user clicks on the "search" button in the Custom lookups window, the results are added to the results that have been previously displayed by autosuggest.

Please change this so that the search button will clear the previous results on click, before displaying the results of its own search action.

Custom lookup option missing on matched selection

At the moment, the Completer will not display a "Custom entry" link if the api returned results.

This is not ideal because there could be cases where the matched selection is wrong, and the user would like to perform a manual search with a different string.

Would you be able to change this to include a custom lookup link on every autocomplete?

request url can't handle whitespaces

Hello. I have an issue with the request url when there is a whitespace in the selection input. I hope someone can help!

My config:

<?xml version="1.0" encoding="UTF-8"?>
<config xmlns="http://humanistika.org/ns/tei-completer">
    <server>
        <baseUrl>https://my-endpoint-url</baseUrl>
    </server>
    <autoComplete>
        <context>//rs</context>
        <attribute>@ref</attribute>
        <dependent default="person">@type</dependent>
        <selection>@n</selection>
        <request>
            <url>$baseUrl/$dependent/?q=$selection</url>
        </request>
    </autoComplete>
</config>

Example repsonse url (does not work):

https://my-endpoint-url/dependent/?q=input string

if the "input string" contains a whitespace I receive this error:

14:24:57.894 [AWT-EventQueue-0] ERROR org.humanistika.oxygen.tei.completer.remote.impl.JerseyClient - Illegal character in query at index 76: https://my-endpoint-url/dependent/?q=input string
java.net.URISyntaxException: Illegal character in query at index 76: https://my-endpoint-url/dependent/?q=input string

Example response url (works):
https://my-endpoint-url/dependent/?q=input%20string
If I manually add the unicode for whitespaces it works.

Is there a way to pre-transform the input in the config?
Or can you fix this in your client?

Custom entry lookup searches across multiple contexts

If the configuration file has multiple autocomplete contexts, like this:

     <autoComplete>
        <context>//w</context>
        <attribute>@lemma</attribute>
        <selection>./text()</selection>
        <request>
            <url>$baseUrl/forms/$selection</url>
        </request>
        <response>
            <transformation>getLemmaOutput.js</transformation>
        </response>
    </autoComplete>
    <autoComplete>
        <context>//rs[@type='place']</context>
        <attribute>@corresp</attribute>  
        <selection>./text()</selection>
        <request>
            <url>$baseUrl/entities/places/$selection</url>
        </request>
        <response>
            <transformation>getPlaceOutput.js</transformation>
        </response>
    </autoComplete>

the custom lookup will not always respect the context from which it was called.

Let's say the user calls up a custom look from <w> and tries to autocomplete on @lemma. Then:

  • if the user simply types in the look up window, relying on autocomplete, the lookup will actually use both (or probably all, if there are more than two) URLs from the configuration table:

    In the above screenshot, the first two results are from $baseUrl/forms/$selection and the second two results are from $baseUrl/entities/places/$customLookup
  • when the user clicks on the search button, the right call is made ($baseUrl/forms/$customLookup), but see also #17

Please make sure that the custom lookups only use the one lookup url for the given context.

Placeholder attribute required for autocomplete query

My config:

<?xml version="1.0" encoding="UTF-8"?>
<config xmlns="http://humanistika.org/ns/tei-completer">
    <server>
        <baseUrl>https://some-endoint</baseUrl>
    </server>
    <autoComplete>
        <context>//rs</context>
        <attribute>@ref</attribute>
        <dependent default="person">@type</dependent>
        <selection>@n</selection>
        <request>
            <url>$baseUrl/$dependent?q=$selection</url>
        </request>
    </autoComplete>
</config>

In this example selection uses @n as placeholder for the search query.
The text() method usually does not apply since the text varies from the required search query.
The initial plan was to use @ref for the query in selection with the desired outcome that I can overwrite @ref value with autocomplete proposals. Unfortunately this does not work.

Is there another way besides using text() or a placeholder attribute?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.