cancel
Showing results for 
Search instead for 
Did you mean: 

Nuxeo-android-connector and custom schema

Artmoni_Mobile
Champ on-the-rise
Champ on-the-rise

Hi,

thanks a lot for this complex plateform, make it simpler to build them all.

I try to connect my android application with Nuxeo Plateform 5.6

I would like to retrieve my custom schema attribute and don't find how to do that.

		DocumentService rs = new DocumentService(session);
		DocRef wsRef = new DocRef("/default-domain/workspaces/mypublicws");
		docs = rs.getChildren(wsRef);
        for (Iterator iterator = docs.iterator(); iterator.hasNext();) {
			Document document = (Document) iterator.next();
			PropertyMap map = document.getProperties();
			
			Log.i("Public Hut", document.getTitle() + "--" + map.getString("vendorseed:datesowingmin"));
		}

The PropertyMap result does not contain my custom attributes even during debug phase.

THE QUESTION IS: How to get my custom schema properties (maybe called metadata ?).

nuxeo-android-connector version:

<dependency>
  <groupId>org.nuxeo.android</groupId>
  <artifactId>nuxeo-android-connector</artifactId>
  <version>2.0-SNAPSHOT</version>
</dependency>

Thanks in advance

1 ACCEPTED ANSWER

Julien_Carsique
Elite Collaborator
Elite Collaborator

Hi,

By default, only the minimal document properties are returned. You can ask for more mapped properties by specifying the wanted schemas in the header (or "*" to get all):

import org.nuxeo.ecm.automation.client.Constants;
import org.nuxeo.ecm.automation.client.adapters.DocumentService;
import org.nuxeo.ecm.automation.client.model.Documents;
Documents docs = (Documents) session.newRequest(DocumentService.GetDocumentChildren)
        .setInput(doc)
        .setHeader(Constants.HEADER_NX_SCHEMAS, "*").execute();

See org.nuxeo.ecm.automation.client.Constants.HEADER_NX_SCHEMAS.
/> Since 5.7, it is possible to change the default schemas for the whole session instead of per request, see org.nuxeo.ecm.automation.client.Session.setDefaultSchemas(String).

View answer in original post

2 REPLIES 2

Julien_Carsique
Elite Collaborator
Elite Collaborator

Hi,

By default, only the minimal document properties are returned. You can ask for more mapped properties by specifying the wanted schemas in the header (or "*" to get all):

import org.nuxeo.ecm.automation.client.Constants;
import org.nuxeo.ecm.automation.client.adapters.DocumentService;
import org.nuxeo.ecm.automation.client.model.Documents;
Documents docs = (Documents) session.newRequest(DocumentService.GetDocumentChildren)
        .setInput(doc)
        .setHeader(Constants.HEADER_NX_SCHEMAS, "*").execute();

See org.nuxeo.ecm.automation.client.Constants.HEADER_NX_SCHEMAS.
/> Since 5.7, it is possible to change the default schemas for the whole session instead of per request, see org.nuxeo.ecm.automation.client.Session.setDefaultSchemas(String).

Thanks a lot,

Getting started

Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.