How to import data into Nuxeo and keep original dc:creator, dc:created, dc:modified, dc:lastContributor from former application

I am migrating content from an existing application into Nuxeo. We are replacing our existing workflow solution by Nuxeo.

I need to keep the dc:creator, dc:created, dc:modified, dc:lastContributor fields with the former application values. I know they are internal fields maintained from DublinCore.

I saw another thread where the suggestion was using a custom field, but that doesn't seem a great idea moving forward. I'd need to maintain those fields manually. I want to rely on Nuxeo core to keep the fields up-to-date for every new created/updated document.

Even though dc:creator, dc:created are dc fields I managed to change their values with an update call after the document has been created.

What are the alternatives to update dc:modified, dc:lastContributor ?

How can I use an Admin user to act on behalf of another user?

The import script will run only once so I don't mind about a few hacks.

2 votes

1 answers

2659 views

ANSWER



Half way there.

With Michael Gena help I managed to get in a good point

It's possible to disable DublinCore using Nuxeo Studio adding this extension

<extension point="listener" target="org.nuxeo.ecm.core.event.EventServiceComponent">  
    <listener enabled="false" async="false" class="org.nuxeo.ecm.platform.dublincore.listener.DublinCoreListener" name="dclistener" postCommit="false" priority="120">  
        <event>documentCreated</event>  
        <event>beforeDocumentModification</event>  
        <event>documentPublished</event>  
        <event>lifecycle_transition_event</event>  
        <event>documentCreatedByCopy</event>  
    </listener>  
</extension>

Note enabled=“false”

The problem with this solution is that it requires an additional deploy to enable DC again.

I wonder if there is a API call that we can use in order to disable and enable DC .

0 votes