nodes = this.avmService.getDirectoryListing(folder);
- for (AVMNodeDescriptor node: nodes.values())
- {
- if (node.isDirectory())
- {
- // recurse through folders
- processFolder(storeName, node);
- }
- else
- {
- // process the node
- processNode(storeName, node);
- }
- }
- }
- }
-
/**
* Processes the given node.
*
- * If the 'wca:expires' aspect is applied and the wca:expired property
- * is false the wca:expirationDate property is checked. If the date is
- * today's date or prior to today the last modifier of the node is retrieved
- * and the node's path added to the users list of expired content.
+ * This method is called if the node has been identified as being expired,
+ * the date and time is checked to make sure it has actually passed i.e. the
+ * date maybe todat but the time set to later in the day. If the item is
+ * indeed expired it's added to the expired list and the date reset.
*
*
* @param storeName The name of the store the folder belongs to
@@ -296,52 +302,49 @@ public class AVMExpiredContentProcessor
{
// check for existence of expires aspect
String nodePath = node.getPath();
- if (this.avmService.hasAspect(-1, nodePath, WCMAppModel.ASPECT_EXPIRES))
- {
- PropertyValue expirationDateProp = this.avmService.getNodeProperty(-1, nodePath,
- WCMAppModel.PROP_EXPIRATIONDATE);
+ PropertyValue expirationDateProp = this.avmService.getNodeProperty(-1, nodePath,
+ WCMAppModel.PROP_EXPIRATIONDATE);
- if (logger.isDebugEnabled())
- logger.debug("Examining expiration date for '" + nodePath + "': " +
- expirationDateProp.getStringValue());
+ if (logger.isDebugEnabled())
+ logger.debug("Examining expiration date for '" + nodePath + "': " +
+ expirationDateProp.getStringValue());
+
+ if (expirationDateProp != null)
+ {
+ Date now = new Date();
+ Date expirationDate = (Date)expirationDateProp.getValue(DataTypeDefinition.DATETIME);
- if (expirationDateProp != null)
- {
- Date now = new Date();
- Date expirationDate = (Date)expirationDateProp.getValue(DataTypeDefinition.DATETIME);
+ if (expirationDate != null && expirationDate.before(now))
+ {
+ // get the map of expired content for the store
+ Map> storeExpiredContent = this.expiredContent.get(storeName);
+ if (storeExpiredContent == null)
+ {
+ storeExpiredContent = new HashMap>(4);
+ this.expiredContent.put(storeName, storeExpiredContent);
+ }
- if (expirationDate != null && expirationDate.before(now))
- {
- // get the map of expired content for the store
- Map> storeExpiredContent = this.expiredContent.get(storeName);
- if (storeExpiredContent == null)
- {
- storeExpiredContent = new HashMap>(4);
- this.expiredContent.put(storeName, storeExpiredContent);
- }
-
- // get the list of expired content for the last modifier of the node
- String modifier = node.getLastModifier();
- List userExpiredContent = storeExpiredContent.get(modifier);
- if (userExpiredContent == null)
- {
- userExpiredContent = new ArrayList(4);
- storeExpiredContent.put(modifier, userExpiredContent);
- }
-
- // add the content to the user's list for the current store
- userExpiredContent.add(nodePath);
-
- if (logger.isDebugEnabled())
- logger.debug("Added " + nodePath + " to " + modifier + "'s list of expired content");
-
- // reset the expiration date
- this.avmService.setNodeProperty(nodePath, WCMAppModel.PROP_EXPIRATIONDATE,
- new PropertyValue(DataTypeDefinition.DATETIME, null));
-
- if (logger.isDebugEnabled())
- logger.debug("Reset expiration date for: " + nodePath);
- }
+ // get the list of expired content for the last modifier of the node
+ String modifier = node.getLastModifier();
+ List userExpiredContent = storeExpiredContent.get(modifier);
+ if (userExpiredContent == null)
+ {
+ userExpiredContent = new ArrayList(4);
+ storeExpiredContent.put(modifier, userExpiredContent);
+ }
+
+ // add the content to the user's list for the current store
+ userExpiredContent.add(nodePath);
+
+ if (logger.isDebugEnabled())
+ logger.debug("Added " + nodePath + " to " + modifier + "'s list of expired content");
+
+ // reset the expiration date
+ this.avmService.setNodeProperty(nodePath, WCMAppModel.PROP_EXPIRATIONDATE,
+ new PropertyValue(DataTypeDefinition.DATETIME, null));
+
+ if (logger.isDebugEnabled())
+ logger.debug("Reset expiration date for: " + nodePath);
}
}
}
@@ -385,6 +388,7 @@ public class AVMExpiredContentProcessor
storeCreator + "' as they created store '" + storeName + "'");
userName = storeCreator;
+ userStore = storeName + STORE_SEPARATOR + userName;
}
// lookup the NodeRef for the user
@@ -399,8 +403,8 @@ public class AVMExpiredContentProcessor
// create the workflow parameters map
Map params = new HashMap(5);
params.put(WorkflowModel.ASSOC_PACKAGE, workflowPackage);
- params.put(WorkflowModel.PROP_WORKFLOW_DESCRIPTION, workflowTitle);
params.put(WorkflowModel.ASSOC_ASSIGNEE, assignee);
+ params.put(WorkflowModel.PROP_WORKFLOW_DESCRIPTION, workflowTitle);
// transition the workflow to send it to the users inbox
this.workflowService.updateTask(startTask.id, params, null, null);