cancel
Showing results for 
Search instead for 
Did you mean: 

How to keep original file creation date

marc1911
Champ in-the-making
Champ in-the-making
Hi there,

When I upload a Word document through the Webclient- or CIFS interface, the original creation date of my file changes automatically to the date of today. This is not what I anticipated. Is there any way to keep the original file date when (bulk) uploading? I need to upload financial documents from last year. If I continue the process it looks that all these documents are from july 2007 and this is really not what we want.

Regards,

Marc
54 REPLIES 54

derek
Star Contributor
Star Contributor
Hi,

The default behaviour of the system is not to look into contents of the files.  The various interfaces don't keep the original date present on the client.

If you are using the zip upload mechanism, then that can be modified to use the details of the files as they come out of the zip.  This is an enhancement request, ofcourse.

The documents you are uploading may have the creation date stored within them.  This is common to most document formats.  You can set up a rule to "Extract Common Metadata", modify the overwritePolicy properties on the extractors responsible for those document types and reapply the rule after the import.  You could also do the import with the rule in place and so extract the creation date from the document itself.

Regards

tschiller
Champ in-the-making
Champ in-the-making
How exactly is this done? Sorry, I'm new to alfresco and don't understand how to "modify the overwritePolicy properties on the extractors responsible for those document types and reapply the rule after the import." (Although I do know how to set up a rule to "Extract Common Metadata"!)

Help/directions are always appreciated! Thanks 🙂

-Tamar

derek
Star Contributor
Star Contributor
Hi,

    You need to know how to override bean definitions: Wiki Repository Configuration.
    Then take a look at the metadata extractors defined in tomcat/webapps/alfresco/content-services-context.xml.
    Familiarise yourself with the configuration options available on these classes: JavaDocs for base class of extractors.
    Then override the extractors as required and set the overwritePolicy as desired.
A basic overview of the extractors is available on the Wiki.

Once you've tested the extractors out to ensure that they are working as required, you can reapply the rules from the UI in the "Manage Content Rules" dialog.

tschiller
Champ in-the-making
Champ in-the-making
Ok, I've read the wikis and think I understand what's going on. First, I realized I needed to install OpenOffice, so I did that. Then, and let me know if this is not correct, but I thought what the Metadata Extraction wiki was asking me to do is copy the sample file <extension-samples>/alfresco/extension/custom-metadata-extractors-context.xml.sample to <extension-samples>/alfresco/extension/custom-metadata-extractors-context.xml to activate metadata extraction on my server. Did that, restarted the server. In the wiki it doesn't say that I need to change the custom-repository-context.xml file– is that correct?

So I've done all these changes, but when I import the files (through CIFS) the creation date is still today's date/time. What am I doing wrong?

Another possible problem is that in the space I'm trying to import the files into, it says there are (0) rules being applied to the space (even though I created the rule at the Company Home space, of which my current upload space is a subspace, and applied that rule to all subspaces), but when I go to More Actions->Manage Content Rules in that same current upload space my rule is there, though I can't click on it. What does this mean?

-Tamar

derek
Star Contributor
Star Contributor
That's just one sample of how to modify an existing extractor.  You need to modify the extractor definitions by setting the appropriate properties.  Are you uploading to WCM or the normal document management Spaces Store?

tschiller
Champ in-the-making
Champ in-the-making
Uploading via CIFS to the normal DM spaces store.

Modify the extractor definitions by setting the appropriate properties in the custom-metadata-extractors-context.xml file? All I really want is what is shown in the Wiki: creationDate, creator, description, and title, which the Wiki says will be populated by the extractor by default. That's all I'm looking to do, nothing custom at this point.

derek
Star Contributor
Star Contributor
That sample file only changes one extractor, just as an example: extracter.OpenDocument.  Post your version of the file.  What types of files are you uploading?

tschiller
Champ in-the-making
Champ in-the-making
Ok, I think I see what you're saying. Here is my custom-metadata-extractors-context.xml file:

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>

<!–
       This sample show how to modify the mappings properties of the new V2.1 Metadata Extractors.
       In this example, in addition to the default mappings, the field 'user1' is mapped to
       'cm:description'.  The available source properties is described on the Javadocs of the
       extracter class.
–>
<beans>

    <bean id="extracter.OpenDocument" class="org.alfresco.repo.content.metadata.OpenDocumentMetadataExtracter" parent="baseMetadataExtracter" >
        <property name="inheritDefaultMapping">
            <value>true</value>
        </property>
        <property name="mappingProperties">
            <props>
                <prop key="namespace.prefix.cm">http://www.alfresco.org/model/content/1.0</prop>
                <prop key="user1">cm:description</prop>
            </props>
        </property>
    </bean>

</beans>

I see that, you are correct, the extractor is only getting the description field. Ahh… I see now- this an example for a custom metadata extractor, which is not really what I need. (Sorry- I've been out of the compsci world for a few years now and though I can read the code, it's not as easy to figure out exactly what's going on as when I was programming every day!)

I am uploading mainly MS Office documents. I see that in the Metadata Extractor wiki that there seems to be an extractor for Office metadata: "org.alfresco.repo.content.metadata.OfficeMetadataExtracter". If that is what I need, how do I get the system to load that?

Thank you for all your help!

derek
Star Contributor
Star Contributor
Hi,

It is an example of overriding one of the built-in extractors.  They are all defined in content-services-context.xml and can be overridden at will.

Regards