08-28-2008 05:12 AM
06-16-2016 02:40 AM
12-04-2008 01:57 AM
Thanks for the clue.. I am able to create user by following your instructions..
12-04-2008 02:52 AM
//get the user data
String userName;
userName = user.getScreenName();
String passwd = user.getPassword();
String firstName = user.getFirstName();
String lastName = user.getLastName();
String email = user.getEmailAddress();
Map<QName, Serializable> props = null;
props = new HashMap<QName, Serializable>(5);
// homeFolder value must be a nodeRef
props.put(ContentModel.PROP_USERNAME, userName);
props.put(ContentModel.PROP_FIRSTNAME, firstName);
props.put(ContentModel.PROP_LASTNAME, lastName);
props.put(ContentModel.PROP_PASSWORD, passwd);
props.put(ContentModel.PROP_EMAIL, email);
try{
//WebApplicationContext configurationApplicationContext=WebApplicationContextUtils.getWebApplicationContext(this.getServlet().getServletContext());
//Alfresco connection
peopleService = (PeopleServiceImpl) configurationApplicationContext.getBean("peopleService");
searchService = (SearchServiceImpl) configurationApplicationContext.getBean("searchService");
nodeService = (NodeServiceImpl) configurationApplicationContext.getBean("nodeService");
configurationApplicationContext=WebApplicationContextUtils.getWebApplicationContext(this.getServlet().getServletContext());
authenticationService = (AuthenticationServiceImpl) configurationApplicationContext.getBean("authenticationService");
ticket = authenticationService.authenticate(repositoryUri, userid, password.toCharArray());
//Create the user in Alfresco and add it to the convenient groups
System.out.println("Creating the user called pruebaLray");
NodeRef userRef = peopleService.createPerson(ticket, userName, passwd.toCharArray(), props);
12-04-2008 11:22 AM
I want to set the folder "Company Home" as the user folder home, if anyone knows a better way to get the nodeRef of "Company Home" and how to set the property homeFolder as "Company Home" y will apreciate any help.
List<QName> properties = new Vector<QName>();
properties.add(ContentModel.PROP_NAME);
String query = "PATH:\"/app:company_home\"";
nodes = searchService.query(ticket, new StoreRef("workspace://SpacesStore"), SearchService.QueryLanguage.lucene, query,
properties, false, false, false, false, null, 1, null);
if (nodes != null) {
for (Node node: nodes) {
props.put(homeFolderQName, node.getNodeRef());
}
}
12-04-2008 11:34 AM
12-04-2008 03:14 PM
02-04-2009 06:54 AM
02-04-2009 07:19 AM
03-30-2010 08:20 AM
07-03-2010 11:56 AM
authenticationService.createAuthentication("testUser","testUser".toCharArray());
And now it doesn't compile.Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.