AnsweredAssumed Answered

Creation Date and Modification Date fetched using CMIS api doesn't match with the dates displayed in Alfresco web application

Question asked by prasadbirje on Jan 28, 2013
Latest reply on Feb 1, 2013 by prasadbirje
Hi,

I have written a custom utility for Document Conversion. In the utility I preserve the Document Creation Date and Last Modification date by disabling the Audit Aspect as shown below:

        UserTransaction tx = transactionService.getUserTransaction();
        tx.begin();
        behaviourFilter.disableBehaviour(ContentModel.ASPECT_AUDITABLE);
        NodeRef node = new NodeRef(document.getId());
        internalNodeService.setProperty(node, ContentModel.PROP_CREATED, creationDate);
        internalNodeService.setProperty(node, ContentModel.PROP_MODIFIED, lastModificationDate);
        behaviourFilter.enableBehaviour(ContentModel.ASPECT_AUDITABLE);
        tx.commit();

When I access the Alfresco web application (http://localhost:8080/alfresco), I can see the Creation and Last Modification dates are set correctly. However when I retrieve the Document using CMIS api, the Creation and Last Modification Date doesn't match with the dates displayed in Alfresco web application. E.g. The Creation Date and Last Modification Dates are displayed as '17-Feb-2010' in Alfresco web application whereas the CMIS object displays these dates as '27-Jan-2013' that's the date when the conversion utility was executed.

How can I get the correct Creation and Last Modification Date using CMIS api?

Outcomes