Merged V3.2E to HEAD

17701: Fix for ETHREEOH-3691 - Blocker issue deleting a group
   17703: ETHREEOH-3688 - Impossibility to open Edit Metadata page for folders from Details page
   17705: ETHREEOH-3707 - Script error occurs when trying to invite external user to site
   17706: ETHREEOH-3678 - Blocker issue: the column 'Path' is empty for 'Move to' and 'Copy to' actions at 'View Detail' page
   17724: Merged DEV/TEMPORARY to V3.2
      17720: ETHREEOH-3703: Bootstrapped content refers to ALC
   17733: Fixes for ETHREEOH-3726, ETHREEOH-3660 and ETHREEOH-3629.
   17960: *RECORD ONLY* Fix for unclosed InputStream in PresentationContainer (already fixed in SpringSurf/3.3).

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@18163 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2010-01-20 10:57:18 +00:00
parent 984ee0a2aa
commit f387d887f0

View File

@@ -104,14 +104,14 @@ public class UIDeployWebsite extends UIInput
// If we have been grouping the checkboxes then the name will have been generated as follows // If we have been grouping the checkboxes then the name will have been generated as follows
// name = this.getClientId(context) + ":group1:child"; // name = this.getClientId(context) + ":group1:child";
Set<String> keys = valuesMap.keySet(); Set<String> keys = valuesMap.keySet();
for( String key : keys) for (String key : keys)
{ {
// Check whether the key matches the pattern for a child checkbox // Check whether the key matches the pattern for a child checkbox
if(key.matches(this.getClientId(context) + ParentChildCheckboxHelper.helperChildPattern)) if (key.matches(this.getClientId(context) + ParentChildCheckboxHelper.helperChildPattern))
{ {
// Key does matches the pattern for a child // Key does matches the pattern for a child
addValues(selectedNodes, valuesMap, key); addValues(selectedNodes, valuesMap, key);
} }
} }
// Need to convert between between Object[] and String[] otherwise we get a class cast exception in the // Need to convert between between Object[] and String[] otherwise we get a class cast exception in the
@@ -247,11 +247,11 @@ public class UIDeployWebsite extends UIInput
List<NodeRef> allocatedServers = DeploymentUtil.findAllocatedTestServers(getStore()); List<NodeRef> allocatedServers = DeploymentUtil.findAllocatedTestServers(getStore());
if (!allocatedServers.isEmpty()) if (!allocatedServers.isEmpty())
{ {
// there is at least one allocated server // there is at least one allocated server
for(NodeRef allocatedServer : allocatedServers) for(NodeRef allocatedServer : allocatedServers)
{ {
renderAllocatedTestServer(context, out, nodeService, allocatedServer); renderAllocatedTestServer(context, out, nodeService, allocatedServer);
} }
} }
else else
{ {
@@ -264,43 +264,41 @@ public class UIDeployWebsite extends UIInput
if (servers.size() > 0) if (servers.size() > 0)
{ {
ParentChildCheckboxHelper helper = new ParentChildCheckboxHelper(this.getClientId(context)); ParentChildCheckboxHelper helper = new ParentChildCheckboxHelper(this.getClientId(context));
//boolean first = true;
//String currentDisplayGroup = "";
boolean selected = false; boolean selected = false;
for (DeploymentServerConfig server: servers) for (DeploymentServerConfig server: servers)
{ {
// Get the display group // Get the display group
String displayGroup = (String)server.getProperties().get(DeploymentServerConfig.PROP_GROUP); String displayGroup = (String)server.getProperties().get(DeploymentServerConfig.PROP_GROUP);
helper.setCurrentDisplayGroup(displayGroup); helper.setCurrentDisplayGroup(displayGroup);
if(helper.newGroup) if(helper.newGroup)
{ {
out.write("<p class='mainSubTitle'>"); out.write("<p class='mainSubTitle'>");
out.write("<input type='checkbox' id='"); out.write("<input type='checkbox' id='");
out.write(helper.groupParentId); out.write(helper.groupParentId);
out.write("' value='"); out.write("' value='");
out.write(displayGroup); out.write(Utils.encode(displayGroup));
out.write("'"); out.write("'");
out.write(" "); out.write(" ");
out.write("onClick=\"select_all(\'"); out.write("onClick=\"select_all(\'");
out.write(helper.groupChildName); out.write(helper.groupChildName);
out.write("\', this.checked);\" "); out.write("\', this.checked);\" ");
out.write(" /> "); out.write(" /> ");
out.write(displayGroup); out.write(Utils.encode(displayGroup));
out.write("</p>"); out.write("</p>");
} }
if(helper.groupParentId.length() > 0) if (helper.groupParentId.length() > 0)
{ {
// render the test server with a child checkbox // render the test server with a child checkbox
renderCheckableServer(context, out, nodeService, server.getServerRef(), selected, helper.groupChildName, helper.groupParentId); renderCheckableServer(context, out, nodeService, server.getServerRef(), selected, helper.groupChildName, helper.groupParentId);
} }
else else
{ {
// render the test server without a parent checkbox // render the test server without a parent checkbox
renderCheckableServer(context, out, nodeService, server.getServerRef(), selected, this.getClientId(context)); renderCheckableServer(context, out, nodeService, server.getServerRef(), selected, this.getClientId(context));
} }
} }
} }
else else
@@ -342,34 +340,34 @@ public class UIDeployWebsite extends UIInput
String displayGroup = (String)server.getProperties().get(DeploymentServerConfig.PROP_GROUP); String displayGroup = (String)server.getProperties().get(DeploymentServerConfig.PROP_GROUP);
helper.setCurrentDisplayGroup(displayGroup); helper.setCurrentDisplayGroup(displayGroup);
if(helper.newGroup) if (helper.newGroup)
{ {
out.write("<p class='mainSubTitle'>"); out.write("<p class='mainSubTitle'>");
out.write("<input type='checkbox' id='"); out.write("<input type='checkbox' id='");
out.write(helper.groupParentId); out.write(helper.groupParentId);
out.write("' value='"); out.write("' value='");
out.write(displayGroup); out.write(Utils.encode(displayGroup));
out.write("'"); out.write("'");
out.write(" checked='checked' "); out.write(" checked='checked' ");
out.write("onClick=\"select_all(\'"); out.write("onClick=\"select_all(\'");
out.write(helper.groupChildName); out.write(helper.groupChildName);
out.write("\', this.checked);\" "); out.write("\', this.checked);\" ");
out.write(" /> "); out.write(" /> ");
out.write(displayGroup); out.write(Utils.encode(displayGroup));
out.write("</p>"); out.write("</p>");
} }
if(helper.groupParentId.length() > 0) if (helper.groupParentId.length() > 0)
{ {
// render the live server with a child checkbox // render the live server with a child checkbox
renderCheckableServer(context, out, nodeService, server.getServerRef(), selected, helper.groupChildName, helper.groupParentId); renderCheckableServer(context, out, nodeService, server.getServerRef(), selected, helper.groupChildName, helper.groupParentId);
} }
else else
{ {
// render the live server without a parent checkbox // render the live server without a parent checkbox
renderCheckableServer(context, out, nodeService, server.getServerRef(), selected, this.getClientId(context)); renderCheckableServer(context, out, nodeService, server.getServerRef(), selected, this.getClientId(context));
} }
} }
} }
@@ -590,22 +588,22 @@ public class UIDeployWebsite extends UIInput
out.write("<div class='deployPanelControl'>"); out.write("<div class='deployPanelControl'>");
out.write("<input type='checkbox' "); out.write("<input type='checkbox' ");
if(checkBoxName != null && checkBoxName.length() > 0) if (checkBoxName != null && checkBoxName.length() > 0)
{ {
out.write("name='"); out.write("name='");
out.write(checkBoxName); out.write(checkBoxName);
out.write("' "); out.write("' ");
// If there is a parent checkbox // If there is a parent checkbox
// generate java script of the form // generate java script of the form
// onClick="select_one('xxx', 'area');" // onClick="select_one('xxx', 'area');"
if(parentId != null && parentId.length() > 0 ) if (parentId != null && parentId.length() > 0 )
{ {
out.write("onClick=\"select_one(\'"); out.write("onClick=\"select_one(\'");
out.write(parentId); out.write(parentId);
out.write("\', \'"); out.write("\', \'");
out.write(checkBoxName); out.write(checkBoxName);
out.write("');\" "); out.write("');\" ");
} }
} }
out.write("value='"); out.write("value='");
@@ -619,15 +617,6 @@ public class UIDeployWebsite extends UIInput
renderPanelMiddle(out, contextPath, nodeService, server, true); renderPanelMiddle(out, contextPath, nodeService, server, true);
// if (selected == false)
// {
// out.write("<div class='deployPanelServerStatus'><img src='");
// out.write(contextPath);
// out.write("/images/icons/info_icon.gif' style='vertical-align: -5px;' />&nbsp;");
// out.write(Application.getMessage(context, "deploy_server_not_selected"));
// out.write("</div>");
// }
renderPanelEnd(out, contextPath); renderPanelEnd(out, contextPath);
} }
@@ -758,7 +747,7 @@ public class UIDeployWebsite extends UIInput
* @return a sorted list of DeploymentServerConfig objects. * @return a sorted list of DeploymentServerConfig objects.
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
private List<DeploymentServerConfig> toSortedDeploymentServerConfig(NodeService nodeService, List<NodeRef> refs) { private List<DeploymentServerConfig> toSortedDeploymentServerConfig(NodeService nodeService, List<NodeRef> refs) {
// Resolve the list of NodeRef to a list of DeploymentServerConfig. // Resolve the list of NodeRef to a list of DeploymentServerConfig.
List<DeploymentServerConfig> servers = new ArrayList<DeploymentServerConfig>(); List<DeploymentServerConfig> servers = new ArrayList<DeploymentServerConfig>();
for (NodeRef ref : refs) for (NodeRef ref : refs)
@@ -778,47 +767,46 @@ private List<DeploymentServerConfig> toSortedDeploymentServerConfig(NodeService
private class ParentChildCheckboxHelper private class ParentChildCheckboxHelper
{ {
private String clientId; private String clientId;
String currentDisplayGroup = ""; String currentDisplayGroup = "";
String groupChildName = ""; String groupChildName = "";
String groupParentId = ""; String groupParentId = "";
String groupName = ""; String groupName = "";
int groupNumber = 1; int groupNumber = 1;
boolean newGroup = false; boolean newGroup = false;
public ParentChildCheckboxHelper(String clientId) public ParentChildCheckboxHelper(String clientId)
{ {
this.clientId = clientId; this.clientId = clientId;
} }
public void setCurrentDisplayGroup(String currentDisplayGroup) public void setCurrentDisplayGroup(String currentDisplayGroup)
{ {
this.newGroup = !this.currentDisplayGroup.equalsIgnoreCase(currentDisplayGroup); this.newGroup = !this.currentDisplayGroup.equalsIgnoreCase(currentDisplayGroup);
this.currentDisplayGroup = currentDisplayGroup; this.currentDisplayGroup = currentDisplayGroup;
if(this.newGroup) if (this.newGroup)
{ {
changeGroup(currentDisplayGroup); changeGroup(currentDisplayGroup);
} }
} }
public String getCurrentDisplayGroup() public String getCurrentDisplayGroup()
{ {
return currentDisplayGroup; return currentDisplayGroup;
} }
private void changeGroup(String newGroupName) private void changeGroup(String newGroupName)
{ {
// Examples of HTML naming scheme
// jsp17:group1:parent, jsp17:group1:child
// jsp17:group2:parent, jsp17:group2:child
groupName = clientId + ":group" + Integer.toString(groupNumber++);
groupChildName = groupName + ":child";
groupParentId = groupName + ":parent";
}
// Examples of HTML naming scheme /**
// jsp17:group1:parent, jsp17:group1:child * Regex pattern for child checkbox names - matches implementation within changeGroup method of this class
// jsp17:group2:parent, jsp17:group2:child */
groupName = clientId + ":group" + Integer.toString(groupNumber++); static final String helperChildPattern = ":group[\\d]+:child";
groupChildName = groupName + ":child";
groupParentId = groupName + ":parent";
}
/**
* Regex pattern for child checkbox names - matches implementation within changeGroup method of this class
*/
static final String helperChildPattern = ":group[\\d]+:child";
} }
} }