labs3beta: javascript api - createPerson

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2008 06:59 AM
Hi,
exploring the Labs-3.0beta, I've been trying the newly (awaited) added createPerson(username) from the Javascriopt API
How is this supposed to work?
var user = people.createPerson("jfoo");
user.properties["cm:firstName"] = "john";
user.properties["cm:lastName"] = "foo";
user.properties["usr
assword"] = "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
erson" object.
What do I miss??
Regards
Stéphane
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

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

What do I miss??
Regards
Stéphane
Labels:
- Labels:
-
Archive
1 REPLY 1

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2009 02:34 PM
Hi Stéphane,
I think you have to do a
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
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
