From a0fb37db917ce3dee1f782a98cff49e3680b7706 Mon Sep 17 00:00:00 2001 From: Gavin Cornwell Date: Wed, 16 May 2007 14:57:31 +0000 Subject: [PATCH] - Added delete item action to change request task dialog (means expired items can now be deleted) - Added virtual server callback to inform it of workflow sandboxes created for change request workflow git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5693 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- config/alfresco/avm-services-context.xml | 3 +++ config/alfresco/workflow/wcmWorkflowModel.xml | 2 +- .../repo/avm/AVMExpiredContentProcessor.java | 24 ++++++++++++++++++- 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/config/alfresco/avm-services-context.xml b/config/alfresco/avm-services-context.xml index dc519420e0..044ff38fe2 100644 --- a/config/alfresco/avm-services-context.xml +++ b/config/alfresco/avm-services-context.xml @@ -308,6 +308,9 @@ + + + diff --git a/config/alfresco/workflow/wcmWorkflowModel.xml b/config/alfresco/workflow/wcmWorkflowModel.xml index d11b343552..52b8e1bc9f 100644 --- a/config/alfresco/workflow/wcmWorkflowModel.xml +++ b/config/alfresco/workflow/wcmWorkflowModel.xml @@ -166,7 +166,7 @@ - edit_wcm_package_item_actions + edit_and_delete_wcm_package_item_actions diff --git a/source/java/org/alfresco/repo/avm/AVMExpiredContentProcessor.java b/source/java/org/alfresco/repo/avm/AVMExpiredContentProcessor.java index ca2348b102..61a508043e 100644 --- a/source/java/org/alfresco/repo/avm/AVMExpiredContentProcessor.java +++ b/source/java/org/alfresco/repo/avm/AVMExpiredContentProcessor.java @@ -36,6 +36,7 @@ import java.util.regex.Pattern; import org.alfresco.config.JNDIConstants; import org.alfresco.i18n.I18NUtil; +import org.alfresco.mbeans.VirtServerRegistry; import org.alfresco.model.ContentModel; import org.alfresco.model.WCMAppModel; import org.alfresco.repo.domain.PropertyValue; @@ -76,7 +77,8 @@ public class AVMExpiredContentProcessor // defaults in case these properties are not configured in Spring protected String adminUserName = "admin"; protected String workflowName = "jbpm$wcmwf:changerequest"; - + + protected List workflowStores; protected Map>> expiredContent; protected AVMService avmService; protected AVMSyncService avmSyncService; @@ -85,6 +87,7 @@ public class AVMExpiredContentProcessor protected PersonService personService; protected PermissionService permissionService; protected TransactionService transactionService; + protected VirtServerRegistry virtServerRegistry; private static Log logger = LogFactory.getLog(AVMExpiredContentProcessor.class); @@ -140,6 +143,11 @@ public class AVMExpiredContentProcessor this.transactionService = transactionService; } + public void setVirtServerRegistry(VirtServerRegistry virtServerRegistry) + { + this.virtServerRegistry = virtServerRegistry; + } + /** * Executes the expired content processor. * The work is performed within a transaction running as the system user. @@ -166,6 +174,13 @@ public class AVMExpiredContentProcessor // perform the work as the system user AuthenticationUtil.runAs(authorisedWork, this.adminUserName); + + // now we know everything worked ok, let the virtualisation server + // know about all the new workflow sandboxes created (just the main stores) + for (String path : this.workflowStores) + { + this.virtServerRegistry.updateAllWebapps(-1, path, true); + } } /** @@ -175,6 +190,7 @@ public class AVMExpiredContentProcessor { // create the maps to hold the expired content for each user in each web project this.expiredContent = new HashMap>>(8); + this.workflowStores = new ArrayList(4); // iterate through all AVM stores and focus only on staging main stores List stores = avmService.getStores(); @@ -390,6 +406,12 @@ public class AVMExpiredContentProcessor this.workflowService.updateTask(startTask.id, params, null, null); this.workflowService.endTask(startTask.id, null); + // remember the root path of the workflow sandbox so we can inform + // the virtualisation server later + this.workflowStores.add(workflowStoreName + ":/" + + JNDIConstants.DIR_DEFAULT_WWW + "/" + + JNDIConstants.DIR_DEFAULT_APPBASE + "/ROOT"); + if (logger.isDebugEnabled()) logger.debug("Started '" + this.workflowName + "' workflow for user '" + userName + "' in store '" + storeName + "'");