cancel
Showing results for 
Search instead for 
Did you mean: 

CIFS issue with creation date

bjoern
Champ in-the-making
Champ in-the-making
Hi,
when copying files to alfrescos cifs drive, the files creation- and last-change-dates are set to exactly the time of copying them to alfresco.
What can I do that theses dates are kept the original ones of the files, while moving files into alfresco ?
Does anyone have an idea?
Cheers
Bjoern
7 REPLIES 7

dinger
Champ in-the-making
Champ in-the-making
I'm not sure exactly what you mean but you can get Alfresco to respect the creation and modified date on word documents by modifying the extractor overwrite rules:
http://wiki.alfresco.com/wiki/Metadata_Extraction

Rob

bjoern
Champ in-the-making
Champ in-the-making
Hi,

thank you for the Link.

The Problem in Detail:

I have an old (8 May 2008 21:05) MS Word Doc on my workstation which I add with the webclient to my space in alfresco…

doing this (at 9 May 2008 12:33) it tells me afterwards in the propertiesview that:
  Created Date:  9 May 2008 12:33
  Modified Date: 9 May 2008 12:33

I would expect it to say:
  Created Date:  8 May 2008 21:05
  Modified Date: 8 May 2008 21:05


the default office extractor: http://dev.alfresco.com/resource/docs/java/repository/org/alfresco/repo/content/metadata/OfficeMetad...
is said to be setting:
   createDateTime:     –      cm:created
   lastSaveDateTime:   –      cm:modified

…and that is set in "content-services-context.xml" under "/opt/alfresco/tomcat/webapps/alfresco/WEB-INF/classes/alfresco"


<!– Content Metadata Extracters –>
<bean id="extracter.Office" class="org.alfresco.repo.content.metadata.OfficeMetadataExtracter" parent="baseMetadataExtracter" />


does that have something to do with the DateParser (http://wiki.alfresco.com/wiki/Metadata_Extraction#Date_Conversions_.28V2.1.2E.29) ?

or is there something else I am missing out on?

Cheers Björn

dinger
Champ in-the-making
Champ in-the-making
Right, you need to add in a property to that bean definition setting the overwrite policy to EAGER.

We have something like:

<bean id="extracter.Office" class="org.alfresco.repo.content.metadata.OfficeMetadataExtracter" parent="baseMetadataExtracter" >
      <property name="inheritDefaultMapping">
               <value>true</value>
        </property>
      <property name="overwritePolicy">
         <value>EAGER</value>
      </property>
      <property name="mappingProperties">
            <props>
                <prop key="namespace.prefix.cm">http://www.alfresco.org/model/content/1.0</prop>
                <prop key="createDataTime">cm:created</prop>
            </props>
        </property>
    </bean>


See this page:
http://wiki.alfresco.com/wiki/Metadata_Extraction#Overwrite_Policies

Rob

bjoern
Champ in-the-making
Champ in-the-making
Hi,
unfortunatly all that did not help.
If I add a document that was created a long time ago alfresco still sets the "created" to the minute I added it to the repo.
Does anyone know how to make it use the creation date from the file ?
Cheers Björn

dinger
Champ in-the-making
Champ in-the-making
You need to create a rule that updates the metadata when a new document is added…

Rob

sacco
Champ in-the-making
Champ in-the-making
To be frank, the real problem is that much of the metadata maintained by Alfresco
is primarily useful for Alfreco's own book-keeping and nothing else really.

For example, the decision to implement even basic services such as locking using
aspects on nodes means that the modified date maintained by Alfresco will never
be any use at all to anybody.  Lock a Node (e.g. by creating a working copy) and
then release the lock and the system considers that you have 'modified' the node.

Actually the situation is worse: it's impossible to know the real modification time of
any node on the system when you are trying to decide whether, for instance, it is
synchronised with another node.  The normal way to do this would be to lock the
node and then check its modification time (because otherwise it could be modified
between being checked and being locked for any subsequent operation).  In Alfresco,
however, the modified time would now be the just time that you locked the node!
In summary, the 'modified' property is pretty much useless for for anything you might
consider doing with it. 
This can be somewhat alleviated by careful use of transactions,
but this probably requires deeper involvement with the source code than most people
using or customising the system would want.  At the level of, say, JavaScript, one
simply has to hope that operations are wrapped in a transaction which prevents
anything unwanted occurring, but there doesn't appear to be a public spec (other
than the source code) for how this is done, so itnis in any case rather difficult to
be sure what is your 'contract' with the repository as regards asynchronous changes.

It's rather disappointing that Alfresco provides, in this respect, effectively no
support at all to normal operations: different filesystems do vary in the types
of access and modification events whose datestamps they record in a file's metadata,
but imagine trying to use a filesystem which effectively records none of these.

matteo_grolla
Champ in-the-making
Champ in-the-making
Can anyone answer to the question reformulated in this way: "Is there a way for alfresco to use the creation date of a file present on the filesystem of the client from which the file is uploaded".
That is not reading the creation date from the document once it is uploaded in alfresco, since some documents might not have metadata to read, but taking the creation date from the computer from which the document is uploaded, which could work even for documents that do not have metadata.
Is this impossible because the creation date of the client filesystem is not passed to alfresco, at least not with all the protocols that you can use to upload documents to alfresco?
I havent been able to find an answer to this question and I think many others would appreciate it
Thanks

Matteo