Home > Blog > [Q&A Friday] How to Retrieve Custom Metadata with Content Automation

[Q&A Friday] How to Retrieve Custom Metadata with Content Automation

How to retrieve custom metadata with Content Automation

How to retrieve custom metadata with Content Automation

Here’s a question that comes up often: When you retrieve a document using content automation, how do you retrieve custom metadata? This question comes up often mostly because content automation is the preferred way of interacting with Nuxeo from another application. People use it on mobile, directly from Javascript, from another Java app, the PHP client, the python client (Nuxeo Drive is a good example of that), etc.

Now back to the question, how do you retrieve other metadata? The question was about the Android connector but it applies to content automation. The short answer: We have special headers. Here’s the definition straight from the documentation:

This header can be used whenever a document will be returned by the server. The header is forcing the server to fill the returned document up with data from schemas that match the X-NXDocumentProperties filter. So, X-NXDocumentProperties is a filter of schemas. If you don’t use the header, only the minimum amount of required document properties are returned. To have more properties in the returned document, you can specify a list of document schema names:

X-NXDocumentProperties: dublincore, file

or to have all the document content, you can use the ‘*’ character as the filter value:

X-NXDocumentProperties: *

If you are not familiar with Nuxeo, schemas are used to define lists of metadata.

This is intended for developers who build their own requests. If you’re using a content automation client, there’s a good chance this is already part of the client API. Here’s an example with the Java client:

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)
.setHeader(Constants.HEADER_NX_SCHEMAS, "*").execute();

Start a Free Trial of Nuxeo
Request a
of the
Nuxeo Platform
  • http://www.cuclapita.com see this

    I simply want to say I am just newbie to weblog and honestly liked this blog. Most likely I’m likely to bookmark your blog post . You really come with remarkable article content. With thanks for sharing your website page.

  • http://www.wordsofalan.com have a peek at this website
  • http://xxxkylierose.com get redirected here
  • http://www.albumsexo.com/12/marco-banderas-penetrando-a-bibian-norai/ go to info
  • http://www.hot-porn-site.com check
  • http://www.pornoizle9.com/16/pija-amateur-quiere-follar-duro/ click to read

    I simply want to tell you that I am just beginner to blogging and certainly liked you’re page. Probably I’m planning to bookmark your blog post . You absolutely come with fantastic writings. Many thanks for revealing your web page.

  • http://jjj Colby Hapeman

    Opinie wyszukane na http://ogloszenia-lubelskie.pl