import org.collectionspace.services.common.document.DocumentUtils;\r
import org.collectionspace.services.common.document.DocumentWrapper;\r
import org.collectionspace.services.common.repository.RepositoryClient;\r
+import org.collectionspace.services.nuxeo.client.java.DocHandlerBase;\r
import org.collectionspace.services.nuxeo.client.java.RepositoryJavaClientImpl;\r
import org.collectionspace.services.common.service.ServiceBindingType;\r
import org.collectionspace.services.jaxb.AbstractCommonList;\r
String csid = NuxeoUtils.getCsid(docModel);//NuxeoUtils.extractId(docModel.getPathAsString());\r
ilistItem.setDocId(csid);\r
ilistItem.setUri(serviceContextPath + csid);\r
+ try {\r
+ ilistItem.setUpdatedAt(DocHandlerBase.getUpdatedAtAsString(docModel));\r
+ } catch(Exception e) {\r
+ logger.error("Error getting udpatedAt value for doc ["+csid+"]: "+e.getLocalizedMessage());\r
+ }\r
// The id and URI are the same on all doctypes\r
ilistItem.setDocType(docType);\r
ilistItem.setDocNumber(\r
return commonList;\r
}\r
\r
+ public static String getUpdatedAtAsString(DocumentModel docModel) throws Exception {\r
+ GregorianCalendar cal = (GregorianCalendar)\r
+ docModel.getProperty(COLLECTIONSPACE_CORE_SCHEMA,\r
+ COLLECTIONSPACE_CORE_UPDATED_AT);\r
+ String updatedAt = DateTimeFormatUtils.formatAsISO8601Timestamp(cal);\r
+ return updatedAt;\r
+ }\r
+\r
@Override\r
public AbstractCommonList extractCommonPartList(DocumentWrapper<DocumentModelList> wrapDoc) throws Exception {\r
String classname = getDocHandlerParams().getAbstractCommonListClassname();\r
item.put(fields[0], id);\r
String uri = getUri(docModel);\r
item.put(fields[1], uri);\r
- GregorianCalendar cal = (GregorianCalendar)\r
- docModel.getProperty(COLLECTIONSPACE_CORE_SCHEMA,\r
- COLLECTIONSPACE_CORE_UPDATED_AT);\r
- String updatedAt = DateTimeFormatUtils.formatAsISO8601Timestamp(cal);\r
- item.put(fields[2], updatedAt);\r
+ item.put(fields[2], getUpdatedAtAsString(docModel));\r
\r
for (ListResultField field : resultsFields ){\r
String schema = field.getSchema();\r
<xs:element name="docName" type="xs:string" minOccurs="0" />
<xs:element name="sourceField" type="xs:string" minOccurs="1" />
<xs:element name="uri" type="xs:anyURI" minOccurs="1" />
+ <xs:element name="updatedAt" type="xs:string" minOccurs="1" />
</xs:sequence>
</xs:complexType>
</xs:element>