mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Point checkin.
Support for notification to virt server on dialog-driven revert operations. No support yet for workflow-diriven revert notification (coming soon). Details ------- root/projects/catalina-virtual/source/java/org/alfresco/catalina/host/AVMHostConfig.java Minor logging cleanup root/projects/core/source/java/org/alfresco/util/VirtServerUtils.java Trigger notification on submits of entire dirs: WEB-INF, WEB-INF/classes, WEB-INF/lib (not just files within them) root/projects/web-client/source/java/org/alfresco/web/bean/wcm/AVMBrowseBean.java notify virt server on revert root/projects/web-client/source/java/org/alfresco/web/bean/wcm/RevertAllDialog.java notify virt server on revert all root/projects/web-client/source/java/org/alfresco/web/bean/wcm/RevertSelectedDialog.java notify virt server on revert selected root/projects/web-client/source/java/org/alfresco/web/bean/wcm/SubmitDialog.java minor cleanup root/projects/web-client/source/web/WEB-INF/faces-config-beans.xml Injecting AVMSyncService into AVMBrowseBean to allow virt server notification to occur only when a comparison between reverted versions shows it's absolutely necessary git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5030 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -41,6 +41,8 @@ import org.alfresco.service.cmr.action.Action;
|
||||
import org.alfresco.service.cmr.action.ActionService;
|
||||
import org.alfresco.service.cmr.avm.AVMNodeDescriptor;
|
||||
import org.alfresco.service.cmr.avm.AVMService;
|
||||
import org.alfresco.service.cmr.avmsync.AVMDifference;
|
||||
import org.alfresco.service.cmr.avmsync.AVMSyncService;
|
||||
import org.alfresco.service.cmr.avm.AVMStoreDescriptor;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
import org.alfresco.service.cmr.workflow.WorkflowService;
|
||||
@@ -70,6 +72,8 @@ import org.alfresco.web.ui.wcm.component.UIUserSandboxes;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import org.alfresco.util.VirtServerUtils;
|
||||
|
||||
/**
|
||||
* Bean backing up the AVM specific browse screens
|
||||
*
|
||||
@@ -155,6 +159,9 @@ public class AVMBrowseBean implements IContextListener
|
||||
|
||||
/** AVM service bean reference */
|
||||
protected AVMService avmService;
|
||||
|
||||
/** AVM sync service bean reference */
|
||||
protected AVMSyncService avmSyncService;
|
||||
|
||||
/** Action service bean reference */
|
||||
protected ActionService actionService;
|
||||
@@ -178,6 +185,14 @@ public class AVMBrowseBean implements IContextListener
|
||||
{
|
||||
this.avmService = avmService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param avmSyncService The AVMSyncService to set.
|
||||
*/
|
||||
public void setAvmSyncService(AVMSyncService avmSyncService)
|
||||
{
|
||||
this.avmSyncService = avmSyncService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param nodeService The NodeService to set.
|
||||
@@ -873,6 +888,14 @@ public class AVMBrowseBean implements IContextListener
|
||||
|
||||
// commit the transaction
|
||||
tx.commit();
|
||||
|
||||
// possibly update webapp after commit
|
||||
|
||||
if ( VirtServerUtils.requiresUpdateNotification( path ) )
|
||||
{
|
||||
AVMConstants.updateVServerWebapp(path, true);
|
||||
}
|
||||
|
||||
|
||||
// if we get here, all was well - output friendly status message to the user
|
||||
String msg = MessageFormat.format(Application.getMessage(
|
||||
@@ -905,6 +928,12 @@ public class AVMBrowseBean implements IContextListener
|
||||
FacesContext context = FacesContext.getCurrentInstance();
|
||||
tx = Repository.getUserTransaction(context, false);
|
||||
tx.begin();
|
||||
|
||||
String sandboxPath = AVMConstants.buildSandboxRootPath( sandbox );
|
||||
|
||||
List<AVMDifference> diffs =
|
||||
this.avmSyncService.compare(
|
||||
-1,sandboxPath,Integer.valueOf(strVersion),sandboxPath,null);
|
||||
|
||||
Map<String, Serializable> args = new HashMap<String, Serializable>(1, 1.0f);
|
||||
args.put(AVMRevertStoreAction.PARAM_VERSION, Integer.valueOf(strVersion));
|
||||
@@ -913,6 +942,18 @@ public class AVMBrowseBean implements IContextListener
|
||||
|
||||
// commit the transaction
|
||||
tx.commit();
|
||||
|
||||
// See if any of the files being reverted require
|
||||
// notification of the virt server.
|
||||
|
||||
for (AVMDifference diff : diffs)
|
||||
{
|
||||
if ( VirtServerUtils.requiresUpdateNotification( diff.getSourcePath()) )
|
||||
{
|
||||
AVMConstants.updateVServerWebapp(diff.getSourcePath() , true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// if we get here, all was well - output friendly status message to the user
|
||||
String msg = MessageFormat.format(Application.getMessage(
|
||||
|
Reference in New Issue
Block a user