mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged V3.2 to HEAD
16681: Fixed ETHREEOH-2454 "It's possible to create a group with less than 3 symbols in JSF client, but it's impossible to find it in Share client" - Group name can now only be between 3-100 characters in webclient git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@16901 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -51,6 +51,7 @@ public class CreateGroupDialog extends BaseDialogBean
|
||||
transient private AuthorityService authService;
|
||||
|
||||
private static final String MSG_ERR_EXISTS = "groups_err_exists";
|
||||
private static final String MSG_GROUPNAME_LENGTH = "groups_err_group_name_length";
|
||||
private static final String MSG_ERR_NAME = "groups_err_group_name";
|
||||
private static final String MSG_ROOT_GROUPS = "root_groups";
|
||||
private static final String MSG_BUTTON_NEW_GROUP = "new_group";
|
||||
@@ -154,8 +155,17 @@ public class CreateGroupDialog extends BaseDialogBean
|
||||
|
||||
public void validateGroupName(FacesContext context, UIComponent component, Object value) throws ValidatorException
|
||||
{
|
||||
String name = (String) value;
|
||||
|
||||
int minGroupNameLength = Application.getClientConfig(context).getMinGroupNameLength();
|
||||
|
||||
String name = ((String)value).trim();
|
||||
|
||||
if (name.length() < minGroupNameLength || name.length() > 100)
|
||||
{
|
||||
String err = MessageFormat.format(Application.getMessage(context, MSG_GROUPNAME_LENGTH),
|
||||
new Object[]{minGroupNameLength, 100});
|
||||
throw new ValidatorException(new FacesMessage(err));
|
||||
}
|
||||
|
||||
if (name.indexOf('"') != -1 || name.indexOf('\\') != -1)
|
||||
{
|
||||
String err = MessageFormat.format(Application.getMessage(context, MSG_ERR_NAME),
|
||||
|
@@ -80,6 +80,7 @@ public class ClientConfigElement extends ConfigElementAdapter
|
||||
private List<QName> simpleSearchAdditionalAttributes = null;
|
||||
private int minUsernameLength = 2;
|
||||
private int minPasswordLength = 3;
|
||||
private int minGroupNameLength = 3;
|
||||
private String breadcrumbMode = BREADCRUMB_PATH;
|
||||
private String cifsURLSuffix = null;
|
||||
private boolean languageSelect = true;
|
||||
@@ -276,7 +277,12 @@ public class ClientConfigElement extends ConfigElementAdapter
|
||||
{
|
||||
combinedElement.setMinPasswordLength(newElement.getMinPasswordLength());
|
||||
}
|
||||
|
||||
|
||||
if (newElement.getMinGroupNameLength() != combinedElement.getMinGroupNameLength())
|
||||
{
|
||||
combinedElement.setMinGroupNameLength(newElement.getMinGroupNameLength());
|
||||
}
|
||||
|
||||
if (newElement.getBreadcrumbMode() != null &&
|
||||
newElement.getBreadcrumbMode().equals(combinedElement.getBreadcrumbMode()) == false)
|
||||
{
|
||||
@@ -728,7 +734,23 @@ public class ClientConfigElement extends ConfigElementAdapter
|
||||
{
|
||||
this.minPasswordLength = minPasswordLength;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return Returns the minimum length for a group name.
|
||||
*/
|
||||
public int getMinGroupNameLength()
|
||||
{
|
||||
return this.minGroupNameLength;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param minGroupNameLength The minimum length of a group name
|
||||
*/
|
||||
/*package*/ void setMinGroupNameLength(int minGroupNameLength)
|
||||
{
|
||||
this.minGroupNameLength = minGroupNameLength;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the breadcrumb mode
|
||||
*
|
||||
|
@@ -64,6 +64,7 @@ public class ClientElementReader implements ConfigElementReader
|
||||
public static final String ELEMENT_SIMPLESEARCHADDITIONALATTRSQNAME = "qname";
|
||||
public static final String ELEMENT_MINUSERNAMELENGTH = "username-min-length";
|
||||
public static final String ELEMENT_MINPASSWORDLENGTH = "password-min-length";
|
||||
public static final String ELEMENT_MINGROUPNAMELENGTH = "group-name-min-length";
|
||||
public static final String ELEMENT_BREADCRUMB_MODE = "breadcrumb-mode";
|
||||
public static final String ELEMENT_CIFSURLSUFFIX = "cifs-url-suffix";
|
||||
public static final String ELEMENT_LANGUAGESELECT = "language-select";
|
||||
@@ -261,7 +262,14 @@ public class ClientElementReader implements ConfigElementReader
|
||||
{
|
||||
configElement.setMinPasswordLength(Integer.parseInt(minPassword.getTextTrim()));
|
||||
}
|
||||
|
||||
|
||||
// get the minimum length of group names
|
||||
Element minGroupName = element.element(ELEMENT_MINGROUPNAMELENGTH);
|
||||
if (minGroupName != null)
|
||||
{
|
||||
configElement.setMinGroupNameLength(Integer.parseInt(minGroupName.getTextTrim()));
|
||||
}
|
||||
|
||||
// get the breadcrumb mode
|
||||
Element breadcrumbMode = element.element(ELEMENT_BREADCRUMB_MODE);
|
||||
if (breadcrumbMode != null)
|
||||
|
Reference in New Issue
Block a user