cancel
Showing results for 
Search instead for 
Did you mean: 

How to change creator,created,modifier,modified details

rajshekar
Champ in-the-making
Champ in-the-making
Hi,

I am Using Alfresco 3.2r2 and
i need to change when a documents and folders are migrated from older version to new one(2.1 to 3.2r2).
the documents and folders seems to be showing present date so,it should show created date.
i need to change or edit it.
a)creator
b)created
c)modifier
d)modified

I need to change in Alfresco Explorer and Alfresco Share Also.
Can anyone provide solution,it will be help full so much.

Thanks in Advance.
Rajshekar.
5 REPLIES 5

savic_prvoslav
Champ on-the-rise
Champ on-the-rise
Well, you can create extension to edit all documents .

rajshekar
Champ in-the-making
Champ in-the-making
Hi

can you help out how to create extension to edit all documents.

Thanks in Advance,
Rajshekar.

savic_prvoslav
Champ on-the-rise
Champ on-the-rise
are you looking for java or script coding?

rajshekar
Champ in-the-making
Champ in-the-making
Yes i need the script,
actually what i did is:
tomcat\webapps\alfresco\WEB-INF\classes\alfresco\model\contentmodel.xml
<type name=”cm:cmobject”>
<title>Object</title>
<parent>sys:base</parent>
<properties>
<property name=”cm:name”>
<title>Name</title>
<type>d:text</type>
<mandatory enforced=”true”>true</mandatory>
<constraints>
<constraint ref=”cm:filename” />
</constraints>
</property>
<!–temporary added properties to go around auditable –>
<property name=”cm:created”>
<title>Created</title>
<type>d:datetime</type>
</property>
<property name=”cm:creator”>
<title>Creator</title>
<type>d:text</type>
</property>
<property name=”cm:modified”>
<title>Modified</title>
<type>d:datetime</type>
</property>
<property name=”cm:modifier”>
<title>Modifier</title>
<type>d:text</type>
</property>
<property name=”cm:accessed”>
<title>Accessed</title>
<type>d:datetime</type>
</property>
</properties>
<!—- Disable Auditable Aspect
<mandatory-aspects>
<aspect>cm:auditable</aspect>
</mandatory-aspects>
–>
</type>
Additionally, for convenience, it’s a good idea to not make these protected, or enforce them as being mandatory, as they are on the original Auditable aspect. As you can see, we commented out cm:auditable as mandatory aspect on this type, which means the code that sets these properties automatically will not get triggered.
Step 2 – Show Properties in the User Interface
The next step is cosmetic – we need to make these properties visible in our UI so it’s easier to test. For that, you will need to edit CONFIGROOT\ web-client-config-properties.xml. Add the auditable properties to “content” evaluator:
<config evaluator=”node-type” condition=”content”>
<property-sheet>
<show-property name=”creator” />
<show-property name=”created” />
<show-property name=”modifier” />
<show-property name=”modified” />
This will allow you to see these in the UI.
Step 3 – Set Properties, Migrate Content, Perform Bulk Load, etc.
After a server restart, you have now disabled the automatic setting of properties. You can either set them programmatically (and your changes will no longer get intercepted), or manually through the UI.

Edit Auditable properties
Note: This is an all or nothing operation – you can’t have it automatically set some properties but not others (to do it you’d have to do metadata extraction or some kind of event handler). This is why this is usually a temporary step as you are loading or migrating content.
After you are done with the content load, the next step is re-enable original model to ensure consistency. You also have a bunch of nodes that don’t have Auditable Aspect applied, so we need to reapply it.
Step 4 – Apply Auditable Aspect to Migrated Content
First, you need to revert to the original content model. To apply auditable aspect to many nodes, you typically write a JavaScript script that walks through the nodes and adds Auditable Aspect.
For applying Auditable aspect manually, you’ll have to add some code to CONFIGROOT\web-client-config.xml so it shows u in Add Aspect action.


config evaluator=”string-compare” condition=”Action Wizards”>

<!– and the has-aspect condition –>
<aspects>
<aspect name=”generalclassifiable”/>
<aspect name=”complianceable”/>
<aspect name=”dublincore”/>
<aspect name=”auditable”/>
<aspect name=”effectivity”/>
<aspect name=”summarizable”/>
<aspect name=”versionable”/>
<aspect name=”templatable”/>
<aspect name=”emailed”/>
<aspect name=”emailserver:aliasable”/>
<aspect name=”taggable”/>
</aspects>


i got successfully the view page of creator,modifier,created date etc but when am trying to change the date its taking the current date,i need to change the date to old ones

Thanks in advance,
Rajshekar

stefan776
Champ on-the-rise
Champ on-the-rise
In regards to the problem of the "cm:modified" property being automatically set to the current date:
During import, try populating cm:created with the the last-modified timestamp of your legacy content.
Then update the imported records in the "alf_node" table.
E.g.
UPDATE alf_node SET audit_modified = audit_created WHERE uuid IN (…)
Restart Alfresco afterwards.

The obvious downside is that the original created-on timestamp did not come through during import, but at least in my situation that was acceptable.

On a somewhat related note - I recommend checking out Peter Monks' Bulk importer extension for Alfresco when doing data migrations,
See http://code.google.com/p/alfresco-bulk-filesystem-import/

CAVEAT: ATM, you must apply this patch http://code.google.com/p/alfresco-bulk-filesystem-import/issues/detail?id=4#c11 to the code and build it from source in order for the bulk importer to pick up on provided cm:modifier, cm:creator and cm:created properties.