mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Big honkin' merge from head. Sheesh!
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3617 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
package org.alfresco.web.bean.users;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.text.MessageFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
@@ -35,6 +36,8 @@ import org.alfresco.service.cmr.search.SearchParameters;
|
||||
import org.alfresco.service.cmr.search.SearchService;
|
||||
import org.alfresco.service.cmr.security.AuthenticationService;
|
||||
import org.alfresco.service.cmr.security.PersonService;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.util.ISO9075;
|
||||
import org.alfresco.web.app.Application;
|
||||
import org.alfresco.web.app.context.IContextListener;
|
||||
import org.alfresco.web.app.context.UIContextService;
|
||||
@@ -264,10 +267,10 @@ public class UsersBean implements IContextListener
|
||||
// create the node ref, then our node representation
|
||||
NodeRef ref = new NodeRef(Repository.getStoreRef(), id);
|
||||
Node node = new Node(ref);
|
||||
|
||||
|
||||
// remember the Person node
|
||||
setPerson(node);
|
||||
|
||||
|
||||
// clear the UI state in preparation for finishing the action
|
||||
// and returning to the main page
|
||||
contextUpdated();
|
||||
@@ -387,7 +390,39 @@ public class UsersBean implements IContextListener
|
||||
|
||||
return outcome;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Action handler called for the OK button press
|
||||
*/
|
||||
public String changeUserDetails()
|
||||
{
|
||||
String outcome = DIALOG_CLOSE;
|
||||
|
||||
FacesContext context = FacesContext.getCurrentInstance();
|
||||
try
|
||||
{
|
||||
Map<QName, Serializable> props = this.nodeService.getProperties(getPerson().getNodeRef());
|
||||
props.put(ContentModel.PROP_FIRSTNAME,
|
||||
(String)getPerson().getProperties().get(ContentModel.PROP_FIRSTNAME));
|
||||
props.put(ContentModel.PROP_LASTNAME,
|
||||
(String)getPerson().getProperties().get(ContentModel.PROP_LASTNAME));
|
||||
props.put(ContentModel.PROP_EMAIL,
|
||||
(String)getPerson().getProperties().get(ContentModel.PROP_EMAIL));
|
||||
|
||||
// persist changes
|
||||
this.nodeService.setProperties(getPerson().getNodeRef(), props);
|
||||
|
||||
// if the above call was successful, then reset Person Node in the session
|
||||
Application.getCurrentUser(context).reset();
|
||||
}
|
||||
catch (Throwable err)
|
||||
{
|
||||
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(
|
||||
context, Repository.ERROR_GENERIC), err.getMessage()), err );
|
||||
}
|
||||
|
||||
return outcome;
|
||||
}
|
||||
|
||||
/**
|
||||
* Event handler called when the user wishes to search for a user
|
||||
@@ -413,10 +448,11 @@ public class UsersBean implements IContextListener
|
||||
tx.begin();
|
||||
|
||||
// define the query to find people by their first or last name
|
||||
String search = ISO9075.encode(this.searchCriteria);
|
||||
String query = "( TYPE:\"{http://www.alfresco.org/model/content/1.0}person\") AND " +
|
||||
"((@\\{http\\://www.alfresco.org/model/content/1.0\\}firstName:" + this.searchCriteria +
|
||||
"*) OR (@\\{http\\://www.alfresco.org/model/content/1.0\\}lastName:" + this.searchCriteria +
|
||||
"*) OR (@\\{http\\://www.alfresco.org/model/content/1.0\\}userName:" + this.searchCriteria +
|
||||
"((@\\{http\\://www.alfresco.org/model/content/1.0\\}firstName:" + search +
|
||||
"*) OR (@\\{http\\://www.alfresco.org/model/content/1.0\\}lastName:" + search +
|
||||
"*) OR (@\\{http\\://www.alfresco.org/model/content/1.0\\}userName:" + search +
|
||||
"*)))";
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
|
Reference in New Issue
Block a user