Create user via resful service [Solved]
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2011 02:02 PM
I am having a minor issue with a service I have.
I create a user via a restful service as stated in the documents.
it works except I wanted to set the user disabled and set there skype value.
should work any idea what my be my issue or does this not work as I would expect ?
service call
URL POST http://localhost/alfresco/service/api/people
content type : application/json
data:
{
"userName": "a44773x",
"enabled": false,
"firstName": "Michael",
"lastName": "Ford",
"jobtitle": "daskldas",
"email": "my@email.com",
"skype": "subscribe"
}
result:
{
"url": "\/alfresco\/service\/api\/person\/a44773x",
"userName": "a44773x",
"enabled": true,
"firstName": "Michael",
"lastName": "Ford",
"jobtitle": "daskldas",
"organization": null,
"location": null,
"telephone": null,
"mobile": null,
"email": "my@email.com",
"companyaddress1": null,
"companyaddress2": null,
"companyaddress3": null,
"companypostcode": null,
"companytelephone": null,
"companyfax": null,
"companyemail": null,
"skype": null,
"instantmsg": null,
"googleusername": null,
"quota": -1,
"sizeCurrent": 0,
"persondescription": null
}
I create a user via a restful service as stated in the documents.
it works except I wanted to set the user disabled and set there skype value.
should work any idea what my be my issue or does this not work as I would expect ?
service call
URL POST http://localhost/alfresco/service/api/people
content type : application/json
data:
{
"userName": "a44773x",
"enabled": false,
"firstName": "Michael",
"lastName": "Ford",
"jobtitle": "daskldas",
"email": "my@email.com",
"skype": "subscribe"
}
result:
{
"url": "\/alfresco\/service\/api\/person\/a44773x",
"userName": "a44773x",
"enabled": true,
"firstName": "Michael",
"lastName": "Ford",
"jobtitle": "daskldas",
"organization": null,
"location": null,
"telephone": null,
"mobile": null,
"email": "my@email.com",
"companyaddress1": null,
"companyaddress2": null,
"companyaddress3": null,
"companypostcode": null,
"companytelephone": null,
"companyfax": null,
"companyemail": null,
"skype": null,
"instantmsg": null,
"googleusername": null,
"quota": -1,
"sizeCurrent": 0,
"persondescription": null
}
Labels:
- Labels:
-
Archive
7 REPLIES 7
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2011 02:36 PM
Looking in the people.post.json.js webscript it seems we don't read all the parameters.
Please feel free to raise an enhancement request in JIRA.
Thanks,
Mike
Please feel free to raise an enhancement request in JIRA.
Thanks,
Mike
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2011 02:59 PM
Looking in the webscript it seems we don't read all the parameters.
Please feel free to raise an enhancement request in JIRA.
Thanks,
Mike
My problem on the add. (rtfm)
on reading again it states on the post username, first, last, email and password.
but on the put it should allow all. I will open one.
So dumb question where is people.post.json.js ?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2011 04:28 PM
Found people.post.json.js in alfresco\classes\alfresco\templates\org\alfresco\respository\person
I added
and I added at about 56
works like a champ. one question is there a way to extend the alfresco library like the share library without doing it inside the war file ?
I added
var enableAccount = ((json.has("disableAccount") && json.get("disableAccount")) == false); if (json.has("enabled")) { if (json.get("enabled") == false){ enableAccount = false; } }
at about line 38 and I added at about 56
if (json.has("skype")) { person.properties["skype"] = json.get("skype"); }
works like a champ. one question is there a way to extend the alfresco library like the share library without doing it inside the war file ?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2011 04:34 PM
…is there a way to extend the alfresco library like the share library without doing it inside the war file ?Yes, but use shared/classes/alfresco/extension instead of web-extension.
Thanks,
Mike
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2011 04:49 PM
…is there a way to extend the alfresco library like the share library without doing it inside the war file ?Yes, but use shared/classes/alfresco/extension instead of web-extension.
Thanks,
Mike
thanks
so that would be /shared/classes/alfresco/extension/org/alfresco/…. ??
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2011 05:55 PM
Edit: Not quite. It would be…is there a way to extend the alfresco library like the share library without doing it inside the war file ?Yes, but use shared/classes/alfresco/extension instead of web-extension.
Thanks,
Mike
thanks
so that would be /shared/classes/alfresco/extension/org/alfresco/…. ??
shared/classes/alfresco/extension/templates/webscripts/org/alfresco/…
Mike
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2011 05:57 PM
You Rock !!!
Thank you
Thank you
