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
This commit is contained in:
Derek Hulley
2008-02-22 15:04:42 +00:00
parent 37a6cb1486
commit e73706d5e0
6 changed files with 69 additions and 6 deletions

View File

@@ -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

View File

@@ -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<NodeRef> 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

View File

@@ -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<String, String> params = new HashMap<String, String>(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);
}
}

View File

@@ -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;

View File

@@ -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("</td></tr></table></td>");
out.write("<td valign='top'><table cellpadding='3' cellspacing='0' class='deployConfigServerDetailsRightCol'>");
out.write("</td></tr>");
out.write("<tr><td align='right'>");
out.write(bundle.getString(MSG_USER));
out.write(":</td><td>");
@@ -385,7 +386,8 @@ public class UIDeploymentServers extends UIInput
{
out.write((String)server.getProperties().get(DeploymentServerConfig.PROP_USER));
}
out.write("</td></tr>");
out.write("</td></tr></table></td>");
out.write("<td valign='top'><table cellpadding='3' cellspacing='0' class='deployConfigServerDetailsRightCol'>");
out.write("<tr><td align='right'>");
out.write(bundle.getString(MSG_SOURCE));
@@ -429,6 +431,29 @@ public class UIDeploymentServers extends UIInput
out.write("</td></tr>");
}
if (WCMAppModel.CONSTRAINT_TESTSERVER.equals(
server.getProperties().get(DeploymentServerConfig.PROP_TYPE)))
{
out.write("<tr><td align='right'>");
out.write(bundle.getString(MSG_ALLOCATED));
out.write(":</td><td>");
if (server.getProperties().get(DeploymentServerConfig.PROP_ALLOCATED_TO) != null)
{
String allocatedToTip = (String)server.getProperties().get(
DeploymentServerConfig.PROP_ALLOCATED_TO);
out.write("<span title='");
out.write(allocatedToTip);
out.write("'>");
out.write(bundle.getString("yes"));
out.write("</span>");
}
else
{
out.write(bundle.getString("no"));
}
out.write("</td></tr>");
}
out.write("</table></td></tr></table></td></tr></table>");
PanelGenerator.generatePanelEnd(out, contextPath, "lightstorm");
out.write("</div>");

View File

@@ -67,7 +67,12 @@
<h:panelGroup id="resources-actions" style="margin-left: 4px;">
<a:actionLink id="resources-action1" value="#{msg.sandbox_deploy}" image="/images/icons/deploy.gif"
action="#{DialogManager.bean.deploy}" style="margin-left: 4px;" rendered="#{DialogManager.bean.testServersAvailable}" />
action="#{DialogManager.bean.deploy}"
rendered="#{DialogManager.bean.testServersAvailable}" />
<h:outputText id="resources-actions-padding" value="&nbsp;&nbsp;" escape="false" />
<a:actionLink id="resources-action2" value="#{msg.deployment_report_action}" image="/images/icons/deployment_report.gif"
action="#{DialogManager.bean.viewDeployReport}"
rendered="#{DialogManager.bean.deployAttempted}" />
</h:panelGroup>
<h:outputText value="#{msg.no_resources}" rendered="#{empty DialogManager.bean.resources}" />