Merged V3.2 to HEAD

15596: Merged V3.1 to V3.2
        14017: Fix ETHREEOH-1880 - remove (double-)reverse of WCM staging snapshot order
        14112: Fix ETHREEOH-1758 - apply contributed patch
        14447: Merged V2.2 to V3.1
            14276: ETWOTWO-1224 / WCM-948 - browsing staging area during (commit of) large submit can cause AVMNotFoundException: Path /www/avm_webapps not found.
       14452: Add WCM services-based unit test for ETWOTWO-1224 / WCM-948
       14589: ETHREEOH-1646 - User Sandboxes aren't visible for Content Publisher
    15604: Merged V3.1 to V3.2
        14734: Merged V2.2 to V3.1
            14718: ETWOTWO-1244 - unable to revert some snapshots ("Does not exist: xxx")
        14852: Merged V2.2 to V3.1
            14720: ETWOTWO-1183 - "Show All Sandboxes" checkbox should only be visible for "Content Publisher" or "Content Manager"
        15032: Fix ETHREEOH-2240 - delete WCM web project (does not clean-up workflow sandboxes and also appears in archive store)
        15037: Fix ETHREEOH-2240 - follow-on for Alfresco Explorer's Manage (Review) Task Dialog
        15056: Fix ETHREEOH-2297 - WCM layered folder - problem deleting file
        15072: Minor - fix remote AVM test
    15605: Merged V3.1 to V3.2
        15082: Merged V2.2 to V3.1
            15081: AVM - add tests only
        15083: Fix ETHREEOH-2296 - user conflict when updating an AVM layered file
        15118: Merged V2.2 to V3.1
            15115: Fix ETWOTWO-1265 - WCM locking not working as expected (+ add WCM services test)
        15137: Fix ETHREEOH-2309 and ETHREEOH-227 - including refactor (& clean-up) of WCM-related actions
        15156: Fix ETHREEOH-2078 & ETHREEOH-2040 - WCM - deploy to localhost causes "Must have at least one store" errors
        15175: Fix ETHREEOH-2309 and ETHREEOH-227 - further clean-up of WCM submit/undo actions (for consistency)
        15190: Minor: message updates for WCM submit/undo actions


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@16858 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Jan Vonka
2009-10-13 11:34:23 +00:00
parent aa61dae7b0
commit d67b53b7cc
7 changed files with 98 additions and 60 deletions

View File

@@ -24,6 +24,7 @@
*/
package org.alfresco.web.bean.wcm;
import java.text.MessageFormat;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -31,10 +32,14 @@ import java.util.Map;
import javax.faces.context.FacesContext;
import javax.transaction.UserTransaction;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.linkvalidation.LinkValidationReport;
import org.alfresco.repo.domain.PropertyValue;
import org.alfresco.wcm.sandbox.SandboxConstants;
import org.alfresco.service.cmr.avm.AVMNotFoundException;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.security.AccessStatus;
import org.alfresco.service.cmr.security.PermissionService;
import org.alfresco.wcm.sandbox.SandboxConstants;
import org.alfresco.wcm.util.WCMUtil;
import org.alfresco.web.app.Application;
import org.alfresco.web.bean.repository.Repository;
@@ -53,10 +58,13 @@ public class ManageReviewTaskDialog extends ManageTaskDialog
{
private static final long serialVersionUID = 59524560340308134L;
private static final String MSG_WEB_PRJ_DOES_NOT_EXIST = "error_webprj_does_not_exist";
protected String store;
protected String webapp;
protected NodeRef webProjectRef;
protected AVMBrowseBean avmBrowseBean;
protected PermissionService permissionService;
private static final Log logger = LogFactory.getLog(ManageReviewTaskDialog.class);
@@ -85,8 +93,15 @@ public class ManageReviewTaskDialog extends ManageTaskDialog
this.store = this.workflowPackage.getStoreRef().getIdentifier();
// get the web project noderef for the workflow store
String wpStoreId = WCMUtil.getWebProjectStoreId(this.store);
this.webProjectRef = getWebProjectService().getWebProjectNodeFromStore(WCMUtil.getWebProjectStoreId(this.store));
if (this.webProjectRef == null)
{
String mesg = MessageFormat.format(Application.getMessage(context, MSG_WEB_PRJ_DOES_NOT_EXIST), wpStoreId);
throw new AlfrescoRuntimeException(mesg);
}
PropertyValue val = this.getAvmService().getStoreProperty(this.store,
SandboxConstants.PROP_LINK_VALIDATION_REPORT);
if (val != null)
@@ -184,6 +199,14 @@ public class ManageReviewTaskDialog extends ManageTaskDialog
this.avmBrowseBean = avmBrowseBean;
}
/**
* @param permissionService PermissionService instance
*/
public void setPermissionService(PermissionService permissionService)
{
this.permissionService = permissionService;
}
/**
* @return Determines if there are any test servers configured for the
* web project this task belongs to
@@ -203,7 +226,7 @@ public class ManageReviewTaskDialog extends ManageTaskDialog
{
result = Boolean.FALSE;
if (this.webProjectRef != null)
if (this.webProjectRef != null && permissionService.hasPermission(webProjectRef, PermissionService.READ_PROPERTIES).equals(AccessStatus.ALLOWED))
{
List<NodeRef> testServers = DeploymentUtil.findTestServers(this.webProjectRef, false);
if (testServers != null)
@@ -227,8 +250,16 @@ public class ManageReviewTaskDialog extends ManageTaskDialog
*/
public boolean getDeployAttempted()
{
PropertyValue propVal = getAvmService().getStoreProperty(this.store,
PropertyValue propVal = null;
try
{
propVal = getAvmService().getStoreProperty(this.store,
SandboxConstants.PROP_LAST_DEPLOYMENT_ID);
}
catch (AVMNotFoundException nfe)
{
// ignore - eg. web project deleted
}
return (propVal != null);
}