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:
@@ -35,6 +35,7 @@ import org.alfresco.service.cmr.avm.AVMService;
|
||||
import org.alfresco.util.Pair;
|
||||
import org.alfresco.web.app.Application;
|
||||
import org.alfresco.web.bean.dialog.BaseDialogBean;
|
||||
import org.alfresco.util.VirtServerUtils;
|
||||
|
||||
/**
|
||||
* Revert (undo) the selected files in the current user sandbox.
|
||||
@@ -47,6 +48,14 @@ public class RevertSelectedDialog extends BaseDialogBean
|
||||
|
||||
protected AVMBrowseBean avmBrowseBean;
|
||||
protected ActionService actionService;
|
||||
|
||||
// The virtualization server might need to be notified
|
||||
// because one or more of the files reverted could alter
|
||||
// the behavior the virtual webapp in the target of the submit.
|
||||
|
||||
private String virtUpdatePath;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @param avmBrowseBean The AVM BrowseBean to set
|
||||
@@ -73,10 +82,21 @@ public class RevertSelectedDialog extends BaseDialogBean
|
||||
{
|
||||
List<AVMNodeDescriptor> selected = this.avmBrowseBean.getSelectedSandboxItems();
|
||||
List<Pair<Integer, String>> versionPaths = new ArrayList<Pair<Integer, String>>();
|
||||
|
||||
|
||||
for (AVMNodeDescriptor node : selected)
|
||||
{
|
||||
versionPaths.add(new Pair<Integer, String>(-1, node.getPath()));
|
||||
String revertPath = node.getPath();
|
||||
versionPaths.add(new Pair<Integer, String>(-1, revertPath ));
|
||||
|
||||
if ( (this.virtUpdatePath == null) &&
|
||||
VirtServerUtils.requiresUpdateNotification(revertPath)
|
||||
)
|
||||
{
|
||||
this.virtUpdatePath = revertPath;
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, Serializable> args = new HashMap<String, Serializable>(1, 1.0f);
|
||||
args.put(AVMUndoSandboxListAction.PARAM_NODE_LIST, (Serializable)versionPaths);
|
||||
for (AVMNodeDescriptor node : selected)
|
||||
@@ -92,6 +112,24 @@ public class RevertSelectedDialog extends BaseDialogBean
|
||||
|
||||
return outcome;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle notification to the virtualization server
|
||||
* (this needs to occur after the sandbox is updated).
|
||||
*/
|
||||
@Override
|
||||
protected String doPostCommitProcessing(FacesContext context, String outcome)
|
||||
{
|
||||
// Force the update because we've already determined
|
||||
// that update_path requires virt server notification.
|
||||
if (this.virtUpdatePath != null)
|
||||
{
|
||||
AVMConstants.updateVServerWebapp(this.virtUpdatePath, true);
|
||||
}
|
||||
return outcome;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @return the confirmation to display to the user
|
||||
|
Reference in New Issue
Block a user