set the creation date/modification date on resource installation
----------------------------------------------------------------

                 Key: MGNLRES-31
                 URL: http://jira.magnolia-cms.com/browse/MGNLRES-31
             Project: Magnolia Resources Module
          Issue Type: Bug
    Affects Versions: 1.4
            Reporter: Philipp Bärfuss
            Assignee: Federico Grilli


In MGNLRES-30 the update of the creation date was not committed. This has to be 
fixed. We should problably also set a creation date on the files which have no 
such date yet (in an update task)

The patch:
{code}
Index: InstallResourceTask.java
===================================================================
--- InstallResourceTask.java    (revision 39888)
+++ InstallResourceTask.java    (working copy)
@@ -99,6 +99,12 @@
             name = StringUtils.replace(name, ".", "-");
             Content node = ContentUtil.getOrCreateContent(parent, name, 
ItemType.CONTENT);
             node.getMetaData().setTemplate(template);
+            if(node.getMetaData().getCreationDate() == null){
+                node.getMetaData().setCreationDate();
+            }
+            else{
+                node.getMetaData().setModificationDate();
+            }
             NodeDataUtil.getOrCreate(node, "text").setValue(content);
             NodeDataUtil.getOrCreate(node, "extension").setValue(extension);
             NodeDataUtil.getOrCreate(node, "version").setValue(version);

{code}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.magnolia-cms.com/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira




----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <dev-list-unsubscr...@magnolia-cms.com>
----------------------------------------------------------------

Reply via email to