AnsweredAssumed Answered

labs3beta: javascript api - createPerson

Question asked by stebans on Aug 19, 2008
Latest reply on Feb 17, 2009 by jerico.dev
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["usr:password"] = "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 "cm:person" object.

What do I miss??

Regards
Stéphane

Outcomes