mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
ALF-8805 (RINF 40) - PersonService getPeople
- return PagingResults<PersonInfo> (follow CQ results pattern) git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@28627 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2005-2010 Alfresco Software Limited.
|
* Copyright (C) 2005-2011 Alfresco Software Limited.
|
||||||
*
|
*
|
||||||
* This file is part of Alfresco
|
* This file is part of Alfresco
|
||||||
*
|
*
|
||||||
@@ -37,8 +37,8 @@ import org.alfresco.repo.transaction.RetryingTransactionHelper;
|
|||||||
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
|
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
|
||||||
import org.alfresco.service.cmr.repository.NodeRef;
|
import org.alfresco.service.cmr.repository.NodeRef;
|
||||||
import org.alfresco.service.cmr.security.AuthorityService;
|
import org.alfresco.service.cmr.security.AuthorityService;
|
||||||
import org.alfresco.service.cmr.security.PagingPersonResults;
|
|
||||||
import org.alfresco.service.cmr.security.PersonService;
|
import org.alfresco.service.cmr.security.PersonService;
|
||||||
|
import org.alfresco.service.cmr.security.PersonService.PersonInfo;
|
||||||
import org.alfresco.web.app.Application;
|
import org.alfresco.web.app.Application;
|
||||||
import org.alfresco.web.bean.dialog.BaseDialogBean;
|
import org.alfresco.web.bean.dialog.BaseDialogBean;
|
||||||
import org.alfresco.web.bean.groups.GroupsDialog.UserAuthorityDetails;
|
import org.alfresco.web.bean.groups.GroupsDialog.UserAuthorityDetails;
|
||||||
@@ -206,22 +206,21 @@ public class AddUsersDialog extends BaseDialogBean
|
|||||||
String term = contains.trim();
|
String term = contains.trim();
|
||||||
if (term.length() != 0)
|
if (term.length() != 0)
|
||||||
{
|
{
|
||||||
PagingPersonResults people = getPersonService().getPeople(
|
List<PersonInfo> persons = getPersonService().getPeople(
|
||||||
Utils.generatePersonFilter(contains.trim()),
|
Utils.generatePersonFilter(contains.trim()),
|
||||||
true,
|
true,
|
||||||
Utils.generatePersonSort(),
|
Utils.generatePersonSort(),
|
||||||
new PagingRequest(Utils.getPersonMaxResults(), null)
|
new PagingRequest(Utils.getPersonMaxResults(), null)
|
||||||
);
|
).getPage();
|
||||||
List<NodeRef> nodes = people.getPage();
|
|
||||||
|
|
||||||
ArrayList<SelectItem> itemList = new ArrayList<SelectItem>(nodes.size());
|
ArrayList<SelectItem> itemList = new ArrayList<SelectItem>(persons.size());
|
||||||
for (NodeRef personRef : nodes)
|
for (PersonInfo person : persons)
|
||||||
{
|
{
|
||||||
String username = (String)getNodeService().getProperty(personRef, ContentModel.PROP_USERNAME);
|
String username = person.getUserName();
|
||||||
if (AuthenticationUtil.getGuestUserName().equals(username) == false)
|
if (AuthenticationUtil.getGuestUserName().equals(username) == false)
|
||||||
{
|
{
|
||||||
String firstName = (String)getNodeService().getProperty(personRef, ContentModel.PROP_FIRSTNAME);
|
String firstName = person.getFirstName();
|
||||||
String lastName = (String)getNodeService().getProperty(personRef, ContentModel.PROP_LASTNAME);
|
String lastName = person.getLastName();
|
||||||
|
|
||||||
// build a sensible label for display
|
// build a sensible label for display
|
||||||
String name = (firstName != null ? firstName : "") + ' ' + (lastName != null ? lastName : "");
|
String name = (firstName != null ? firstName : "") + ' ' + (lastName != null ? lastName : "");
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2005-2010 Alfresco Software Limited.
|
* Copyright (C) 2005-2011 Alfresco Software Limited.
|
||||||
*
|
*
|
||||||
* This file is part of Alfresco
|
* This file is part of Alfresco
|
||||||
*
|
*
|
||||||
@@ -33,8 +33,8 @@ import org.alfresco.query.PagingRequest;
|
|||||||
import org.alfresco.service.cmr.repository.InvalidNodeRefException;
|
import org.alfresco.service.cmr.repository.InvalidNodeRefException;
|
||||||
import org.alfresco.service.cmr.repository.NodeRef;
|
import org.alfresco.service.cmr.repository.NodeRef;
|
||||||
import org.alfresco.service.cmr.security.AuthenticationService;
|
import org.alfresco.service.cmr.security.AuthenticationService;
|
||||||
import org.alfresco.service.cmr.security.PagingPersonResults;
|
|
||||||
import org.alfresco.service.cmr.security.PersonService;
|
import org.alfresco.service.cmr.security.PersonService;
|
||||||
|
import org.alfresco.service.cmr.security.PersonService.PersonInfo;
|
||||||
import org.alfresco.service.namespace.QName;
|
import org.alfresco.service.namespace.QName;
|
||||||
import org.alfresco.util.ISO9075;
|
import org.alfresco.util.ISO9075;
|
||||||
import org.alfresco.util.Pair;
|
import org.alfresco.util.Pair;
|
||||||
@@ -129,26 +129,28 @@ public class DeleteUserDialog extends BaseDialogBean
|
|||||||
filter.add(new Pair<QName, String>(ContentModel.PROP_LASTNAME, search));
|
filter.add(new Pair<QName, String>(ContentModel.PROP_LASTNAME, search));
|
||||||
|
|
||||||
if (logger.isDebugEnabled())
|
if (logger.isDebugEnabled())
|
||||||
|
{
|
||||||
logger.debug("Query filter: " + filter);
|
logger.debug("Query filter: " + filter);
|
||||||
|
}
|
||||||
|
|
||||||
// Perform the search
|
List<PersonInfo> persons = getPersonService().getPeople(
|
||||||
PagingPersonResults people = getPersonService().getPeople(
|
|
||||||
filter,
|
filter,
|
||||||
true,
|
true,
|
||||||
Utils.generatePersonSort(),
|
Utils.generatePersonSort(),
|
||||||
new PagingRequest(Utils.getPersonMaxResults(), null)
|
new PagingRequest(Utils.getPersonMaxResults(), null)
|
||||||
);
|
).getPage();
|
||||||
List<NodeRef> nodes = people.getPage();
|
|
||||||
|
|
||||||
if (logger.isDebugEnabled())
|
if (logger.isDebugEnabled())
|
||||||
logger.debug("Found " + nodes.size() + " users");
|
{
|
||||||
|
logger.debug("Found " + persons.size() + " users");
|
||||||
|
}
|
||||||
|
|
||||||
this.users = new ArrayList<Node>(nodes.size());
|
this.users = new ArrayList<Node>(persons.size());
|
||||||
|
|
||||||
for (NodeRef nodeRef : nodes)
|
for (PersonInfo person : persons)
|
||||||
{
|
{
|
||||||
// create our Node representation
|
// create our Node representation
|
||||||
MapNode node = new MapNode(nodeRef);
|
MapNode node = new MapNode(person.getNodeRef());
|
||||||
|
|
||||||
// set data binding properties
|
// set data binding properties
|
||||||
// this will also force initialisation of the props now during the UserTransaction
|
// this will also force initialisation of the props now during the UserTransaction
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2005-2010 Alfresco Software Limited.
|
* Copyright (C) 2005-2011 Alfresco Software Limited.
|
||||||
*
|
*
|
||||||
* This file is part of Alfresco
|
* This file is part of Alfresco
|
||||||
*
|
*
|
||||||
@@ -33,7 +33,7 @@ import org.alfresco.model.ContentModel;
|
|||||||
import org.alfresco.query.PagingRequest;
|
import org.alfresco.query.PagingRequest;
|
||||||
import org.alfresco.service.cmr.repository.InvalidNodeRefException;
|
import org.alfresco.service.cmr.repository.InvalidNodeRefException;
|
||||||
import org.alfresco.service.cmr.repository.NodeRef;
|
import org.alfresco.service.cmr.repository.NodeRef;
|
||||||
import org.alfresco.service.cmr.security.PagingPersonResults;
|
import org.alfresco.service.cmr.security.PersonService.PersonInfo;
|
||||||
import org.alfresco.service.namespace.QName;
|
import org.alfresco.service.namespace.QName;
|
||||||
import org.alfresco.web.app.Application;
|
import org.alfresco.web.app.Application;
|
||||||
import org.alfresco.web.app.context.IContextListener;
|
import org.alfresco.web.app.context.IContextListener;
|
||||||
@@ -296,25 +296,28 @@ public class UsersDialog extends BaseDialogBean implements IContextListener, Cha
|
|||||||
// define the query to find people by their first or last name
|
// define the query to find people by their first or last name
|
||||||
String search = properties.getSearchCriteria();
|
String search = properties.getSearchCriteria();
|
||||||
if (logger.isDebugEnabled())
|
if (logger.isDebugEnabled())
|
||||||
logger.debug("Query term: " + search);
|
{
|
||||||
|
logger.debug("Query filter: " + search);
|
||||||
|
}
|
||||||
|
|
||||||
PagingPersonResults people = properties.getPersonService().getPeople(
|
List<PersonInfo> persons = properties.getPersonService().getPeople(
|
||||||
Utils.generatePersonFilter(search),
|
Utils.generatePersonFilter(search),
|
||||||
true,
|
true,
|
||||||
Utils.generatePersonSort(),
|
Utils.generatePersonSort(),
|
||||||
new PagingRequest(Utils.getPersonMaxResults(), null)
|
new PagingRequest(Utils.getPersonMaxResults(), null)
|
||||||
);
|
).getPage();
|
||||||
List<NodeRef> nodes = people.getPage();
|
|
||||||
|
|
||||||
if (logger.isDebugEnabled())
|
if (logger.isDebugEnabled())
|
||||||
logger.debug("Found " + nodes.size() + " users");
|
{
|
||||||
|
logger.debug("Found " + persons.size() + " users");
|
||||||
|
}
|
||||||
|
|
||||||
this.users = new ArrayList<Node>(nodes.size());
|
this.users = new ArrayList<Node>(persons.size());
|
||||||
|
|
||||||
for (NodeRef nodeRef : nodes)
|
for (PersonInfo person : persons)
|
||||||
{
|
{
|
||||||
// create our Node representation
|
// create our Node representation
|
||||||
MapNode node = new MapNode(nodeRef);
|
MapNode node = new MapNode(person.getNodeRef());
|
||||||
|
|
||||||
// set data binding properties
|
// set data binding properties
|
||||||
// this will also force initialisation of the props now during the UserTransaction
|
// this will also force initialisation of the props now during the UserTransaction
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2005-2010 Alfresco Software Limited.
|
* Copyright (C) 2005-2011 Alfresco Software Limited.
|
||||||
*
|
*
|
||||||
* This file is part of Alfresco
|
* This file is part of Alfresco
|
||||||
*
|
*
|
||||||
@@ -44,9 +44,9 @@ import org.alfresco.service.cmr.avm.AVMNodeDescriptor;
|
|||||||
import org.alfresco.service.cmr.repository.NodeRef;
|
import org.alfresco.service.cmr.repository.NodeRef;
|
||||||
import org.alfresco.service.cmr.security.AuthorityService;
|
import org.alfresco.service.cmr.security.AuthorityService;
|
||||||
import org.alfresco.service.cmr.security.AuthorityType;
|
import org.alfresco.service.cmr.security.AuthorityType;
|
||||||
import org.alfresco.service.cmr.security.PagingPersonResults;
|
|
||||||
import org.alfresco.service.cmr.security.PermissionService;
|
import org.alfresco.service.cmr.security.PermissionService;
|
||||||
import org.alfresco.service.cmr.security.PersonService;
|
import org.alfresco.service.cmr.security.PersonService;
|
||||||
|
import org.alfresco.service.cmr.security.PersonService.PersonInfo;
|
||||||
import org.alfresco.web.app.Application;
|
import org.alfresco.web.app.Application;
|
||||||
import org.alfresco.web.bean.repository.Repository;
|
import org.alfresco.web.bean.repository.Repository;
|
||||||
import org.alfresco.web.ui.common.SortableSelectItem;
|
import org.alfresco.web.ui.common.SortableSelectItem;
|
||||||
@@ -254,21 +254,19 @@ public class SetPermissionsDialog extends UpdatePermissionsDialog
|
|||||||
|
|
||||||
if (filterIndex == 0)
|
if (filterIndex == 0)
|
||||||
{
|
{
|
||||||
// Use lucene search to retrieve user details
|
List<PersonInfo> persons = getPersonService().getPeople(
|
||||||
PagingPersonResults people = getPersonService().getPeople(
|
|
||||||
Utils.generatePersonFilter(contains.trim()),
|
Utils.generatePersonFilter(contains.trim()),
|
||||||
true,
|
true,
|
||||||
Utils.generatePersonSort(),
|
Utils.generatePersonSort(),
|
||||||
new PagingRequest(Utils.getPersonMaxResults(), null)
|
new PagingRequest(Utils.getPersonMaxResults(), null)
|
||||||
);
|
).getPage();
|
||||||
List<NodeRef> nodes = people.getPage();
|
|
||||||
|
|
||||||
for (int index = 0; index < nodes.size(); index++)
|
for (int index = 0; index < persons.size(); index++)
|
||||||
{
|
{
|
||||||
NodeRef personRef = nodes.get(index);
|
PersonInfo person = persons.get(index);
|
||||||
String firstName = (String) getNodeService().getProperty(personRef, ContentModel.PROP_FIRSTNAME);
|
String firstName = person.getFirstName();
|
||||||
String lastName = (String) getNodeService().getProperty(personRef, ContentModel.PROP_LASTNAME);
|
String lastName = person.getLastName();
|
||||||
String username = (String) getNodeService().getProperty(personRef, ContentModel.PROP_USERNAME);
|
String username = person.getUserName();
|
||||||
if (username != null)
|
if (username != null)
|
||||||
{
|
{
|
||||||
SelectItem item = new SortableSelectItem(username, firstName + " " + lastName + " [" + username + "]", lastName);
|
SelectItem item = new SortableSelectItem(username, firstName + " " + lastName + " [" + username + "]", lastName);
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2005-2010 Alfresco Software Limited.
|
* Copyright (C) 2005-2011 Alfresco Software Limited.
|
||||||
*
|
*
|
||||||
* This file is part of Alfresco
|
* This file is part of Alfresco
|
||||||
*
|
*
|
||||||
@@ -44,9 +44,9 @@ import org.alfresco.service.cmr.dictionary.DictionaryService;
|
|||||||
import org.alfresco.service.cmr.repository.NodeRef;
|
import org.alfresco.service.cmr.repository.NodeRef;
|
||||||
import org.alfresco.service.cmr.security.AuthorityService;
|
import org.alfresco.service.cmr.security.AuthorityService;
|
||||||
import org.alfresco.service.cmr.security.AuthorityType;
|
import org.alfresco.service.cmr.security.AuthorityType;
|
||||||
import org.alfresco.service.cmr.security.PagingPersonResults;
|
|
||||||
import org.alfresco.service.cmr.security.PermissionService;
|
import org.alfresco.service.cmr.security.PermissionService;
|
||||||
import org.alfresco.service.cmr.security.PersonService;
|
import org.alfresco.service.cmr.security.PersonService;
|
||||||
|
import org.alfresco.service.cmr.security.PersonService.PersonInfo;
|
||||||
import org.alfresco.service.namespace.NamespaceService;
|
import org.alfresco.service.namespace.NamespaceService;
|
||||||
import org.alfresco.service.namespace.QName;
|
import org.alfresco.service.namespace.QName;
|
||||||
import org.alfresco.util.Pair;
|
import org.alfresco.util.Pair;
|
||||||
@@ -460,22 +460,21 @@ public abstract class BaseInviteUsersWizard extends BaseWizardBean
|
|||||||
logger.debug("Using query filter to find users: " + filter);
|
logger.debug("Using query filter to find users: " + filter);
|
||||||
}
|
}
|
||||||
|
|
||||||
PagingPersonResults people = getPersonService().getPeople(
|
List<PersonInfo> persons = getPersonService().getPeople(
|
||||||
filter,
|
filter,
|
||||||
true,
|
true,
|
||||||
Utils.generatePersonSort(),
|
Utils.generatePersonSort(),
|
||||||
new PagingRequest(maxResults, null)
|
new PagingRequest(maxResults, null)
|
||||||
);
|
).getPage();
|
||||||
List<NodeRef> nodes = people.getPage();
|
|
||||||
|
|
||||||
results = new ArrayList<SelectItem>(nodes.size());
|
results = new ArrayList<SelectItem>(persons.size());
|
||||||
for (int index=0; index<nodes.size(); index++)
|
for (int index=0; index<persons.size(); index++)
|
||||||
{
|
{
|
||||||
NodeRef personRef = nodes.get(index);
|
PersonInfo person = persons.get(index);
|
||||||
|
|
||||||
String firstName = (String)this.getNodeService().getProperty(personRef, ContentModel.PROP_FIRSTNAME);
|
String firstName = person.getFirstName();
|
||||||
String lastName = (String)this.getNodeService().getProperty(personRef, ContentModel.PROP_LASTNAME);
|
String lastName = person.getLastName();
|
||||||
String username = (String)this.getNodeService().getProperty(personRef, ContentModel.PROP_USERNAME);
|
String username = person.getUserName();
|
||||||
if (username != null)
|
if (username != null)
|
||||||
{
|
{
|
||||||
String name = (firstName != null ? firstName : "") + ' ' + (lastName != null ? lastName : "");
|
String name = (firstName != null ? firstName : "") + ' ' + (lastName != null ? lastName : "");
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2005-2010 Alfresco Software Limited.
|
* Copyright (C) 2005-2011 Alfresco Software Limited.
|
||||||
*
|
*
|
||||||
* This file is part of Alfresco
|
* This file is part of Alfresco
|
||||||
*
|
*
|
||||||
@@ -28,13 +28,11 @@ import javax.faces.context.FacesContext;
|
|||||||
import javax.faces.model.SelectItem;
|
import javax.faces.model.SelectItem;
|
||||||
import javax.transaction.UserTransaction;
|
import javax.transaction.UserTransaction;
|
||||||
|
|
||||||
import org.alfresco.model.ContentModel;
|
|
||||||
import org.alfresco.query.PagingRequest;
|
import org.alfresco.query.PagingRequest;
|
||||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||||
import org.alfresco.service.cmr.repository.NodeRef;
|
|
||||||
import org.alfresco.service.cmr.search.ResultSet;
|
import org.alfresco.service.cmr.search.ResultSet;
|
||||||
import org.alfresco.service.cmr.security.PagingPersonResults;
|
|
||||||
import org.alfresco.service.cmr.security.PersonService;
|
import org.alfresco.service.cmr.security.PersonService;
|
||||||
|
import org.alfresco.service.cmr.security.PersonService.PersonInfo;
|
||||||
import org.alfresco.service.cmr.workflow.WorkflowService;
|
import org.alfresco.service.cmr.workflow.WorkflowService;
|
||||||
import org.alfresco.web.app.Application;
|
import org.alfresco.web.app.Application;
|
||||||
import org.alfresco.web.bean.dialog.BaseDialogBean;
|
import org.alfresco.web.bean.dialog.BaseDialogBean;
|
||||||
@@ -50,6 +48,11 @@ import org.alfresco.web.ui.common.Utils;
|
|||||||
*/
|
*/
|
||||||
public abstract class BaseReassignDialog extends BaseDialogBean
|
public abstract class BaseReassignDialog extends BaseDialogBean
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private static final long serialVersionUID = 3392941403282035753L;
|
||||||
|
|
||||||
private static final String MSG_SEARCH_MINIMUM = "picker_search_min";
|
private static final String MSG_SEARCH_MINIMUM = "picker_search_min";
|
||||||
|
|
||||||
transient private WorkflowService workflowService;
|
transient private WorkflowService workflowService;
|
||||||
@@ -144,23 +147,21 @@ public abstract class BaseReassignDialog extends BaseDialogBean
|
|||||||
maxResults = Utils.getPersonMaxResults();
|
maxResults = Utils.getPersonMaxResults();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Use lucene search to retrieve user details
|
List<PersonInfo> persons = getPersonService().getPeople(
|
||||||
PagingPersonResults people = getPersonService().getPeople(
|
|
||||||
Utils.generatePersonFilter(contains.trim()),
|
Utils.generatePersonFilter(contains.trim()),
|
||||||
true,
|
true,
|
||||||
Utils.generatePersonSort(),
|
Utils.generatePersonSort(),
|
||||||
new PagingRequest(maxResults, null)
|
new PagingRequest(maxResults, null)
|
||||||
);
|
).getPage();
|
||||||
List<NodeRef> nodes = people.getPage();
|
|
||||||
|
|
||||||
ArrayList<SelectItem> itemList = new ArrayList<SelectItem>(nodes.size());
|
ArrayList<SelectItem> itemList = new ArrayList<SelectItem>(persons.size());
|
||||||
for (NodeRef personRef : nodes)
|
for (PersonInfo person : persons)
|
||||||
{
|
{
|
||||||
String username = (String)getNodeService().getProperty(personRef, ContentModel.PROP_USERNAME);
|
String username = person.getUserName();
|
||||||
if (AuthenticationUtil.getGuestUserName().equals(username) == false)
|
if (AuthenticationUtil.getGuestUserName().equals(username) == false)
|
||||||
{
|
{
|
||||||
String firstName = (String)this.getNodeService().getProperty(personRef, ContentModel.PROP_FIRSTNAME);
|
String firstName = person.getFirstName();
|
||||||
String lastName = (String)this.getNodeService().getProperty(personRef, ContentModel.PROP_LASTNAME);
|
String lastName = person.getLastName();
|
||||||
String name = (firstName != null ? firstName : "") + ' ' + (lastName != null ? lastName : "");
|
String name = (firstName != null ? firstName : "") + ' ' + (lastName != null ? lastName : "");
|
||||||
SelectItem item = new SortableSelectItem(username, name + " [" + username + "]", lastName != null ? lastName : username);
|
SelectItem item = new SortableSelectItem(username, name + " [" + username + "]", lastName != null ? lastName : username);
|
||||||
itemList.add(item);
|
itemList.add(item);
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2005-2010 Alfresco Software Limited.
|
* Copyright (C) 2005-2011 Alfresco Software Limited.
|
||||||
*
|
*
|
||||||
* This file is part of Alfresco
|
* This file is part of Alfresco
|
||||||
*
|
*
|
||||||
@@ -51,8 +51,8 @@ import org.alfresco.service.cmr.search.SearchParameters;
|
|||||||
import org.alfresco.service.cmr.search.SearchService;
|
import org.alfresco.service.cmr.search.SearchService;
|
||||||
import org.alfresco.service.cmr.security.AuthorityService;
|
import org.alfresco.service.cmr.security.AuthorityService;
|
||||||
import org.alfresco.service.cmr.security.AuthorityType;
|
import org.alfresco.service.cmr.security.AuthorityType;
|
||||||
import org.alfresco.service.cmr.security.PagingPersonResults;
|
|
||||||
import org.alfresco.service.cmr.security.PermissionService;
|
import org.alfresco.service.cmr.security.PermissionService;
|
||||||
|
import org.alfresco.service.cmr.security.PersonService.PersonInfo;
|
||||||
import org.alfresco.service.namespace.NamespaceService;
|
import org.alfresco.service.namespace.NamespaceService;
|
||||||
import org.alfresco.service.namespace.QName;
|
import org.alfresco.service.namespace.QName;
|
||||||
import org.alfresco.util.Pair;
|
import org.alfresco.util.Pair;
|
||||||
@@ -930,7 +930,6 @@ public abstract class BaseAssociationEditor extends UIInput
|
|||||||
* @param context Faces Context
|
* @param context Faces Context
|
||||||
* @param contains The contains part of the query
|
* @param contains The contains part of the query
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
protected void getAvailableOptions(FacesContext context, String contains)
|
protected void getAvailableOptions(FacesContext context, String contains)
|
||||||
{
|
{
|
||||||
AssociationDefinition assocDef = getAssociationDefinition(context);
|
AssociationDefinition assocDef = getAssociationDefinition(context);
|
||||||
@@ -1044,16 +1043,19 @@ public abstract class BaseAssociationEditor extends UIInput
|
|||||||
maxResults = Utils.getPersonMaxResults();
|
maxResults = Utils.getPersonMaxResults();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Perform the search
|
List<PersonInfo> persons = Repository.getServiceRegistry(context).getPersonService().getPeople(
|
||||||
PagingPersonResults people = Repository.getServiceRegistry(context).getPersonService().getPeople(
|
|
||||||
filter,
|
filter,
|
||||||
true,
|
true,
|
||||||
sort,
|
sort,
|
||||||
new PagingRequest(maxResults, null)
|
new PagingRequest(maxResults, null)
|
||||||
);
|
).getPage();
|
||||||
|
|
||||||
// Save the results
|
// Save the results
|
||||||
List<NodeRef> nodes = people.getPage();
|
List<NodeRef> nodes = new ArrayList<NodeRef>(persons.size());
|
||||||
|
for (PersonInfo person : persons)
|
||||||
|
{
|
||||||
|
nodes.add(person.getNodeRef());
|
||||||
|
}
|
||||||
this.availableOptions = nodes;
|
this.availableOptions = nodes;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Reference in New Issue
Block a user