Class CalendarWebService
java.lang.Object
org.apache.openmeetings.webservice.BaseWebService
org.apache.openmeetings.webservice.CalendarWebService
@Service("calendarWebService")
@Produces("application/json")
@Path("/calendar")
public class CalendarWebService
extends BaseWebService
CalendarService contains methods to create, edit delete calendar meetings
- Author:
- sebawagner
-
Field Summary
Fields inherited from class org.apache.openmeetings.webservice.BaseWebService
fileDao, roomDao, sessionDao, userDao
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondelete a calendar event If the given sid is from an Administrator or Web-Service USER, the USER can delete any appointment.Load a calendar event by its room idgetByTitle
(String sid, String title) Search a calendar event for the current SIDGet the next Calendar event for the current USER of the SIDnextForUser
(String sid, long userid) Get the next Calendar event for userIdLoad appointments by a start / end range for the current SIDrangeForUser
(String sid, long userid, Calendar start, Calendar end) Load appointments by a start / end range for the userIdsave
(String sid, AppointmentDTO appointment) Create an appointment
-
Constructor Details
-
CalendarWebService
public CalendarWebService()
-
-
Method Details
-
range
@GET @Path("/{start}/{end}") public List<AppointmentDTO> range(@QueryParam("sid") String sid, @PathParam("start") Calendar start, @PathParam("end") Calendar end) throws ServiceException Load appointments by a start / end range for the current SID- Parameters:
sid
- The SID of the User. This SID must be marked as Loggedinstart
- start timeend
- end time- Returns:
- - list of appointments in range
- Throws:
ServiceException
-
rangeForUser
@GET @Path("/{userid}/{start}/{end}") public List<AppointmentDTO> rangeForUser(@QueryParam("sid") String sid, @PathParam("userid") long userid, @PathParam("start") Calendar start, @PathParam("end") Calendar end) throws ServiceException Load appointments by a start / end range for the userId- Parameters:
sid
- The SID of the User. This SID must be marked as Loggedinuserid
- the userId the calendar events should be loadedstart
- start timeend
- end time- Returns:
- - list of appointments in range
- Throws:
ServiceException
-
next
@GET @Path("/next") public AppointmentDTO next(@QueryParam("sid") String sid) throws ServiceException Get the next Calendar event for the current USER of the SID- Parameters:
sid
- The SID of the User. This SID must be marked as Loggedin- Returns:
- - next Calendar event
- Throws:
ServiceException
-
nextForUser
@GET @Path("/next/{userid}") public AppointmentDTO nextForUser(@QueryParam("sid") String sid, @PathParam("userid") long userid) throws ServiceException Get the next Calendar event for userId- Parameters:
sid
- The SID of the User. This SID must be marked as Loggedinuserid
- the userId the calendar events should be loaded- Returns:
- - next Calendar event
- Throws:
ServiceException
-
getByRoom
@GET @Path("/room/{roomid}") public AppointmentDTO getByRoom(@QueryParam("sid") String sid, @PathParam("roomid") long roomid) throws ServiceException Load a calendar event by its room id- Parameters:
sid
- The SID of the User. This SID must be marked as Loggedinroomid
- id of appointment special room- Returns:
- - calendar event by its room id
- Throws:
ServiceException
-
getByTitle
@GET @Path("/title/{title}") public List<AppointmentDTO> getByTitle(@QueryParam("sid") String sid, @PathParam("title") String title) throws ServiceException Search a calendar event for the current SID- Parameters:
sid
- The SID of the User. This SID must be marked as Loggedintitle
- the search string- Returns:
- - calendar event list
- Throws:
ServiceException
-
save
@POST @Path("/") public AppointmentDTO save(@QueryParam("sid") String sid, @FormParam("appointment") AppointmentDTO appointment) throws ServiceException Create an appointment- Parameters:
sid
- The SID of the User. This SID must be marked as Loggedinappointment
- calendar event- Returns:
- - appointment saved
- Throws:
ServiceException
-
delete
@DELETE @Path("/{id}") public ServiceResult delete(@QueryParam("sid") String sid, @PathParam("id") Long id) throws ServiceException delete a calendar event If the given sid is from an Administrator or Web-Service USER, the USER can delete any appointment. If the sid is assigned to a regular USER, he can only delete appointments where he is also the owner/creator of the appointment- Parameters:
sid
- an authenticated SIDid
- the id to delete- Returns:
ServiceResult
with result type- Throws:
ServiceException
-