How to preserve original document create and modified date during upload

cancel
Showing results for 
Search instead for 
Did you mean: 
douglascrp
Advanced II

Re: How to preserve original docucment create and modified date during upload

Jump to solution

Hello.

Were you able to achieve this using the t-engine way of doing things?

abhinavmishra14
Advanced

Re: How to preserve original docucment create and modified date during upload

Jump to solution

This documentation seems talking about the steps. It is too confusing. 

https://docs.alfresco.com/content-services/latest/develop/repo-ext-points/metadata-extractors/

For one it is asking to extend the interface  to org.alfresco.repo.content.metadata.MetadataExtractorPropertyMappingOverride and include the bean here under metadataExtractorPropertyMappingOverrides:

 

<bean id="extractor.Asynchronous" class="org.alfresco.repo.content.metadata.AsynchronousExtractor" parent="baseMetadataExtracter">
      <property name="nodeService" ref="nodeService" />
      <property name="namespacePrefixResolver" ref="namespaceService" />
      <property name="transformerDebug" ref="transformerDebug" />
      <property name="renditionService2" ref="renditionService2" />
      <property name="renditionDefinitionRegistry2" ref="renditionDefinitionRegistry2" />
      <property name="contentService" ref="ContentService" />
      <property name="transactionService" ref="transactionService" />
      <property name="transformServiceRegistry" ref="transformServiceRegistry" />
      <property name="taggingService" ref="taggingService" />
      <property name="metadataExtractorPropertyMappingOverrides">
         <list>
             <ref bean="extracter.RFC822" /> <!-- The RM AMP overrides this bean, extending the base class -->
<ref bean="extracter.custom" />
         </list>
      </property>
   </bean>

I could however, get it to work only when i override this property file via custom image build : https://github.com/Alfresco/alfresco-transform-core/blob/master/engines/tika/src/main/resources/Tika... 

 

Ideally there should be a way to just configure here: https://github.com/Alfresco/alfresco-transform-core/blob/master/engines/tika/src/main/resources/tika... as something like:

 

{"extractMapping":{
   "author":["{http://www.xyz.org/model/customcontent/1.0}author"],
  },
 "timeout":20000,
 "sourceEncoding":"UTF-8"}

but its not clear per documentation as to how this can be done.

 

 

~Abhinav
(ACSCE, AWS SAA, Azure Admin)
douglascrp
Advanced II

Re: How to preserve original docucment create and modified date during upload

Jump to solution

Indeed, it isn't very clear.

I've tried creating a custom image, but it didn't work in my case.

Can you please share what and how you did it?

 

Thank you for taking the time to read this.

abhinavmishra14
Advanced

Re: How to preserve original docucment create and modified date during upload

Jump to solution

Yeah i just build the image using this: https://github.com/Alfresco/alfresco-transform-core/blob/master/engines/tika/Dockerfile

and added custom property here: https://github.com/Alfresco/alfresco-transform-core/blob/master/engines/tika/src/main/resources/Tika...

And then used the newly built image.

To test i changed 

author=demo:author

~Abhinav
(ACSCE, AWS SAA, Azure Admin)
angelborroy
Alfresco Employee

Re: How to preserve original docucment create and modified date during upload

Jump to solution

I have created an alternative deployment for Docker that allows apply this configuration.

Sample project available in https://github.com/aborroy/alfresco-custom-metadata-extractor

Hyland Developer Evangelist