[REST API] How to overwrite a webobject
Hi There,
I'm currently working on fixing the multi-tenant/LDAP issues. I did find a issue in the REST API and I want to fix this.
Is it possible to overwrite a webobject (in my case: UserRootObject.java) in Nuxeo?
Thanks in advance, Bauke Roo
0 votes
0 answers
2108 views
Can we have your feedback about this issue? Maybe we can create a JIRA for the Nuxeo team.
I think to override your WebObject you have to create a 'fragment' (there is an example in https://github.com/nuxeo/nuxeo/tree/master/nuxeo-features/nuxeo-webengine-features)
Sure: I'm using Nuxeo 5.8 with LDAP + multi-tenant plugins. When searching for users in widgets or API also users from other tenants are found and displayed.
So far I've managed to fix :
Currently I'm looking into a fix for the REST API which still returns users from other tenants. I think that I need to overwrite the class: "UserRootObject" to do this.
However I haven't been able to do so yet.
I've created a new class:
package org.nuxeo.capgemini.jaxrs;
@WebObject(type = "users") @Produces({ MediaType.APPLICATION_JSON,
public class LDAPMultiTenantUserRootObject extends UserRootObject
But I don't know how the UserRootObject class should be ignored and my class should take it's place.
Did you mean by creating a fragment this line in the Manifest file: Nuxeo-WebModule: org.nuxeo.ecm.restapi.server.jaxrs.APIModule;name=api-extended;extends=api;package=org/nuxeo/capgemini/jaxrs;headless=true
I still don't understand why you have fixed "UserGroup.Suggestion" and you're trying to fix "UserRootObject".
What were your issues?
Can you please share the code which could be used for a similar issue like the one above.
Thanks in advance, Kartik