Hi,
> On 9. Jun 2020, at 12:38, Dominik Spies <
domini...@qualicen.de> wrote:
>
> Could you give me some pointers, on what would be necessary for creating an additional API. As I've said in my first post I ran into the problem, that my requests got redirected to the login page. I assume there is some point in the code, where an exception for this redirection is added for the purpose of the AERO API.
Normally, you would add a new editor by extending the AnnotationEditorBase. In the editors that we use so far, when then use an AbstractDefaultAjaxBehavior to establish communication with the client-side JavaScript.
If you wanted to implement an annotation interface which completely hides the backend and only communicate with it via some REST API, you'd probably want to implement another Spring REST service similar to the AeroRemoteApiController which would provide finer-grained access. The new REST controller must also be configured with Spring Security so it can use e.g. HTTP basic authentication instead of form-based authentication.
If you do that, the recent changes to the CAS storage (CasStorageSession) will likely become crucial for you - i.e. that CAS objects can now be kept in memory and can be accessed via a pool which ensures that multiple concurrent threads cannot make simultaneous modifications. This is currently only available on the INCEpTION/WebAnno master branches.
We had done some work towards an annotation-oriented REST API in INCEpTION a while back, but didn't yet find the time to get back to it. The latest status is here:
https://github.com/inception-project/inception/blob/feature/700-Support-for-custom-annotation-UIs/inception-annotation-mvc/src/main/java/de/tudarmstadt/ukp/clarin/webanno/webapp/remoteapi/RemoteApiControllerRuita.java
This API is the output of a student project and - as I said - we didn't yet find the time to get back to it. One of the reasons was that the above mentioned CAS caching in memory was not there until a like 2 weeks ago.
Cheers,
-- Richard