Partially applied patch from ETHREEOH-2145 to resolve combining issue in JSF client config

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@14510 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Gavin Cornwell
2009-06-03 09:44:15 +00:00
parent 35d40aa9cf
commit 67971c3851
6 changed files with 83 additions and 16 deletions

View File

@@ -24,6 +24,7 @@
*/
package org.alfresco.web.config;
import java.util.ArrayList;
import java.util.List;
import javax.faces.context.FacesContext;
@@ -80,7 +81,7 @@ public class ClientConfigElement extends ConfigElementAdapter
private int minUsernameLength = 2;
private int minPasswordLength = 3;
private String breadcrumbMode = BREADCRUMB_PATH;
private String cifsURLSuffix;
private String cifsURLSuffix = null;
private boolean languageSelect = true;
private boolean zeroByteFileUploads = true;
private boolean userGroupAdmin = true;
@@ -160,6 +161,38 @@ public class ClientConfigElement extends ConfigElementAdapter
combinedElement.setHomeSpacePermission(newElement.getHomeSpacePermission());
}
if (newElement.getCifsURLSuffix() == null)
{
combinedElement.setCifsURLSuffix(this.cifsURLSuffix);
}
else
{
combinedElement.setCifsURLSuffix(newElement.getCifsURLSuffix());
}
if (newElement.getSimpleSearchAdditionalAttributes() == null)
{
combinedElement.setSimpleSearchAdditionalAttributes(this.simpleSearchAdditionalAttributes);
}
else
{
if (this.simpleSearchAdditionalAttributes == null)
{
// there aren't any existing attributes so just use the new set
combinedElement.setSimpleSearchAdditionalAttributes(newElement.getSimpleSearchAdditionalAttributes());
}
else
{
// get the current list and add the additional attributes to it
List<QName> newAttrs = newElement.getSimpleSearchAdditionalAttributes();
List<QName> combinedAttrs = new ArrayList<QName>(
this.simpleSearchAdditionalAttributes.size() + newAttrs.size());
combinedAttrs.addAll(this.simpleSearchAdditionalAttributes);
combinedAttrs.addAll(newAttrs);
combinedElement.setSimpleSearchAdditionalAttributes(combinedAttrs);
}
}
// override default values if they have changed
if (newElement.getDefaultHomeSpacePath() != null &&
newElement.getDefaultHomeSpacePath().equals(combinedElement.getDefaultHomeSpacePath()) == false)
@@ -234,12 +267,6 @@ public class ClientConfigElement extends ConfigElementAdapter
combinedElement.setAllowGuestConfig(newElement.getAllowGuestConfig());
}
if (newElement.getSimpleSearchAdditionalAttributes() != null &&
newElement.getSimpleSearchAdditionalAttributes().equals(combinedElement.getSimpleSearchAdditionalAttributes()) == false)
{
combinedElement.setSimpleSearchAdditionalAttributes(newElement.getSimpleSearchAdditionalAttributes());
}
if (newElement.getMinUsernameLength() != combinedElement.getMinUsernameLength())
{
combinedElement.setMinUsernameLength(newElement.getMinUsernameLength());
@@ -250,12 +277,6 @@ public class ClientConfigElement extends ConfigElementAdapter
combinedElement.setMinPasswordLength(newElement.getMinPasswordLength());
}
if ( newElement.getCifsURLSuffix() != null &&
newElement.getCifsURLSuffix().equals(combinedElement.getCifsURLSuffix()) == false)
{
combinedElement.setCifsURLSuffix(newElement.getCifsURLSuffix());
}
if (newElement.getBreadcrumbMode() != null &&
newElement.getBreadcrumbMode().equals(combinedElement.getBreadcrumbMode()) == false)
{