- 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
This commit is contained in:
Gavin Cornwell
2007-05-16 14:57:31 +00:00
parent e83bbf8131
commit a0fb37db91
3 changed files with 27 additions and 2 deletions

View File

@@ -308,6 +308,9 @@
<property name="transactionService"> <property name="transactionService">
<ref bean="TransactionService" /> <ref bean="TransactionService" />
</property> </property>
<property name="virtServerRegistry">
<ref bean="VirtServerRegistry" />
</property>
</bean> </bean>
<!-- AVM Locking. --> <!-- AVM Locking. -->

View File

@@ -166,7 +166,7 @@
<default></default> <default></default>
</property> </property>
<property name="bpm:packageItemActionGroup"> <property name="bpm:packageItemActionGroup">
<default>edit_wcm_package_item_actions</default> <default>edit_and_delete_wcm_package_item_actions</default>
</property> </property>
</overrides> </overrides>
<mandatory-aspects> <mandatory-aspects>

View File

@@ -36,6 +36,7 @@ import java.util.regex.Pattern;
import org.alfresco.config.JNDIConstants; import org.alfresco.config.JNDIConstants;
import org.alfresco.i18n.I18NUtil; import org.alfresco.i18n.I18NUtil;
import org.alfresco.mbeans.VirtServerRegistry;
import org.alfresco.model.ContentModel; import org.alfresco.model.ContentModel;
import org.alfresco.model.WCMAppModel; import org.alfresco.model.WCMAppModel;
import org.alfresco.repo.domain.PropertyValue; import org.alfresco.repo.domain.PropertyValue;
@@ -77,6 +78,7 @@ public class AVMExpiredContentProcessor
protected String adminUserName = "admin"; protected String adminUserName = "admin";
protected String workflowName = "jbpm$wcmwf:changerequest"; protected String workflowName = "jbpm$wcmwf:changerequest";
protected List<String> workflowStores;
protected Map<String, Map<String, List<String>>> expiredContent; protected Map<String, Map<String, List<String>>> expiredContent;
protected AVMService avmService; protected AVMService avmService;
protected AVMSyncService avmSyncService; protected AVMSyncService avmSyncService;
@@ -85,6 +87,7 @@ public class AVMExpiredContentProcessor
protected PersonService personService; protected PersonService personService;
protected PermissionService permissionService; protected PermissionService permissionService;
protected TransactionService transactionService; protected TransactionService transactionService;
protected VirtServerRegistry virtServerRegistry;
private static Log logger = LogFactory.getLog(AVMExpiredContentProcessor.class); private static Log logger = LogFactory.getLog(AVMExpiredContentProcessor.class);
@@ -140,6 +143,11 @@ public class AVMExpiredContentProcessor
this.transactionService = transactionService; this.transactionService = transactionService;
} }
public void setVirtServerRegistry(VirtServerRegistry virtServerRegistry)
{
this.virtServerRegistry = virtServerRegistry;
}
/** /**
* Executes the expired content processor. * Executes the expired content processor.
* The work is performed within a transaction running as the system user. * 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 // perform the work as the system user
AuthenticationUtil.runAs(authorisedWork, this.adminUserName); 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 // create the maps to hold the expired content for each user in each web project
this.expiredContent = new HashMap<String, Map<String, List<String>>>(8); this.expiredContent = new HashMap<String, Map<String, List<String>>>(8);
this.workflowStores = new ArrayList<String>(4);
// iterate through all AVM stores and focus only on staging main stores // iterate through all AVM stores and focus only on staging main stores
List<AVMStoreDescriptor> stores = avmService.getStores(); List<AVMStoreDescriptor> stores = avmService.getStores();
@@ -390,6 +406,12 @@ public class AVMExpiredContentProcessor
this.workflowService.updateTask(startTask.id, params, null, null); this.workflowService.updateTask(startTask.id, params, null, null);
this.workflowService.endTask(startTask.id, 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()) if (logger.isDebugEnabled())
logger.debug("Started '" + this.workflowName + "' workflow for user '" + logger.debug("Started '" + this.workflowName + "' workflow for user '" +
userName + "' in store '" + storeName + "'"); userName + "' in store '" + storeName + "'");