public class CalendarRestApi extends Object implements org.exoplatform.services.rest.resource.ResourceContainer
| Modifier and Type | Class and Description |
|---|---|
static class |
CalendarRestApi.Expand |
| Modifier and Type | Field and Description |
|---|---|
static String |
ATTACHMENT_URI |
static String |
BASE_EVENT_URL |
static String |
BASE_URL |
static String |
CAL_BASE_URI |
static String |
CALENDAR_URI |
static String |
CATEGORY_URI |
static String |
DEFAULT_CAL_NAME |
static String |
DEFAULT_EVENT_NAME |
static String[] |
EVENT_AVAILABILITY |
static String |
EVENT_URI |
static String |
FEED_URI |
static String |
HEADER_LINK |
static String |
HEADER_LOCATION |
static String |
ICS_URI |
static String |
INVITATION_URI |
static String |
OCCURRENCE_URI |
static String[] |
PRIORITY |
static String[] |
REPEATTYPES |
static String[] |
RP_WEEKLY_BYDAY |
static String |
RSS_URI |
static String[] |
TASK_STATUS |
static String |
TASK_URI |
static String |
TEXT_ICS |
static javax.ws.rs.core.MediaType |
TEXT_ICS_TYPE |
| Constructor and Description |
|---|
CalendarRestApi(org.exoplatform.services.organization.OrganizationService orgService,
org.exoplatform.container.xml.InitParams params)
Contructor help to configure the rest service with parameters.
|
| Modifier and Type | Method and Description |
|---|---|
javax.ws.rs.core.Response |
createAttachmentForEvent(javax.ws.rs.core.UriInfo uriInfo,
String id,
Iterator<org.apache.commons.fileupload.FileItem> iter)
Creates attachments for an event with specified id if:
- the authenticated user is the owner of the calendar of the event
- for group calendars, the authenticated user has edit rights on the calendar
- the calendar of the event has been shared with the authenticated user, with modification rights
- the calendar of the event has been shared with a group of the authenticated user, with modification rights
This entry point only allow http POST request, with file input stream in the http form submit, and the id of event in the path
|
javax.ws.rs.core.Response |
createCalendar(CalendarResource cal,
javax.ws.rs.core.UriInfo uriInfo)
Creates a calendar if:
- this is a personal calendar and the user is authenticated.
|
javax.ws.rs.core.Response |
createEventForCalendar(String id,
EventResource evObject,
javax.ws.rs.core.UriInfo uriInfo)
Creates an event in a calendar with specified id only if:
- the authenticated user is the owner of the calendar
- for group calendars, the authenticated user has edit rights on the calendar
- the calendar has been shared with the authenticated user, with modification rights
- the calendar has been shared with a group of the authenticated user, with modification rights
This entry point only allow http POST request, with json object (evObject) in the request body.
|
javax.ws.rs.core.Response |
createInvitationForEvent(String id,
InvitationResource invitation,
javax.ws.rs.core.UriInfo uriInfo)
Creates an invitation in the event with the given id .
|
javax.ws.rs.core.Response |
createTaskForCalendar(String id,
TaskResource evObject,
javax.ws.rs.core.UriInfo uriInfo)
Creates a task for a calendar with specified id only if:
- the authenticated user is the owner of the calendar
- for group calendars, the authenticated user has edit rights on the calendar
- the calendar has been shared with the authenticated user, with modification rights
- the calendar has been shared with a group of the authenticated user, with modification rights
This entry point only allow http POST request, with json object (evObject) in the request body.
|
javax.ws.rs.core.Response |
deleteAttachmentById(String id)
Deletes an attachment with specified id if:
- the authenticated user is the owner of the calendar of the event
- for group calendars, the authenticated user has edit rights on the calendar
- the calendar of the event has been shared with the authenticated user, with modification rights
- the calendar of the event has been shared with a group of the authenticated user, with modification rights
|
javax.ws.rs.core.Response |
deleteCalendarById(String id)
Delete the calendar with the specified id if:
- the authenticated user is the owner of the calendar.
|
javax.ws.rs.core.Response |
deleteEventById(String id)
Delete an event with specified id parameter if:
- the authenticated user is the owner of the calendar of the event
- for group calendars, the authenticated user has edit rights on the calendar
- the calendar of the event has been shared with the authenticated user, with modification rights
- the calendar of the event has been shared with a group of the authenticated user, with modification rights
|
javax.ws.rs.core.Response |
deleteFeedById(String id)
Deletes a feed with the given id
Deletes the feed if the authenticated user is the owner of the feed
|
javax.ws.rs.core.Response |
deleteInvitationById(String id)
Delete an invitation with specified id if the authenticated user has edit rights on the calendar of the event of the invitation
|
javax.ws.rs.core.Response |
deleteTaskById(String id)
Deletes a task with specified id if:
- the authenticated user is the owner of the calendar of the event
- for group calendars, the authenticated user has edit rights on the calendar
- the calendar of the event has been shared with the authenticated user, with modification rights
- the calendar of the event has been shared with a group of the authenticated user, with modification rights
|
javax.ws.rs.core.Response |
exportCalendarToIcs(String id,
javax.ws.rs.core.Request request)
Returns an iCalendar formated file which is exported from the calendar with specified id if:
- the calendar is public
- the authenticated user is the owner of the calendar
- the authenticated user belongs to the group of the calendar
- the calendar has been shared with the authenticated user or with a group of the authenticated user
|
javax.ws.rs.core.Response |
getAttachmentById(String id,
String fields,
String jsonp,
javax.ws.rs.core.UriInfo uriInfo,
javax.ws.rs.core.Request request)
Returns an attachment with specified id if:
- the calendar of the event is public
- the authenticated user is the owner of the calendar of the event
- the authenticated user belongs to the group of the calendar of the event
- the authenticated user is a participant of the event
- the calendar of the event has been shared with the authenticated user or with a group of the authenticated user
|
javax.ws.rs.core.Response |
getAttachmentsFromEvent(String id,
int offset,
int limit,
String fields,
String jsonp,
javax.ws.rs.core.UriInfo uriInfo)
Returns attachments of an event with specified id if:
- the calendar of the event is public
- the authenticated user is the owner of the calendar of the event
- the authenticated user belongs to the group of the calendar of the event
- the authenticated user is a participant of the event
- the calendar of the event has been shared with the authenticated user or with a group of the authenticated user
|
javax.ws.rs.core.Response |
getCalendarById(String id,
String fields,
String jsonp,
javax.ws.rs.core.UriInfo uriInfo,
javax.ws.rs.core.Request request)
Returns the calendar with the specified id parameter if:
- The authenticated user is the owner of the calendar
- The authenticated user belongs to the group of the calendar
- The calendar has been shared with the authenticated user or with a group of the authenticated user
|
javax.ws.rs.core.Response |
getCalendars(String type,
int offset,
int limit,
boolean returnSize,
String fields,
String jsonp,
javax.ws.rs.core.UriInfo uri)
Search for calendars which:
- the authenticated user is the owner of the calendar.
|
javax.ws.rs.core.Response |
getEventById(String id,
String fields,
String expand,
String jsonp,
javax.ws.rs.core.UriInfo uriInfo,
javax.ws.rs.core.Request request)
Returns an event with specified id parameter if:
- the calendar of the event is public
- the authenticated user is the owner of the calendar of the event
- the authenticated user belongs to the group of the calendar of the event
- the authenticated user is a participant of the event
- the calendar of the event has been shared with the authenticated user or with a group of the authenticated user
|
javax.ws.rs.core.Response |
getEventCategories(int offset,
int limit,
String fields,
String jsonp,
javax.ws.rs.core.UriInfo uriInfo)
Returns the categories if an user is authenticated (the common categories + the personal categories)
|
javax.ws.rs.core.Response |
getEventCategoryById(String id,
String fields,
String jsonp,
javax.ws.rs.core.UriInfo uriInfo,
javax.ws.rs.core.Request request)
Returns the event category by id and it belongs to user
|
javax.ws.rs.core.Response |
getEventsByCalendar(String id,
String start,
String end,
String category,
int offset,
int limit,
String fields,
String jsonp,
String expand,
boolean returnSize,
javax.ws.rs.core.UriInfo uri)
Returns events of an calendar with specified id when:
- the calendar is public
- the authenticated user is the owner of the calendar of the event
- the authenticated user belongs to the group of the calendar of the event
- the authenticated user is a participant of the event
- the calendar of the event has been shared with the authenticated user or with a group of the authenticated user
|
javax.ws.rs.core.Response |
getFeedById(String id,
String fields,
String expand,
String jsonp,
javax.ws.rs.core.UriInfo uriInfo,
javax.ws.rs.core.Request request)
Gets a feed with the given id
Returns the feed if the authenticated user is the owner of the feed
|
javax.ws.rs.core.Response |
getInvitationById(String id,
String fields,
String jsonp,
String expand,
javax.ws.rs.core.UriInfo uriInfo,
javax.ws.rs.core.Request request)
Returns an invitation with specified id if:
- the authenticated user is the participant of the invitation
- the authenticated user has edit rights on the calendar of the event of the invitation
|
javax.ws.rs.core.Response |
getInvitationsFromEvent(String id,
int offset,
int limit,
boolean returnSize,
String status,
String fields,
String jsonp,
String expand,
javax.ws.rs.core.UriInfo uriInfo)
Returns invitations of an event with specified id when:
the authenticated user is the participant of the invitation
the authenticated user has edit rights on the calendar of the event of the invitation
|
javax.ws.rs.core.Response |
getOccurrencesFromEvent(String id,
int offset,
int limit,
String start,
String end,
String fields,
String jsonp,
String expand,
boolean returnSize,
javax.ws.rs.core.UriInfo uriInfo)
Returns occurrences of a recurring event with specified id when :
the calendar of the event is public
the authenticated user is the owner of the calendar of the event
the authenticated user belongs to the group of the calendar of the event
the authenticated user is a participant of the event
the calendar of the event has been shared with the authenticated user or with a group of the authenticated user
|
javax.ws.rs.core.Response |
getRssFromFeed(String id,
javax.ws.rs.core.UriInfo uri,
javax.ws.rs.core.Request request)
Gets the RSS stream of the feed with the given id
Returns the RSS stream if:
- the calendar is public
- the authenticated user is the owner of the calendar
- the authenticated user belongs to the group of the calendar
- the calendar has been shared with the authenticated user or with a group of the authenticated user
|
javax.ws.rs.core.Response |
getSubResources(javax.ws.rs.core.UriInfo uri)
Return all the available subresources as json, in order to navigate easily in the REST API.
|
javax.ws.rs.core.Response |
getTaskById(String id,
String fields,
String expand,
String jsonp,
javax.ws.rs.core.UriInfo uriInfo,
javax.ws.rs.core.Request request)
Returns a task with specified id if: same rules as /events/{id}
#getEventById(String, String, String, String) |
javax.ws.rs.core.Response |
getTasksByCalendar(String id,
String start,
String end,
String category,
int offset,
int limit,
String fields,
String jsonp,
String expand,
boolean returnSize,
javax.ws.rs.core.UriInfo uri)
Returns tasks of a calendar with specified id when:
- the calendar is public
- the authenticated user is the owner of the calendar of the task
- the authenticated user belongs to the group of the calendar of the task
- the authenticated user is delegated by the task
- the calendar of the task has been shared with the authenticated user or with a group of the authenticated user
|
javax.ws.rs.core.Response |
updateCalendarById(String id,
CalendarResource calObj)
Update the calendar with specified id if:
- the authenticated user is the owner of the calendar
- for group calendars, the authenticated user has edit rights on the calendar
This entry point only allow http PUT request, with json object (calObj) in the request body, and calendar id in the path.
|
javax.ws.rs.core.Response |
updateEventById(String id,
EventResource evObject)
Updates the event with specified id if:
- the authenticated user is the owner of the calendar of the event
- for group calendars, the authenticated user has edit rights on the calendar
- the calendar of the event has been shared with the authenticated user, with modification rights
- the calendar of the event has been shared with a group of the authenticated user, with modification rights
This entry point only allow http PUT request, with json object (evObject) in the request body, and event id in the path.
|
javax.ws.rs.core.Response |
updateFeedById(String id,
FeedResource feedResource)
Updates a feed with the given id
Updates the feed if the authenticated user is the owner of the feed
This entry point only allow http PUT request, with json object (feedResource) in the request body, and feed id in the path.
|
javax.ws.rs.core.Response |
updateInvitationById(String id,
String status)
Update the invitation if the authenticated user is the participant of the invitation
This entry point only allow http PUT request, with id of invitation in the path, and the status
|
javax.ws.rs.core.Response |
updateTaskById(String id,
TaskResource evObject)
Updates a task with the specified id if:
- the authenticated user is the owner of the calendar of the event
- for group calendars, the authenticated user has edit rights on the calendar
- the calendar of the event has been shared with the authenticated user, with modification rights
- the calendar of the event has been shared with a group of the authenticated user, with modification rights
This entry point only allow http PUT request, with json object (evObject) in the request body, and task id in the path.
|
public static final String CAL_BASE_URI
public static final String TEXT_ICS
public static final javax.ws.rs.core.MediaType TEXT_ICS_TYPE
public static final String BASE_URL
public static final String BASE_EVENT_URL
public static final String CALENDAR_URI
public static final String EVENT_URI
public static final String TASK_URI
public static final String ICS_URI
public static final String ATTACHMENT_URI
public static final String OCCURRENCE_URI
public static final String CATEGORY_URI
public static final String FEED_URI
public static final String RSS_URI
public static final String INVITATION_URI
public static final String HEADER_LINK
public static final String HEADER_LOCATION
public static final String DEFAULT_CAL_NAME
public static final String DEFAULT_EVENT_NAME
public static final String[] RP_WEEKLY_BYDAY
public static final String[] EVENT_AVAILABILITY
public static final String[] REPEATTYPES
public static final String[] PRIORITY
public static final String[] TASK_STATUS
public CalendarRestApi(org.exoplatform.services.organization.OrganizationService orgService,
org.exoplatform.container.xml.InitParams params)
orgService - exo organization service implementationparams - Object contains the configuration parameters.@RolesAllowed(value="users") public javax.ws.rs.core.Response getSubResources(@Context javax.ws.rs.core.UriInfo uri)
@RolesAllowed(value="users") public javax.ws.rs.core.Response getCalendars(String type, int offset, int limit, boolean returnSize, String fields, String jsonp, @Context javax.ws.rs.core.UriInfo uri)
type - The calendar type to search for. It can be one of *personal, group, shared*.
If this is omitted OR an unknown type is specified, it will search for *all* types.offset - The starting point when paging through a list of entities. Defaults to *0*.limit - The maximum number of results when paging through a list of entities, if not specify or exceed
the *query_limit* configuration of calendar rest service, it will use the *query_limit*
(see more on CalendarRestApi(OrganizationService, InitParams) java doc)resturnSize - Tell the service if it must return the total size of the returned collection result,
and the *link* http headers.
It can be true or false, by default, it's *false*fields - This is a list of comma-separated property's names of response json object,
if not specified, it return the json will all available properties.jsonp - The name of a JavaScript function to be used as the JSONP callback, if not specified, only
json object is returned.@RolesAllowed(value="users") public javax.ws.rs.core.Response createCalendar(CalendarResource cal, @Context javax.ws.rs.core.UriInfo uriInfo)
cal - JSON object contains attributes of calendar object to create.
All attributes are optional. If specified explicitly, calendar name must not empty,
contains only letter, digit, space, "-", "_" characters. Default value of calendar name is: calendar.@RolesAllowed(value="users") public javax.ws.rs.core.Response getCalendarById(String id, String fields, String jsonp, @Context javax.ws.rs.core.UriInfo uriInfo, @Context javax.ws.rs.core.Request request)
id - identity of the calendar to retrievefields - This is a list of comma-separated property's names of response json object,
if not specified, it return the json will all available properties (id, href, name, description, type, timezone,
color, owner, viewPermission, editPermision, groups, publicURL, privateURL, icsURL)jsonp - The name of a JavaScript function to be used as the JSONP callback, if not specified, only
json object is returned@RolesAllowed(value="users") public javax.ws.rs.core.Response updateCalendarById(String id, CalendarResource calObj)
id - identity of the calendar to updatecalObj - json object contains attributes of calendar object to update, all the attributes are optional.
The calendar name must not empty, contains only letter, digit, space, "-", "_" characters@RolesAllowed(value="users") public javax.ws.rs.core.Response deleteCalendarById(String id)
id - identity of the calendar to delete@RolesAllowed(value="users") public javax.ws.rs.core.Response exportCalendarToIcs(String id, @Context javax.ws.rs.core.Request request)
id - identity of the calendar to retrieve ICS file@RolesAllowed(value="users") public javax.ws.rs.core.Response getEventById(String id, String fields, String expand, String jsonp, @Context javax.ws.rs.core.UriInfo uriInfo, @Context javax.ws.rs.core.Request request)
id - identity of event to findfields - This is a list of comma separated property's names of response json object,
if not specified, it return the json will all available properties.jsonp - The name of a JavaScript function to be used as the JSONP callback, if not specified, only
json object is returned.expand - used to ask for a full representation of a subresource, instead of only its link.
This is a list of comma-separated property's names. For example: expand=calendar,categories. In case of collections,
you can put offset (default: 0), limit (default: *query_limit*) value into param. For example, expand=categories(1,5).
Instead of:
{
id: "...",
calendar: "http://localhost:8080/portal/rest/v1/calendar/calendars/demo-defaultCalendarId"
....
}
It returns:
{
id: "...",
calendar: {
id: "...",
name:"demo-"efaultId",
....
}
....
}@RolesAllowed(value="users") public javax.ws.rs.core.Response updateEventById(String id, EventResource evObject)
id - identity of the event to updateevObject - json object contains attributes of event object to update, all the attributes are optional.
If provided explitly (not null), attributes are checked with some rules:
1. subject must not be empty
2. availability can only be one of "available", "busy", "outside"
3. repeat.repeatOn can only be one of"MO", "TU", "WE", "TH", "FR", "SA", "SU"
4. repeat.repeatBy must be >= 1 and <= 31
5. repeat.repeatType must be one of "norepeat", "daily", "weekly", "monthly", "yearly"
6. "from" date must be before "to" date
7. priority must be one of "none", "high", "normal", "low"
8. privacy can only be public or private@RolesAllowed(value="users") public javax.ws.rs.core.Response deleteEventById(String id)
id - identity of the event to delete@RolesAllowed(value="users") public javax.ws.rs.core.Response getAttachmentsFromEvent(String id, int offset, int limit, String fields, String jsonp, @Context javax.ws.rs.core.UriInfo uriInfo)
id - identity of event that being query for attachmentsoffset - The starting point when paging through a list of entities. Defaults to *0*.limit - The maximum number of results when paging through a list of entities, if not specify or exceed
the *query_limit* configuration of calendar rest service, it will use the *query_limit*
(see more on CalendarRestApi(OrganizationService, InitParams) java doc)fields - This is a list of comma-separated property's names of response json object,
if not specified, it return the json will all available properties.jsonp - The name of a JavaScript function to be used as the JSONP callback, if not specified, only
json object is returned.@RolesAllowed(value="users") public javax.ws.rs.core.Response createAttachmentForEvent(@Context javax.ws.rs.core.UriInfo uriInfo, String id, Iterator<org.apache.commons.fileupload.FileItem> iter)
id - identity of event to create attachmentiter - Iterator of org.apache.commons.fileupload.FileItem object
(eXo rest framework use apache file upload to parse the input stream of http form submit request, and inject FileItem objects@RolesAllowed(value="users") public javax.ws.rs.core.Response getEventsByCalendar(String id, String start, String end, String category, int offset, int limit, String fields, String jsonp, String expand, boolean returnSize, @Context javax.ws.rs.core.UriInfo uri) throws Exception
id - identity of a calendar to search for eventsstart - date follow ISO8601 (YYYY-MM-DDThh:mm:ssTZD). Search for events *from* this date.
Default: current server time.end - date follow ISO8601 (YYYY-MM-DDThh:mm:ssTZD). Search for events *to* this date
Default: current server time + 1 week.category - search for this category only. If not specify, search event of any categoryoffset - The starting point when paging through a list of entities. Defaults to *0*.limit - The maximum number of results when paging through a list of entities, if not specify or exceed
the *query_limit* configuration of calendar rest service, it will use the *query_limit*
(see more on CalendarRestApi(OrganizationService, InitParams) java doc)resturnSize - tell the service if it must return the total size of the returned collection result, and the *link* http headers.
It can be true or false, by default, it's *false*fields - This is a list of comma separated property's names of response json object,
if not specified, it return the json will all available properties.jsonp - The name of a JavaScript function to be used as the JSONP callback, if not specified, only
json object is returned.expand - used to ask for a full representation of a subresource, instead of only its link.
This is a list of comma-separated property's names. For example: expand=calendar,categories. In case of collections,
you can put offset (default: 0), limit (default: *query_limit* of the rest service) value into param, for example: expand=categories(1,5).
Instead of:
{
id: "...",
calendar: "http://localhost:8080/portal/rest/v1/calendar/calendars/demo-defaultCalendarId"
....
}
It returns:
{
id: "...",
calendar: {
id: "...",
name:"demo-defaultId",
....
}
....
}Exception@RolesAllowed(value="users") public javax.ws.rs.core.Response createEventForCalendar(String id, EventResource evObject, @Context javax.ws.rs.core.UriInfo uriInfo)
evObject - json object contains attributes of event object to create.
All attribute are optional. If provided explitly (not null), attributes are checked with some rules:
1. subject must not be empty, default value is: default
2. availability can only be one of "available", "busy", "outside"
3. repeat.repeatOn can only be one of"MO", "TU", "WE", "TH", "FR", "SA", "SU"
4. repeat.repeatBy must be >= 1 and <= 31
5. repeat.repeatType must be one of "norepeat", "daily", "weekly", "monthly", "yearly"
6. "from" date must be before "to" date
7. priority must be one of "none", "high", "normal", "low"
8. privacy can only be public or privateid - identity of the *calendar* to create event@RolesAllowed(value="users") public javax.ws.rs.core.Response getOccurrencesFromEvent(String id, int offset, int limit, String start, String end, String fields, String jsonp, String expand, boolean returnSize, @Context javax.ws.rs.core.UriInfo uriInfo)
id - identity of recurrence event, if event not exists, return 404 http status codestart - date follow ISO8601 (YYYY-MM-DDThh:mm:ssTZD). Search for events *from* this date.
Default: current server time.end - date follow ISO8601 (YYYY-MM-DDThh:mm:ssTZD). Search for events *to* this date
Default: current server time + 1 week.offset - The starting point when paging through a list of entities. Defaults to *0*.limit - The maximum number of results when paging through a list of entities, if not specify or exceed
the *query_limit* configuration of calendar rest service, it will use the *query_limit*
(see more on CalendarRestApi(OrganizationService, InitParams) java doc)resturnSize - tell the service if it must return the total size of the returned collection result, and the *link* http headers.
It can be true or false, by default, it's *false*fields - This is a list of comma separated property's names of response json object,
if not specified, it return the json will all available properties.jsonp - The name of a JavaScript function to be used as the JSONP callback, if not specified, only
json object is returned.expand - used to ask for a full representation of a subresource, instead of only its link.
This is a list of comma-separated property's names. For example: expand=calendar,categories. In case of collections,
you can put offset (default: 0), limit (default: *query_limit* of the rest service) value into param, for example: expand=categories(1,5).
Instead of:
{
id: "...",
calendar: "http://localhost:8080/portal/rest/v1/calendar/calendars/demo-defaultCalendarId"
....
}
It returns:
{
id: "...",
calendar: {
id: "...",
name:"demo-defaultId",
....
}
....
}@RolesAllowed(value="users") public javax.ws.rs.core.Response getTasksByCalendar(String id, String start, String end, String category, int offset, int limit, String fields, String jsonp, String expand, boolean returnSize, @Context javax.ws.rs.core.UriInfo uri) throws Exception
id - identity of a calendar to search for tasksstart - date follow ISO8601 (YYYY-MM-DDThh:mm:ssTZD). Search for events *from* this date.
Default: current server time.end - date follow ISO8601 (YYYY-MM-DDThh:mm:ssTZD). Search for events *to* this date
Default: current server time + 1 week.category - search for this category only. If not specify, search task of any categoryoffset - The starting point when paging through a list of entities. Defaults to *0*.limit - The maximum number of results when paging through a list of entities, if not specify or exceed
the *query_limit* configuration of calendar rest service, it will use the *query_limit*
(see more on CalendarRestApi(OrganizationService, InitParams) java doc)resturnSize - tell the service if it must return the total size of the returned collection result, and the *link* http headers.
It can be true or false, by default, it's *false*fields - This is a list of comma separated property's names of response json object,
if not specified, it return the json will all available properties.jsonp - The name of a JavaScript function to be used as the JSONP callback, if not specified, only
json object is returned.expand - used to ask for a full representation of a subresource, instead of only its link.
This is a list of comma-separated property's names. For example: expand=calendar,categories. In case of collections,
you can put offset (default: 0), limit (default: *query_limit* of the rest service) value into param, for example: expand=categories(1,5).
Instead of:
{
id: "...",
calendar: "http://localhost:8080/portal/rest/v1/calendar/calendars/demo-defaultCalendarId"
....
}
It returns:
{
id: "...",
calendar: {
id: "...",
name:"demo-defaultId",
....
}
....
}Exception@RolesAllowed(value="users") public javax.ws.rs.core.Response createTaskForCalendar(String id, TaskResource evObject, @Context javax.ws.rs.core.UriInfo uriInfo)
evObject - json object contains attributes of task object to create.
All attribute are optional. If provided explitly (not null), attributes are checked with some rules:
1. name must not be empty, default value is: "default".
2. "from" date must be before "to" date
3. priority must be one of "none", "high", "normal", "low"
4. status must be one of "needs-action", "completed", "in-progress", "canceled"id - identity of the *calendar* to create task@RolesAllowed(value="users") public javax.ws.rs.core.Response getTaskById(String id, String fields, String expand, String jsonp, @Context javax.ws.rs.core.UriInfo uriInfo, @Context javax.ws.rs.core.Request request)
#getEventById(String, String, String, String)id - identity of task to findfields - This is a list of comma separated property's names of response json object,
if not specified, it return the json will all available properties.jsonp - The name of a JavaScript function to be used as the JSONP callback, if not specified, only
json object is returned.expand - used to ask for a full representation of a subresource, instead of only its link.
This is a list of comma-separated property's names. For example: expand=calendar,categories. In case of collections,
you can put offset (default: 0), limit (default: *query_limit* of the rest service) value into param, for example: expand=categories(1,5).
Instead of:
{
id: "...",
calendar: "http://localhost:8080/portal/rest/v1/calendar/calendars/demo-defaultCalendarId"
....
}
It returns:
{
id: "...",
calendar: {
id: "...",
name:"demo-defaultId",
....
}
....
}@RolesAllowed(value="users") public javax.ws.rs.core.Response updateTaskById(String id, TaskResource evObject)
id - identity of the task to updateevObject - json object contains attributes of task object to update, all the attributes are optional.
If provided explitly (not null), attributes are checked with some rules:
1. name must not be empty
2. "from" date must be before "to" date
3. priority must be one of "none", "high", "normal", "low"
4. status must be one of "needs-action", "completed", "in-progress", "canceled"@RolesAllowed(value="users") public javax.ws.rs.core.Response deleteTaskById(String id)
id - identity of the task to delete@RolesAllowed(value="users") public javax.ws.rs.core.Response getAttachmentById(String id, String fields, String jsonp, @Context javax.ws.rs.core.UriInfo uriInfo, @Context javax.ws.rs.core.Request request)
id - identity of attachment to findfields - This is a list of comma separated property's names of response json object,
if not specified, it return the json will all available properties.jsonp - The name of a JavaScript function to be used as the JSONP callback, if not specified, only
json object is returned.@RolesAllowed(value="users") public javax.ws.rs.core.Response deleteAttachmentById(String id)
id - identity of the attachment to delete@RolesAllowed(value="users") public javax.ws.rs.core.Response getEventCategories(int offset, int limit, String fields, String jsonp, @Context javax.ws.rs.core.UriInfo uriInfo)
offset - The starting point when paging through a list of entities. Defaults to *0*.limit - The maximum number of results when paging through a list of entities, if not specify or exceed
the *query_limit* configuration of calendar rest service, it will use the *query_limit*
(see more on CalendarRestApi(OrganizationService, InitParams) java doc)fields - This is a list of comma separated property"s names of response json object,
if not specified, it return the json will all available properties.jsonp - The name of a JavaScript function to be used as the JSONP callback, if not specified, only
json object is returned.@RolesAllowed(value="users") public javax.ws.rs.core.Response getEventCategoryById(String id, String fields, String jsonp, @Context javax.ws.rs.core.UriInfo uriInfo, @Context javax.ws.rs.core.Request request)
id - identity of event category to findfields - This is a list of comma separated property's names of response json object,
if not specified, it return the json will all available properties.jsonp - The name of a JavaScript function to be used as the JSONP callback, if not specified, only
json object is returned.@RolesAllowed(value="users") public javax.ws.rs.core.Response getFeedById(String id, String fields, String expand, String jsonp, @Context javax.ws.rs.core.UriInfo uriInfo, @Context javax.ws.rs.core.Request request)
id - title of feed to findfields - This is a list of comma separated property's names of response json object,
if not specified, it return the json will all available properties.jsonp - The name of a JavaScript function to be used as the JSONP callback, if not specified, only
json object is returned.expand - used to ask for a full representation of a subresource, instead of only its link.
This is a list of comma-separated property's names. For example: expand=calendar. In case of collections,
you can put offset (default: 0), limit (default: *query_limit* of the rest service) value into param, for example: expand=calendar(0,5).
Instead of:
{
id: "...",
calendars: {
"http://localhost:8080/portal/rest/v1/calendar/calendars/demo-defaultCalendarId"
}
....
}
It returns:
{
id: "...",
calendars: {
id: "...",
name:"demo-defaultId",
....
}
....
}@RolesAllowed(value="users") public javax.ws.rs.core.Response updateFeedById(String id, FeedResource feedResource)
id - title of the feed to updatefeedResource - json object contains attributes of feed object to update, all the attributes are optional@RolesAllowed(value="users") public javax.ws.rs.core.Response deleteFeedById(String id)
id - title of the feed to delete@RolesAllowed(value="users") public javax.ws.rs.core.Response getRssFromFeed(String id, @Context javax.ws.rs.core.UriInfo uri, @Context javax.ws.rs.core.Request request)
id - title of the feed@RolesAllowed(value="users") public javax.ws.rs.core.Response getInvitationById(String id, String fields, String jsonp, String expand, @Context javax.ws.rs.core.UriInfo uriInfo, @Context javax.ws.rs.core.Request request) throws Exception
id - identity of invitation to findfields - This is a list of comma separated property's names of response json object,
if not specified, it return the json will all available properties.jsonp - The name of a JavaScript function to be used as the JSONP callback, if not specified, only
json object is returned.expand - used to ask for a full representation of a subresource, instead of only its link.
This is a list of comma-separated property's names. For example: expand=event
Instead of:
{
id: "...",
event: "http://localhost:8080/portal/rest/v1/calendar/events/evt123"
....
}
It returns:
{
id: "...",
event: {
id: "...",
name:"myEvent",
....
}
....
}Exception@RolesAllowed(value="users") public javax.ws.rs.core.Response updateInvitationById(String id, String status)
id - identity of the invitation to updatestatus - new status to update ("", "maybe", "yes", "no")@RolesAllowed(value="users") public javax.ws.rs.core.Response deleteInvitationById(String id) throws Exception
id - identity of the invitation to deleteException@RolesAllowed(value="users") public javax.ws.rs.core.Response getInvitationsFromEvent(String id, int offset, int limit, boolean returnSize, String status, String fields, String jsonp, String expand, @Context javax.ws.rs.core.UriInfo uriInfo) throws Exception
id - identity of event to search for invitationsstatus - search for this status only. If not specify, search invitation of any status ("", "maybe", "yes", "no")offset - The starting point when paging through a list of entities. Defaults to *0*.limit - The maximum number of results when paging through a list of entities, if not specify or exceed
the *query_limit* configuration of calendar rest service, it will use the *query_limit*
(see more on CalendarRestApi(OrganizationService, InitParams) java doc)fields - This is a list of comma separated property's names of response json object,
if not specified, it return the json will all available properties.jsonp - The name of a JavaScript function to be used as the JSONP callback, if not specified, only
json object is returned.expand - used to ask for a full representation of a subresource, instead of only its link.
This is a list of comma-separated property's names. For example: expand=event
Instead of:
{
id: "...",
event: "http://localhost:8080/portal/rest/v1/calendar/events/evt123"
....
}
It returns:
{
id: "...",
event: {
id: "...",
name:"myEvent",
....
}
....
}Exception@RolesAllowed(value="users") public javax.ws.rs.core.Response createInvitationForEvent(String id, InvitationResource invitation, @Context javax.ws.rs.core.UriInfo uriInfo) throws Exception
id - identity of the *event* to create invitationparticipant - name of participant (userId). If not provided or empty, return 400 status codestatus - status of invitation ("", "maybe", "yes", "no")ExceptionCopyright © 2003–2015 eXo Platform SAS. All rights reserved.