cancel
Showing results for 
Search instead for 
Did you mean: 

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

prasadbirje
Champ in-the-making
Champ in-the-making
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?
4 REPLIES 4

prasadbirje
Champ in-the-making
Champ in-the-making
Does Alfresco has two seperate models one for CMIS and the other Content Model which is used by Alfresco exploer application?

Can somebody from Alfresco throw light on this issue?

Well it seems to be the normal behavior as when you are converting document you are actually creating the new document and when you create the document by using alfresco services it set the creation date and modification date automatically you cannot manipulate those properties.
So, if you want to keep track of those you can create one more aspect like "OriginalDetail" with properties like "OriginalCreationDate" something like that and during conversion copy the creation date from old doc to new one.

Hi Mits,

Thanks for the response.

In my case I was able to change the Creation Date and Modification Date properties of Document by disabling the Auditable aspect. I am also able to see these being reflected in Alfresco explorer application.

The problem is when I use CMIS api to retrieve the document, it doesn't return the Creation Date and Modification Date as seen in Alfresco explorer application.

Yes, using the Custom Aspect would be my last option to resolve this issue. However I am unable to find why the CMIS api doesn't return the same dates as that of the Alfresco explorer web application.

andy
Champ on-the-rise
Champ on-the-rise
Hi

The two are in sync - there is only one place where this information is stored.


Andy