From e73706d5e0abfb3406df4e0ffc8766bbe1f3cec8 Mon Sep 17 00:00:00 2001 From: Derek Hulley Date: Fri, 22 Feb 2008 15:04:42 +0000 Subject: [PATCH] Merged V2.2 to HEAD 7452: Fixes submit breakage. 7456: Patch to redeploy new submission workflow definition 7457: Added 'View Deployment' action to workflow sandbox so reviewers can examine the last attempted deployment Added 'Allocated' field to server config, tooltip shows which store the test server is allocated to git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@8363 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- config/alfresco/messages/webclient.properties | 1 + .../alfresco/web/bean/wcm/DeploymentUtil.java | 12 +++++-- .../wcm/ManageLinkValidationTaskDialog.java | 23 ++++++++++++++ .../alfresco/web/bean/wcm/SubmitDialog.java | 1 + .../ui/wcm/component/UIDeploymentServers.java | 31 +++++++++++++++++-- .../web/jsp/wcm/manage-review-task-dialog.jsp | 7 ++++- 6 files changed, 69 insertions(+), 6 deletions(-) diff --git a/config/alfresco/messages/webclient.properties b/config/alfresco/messages/webclient.properties index 1cb25b6595..d8b60a371e 100644 --- a/config/alfresco/messages/webclient.properties +++ b/config/alfresco/messages/webclient.properties @@ -1240,6 +1240,7 @@ deploy_server_port=Port deploy_server_username=Username deploy_server_password=Password deploy_server_url=URL +deploy_server_allocated=Allocated deploy_server_source_path=Source Path deploy_server_target_name=Target Name deploy_automatically=Auto Deploy diff --git a/source/java/org/alfresco/web/bean/wcm/DeploymentUtil.java b/source/java/org/alfresco/web/bean/wcm/DeploymentUtil.java index 4e424aee69..e7dfff6265 100644 --- a/source/java/org/alfresco/web/bean/wcm/DeploymentUtil.java +++ b/source/java/org/alfresco/web/bean/wcm/DeploymentUtil.java @@ -39,6 +39,8 @@ import org.alfresco.service.namespace.NamespaceService; import org.alfresco.util.ISO9075; import org.alfresco.web.app.Application; import org.alfresco.web.bean.repository.Repository; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; /** @@ -48,6 +50,8 @@ import org.alfresco.web.bean.repository.Repository; */ public final class DeploymentUtil { + private static final Log logger = LogFactory.getLog(DeploymentUtil.class); + public static List findDeploymentAttempts(String store) { FacesContext fc = FacesContext.getCurrentInstance(); @@ -170,8 +174,12 @@ public final class DeploymentUtil } else if (results.length() > 1) { - throw new IllegalStateException("More than one allocated test server for store '" + - store + "' was found, should only be one!"); + // get the first one and warn that we found many! + testServer = results.getNodeRef(0); + + if (logger.isWarnEnabled()) + logger.warn("More than one allocated test server for store '" + + store + "' was found, should only be one, first one found returned!"); } } finally diff --git a/source/java/org/alfresco/web/bean/wcm/ManageLinkValidationTaskDialog.java b/source/java/org/alfresco/web/bean/wcm/ManageLinkValidationTaskDialog.java index be9e25dded..25bea4771f 100644 --- a/source/java/org/alfresco/web/bean/wcm/ManageLinkValidationTaskDialog.java +++ b/source/java/org/alfresco/web/bean/wcm/ManageLinkValidationTaskDialog.java @@ -142,6 +142,18 @@ public class ManageLinkValidationTaskDialog extends ManageTaskDialog return "dialog:linkValidation"; } + public String viewDeployReport() + { + if (logger.isDebugEnabled()) + logger.debug("Viewing deployment report for store: " + store); + + Map params = new HashMap(3); + params.put("store", this.store); + Application.getDialogManager().setupParameters(params); + + return "dialog:viewDeploymentReport"; + } + public String deploy() { if (logger.isDebugEnabled()) @@ -204,4 +216,15 @@ public class ManageLinkValidationTaskDialog extends ManageTaskDialog return result.booleanValue(); } + + /** + * @return Determines whether a deployment has been attempted + */ + public boolean getDeployAttempted() + { + PropertyValue propVal = getAvmService().getStoreProperty(this.store, + SandboxConstants.PROP_LAST_DEPLOYMENT_ID); + + return (propVal != null); + } } diff --git a/source/java/org/alfresco/web/bean/wcm/SubmitDialog.java b/source/java/org/alfresco/web/bean/wcm/SubmitDialog.java index 5016e1c4b1..bb9f1f3430 100644 --- a/source/java/org/alfresco/web/bean/wcm/SubmitDialog.java +++ b/source/java/org/alfresco/web/bean/wcm/SubmitDialog.java @@ -276,6 +276,7 @@ public class SubmitDialog extends BaseDialogBean this.workflowSelectedValue = null; this.launchDate = null; this.validateLinks = true; + this.autoDeploy = false; this.workflowParams = null; this.sandboxInfo = null; this.virtUpdatePath = null; diff --git a/source/java/org/alfresco/web/ui/wcm/component/UIDeploymentServers.java b/source/java/org/alfresco/web/ui/wcm/component/UIDeploymentServers.java index 25e3fd8e7e..8b74a0bb38 100644 --- a/source/java/org/alfresco/web/ui/wcm/component/UIDeploymentServers.java +++ b/source/java/org/alfresco/web/ui/wcm/component/UIDeploymentServers.java @@ -72,6 +72,7 @@ public class UIDeploymentServers extends UIInput private static final String MSG_USER = "deploy_server_username"; private static final String MSG_PWD = "deploy_server_password"; private static final String MSG_URL = "deploy_server_url"; + private static final String MSG_ALLOCATED = "deploy_server_allocated"; private static final String MSG_SOURCE = "deploy_server_source_path"; private static final String MSG_TARGET = "deploy_server_target_name"; private static final String MSG_AUTO_DEPLOY = "deploy_automatically"; @@ -376,8 +377,8 @@ public class UIDeploymentServers extends UIInput { out.write((String)server.getProperties().get(DeploymentServerConfig.PROP_URL)); } - out.write(""); - out.write(""); + out.write(""); + out.write(""); + out.write("
"); out.write(bundle.getString(MSG_USER)); out.write(":"); @@ -385,7 +386,8 @@ public class UIDeploymentServers extends UIInput { out.write((String)server.getProperties().get(DeploymentServerConfig.PROP_USER)); } - out.write("
"); + out.write(""); out.write(""); } + if (WCMAppModel.CONSTRAINT_TESTSERVER.equals( + server.getProperties().get(DeploymentServerConfig.PROP_TYPE))) + { + out.write(""); + } + out.write("
"); out.write(bundle.getString(MSG_SOURCE)); @@ -429,6 +431,29 @@ public class UIDeploymentServers extends UIInput out.write("
"); + out.write(bundle.getString(MSG_ALLOCATED)); + out.write(":"); + if (server.getProperties().get(DeploymentServerConfig.PROP_ALLOCATED_TO) != null) + { + String allocatedToTip = (String)server.getProperties().get( + DeploymentServerConfig.PROP_ALLOCATED_TO); + out.write(""); + out.write(bundle.getString("yes")); + out.write(""); + } + else + { + out.write(bundle.getString("no")); + } + out.write("
"); PanelGenerator.generatePanelEnd(out, contextPath, "lightstorm"); out.write(""); diff --git a/source/web/jsp/wcm/manage-review-task-dialog.jsp b/source/web/jsp/wcm/manage-review-task-dialog.jsp index a6a38ecb4b..88216b8e4a 100644 --- a/source/web/jsp/wcm/manage-review-task-dialog.jsp +++ b/source/web/jsp/wcm/manage-review-task-dialog.jsp @@ -67,7 +67,12 @@ + action="#{DialogManager.bean.deploy}" + rendered="#{DialogManager.bean.testServersAvailable}" /> + +