cancel
Showing results for 
Search instead for 
Did you mean: 

labs3beta: javascript api - createPerson

stebans
Champ in-the-making
Champ in-the-making
Hi,

exploring the Labs-3.0beta, I've been trying the newly (awaited) added createPerson(username) from the Javascriopt API
ScriptNode createPerson(String username)
Create a Person (cm:person) with the given user name. Returns the person node created or null if the user name already exists.

How is this supposed to work?
    var user = people.createPerson("jfoo");
    user.properties["cm:firstName"] = "john";
    user.properties["cm:lastName"] = "foo";
    user.properties["usrSmiley Tongueassword"] = "psw";
With this code, a user with "jfoo" as username is displayed, even though the other attributes are not set. It's possible to update the user properties from the web client, but not the password (message: "A system error happened during the operation: User name does not exist: jfoo"). Using people.getPerson("jfoo") doesn't change anything, while being a "cmSmiley Tongueerson" object.

What do I miss??

Regards
Stéphane
1 REPLY 1

jerico_dev
Champ in-the-making
Champ in-the-making
Hi Stéphane,

var user = people.createPerson("jfoo");

With this code, a user with "jfoo" as username is displayed, even though the other attributes are not set.

I think you have to do a


user.save();

at the end.

See http://svn.alfresco.com/repos/alfresco-open-mirror/alfresco/HEAD/root/projects/remote-api/config/alf... for an example.

Is this what you were looking for?

Jerico
Getting started

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.