01-26-2017 11:29 PM
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.
02-03-2017 12:50 AM
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 .
05-12-2026 06:12 PM
Try
if (doc.getProperty(key).isSecured()) {
try (NuxeoLoginContext ignored = Framework.loginUser("Administrator")) {
log.debug("Is secured " + key);
doc.setPropertyValue(key, (Serializable) fieldValue);
}
} else {
doc.setPropertyValue(key, (Serializable) fieldValue);
}
session.importDocuments(Collections.singletonList(docToCreate));05-13-2026 04:46 AM
You don't have to disable Dublin Core listeners for the whole application using a contribution. You can temporarily disable the listeners when processing one specific document in backend code if that is what you want. Then save your document. Like this:
doc.putContextData(DISABLE_DUBLINCORE_LISTENER, Boolean.TRUE);Search Nuxeos source code for DISABLE_DUBLINCORE_LISTENER if you want examples.
Attention: Blogs & Forums are in READ-ONLY mode from Oct 9-19 as we transition to our new platform. Learn more.
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.