1 package org.collectionspace.services.nuxeo.elasticsearch.anthro;
5 import org.codehaus.jackson.node.ObjectNode;
7 import org.collectionspace.services.nuxeo.elasticsearch.DefaultESDocumentWriter;
8 import org.nuxeo.ecm.core.api.DocumentModel;
10 public class AnthroESDocumentWriter extends DefaultESDocumentWriter {
13 public ObjectNode getDenormValues(DocumentModel doc) {
14 ObjectNode denormValues = super.getDenormValues(doc);
15 String docType = doc.getType();
17 if (docType.startsWith("CollectionObject")) {
18 // Create a list of collection years from the field collection date structured date.
20 Map<String, Object> fieldCollectionDateGroup = (Map<String, Object>) doc.getProperty("collectionobjects_common", "fieldCollectionDateGroup");
22 denormValues.putArray("collectionYears").addAll(structDateToYearNodes(fieldCollectionDateGroup));