mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged V3.1 to HEAD
13129: Merged V2.1-A to V3.1 8598: Fix for ADB-41 (ACT 1657) 13139: Merged V2.1-A to V3.1 8674: First phase of using group display name in UI 13148: Merged V2.1-A to V3.1 8679: Completion of using group display name in UI 13149: Merged V2.1-A to V3.1 8690: Fixed ADB-33 again 13150: Merged V2.1-A to V3.1 8775: Fix ACT-2399 13152: Merged V2.1-A to V3.1 8941: ACT-2631: added max users message to send email action page git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@13565 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -295,9 +295,24 @@ public abstract class BaseInviteUsersWizard extends BaseWizardBean
|
||||
}
|
||||
}
|
||||
|
||||
// reset max users flag
|
||||
this.maxUsersReturned = false;
|
||||
|
||||
return outcome;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.web.bean.dialog.BaseDialogBean#cancel()
|
||||
*/
|
||||
@Override
|
||||
public String cancel()
|
||||
{
|
||||
// reset max users flag
|
||||
this.maxUsersReturned = false;
|
||||
|
||||
return super.cancel();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.web.bean.dialog.BaseDialogBean#getFinishButtonDisabled()
|
||||
*/
|
||||
@@ -366,19 +381,30 @@ public abstract class BaseInviteUsersWizard extends BaseWizardBean
|
||||
// Use lucene search to retrieve user details
|
||||
String term = QueryParser.escape(contains.trim());
|
||||
StringBuilder query = new StringBuilder(128);
|
||||
query.append("@").append(NamespaceService.CONTENT_MODEL_PREFIX).append("\\:firstName:\"*");
|
||||
query.append(term);
|
||||
query.append("*\" @").append(NamespaceService.CONTENT_MODEL_PREFIX).append("\\:lastName:\"*");
|
||||
query.append(term);
|
||||
query.append("*\" @").append(NamespaceService.CONTENT_MODEL_PREFIX).append("\\:userName:");
|
||||
query.append(term);
|
||||
query.append("*");
|
||||
|
||||
if (contains == null || contains.length() == 0)
|
||||
{
|
||||
// if there is no search term, search for all people
|
||||
query.append("+TYPE:\"");
|
||||
query.append(ContentModel.TYPE_PERSON.toString());
|
||||
query.append("\"");
|
||||
}
|
||||
else
|
||||
{
|
||||
query.append("@").append(NamespaceService.CONTENT_MODEL_PREFIX).append("\\:firstName:\"*");
|
||||
query.append(term);
|
||||
query.append("*\" @").append(NamespaceService.CONTENT_MODEL_PREFIX).append("\\:lastName:\"*");
|
||||
query.append(term);
|
||||
query.append("*\" @").append(NamespaceService.CONTENT_MODEL_PREFIX).append("\\:userName:");
|
||||
query.append(term);
|
||||
query.append("*");
|
||||
}
|
||||
|
||||
int maxResults = Application.getClientConfig(context).getInviteUsersMaxResults();
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
logger.debug("Maximum invite users results size: " + maxResults);
|
||||
logger.debug("Using query to find users: " + query.toString());
|
||||
}
|
||||
|
||||
SearchParameters searchParams = new SearchParameters();
|
||||
@@ -428,12 +454,19 @@ public abstract class BaseInviteUsersWizard extends BaseWizardBean
|
||||
groups.addAll(getAuthorityService().getAllAuthorities(AuthorityType.EVERYONE));
|
||||
|
||||
String containsLower = contains.trim().toLowerCase();
|
||||
int offset = PermissionService.GROUP_PREFIX.length();
|
||||
String groupDisplayName;
|
||||
for (String group : groups)
|
||||
{
|
||||
if (group.toLowerCase().indexOf(containsLower, offset) != -1)
|
||||
// get display name, if not present strip prefix from group id
|
||||
groupDisplayName = authorityService.getAuthorityDisplayName(group);
|
||||
if (groupDisplayName == null || groupDisplayName.length() == 0)
|
||||
{
|
||||
results.add(new SortableSelectItem(group, group.substring(offset), group));
|
||||
groupDisplayName = group.substring(PermissionService.GROUP_PREFIX.length());
|
||||
}
|
||||
|
||||
if (groupDisplayName.toLowerCase().indexOf(containsLower) != -1)
|
||||
{
|
||||
results.add(new SortableSelectItem(group, groupDisplayName, groupDisplayName));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -684,8 +717,14 @@ public abstract class BaseInviteUsersWizard extends BaseWizardBean
|
||||
*/
|
||||
public String buildLabelForGroupAuthorityRole(String authority, String role)
|
||||
{
|
||||
String groupDisplayName = this.authorityService.getAuthorityDisplayName(authority);
|
||||
if (groupDisplayName == null || groupDisplayName.length() == 0)
|
||||
{
|
||||
groupDisplayName = authority.substring(PermissionService.GROUP_PREFIX.length());
|
||||
}
|
||||
|
||||
StringBuilder buf = new StringBuilder(100);
|
||||
buf.append(authority.substring(PermissionService.GROUP_PREFIX.length()))
|
||||
buf.append(groupDisplayName)
|
||||
.append(" (")
|
||||
.append(Application.getMessage(FacesContext.getCurrentInstance(), role))
|
||||
.append(")");
|
||||
|
Reference in New Issue
Block a user