serverProps = nodeService.getProperties(deploymentReport);
+ Long serverId = (Long)serverProps.get(ContentModel.PROP_NODE_DBID);
String server = (String)serverProps.get(WCMAppModel.PROP_DEPLOYSERVER);
boolean showServerAddress = true;
String serverName = (String)serverProps.get(WCMAppModel.PROP_DEPLOYSERVERNAMEUSED);
@@ -535,7 +549,7 @@ public class UIDeploymentReports extends SelfRenderingComponent
out.write(deployType);
out.write(".gif' />");
out.write(" ");
- out.write(serverName);
+ out.write(Utils.encode(serverName));
out.write(" ;
out.write(context.getExternalContext().getRequestContextPath());
out.write("/images/icons/deploy_");
@@ -563,7 +577,7 @@ public class UIDeploymentReports extends SelfRenderingComponent
out.write("<div style=) ");
out.write(Application.getMessage(context, "reason"));
out.write(": ");
- out.write(failReason);
+ out.write(Utils.encode(failReason));
out.write(" ");
}
@@ -572,7 +586,7 @@ public class UIDeploymentReports extends SelfRenderingComponent
out.write("");
out.write(Application.getMessage(context, "deploy_server"));
out.write(": ");
- out.write(server);
+ out.write(Utils.encode(server));
out.write(" ");
}
@@ -597,7 +611,7 @@ public class UIDeploymentReports extends SelfRenderingComponent
out.write("");
out.write(Application.getMessage(context, "deployed_by"));
out.write(": ");
- out.write(creator);
+ out.write(Utils.encode(creator));
out.write(" ");
if (username != null)
@@ -605,7 +619,7 @@ public class UIDeploymentReports extends SelfRenderingComponent
out.write("");
out.write(Application.getMessage(context, "deploy_server_username"));
out.write(": ");
- out.write(username);
+ out.write(Utils.encode(username));
out.write(" ");
}
@@ -614,7 +628,7 @@ public class UIDeploymentReports extends SelfRenderingComponent
out.write("");
out.write(Application.getMessage(context, "deploy_server_source_path"));
out.write(": ");
- out.write(source);
+ out.write(Utils.encode(source));
out.write(" ");
}
@@ -623,7 +637,7 @@ public class UIDeploymentReports extends SelfRenderingComponent
out.write("");
out.write(Application.getMessage(context, "deploy_server_excludes"));
out.write(": ");
- out.write(excludes);
+ out.write(Utils.encode(excludes));
out.write(" ");
}
@@ -632,7 +646,7 @@ public class UIDeploymentReports extends SelfRenderingComponent
out.write("");
out.write(Application.getMessage(context, "deploy_server_target_name"));
out.write(": ");
- out.write(target);
+ out.write(Utils.encode(target));
out.write(" ");
}
@@ -643,7 +657,7 @@ public class UIDeploymentReports extends SelfRenderingComponent
out.write(": ");
- out.write(url);
+ out.write(Utils.encode(url));
out.write("");
}
@@ -652,14 +666,14 @@ public class UIDeploymentReports extends SelfRenderingComponent
out.write(";
out.write(context.getExternalContext().getRequestContextPath());
out.write("/images/icons/collapsed.gif) ");
out.write(Application.getMessage(context, "details"));
out.write(" \n");
out.write("");
- out.write(content);
+ out.write(Utils.encode(content));
out.write(" ");
}
out.write("\n\n");
@@ -671,11 +685,10 @@ public class UIDeploymentReports extends SelfRenderingComponent
}
@SuppressWarnings("unchecked")
- protected UIActionLink aquireViewAttemptAction(FacesContext context,
- String attemptId, NodeRef attemptRef, String attemptDate)
+ protected UIActionLink aquireViewAttemptAction(FacesContext context, DeploymentAttempt attempt)
{
UIActionLink action = null;
- String actionId = "va_" + attemptId;
+ String actionId = "va_" + attempt.getId();
// try find the action as a child of this component
for (UIComponent component : (List)getChildren())
@@ -693,7 +706,7 @@ public class UIDeploymentReports extends SelfRenderingComponent
javax.faces.application.Application facesApp = context.getApplication();
action = (UIActionLink)facesApp.createComponent(UIActions.COMPONENT_ACTIONLINK);
action.setId(actionId);
- action.setValue(attemptDate);
+ action.setValue(attempt.getDateAsString());
action.setTooltip(Application.getMessage(context, MSG_SELECT_ATTEMPT));
action.setShowLink(true);
action.setActionListener(facesApp.createMethodBinding(
@@ -703,14 +716,14 @@ public class UIDeploymentReports extends SelfRenderingComponent
UIParameter param1 = (UIParameter)facesApp.createComponent(ComponentConstants.JAVAX_FACES_PARAMETER);
param1.setId(actionId + "_1");
param1.setName("attemptRef");
- param1.setValue(attemptRef.toString());
+ param1.setValue(attempt.getNodeRef().toString());
action.getChildren().add(param1);
// add attemptDate param
UIParameter param2 = (UIParameter)facesApp.createComponent(ComponentConstants.JAVAX_FACES_PARAMETER);
param2.setId(actionId + "_2");
param2.setName("attemptDate");
- param2.setValue(attemptDate);
+ param2.setValue(attempt.getDateAsString());
action.getChildren().add(param2);
this.getChildren().add(action);
@@ -718,4 +731,54 @@ public class UIDeploymentReports extends SelfRenderingComponent
return action;
}
+
+ private class DeploymentAttempt
+ {
+ private NodeRef nodeRef;
+ private String id;
+ private Date date;
+ private String servers;
+ private Integer version;
+
+ public DeploymentAttempt(NodeRef nodeRef, String id, Date date,
+ String servers, Integer version)
+ {
+ this.nodeRef = nodeRef;
+ this.id = id;
+ this.date = date;
+ this.servers = servers;
+ this.version = version;
+ }
+
+ public NodeRef getNodeRef()
+ {
+ return this.nodeRef;
+ }
+
+ public String getId()
+ {
+ return this.id;
+ }
+
+ public String getServers()
+ {
+ return this.servers;
+ }
+
+ public Integer getVersion()
+ {
+ return this.version;
+ }
+
+ public Date getDate()
+ {
+ return this.date;
+ }
+
+ public String getDateAsString()
+ {
+ // format the date using the default pattern
+ return Utils.getDateTimeFormat(FacesContext.getCurrentInstance()).format(this.date);
+ }
+ }
}
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 952aa67e45..fb98ba6dd8 100644
--- a/source/java/org/alfresco/web/ui/wcm/component/UIDeploymentServers.java
+++ b/source/java/org/alfresco/web/ui/wcm/component/UIDeploymentServers.java
@@ -193,9 +193,9 @@ public class UIDeploymentServers extends UIInput
out.write("YAHOO.util.Event.on(window, \"load\", Alfresco.checkDeployConfigPage);");
if (currentServer != null)
{
- out.write("Alfresco.scrollToEditServer('");
+ out.write("var SCROLL_TO_SERVER_CONFIG_ID = '");
out.write(currentServer.getId());
- out.write("');\n");
+ out.write("';\n");
}
out.write("\n");
@@ -334,7 +334,7 @@ public class UIDeploymentServers extends UIInput
out.write(server.getDeployType());
out.write(".gif");
out.write("' /> | ");
- out.write(serverName);
+ out.write(Utils.encode(serverName));
out.write(" | ");
Utils.encodeRecursive(context, aquireEditServerAction(context, server.getId()));
Utils.encodeRecursive(context, aquireDeleteServerAction(context, server.getId()));
@@ -347,7 +347,7 @@ public class UIDeploymentServers extends UIInput
out.write(": | ");
if (server.getProperties().get(DeploymentServerConfig.PROP_HOST) != null)
{
- out.write((String)server.getProperties().get(DeploymentServerConfig.PROP_HOST));
+ out.write(Utils.encode((String)server.getProperties().get(DeploymentServerConfig.PROP_HOST)));
}
out.write(" | ");
@@ -382,7 +382,7 @@ public class UIDeploymentServers extends UIInput
out.write(":");
if (server.getProperties().get(DeploymentServerConfig.PROP_URL) != null)
{
- out.write((String)server.getProperties().get(DeploymentServerConfig.PROP_URL));
+ out.write(Utils.encode((String)server.getProperties().get(DeploymentServerConfig.PROP_URL)));
}
out.write(" | ");
@@ -391,7 +391,7 @@ public class UIDeploymentServers extends UIInput
out.write(":");
if (server.getProperties().get(DeploymentServerConfig.PROP_USER) != null)
{
- out.write((String)server.getProperties().get(DeploymentServerConfig.PROP_USER));
+ out.write(Utils.encode((String)server.getProperties().get(DeploymentServerConfig.PROP_USER)));
}
out.write(" | ");
out.write("");
@@ -401,7 +401,7 @@ public class UIDeploymentServers extends UIInput
out.write(":");
if (server.getProperties().get(DeploymentServerConfig.PROP_SOURCE_PATH) != null)
{
- out.write((String)server.getProperties().get(DeploymentServerConfig.PROP_SOURCE_PATH));
+ out.write(Utils.encode((String)server.getProperties().get(DeploymentServerConfig.PROP_SOURCE_PATH)));
}
out.write(" | ");
@@ -410,7 +410,7 @@ public class UIDeploymentServers extends UIInput
out.write(":");
if (server.getProperties().get(DeploymentServerConfig.PROP_EXCLUDES) != null)
{
- out.write((String)server.getProperties().get(DeploymentServerConfig.PROP_EXCLUDES));
+ out.write(Utils.encode((String)server.getProperties().get(DeploymentServerConfig.PROP_EXCLUDES)));
}
out.write(" | ");
@@ -421,7 +421,7 @@ public class UIDeploymentServers extends UIInput
out.write(":");
if (server.getProperties().get(DeploymentServerConfig.PROP_TARGET_NAME) != null)
{
- out.write((String)server.getProperties().get(DeploymentServerConfig.PROP_TARGET_NAME));
+ out.write(Utils.encode((String)server.getProperties().get(DeploymentServerConfig.PROP_TARGET_NAME)));
}
out.write(" | ");
}
diff --git a/source/web/scripts/ajax/deployment.js b/source/web/scripts/ajax/deployment.js
index 6dc5f68632..106f278396 100644
--- a/source/web/scripts/ajax/deployment.js
+++ b/source/web/scripts/ajax/deployment.js
@@ -106,6 +106,12 @@ Alfresco.checkDeployConfigPage = function()
button.onclick = function() {deployActionButtonPressed = true; clear_wizard();}
document.getElementById('wizard:wizard-body:deployServerHost').focus();
}
+
+ // if a scroll to id has been set, scroll there
+ if (window.SCROLL_TO_SERVER_CONFIG_ID)
+ {
+ Alfresco.scrollToEditServer(SCROLL_TO_SERVER_CONFIG_ID);
+ }
}
Alfresco.checkDeployConfigButtonState = function()
|