site (xml)

Represents a site (a collection of users and tools) in the Sakai system
RESTful URLs: http://microformats.org/wiki/rest/urls
HTTP response codes as returned by the system:
200 - OK (request is ok and content returned)
201 - CREATED (request created new content, URL and id of content in the header)
204 - NO CONTENT (request is ok but no content to return)
400 - ERROR (general error in the request, probably invalid parameters or data)
401 - UNAUTHORIZED (user authentication required for this request)
403 - FORBIDDEN (authorization required, insufficient privileges, user is already authenticated)
404 - NOT FOUND (resource not found, URL is invalid in some way, id or action are invalid)
405 - METHOD NOT ALLOWED (the method is not supported for this entity type)
406 - NOT ACCEPTABLE (the data format requested is unavailable for this entity type)
500 - INTERNAL SERVER ERROR (general server failure, probably a failure in the provider)
501 - NOT IMPLEMENTED (indicates that a prefix is invalid)

Sample Entity URLs (_id=':ID:') [may not be valid]:

Entity Collection URL: GET /site (xml) (json) (html) (form)
Response Code Details: 200 plus data; 404 if not found, 406 if format unavailable
Retrieves the list of all sites that the current user can access. Supply a value for '_limit' to specify how many sites should be returned. Note that there is a system maximum that will override a specified value if it is larger than allowed. Supply a value for '_start' to page through results in multiple requests. For example, with 42 sites, requests with '_start' = 1, '_limit' = 50 and then '_start' = 51, '_limit' = 50 could be used to retrieve the first batch of 42 sites and the second being empty would signify the end of available results.
Create Entity URL: POST /site (form)
Response Code Details: 201 plus id (EntityId); 400 if inputs invalid
Adding a site will always set the owner/created by to the current user unless 'owner' is set to a userId, the minimum to create a site is the id and the type, all other fields are optional
Show Entity URL: GET /site/:ID: (xml) (json) (html) (form)
Response Code Details: 200 plus data; 404 if not found, 406 if format unavailable
Allows viewing of data from a single site, use 'includeGroups' (boolean) to also get the groups data with the site
Update Entity URL: PUT /site/:ID: (form)
Response Code Details: 204; 400 if inputs invalid
Can update all writeable fields in the site including owner
Delete Entity URL: DELETE /site/:ID: (form)
Response Code Details: 204; 404 if not found

Custom Actions

role : * : [/site/role] (xml) (json) (html) (form)
pages : show (GET) : [/site/:ID:/pages] (xml) (json) (html) (form)
Allows retrieval of all pages and tools in a site, use "props" (true/false, default false) to include page properties, use "config" (true/false, default false) to include tool configurations
setPerms : edit (PUT) : [/site/:ID:/setPerms]
Allows the setting of the permissions for the specified site by posting to the url /site/:SITEID:/setPerms. This is done by passing a set of post parameters where the key takes the form of 'ROLEID:FUNCTION' and the value is a boolean 'true' or 'false'. For example, passing the parameter 'maintain:blog.post.create=true' would switch the blog.post.create function on for the maintain role in the specified site.
exists : show (GET) : [/site/:ID:/exists] (xml) (json) (html) (form)
Returns an empty 200 if the site exists, and a failure (possibly 404) if it does not.
Note that you can also check this by simply using the show view of a site but that returns the site information as well so this is faster
perms : show (GET) : [/site/:ID:/perms] (xml) (json) (html) (form)
Allows the retrieval of the permissions for the specified site using a url like /site/:SITEID:/perms[/:PREFIX].json, where PREFIX allows the caller to limit the returned permissions to a subset. For example, the url '/direct/site/XYZ/perms/calendar.json' would return the calendar permissions for each role in the site 'XYZ'. Missing the PREFIX off would result in the permissions for all the tools in the site being returned.
userPerms : show (GET) : [/site/:ID:/userPerms] (xml) (json) (html) (form)
Allows the retrieval of the current user's permissions within the specified site using a url like /site/:SITEID:/userPerms[/:PREFIX], where PREFIX allows the caller to limit the returned permissions to a subset. For example, the url '/direct/site/XYZ/userPerms/calendar.json' would return the calendar permissions of the current user in the site 'XYZ'. Missing the PREFIX off would result in the permissions for all the tools in the site being returned.
withPerm : * : [/site/withPerm] (xml) (json) (html) (form)
The URL for example, /site/withPerm/.json?permission=site.upd
group : * : [/site/group] (xml) (json) (html) (form)
Allows access to group information directly using a url like: /site/siteId/group/groupId For membership actions use the Membership Provider
(GET) /direct/site/siteid/group/groupid - gets metadata for group but not membership.
(POST) /direct/site/siteid/group/groupid - updates metadata for group but not membership.
(PUT) /direct/site/siteid/group - create a new group in the site (returns group id). Parameters include title, description, optionally initial list of members.
(DELETE) /direct/site/siteid/group/groupid - delete an existing group in the site.
info : * : [/site/info] (xml) (json) (html) (form)

URL Redirects

1)   /site/{id}/memberships ==> calculated destination
Allows for retrieval of all memberships for a site by redirecting to the memberships entity provider

Entity class : org.sakaiproject.entitybroker.providers.model.EntitySite

Type :: bean
Name Type Status
1) activeEditbooleanRead Only
2) contactEmailstringRead Only
3) contactNamestringRead Only
4) createdDatejava.util.DateRead Only
5) createdTimeorg.sakaiproject.time.api.TimeRead Only
6) customPageOrderedbooleanRead/Write
7) descriptionstringRead/Write
8) emptybooleanRead Only
9) htmlDescriptionstringRead Only
10) htmlShortDescriptionstringRead Only
11) iconUrlstringRead/Write
12) iconUrlFullstringRead/Write
13) idstringRead/Write
14) infoUrlstringRead/Write
15) infoUrlFullstringRead/Write
16) joinablebooleanRead/Write
17) joinerRolestringRead/Write
18) lastModifiedlongRead/Write
19) maintainRolestringRead/Write
20) modifiedDatejava.util.DateRead Only
21) modifiedTimeorg.sakaiproject.time.api.TimeRead Only
22) ownerstringRead/Write
A userId, can be changed after a site is created but has no real effect if the contact info is set
23) propsjava.util.MapRead/Write
24) providerGroupIdstringRead/Write
25) pubViewbooleanRead/Write
26) publishedbooleanRead/Write
27) referencestringRead Only
28) shortDescriptionstringRead/Write
29) siteGroupsjava.util.ListRead Only
30) siteGroupsListjava.util.ListWrite Only
31) siteOwnerorg.sakaiproject.entitybroker.providers.model.OwnerRead Only
32) sitePagesjava.util.ListRead Only
33) skinstringRead/Write
34) softlyDeletedbooleanRead/Write
35) softlyDeletedDatejava.util.DateRead Only
36) titlestringRead/Write * required
37) typestringRead/Write * required
38) userRoles[Ljava.lang.String;Read/Write

Data and Request Handling

Output formats : xml, json, html, form
Input formats : html, xml, json
No Access Provider registered for request processing

Capabilities

NameTypeDescription
1CoreEntityProviderorg.sakaiproject.entitybroker.entityprovider.CoreEntityProvider
2EntityProviderorg.sakaiproject.entitybroker.entityprovider.EntityProvider
3ActionsExecutableorg.sakaiproject.entitybroker.entityprovider.capabilities.ActionsExecutable
4CRUDableorg.sakaiproject.entitybroker.entityprovider.capabilities.CRUDable
5CollectionResolvableorg.sakaiproject.entitybroker.entityprovider.capabilities.CollectionResolvable
6Createableorg.sakaiproject.entitybroker.entityprovider.capabilities.Createable
7Deleteableorg.sakaiproject.entitybroker.entityprovider.capabilities.Deleteable
8DepthLimitableorg.sakaiproject.entitybroker.entityprovider.capabilities.DepthLimitable
9Describeableorg.sakaiproject.entitybroker.entityprovider.capabilities.Describeable
10Inputableorg.sakaiproject.entitybroker.entityprovider.capabilities.Inputable
11Outputableorg.sakaiproject.entitybroker.entityprovider.capabilities.Outputable
12RESTfulorg.sakaiproject.entitybroker.entityprovider.capabilities.RESTful
13Redirectableorg.sakaiproject.entitybroker.entityprovider.capabilities.Redirectable
14RequestStorableorg.sakaiproject.entitybroker.entityprovider.capabilities.RequestStorable
15Resolvableorg.sakaiproject.entitybroker.entityprovider.capabilities.Resolvable
16Sampleableorg.sakaiproject.entitybroker.entityprovider.capabilities.Sampleable
17Saveableorg.sakaiproject.entitybroker.entityprovider.capabilities.Saveable
18Updateableorg.sakaiproject.entitybroker.entityprovider.capabilities.UpdateableThe owner (a userId) value can now be changed once the site is created

REST:: 1.0.1 SVN: $Revision$ : $Date$