Author: thomas.heute(a)jboss.com
Date: 2008-02-05 08:17:15 -0500 (Tue, 05 Feb 2008)
New Revision: 9768
Modified:
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/command/FileCreateCommand.java
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/command/FileUpdateAndVersionCommand.java
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/command/FileUpdateCommand.java
Log:
Update folder last modified timestamp
Modified:
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/command/FileCreateCommand.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/command/FileCreateCommand.java 2008-02-05
11:38:38 UTC (rev 9767)
+++
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/command/FileCreateCommand.java 2008-02-05
13:17:15 UTC (rev 9768)
@@ -59,6 +59,7 @@
Node parentNode = (Node)context.getSession().getItem(parentPath);
Node fileNode = parentNode.addNode(nodeName, "portalcms:file");
parentNode.setProperty("jcr:lastModified", new
DateValue(Calendar.getInstance()));
+ parentNode.setProperty("portalcms:lastmodified", new
DateValue(Calendar.getInstance()));
fileNode.setProperty("jcr:lastModified", new
DateValue(Calendar.getInstance()));
parentNode.save();
}
Modified:
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/command/FileUpdateAndVersionCommand.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/command/FileUpdateAndVersionCommand.java 2008-02-05
11:38:38 UTC (rev 9767)
+++
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/command/FileUpdateAndVersionCommand.java 2008-02-05
13:17:15 UTC (rev 9768)
@@ -84,7 +84,6 @@
contentNode.setProperty("jcr:mimeType",
"application/octet-stream");
}
}
- contentNode.save();
//make a new version live version
Node versionNode =
(Node)context.getSession().getItem(mFile.getContent().getBasePath());
@@ -93,7 +92,12 @@
//Update the lastModified Property of the FileNode of this content
Node fileNode = (Node)context.getSession().getItem(mFile.getBasePath());
fileNode.setProperty("jcr:lastModified", timestamp);
- fileNode.save();
+
+ // Update the folder modified date
+ fileNode.getParent().setProperty("portalcms:lastmodified",
timestamp);
+
+ contentNode.getSession().save();
+
}
catch (Exception e)
{
Modified:
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/command/FileUpdateCommand.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/command/FileUpdateCommand.java 2008-02-05
11:38:38 UTC (rev 9767)
+++
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/command/FileUpdateCommand.java 2008-02-05
13:17:15 UTC (rev 9768)
@@ -29,6 +29,7 @@
import org.jboss.portal.cms.model.File;
import javax.jcr.Node;
+
import java.util.Calendar;
/** @author <a href="mailto:roy@jboss.org">Roy Russo</a> */
@@ -82,12 +83,15 @@
contentNode.setProperty("jcr:mimeType",
"application/octet-stream");
}
}
- contentNode.save();
//Update the lastModified Property of the FileNode of this content
Node fileNode = (Node)context.getSession().getItem(mFile.getBasePath());
fileNode.setProperty("jcr:lastModified", timestamp);
- fileNode.save();
+
+ // Update the folder modified date
+ fileNode.getParent().setProperty("portalcms:lastmodified",
timestamp);
+
+ contentNode.getSession().save();
}
catch (Exception e)
{
@@ -95,4 +99,5 @@
}
return null;
}
+
}
Show replies by date