org.exoplatform.calendar.service.impl
Class JCRDataStorage

java.lang.Object
  extended by org.exoplatform.calendar.service.impl.JCRDataStorage
All Implemented Interfaces:
DataStorage

public class JCRDataStorage
extends Object
implements DataStorage

Created by The eXo Platform SARL Author : Hung Nguyen Quang hung.nguyen@exoplatform.com Jul 10, 2007


Field Summary
 
Fields inherited from interface org.exoplatform.calendar.service.DataStorage
USERS_PATH
 
Constructor Summary
JCRDataStorage(org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator nodeHierarchyCreator, org.exoplatform.services.jcr.RepositoryService repoService, org.exoplatform.services.cache.CacheService cservice)
           
 
Method Summary
 void addAttachment(javax.jcr.Node eventNode, Attachment attachment, boolean isNew)
          Add an attachment to event
 void addCalendarSetting(javax.jcr.Node calendarHome, CalendarSetting setting)
          
 void addEvent(CalendarEvent event)
          creates a virtual event for a new event in a public folder of storage this virtual event is search-able (by XPATH query) and used to find the free/busy time in Schedule tab
 void addReminder(javax.jcr.Node eventNode, javax.jcr.Node reminderFolder, Reminder reminder)
          Add a reminder to event
 void assignGroupTask(String taskId, String calendarId, String assignee)
           
 void autoRemoveShareCalendar(String groupId, String username)
           
 void autoShareCalendar(List<String> groupsOfUser, String receiver)
           
 Date calculateRecurrenceFinishDate(CalendarEvent originalEvent)
          Calculate the end-date of recurrence event
 boolean canEdit(javax.jcr.Node calNode, String username)
          Get the permission to edit of user on the calendar
 Map<String,String> checkFreeBusy(EventQuery eventQuery)
          
 Map<String,String> checkFreeBusy(EventQuery eventQuery, Date date)
           
 void closeSessionProvider(org.exoplatform.services.jcr.ext.common.SessionProvider sessionProvider)
          Safely closes JCR session provider.
 void confirmInvitation(String fromUserId, String toUserId, int calType, String calendarId, String eventId, int answer)
          
 void confirmInvitation(String fromUserId, String confirmingEmail, String confirmingUser, int calType, String calendarId, String eventId, int answer)
          
 Calendar createRemoteCalendar(RemoteCalendar remoteCalendar)
          Create a new eXo calendar with mixin type 'exo:remoteCalendar' to store data from remote calendar, this method also creates a 'Remote' category
 org.exoplatform.services.jcr.ext.common.SessionProvider createSessionProvider()
          Create a session provider for current context.
 org.exoplatform.services.jcr.ext.common.SessionProvider createSystemProvider()
          
 org.exoplatform.services.jcr.ext.common.SessionProvider createUserProvider()
          
 int generateRss(String username, LinkedHashMap<String,Calendar> calendars, RssData rssData, CalendarImportExport importExport)
          
 int generateRss(String username, List<String> calendarIds, RssData rssData, CalendarImportExport importExport)
          
 Calendar getCalendar(String[] defaultFilterCalendars, String username, javax.jcr.Node calNode, boolean isShowAll)
           
 Calendar getCalendarById(String calId)
           
 javax.jcr.Node getCalendarEventNode(String username, String calType, String calendarId, String eventId)
           
 CalendarSetting getCalendarSetting(String username)
          Get calendar settings of a user
 javax.jcr.Node getDateFolder(javax.jcr.Node publicApp, Date date)
          
 String getEntryUrl(String portalName, String wsName, String username, String path, String baseUrl)
          
 CalendarEvent getEvent(javax.jcr.Node eventNode)
          Get a event from event node
 CalendarEvent getEvent(String username, String eventId)
          Get a user event
 CalendarEvent getEventById(String eventId)
           
 List<EventCategory> getEventCategories(String username)
          Get all event categories of a user
 EventCategory getEventCategory(javax.jcr.Node eventCatNode)
          Get a event category from node
 EventCategory getEventCategory(String username, String eventcategoryId)
          Get event category from name
protected  javax.jcr.Node getEventCategoryHome(String username)
           
 javax.jcr.Node getEventFolder(Date fromDate)
          
 List<CalendarEvent> getEvents(String username, EventQuery eventQuery, String[] publicCalendarIds)
          
 List<CalendarEvent> getExceptionEvents(String username, CalendarEvent recurEvent)
          Get all exception occurrence from original recurrence event
 List<FeedData> getFeeds(String username)
           
 Calendar getGroupCalendar(String calendarId)
          Get a group calendar
 List<GroupCalendarData> getGroupCalendars(String[] groupIds, boolean isShowAll, String username)
          
 CalendarEvent getGroupEvent(String eventId)
          Get a group event with given eventId
 CalendarEvent getGroupEvent(String calendarId, String eventId)
          Get a group event
 List<CalendarEvent> getGroupEventByCalendar(List<String> calendarIds)
          Get all group events from list of calendars
 net.fortuna.ical4j.model.Recur getICalendarRecur(CalendarEvent recurEvent)
           
 javax.jcr.Node getNodeByPath(String nodePath, org.exoplatform.services.jcr.ext.common.SessionProvider sessionProvider)
          
 Map<String,CalendarEvent> getOccurrenceEvents(CalendarEvent recurEvent, Calendar from, Calendar to, String timezone)
          Query all occurrences of recurrence event between from and to date.
 List<CalendarEvent> getOriginalRecurrenceEvents(javax.jcr.Node calendar, String calType, Calendar from, Calendar to, String[] calendarIds, String[] filterCalendarIds)
           
 List<CalendarEvent> getOriginalRecurrenceEvents(String username, Calendar from, Calendar to, String[] publicCalendarIds)
          Get all active 'original' recurrence event
The result list includes all 'original' recurrence event in all three types: private, public and shared
 javax.jcr.Node getPublicCalendarHome()
          Get the home node of all public calendars under public Calendar storage
 javax.jcr.Node getPublicCalendarServiceHome()
          Get the public Calendar application storage
 List<CalendarEvent> getPublicEventByCategory(String username, String eventCategoryId)
          Get all user public events from a category
 List<CalendarEvent> getPublicEvents(EventQuery eventQuery)
          Get all public events from a event query
 javax.jcr.Node getPublicRoot()
          
 javax.jcr.Node getReminderFolder(Date fromDate)
          
 RemoteCalendar getRemoteCalendar(String username, String remoteCalendarId)
           
 Calendar getRemoteCalendar(String username, String remoteUrl, String remoteType)
           
 int getRemoteCalendarCount(String username)
           
 javax.jcr.Node getRssHome(String username)
          Get the home node of user feeds in Calendar application
 javax.jcr.Session getSession(org.exoplatform.services.jcr.ext.common.SessionProvider sprovider)
          
 javax.jcr.Node getSharedCalendarHome()
          Get the shared Calendar application storage
 GroupCalendarData getSharedCalendars(String username, boolean isShowAll)
          Get all shared calendars of a user
 CalendarEvent getSharedEvent(String username, String calendarId, String eventId)
           
 List<CalendarEvent> getSharedEventByCalendars(String username, List<String> calendarIds)
          Get all shared events from list of calendars
 List<CalendarEvent> getSharedEventByCategory(String username, String eventCategoryId)
          Get all user shared events from a category
 List<CalendarEvent> getSharedEvents(String username, EventQuery eventQuery)
          Get all shared events with a EventQuery
 int getTypeOfCalendar(String userName, String calendarId)
          
 Calendar getUserCalendar(String username, String calendarId)
          Get a calendar under user calendar data storage
 javax.jcr.Node getUserCalendarHome(String username)
          Get the home node of user calendars under user calendar data storage
 List<Calendar> getUserCalendars(String username, boolean isShowAll)
          Get all calendars of a user
 javax.jcr.Node getUserCalendarServiceHome(String username)
          Get the Calendar application user data storage root
 CalendarEvent getUserEvent(String username, String calendarId, String eventId)
          Get a user event from calendarId and eventId
 List<CalendarEvent> getUserEventByCalendar(String username, List<String> calendarIds)
          Get all user events from a calendar
 List<CalendarEvent> getUserEventByCategory(String username, String eventCategoryId)
          Get all user events from a category
 List<CalendarEvent> getUserEvents(String username, EventQuery eventQuery)
          Get all user event with a event query
 boolean isRemoteCalendar(String username, String calendarId)
          Check if a calendar is a remote calendar by checking mixin type of calendar node
 void moveEvent(String formCalendar, String toCalendar, String fromType, String toType, List<CalendarEvent> calEvents, String username)
          Move events between calendars
 void removeEventCategory(String username, String eventCategoryId)
          Remove a user event category
 void removeFeed(String username, String calendarId)
          
 void removeFeedData(String username, String title)
           
 Calendar removeGroupCalendar(String calendarId)
          Remove a group calendar
 void removeOccurrenceInstance(String username, CalendarEvent occurrence)
           
 CalendarEvent removePublicEvent(String calendarId, String eventId)
          Remove a public event
 void removeRecurrenceSeries(String username, CalendarEvent originalEvent)
           
 void removeReminder(javax.jcr.Node eventNode)
          Remove reminder from event
 void removeSharedCalendar(String username, String calendarId)
          Remove a shared calendar
 void removeSharedCalendarFolder(String username)
           
 void removeSharedEvent(String username, String calendarId, String eventId)
          
 Calendar removeUserCalendar(String username, String calendarId)
          Remove a user calendar
 CalendarEvent removeUserEvent(String username, String calendarId, String eventId)
          Remove a user event
 void saveCalendarSetting(String username, CalendarSetting setting)
          Save calendar setting of a user to JCR
 void saveEvent(javax.jcr.Node calendarNode, CalendarEvent event, javax.jcr.Node reminderFolder, boolean isNew)
          Save a event
 void saveEventCategory(String username, EventCategory eventCategory, boolean isNew)
          Save a user event category to JCR
 void saveEventCategory(String username, EventCategory eventCategory, String[] values, boolean isNew)
           
 void saveEventToSharedCalendar(String username, String calendarId, CalendarEvent event, boolean isNew)
          Save a event to a shared calendar
 void saveOccurrenceEvent(javax.jcr.Node calendarNode, CalendarEvent event, javax.jcr.Node reminderFolder, boolean isNew)
           
 void saveOccurrenceEvent(String username, String calendarId, CalendarEvent event, boolean isNew)
          Save a occurrence event
 void savePublicCalendar(Calendar calendar, boolean isNew, String username)
          Save a public calendar
 void savePublicEvent(String calendarId, CalendarEvent event, boolean isNew)
          Save a public event
 void saveSharedCalendar(String username, Calendar calendar)
          Save a shared calendar to JCR
 void saveUserCalendar(String username, Calendar calendar, boolean isNew)
          Save a user calendar
 void saveUserEvent(String username, String calendarId, CalendarEvent event, boolean isNew)
          Save a user event
 EventPageList searchEvent(String username, EventQuery eventQuery, String[] publicCalendarIds)
          
 Map<Integer,String> searchHighlightRecurrenceEvent(String username, EventQuery eventQuery, String[] publicCalendarIds, String timezone)
           
 Map<Integer,String> searchHightLightEvent(String username, EventQuery eventQuery, String[] publicCalendarIds)
          
 void setCalDavResourceEtag(String username, String calendarId, String eventId, String etag)
           
 void setCalDavResourceHref(String username, String calendarId, String eventId, String href)
           
 void setGroupTaskStatus(String taskId, String calendarId, String status)
           
 void setRemoteCalendarLastUpdated(String username, String calendarId, Calendar timeGMT)
           
 void setRemoteEvent(String username, String calendarId, String eventId, String href, String etag)
           
 void shareCalendar(String username, String calendarId, List<String> receiverUsers)
          Shared a calendar to list of users
 void storeXML(String feedXML, javax.jcr.Node rssHome, RssData rssData)
          
 void syncRemoveEvent(javax.jcr.Node eventFolder, String rootEventId)
          
 void updateOccurrenceEvent(String fromCalendar, String toCalendar, String fromCalendarType, String toCalendarType, List<CalendarEvent> events, String username)
          This function is used to update a occurrence event.
 void updateRecurrenceSeries(String fromCalendar, String toCalendar, String fromType, String toType, CalendarEvent occurrence, String username)
          Update recurrence series
 Calendar updateRemoteCalendarInfo(RemoteCalendar remoteCalendar)
          Update information about remote calendar
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JCRDataStorage

public JCRDataStorage(org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator nodeHierarchyCreator,
                      org.exoplatform.services.jcr.RepositoryService repoService,
                      org.exoplatform.services.cache.CacheService cservice)
               throws Exception
Throws:
Exception
Method Detail

getPublicCalendarServiceHome

public javax.jcr.Node getPublicCalendarServiceHome()
                                            throws Exception
Get the public Calendar application storage

Specified by:
getPublicCalendarServiceHome in interface DataStorage
Returns:
the node that is on top of Calendar application public storage
Throws:
Exception

getSharedCalendarHome

public javax.jcr.Node getSharedCalendarHome()
                                     throws Exception
Get the shared Calendar application storage

Specified by:
getSharedCalendarHome in interface DataStorage
Returns:
the node that is on top of Calendar application shared storage
Throws:
Exception

getPublicRoot

public javax.jcr.Node getPublicRoot()
                             throws Exception

Specified by:
getPublicRoot in interface DataStorage
Returns:
Throws:
Exception

getUserCalendarServiceHome

public javax.jcr.Node getUserCalendarServiceHome(String username)
                                          throws Exception
Get the Calendar application user data storage root

Specified by:
getUserCalendarServiceHome in interface DataStorage
Returns:
Node object represents the node that is on top of user data storage
Throws:
Exception

getPublicCalendarHome

public javax.jcr.Node getPublicCalendarHome()
                                     throws Exception
Get the home node of all public calendars under public Calendar storage

Specified by:
getPublicCalendarHome in interface DataStorage
Returns:
Node object represents the home node of all public calendars
Throws:
Exception

getUserCalendarHome

public javax.jcr.Node getUserCalendarHome(String username)
                                   throws Exception
Get the home node of user calendars under user calendar data storage

Specified by:
getUserCalendarHome in interface DataStorage
Returns:
Node object represents home node of user calendars
Throws:
Exception

getRssHome

public javax.jcr.Node getRssHome(String username)
                          throws Exception
Get the home node of user feeds in Calendar application

Specified by:
getRssHome in interface DataStorage
Returns:
Node object represents the home node of user feeds
Throws:
Exception

getEventCategoryHome

protected javax.jcr.Node getEventCategoryHome(String username)
                                       throws Exception
Parameters:
username -
Returns:
Throws:
Exception

getUserCalendar

public Calendar getUserCalendar(String username,
                                String calendarId)
                         throws Exception
Get a calendar under user calendar data storage

Specified by:
getUserCalendar in interface DataStorage
Returns:
the Calendar object represents user calendar
Throws:
Exception

getUserCalendars

public List<Calendar> getUserCalendars(String username,
                                       boolean isShowAll)
                                throws Exception
Get all calendars of a user

Specified by:
getUserCalendars in interface DataStorage
Returns:
the list of all calendars of user
Throws:
Exception

saveUserCalendar

public void saveUserCalendar(String username,
                             Calendar calendar,
                             boolean isNew)
                      throws Exception
Save a user calendar

Specified by:
saveUserCalendar in interface DataStorage
Throws:
Exception

removeUserCalendar

public Calendar removeUserCalendar(String username,
                                   String calendarId)
                            throws Exception
Remove a user calendar

Specified by:
removeUserCalendar in interface DataStorage
Returns:
the Calendar which is removed
Throws:
Exception

getGroupCalendar

public Calendar getGroupCalendar(String calendarId)
                          throws Exception
Get a group calendar

Specified by:
getGroupCalendar in interface DataStorage
Returns:
the group calendar
Throws:
Exception

getGroupCalendars

public List<GroupCalendarData> getGroupCalendars(String[] groupIds,
                                                 boolean isShowAll,
                                                 String username)
                                          throws Exception

Specified by:
getGroupCalendars in interface DataStorage
Returns:
the list of GroupCalendarData objects
Throws:
Exception

savePublicCalendar

public void savePublicCalendar(Calendar calendar,
                               boolean isNew,
                               String username)
                        throws Exception
Save a public calendar

Specified by:
savePublicCalendar in interface DataStorage
Throws:
Exception

removeGroupCalendar

public Calendar removeGroupCalendar(String calendarId)
                             throws Exception
Remove a group calendar

Specified by:
removeGroupCalendar in interface DataStorage
Returns:
Throws:
Exception

getCalendar

public Calendar getCalendar(String[] defaultFilterCalendars,
                            String username,
                            javax.jcr.Node calNode,
                            boolean isShowAll)
                     throws Exception
Specified by:
getCalendar in interface DataStorage
Returns:
Calendar object
Throws:
Exception

getEventCategories

public List<EventCategory> getEventCategories(String username)
                                       throws Exception
Description copied from interface: DataStorage
Get all event categories of a user

Specified by:
getEventCategories in interface DataStorage
Returns:
the list of EventCategory objects
Throws:
Exception

saveEventCategory

public void saveEventCategory(String username,
                              EventCategory eventCategory,
                              String[] values,
                              boolean isNew)
                       throws Exception
Throws:
Exception

saveEventCategory

public void saveEventCategory(String username,
                              EventCategory eventCategory,
                              boolean isNew)
                       throws Exception
Description copied from interface: DataStorage
Save a user event category to JCR

Specified by:
saveEventCategory in interface DataStorage
Throws:
Exception

removeEventCategory

public void removeEventCategory(String username,
                                String eventCategoryId)
                         throws Exception
Description copied from interface: DataStorage
Remove a user event category

Specified by:
removeEventCategory in interface DataStorage
Throws:
Exception

getEventCategory

public EventCategory getEventCategory(javax.jcr.Node eventCatNode)
                               throws Exception
Get a event category from node

Specified by:
getEventCategory in interface DataStorage
Returns:
the EventCategory object
Throws:
Exception

getEventCategory

public EventCategory getEventCategory(String username,
                                      String eventcategoryId)
                               throws Exception
Description copied from interface: DataStorage
Get event category from name

Specified by:
getEventCategory in interface DataStorage
Returns:
the EventCategory object
Throws:
Exception

getUserEvent

public CalendarEvent getUserEvent(String username,
                                  String calendarId,
                                  String eventId)
                           throws Exception
Description copied from interface: DataStorage
Get a user event from calendarId and eventId

Specified by:
getUserEvent in interface DataStorage
Returns:
the CalendarEvent
Throws:
Exception

getUserEventByCalendar

public List<CalendarEvent> getUserEventByCalendar(String username,
                                                  List<String> calendarIds)
                                           throws Exception
Description copied from interface: DataStorage
Get all user events from a calendar

Specified by:
getUserEventByCalendar in interface DataStorage
Returns:
the list of CalendarEvent object
Throws:
Exception

getPublicEventByCategory

public List<CalendarEvent> getPublicEventByCategory(String username,
                                                    String eventCategoryId)
                                             throws Exception
Description copied from interface: DataStorage
Get all user public events from a category

Specified by:
getPublicEventByCategory in interface DataStorage
Returns:
the list of CalendarEvent
Throws:
Exception

getSharedEventByCategory

public List<CalendarEvent> getSharedEventByCategory(String username,
                                                    String eventCategoryId)
                                             throws Exception
Description copied from interface: DataStorage
Get all user shared events from a category

Specified by:
getSharedEventByCategory in interface DataStorage
Returns:
the list of CalendarEvent
Throws:
Exception

getUserEventByCategory

public List<CalendarEvent> getUserEventByCategory(String username,
                                                  String eventCategoryId)
                                           throws Exception
Get all user events from a category

Specified by:
getUserEventByCategory in interface DataStorage
Returns:
the list of CalendarEvent
Throws:
Exception

getEvent

public CalendarEvent getEvent(String username,
                              String eventId)
                       throws Exception
Get a user event

Specified by:
getEvent in interface DataStorage
Returns:
the CalendarEvent
Throws:
Exception

getUserEvents

public List<CalendarEvent> getUserEvents(String username,
                                         EventQuery eventQuery)
                                  throws Exception
Get all user event with a event query

Specified by:
getUserEvents in interface DataStorage
Returns:
the list of CalendarEvent
Throws:
Exception

saveUserEvent

public void saveUserEvent(String username,
                          String calendarId,
                          CalendarEvent event,
                          boolean isNew)
                   throws Exception
Save a user event

Specified by:
saveUserEvent in interface DataStorage
Throws:
Exception

saveOccurrenceEvent

public void saveOccurrenceEvent(String username,
                                String calendarId,
                                CalendarEvent event,
                                boolean isNew)
                         throws Exception
Save a occurrence event

Parameters:
username -
calendarId -
event -
isNew -
Throws:
Exception

saveOccurrenceEvent

public void saveOccurrenceEvent(javax.jcr.Node calendarNode,
                                CalendarEvent event,
                                javax.jcr.Node reminderFolder,
                                boolean isNew)
                         throws Exception
Throws:
Exception

removeOccurrenceInstance

public void removeOccurrenceInstance(String username,
                                     CalendarEvent occurrence)
                              throws Exception
Throws:
Exception

removeRecurrenceSeries

public void removeRecurrenceSeries(String username,
                                   CalendarEvent originalEvent)
                            throws Exception
Throws:
Exception

getCalendarEventNode

public javax.jcr.Node getCalendarEventNode(String username,
                                           String calType,
                                           String calendarId,
                                           String eventId)
                                    throws Exception
Throws:
Exception

removeUserEvent

public CalendarEvent removeUserEvent(String username,
                                     String calendarId,
                                     String eventId)
                              throws Exception
Remove a user event

Specified by:
removeUserEvent in interface DataStorage
Returns:
the CalendarEvent which is removed
Throws:
Exception

removeReminder

public void removeReminder(javax.jcr.Node eventNode)
                    throws Exception
Remove reminder from event

Specified by:
removeReminder in interface DataStorage
Throws:
Exception

getGroupEvent

public CalendarEvent getGroupEvent(String calendarId,
                                   String eventId)
                            throws Exception
Get a group event

Specified by:
getGroupEvent in interface DataStorage
Returns:
the CalendarEvent
Throws:
Exception

getGroupEvent

public CalendarEvent getGroupEvent(String eventId)
                            throws Exception
Get a group event with given eventId

Specified by:
getGroupEvent in interface DataStorage
Returns:
CalendarEvent object, or null if event was not found
Throws:
Exception

getGroupEventByCalendar

public List<CalendarEvent> getGroupEventByCalendar(List<String> calendarIds)
                                            throws Exception
Get all group events from list of calendars

Specified by:
getGroupEventByCalendar in interface DataStorage
Returns:
the list of CalendarEvent objects
Throws:
Exception

getPublicEvents

public List<CalendarEvent> getPublicEvents(EventQuery eventQuery)
                                    throws Exception
Get all public events from a event query

Specified by:
getPublicEvents in interface DataStorage
Returns:
the list of CalendarEvent objects
Throws:
Exception

savePublicEvent

public void savePublicEvent(String calendarId,
                            CalendarEvent event,
                            boolean isNew)
                     throws Exception
Save a public event

Specified by:
savePublicEvent in interface DataStorage
Throws:
Exception

removePublicEvent

public CalendarEvent removePublicEvent(String calendarId,
                                       String eventId)
                                throws Exception
Remove a public event

Specified by:
removePublicEvent in interface DataStorage
Returns:
CalendarEvent object
Throws:
Exception

getEvent

public CalendarEvent getEvent(javax.jcr.Node eventNode)
                       throws Exception
Get a event from event node

Specified by:
getEvent in interface DataStorage
Returns:
the CalendarEvent object
Throws:
Exception

saveEvent

public void saveEvent(javax.jcr.Node calendarNode,
                      CalendarEvent event,
                      javax.jcr.Node reminderFolder,
                      boolean isNew)
               throws Exception
Save a event

Specified by:
saveEvent in interface DataStorage
Throws:
Exception

addReminder

public void addReminder(javax.jcr.Node eventNode,
                        javax.jcr.Node reminderFolder,
                        Reminder reminder)
                 throws Exception
Add a reminder to event

Specified by:
addReminder in interface DataStorage
Throws:
Exception

addEvent

public void addEvent(CalendarEvent event)
              throws Exception
creates a virtual event for a new event in a public folder of storage this virtual event is search-able (by XPATH query) and used to find the free/busy time in Schedule tab

Specified by:
addEvent in interface DataStorage
Throws:
Exception

syncRemoveEvent

public void syncRemoveEvent(javax.jcr.Node eventFolder,
                            String rootEventId)
                     throws Exception

Specified by:
syncRemoveEvent in interface DataStorage
Throws:
Exception

getReminderFolder

public javax.jcr.Node getReminderFolder(Date fromDate)
                                 throws Exception

Specified by:
getReminderFolder in interface DataStorage
Returns:
Throws:
Exception

getEventFolder

public javax.jcr.Node getEventFolder(Date fromDate)
                              throws Exception

Specified by:
getEventFolder in interface DataStorage
Returns:
Throws:
Exception

getDateFolder

public javax.jcr.Node getDateFolder(javax.jcr.Node publicApp,
                                    Date date)
                             throws Exception

Specified by:
getDateFolder in interface DataStorage
Returns:
Node object
Throws:
Exception

addAttachment

public void addAttachment(javax.jcr.Node eventNode,
                          Attachment attachment,
                          boolean isNew)
                   throws Exception
Add an attachment to event

Specified by:
addAttachment in interface DataStorage
Parameters:
eventNode - the event node
attachment - the attachment to add
isNew - is it a new attachment?
Throws:
Exception

saveCalendarSetting

public void saveCalendarSetting(String username,
                                CalendarSetting setting)
                         throws Exception
Save calendar setting of a user to JCR

Specified by:
saveCalendarSetting in interface DataStorage
Parameters:
username - the username
setting - the setting to save
Throws:
Exception

addCalendarSetting

public void addCalendarSetting(javax.jcr.Node calendarHome,
                               CalendarSetting setting)
                        throws Exception

Specified by:
addCalendarSetting in interface DataStorage
Throws:
Exception

getCalendarSetting

public CalendarSetting getCalendarSetting(String username)
                                   throws Exception
Get calendar settings of a user

Specified by:
getCalendarSetting in interface DataStorage
Returns:
the CalendarSetting objects
Throws:
Exception

storeXML

public void storeXML(String feedXML,
                     javax.jcr.Node rssHome,
                     RssData rssData)
              throws Exception

Specified by:
storeXML in interface DataStorage
Throws:
Exception

removeFeed

public void removeFeed(String username,
                       String calendarId)
                throws Exception

Specified by:
removeFeed in interface DataStorage
Throws:
Exception

removeFeedData

public void removeFeedData(String username,
                           String title)
Parameters:
username -
title -

getFeeds

public List<FeedData> getFeeds(String username)
                        throws Exception
Specified by:
getFeeds in interface DataStorage
Returns:
Throws:
Exception

generateRss

public int generateRss(String username,
                       List<String> calendarIds,
                       RssData rssData,
                       CalendarImportExport importExport)
                throws Exception

Specified by:
generateRss in interface DataStorage
Returns:
Throws:
Exception

generateRss

public int generateRss(String username,
                       LinkedHashMap<String,Calendar> calendars,
                       RssData rssData,
                       CalendarImportExport importExport)
                throws Exception

Specified by:
generateRss in interface DataStorage
Returns:
Throws:
Exception

getEntryUrl

public String getEntryUrl(String portalName,
                          String wsName,
                          String username,
                          String path,
                          String baseUrl)
                   throws Exception

Specified by:
getEntryUrl in interface DataStorage
Returns:
Throws:
Exception

searchEvent

public EventPageList searchEvent(String username,
                                 EventQuery eventQuery,
                                 String[] publicCalendarIds)
                          throws Exception

Specified by:
searchEvent in interface DataStorage
Returns:
Throws:
Exception

searchHightLightEvent

public Map<Integer,String> searchHightLightEvent(String username,
                                                 EventQuery eventQuery,
                                                 String[] publicCalendarIds)
                                          throws Exception

Specified by:
searchHightLightEvent in interface DataStorage
Returns:
Throws:
Exception

searchHighlightRecurrenceEvent

public Map<Integer,String> searchHighlightRecurrenceEvent(String username,
                                                          EventQuery eventQuery,
                                                          String[] publicCalendarIds,
                                                          String timezone)
                                                   throws Exception
Throws:
Exception

shareCalendar

public void shareCalendar(String username,
                          String calendarId,
                          List<String> receiverUsers)
                   throws Exception
Shared a calendar to list of users

Specified by:
shareCalendar in interface DataStorage
Throws:
Exception

getSharedCalendars

public GroupCalendarData getSharedCalendars(String username,
                                            boolean isShowAll)
                                     throws Exception
Get all shared calendars of a user

Specified by:
getSharedCalendars in interface DataStorage
Returns:
the GroupCalendarData object contains list of all shared calendars belong to user
Throws:
Exception

saveSharedCalendar

public void saveSharedCalendar(String username,
                               Calendar calendar)
                        throws Exception
Save a shared calendar to JCR

Specified by:
saveSharedCalendar in interface DataStorage
Throws:
Exception

getSharedEvents

public List<CalendarEvent> getSharedEvents(String username,
                                           EventQuery eventQuery)
                                    throws Exception
Get all shared events with a EventQuery

Specified by:
getSharedEvents in interface DataStorage
Returns:
the list of CalendarEvent objects
Throws:
Exception

getSharedEventByCalendars

public List<CalendarEvent> getSharedEventByCalendars(String username,
                                                     List<String> calendarIds)
                                              throws Exception
Get all shared events from list of calendars

Specified by:
getSharedEventByCalendars in interface DataStorage
Returns:
the list of CalendarEvent objects
Throws:
Exception

getSharedEvent

public CalendarEvent getSharedEvent(String username,
                                    String calendarId,
                                    String eventId)
                             throws Exception
Throws:
Exception

saveEventToSharedCalendar

public void saveEventToSharedCalendar(String username,
                                      String calendarId,
                                      CalendarEvent event,
                                      boolean isNew)
                               throws Exception
Save a event to a shared calendar

Specified by:
saveEventToSharedCalendar in interface DataStorage
Throws:
Exception

canEdit

public boolean canEdit(javax.jcr.Node calNode,
                       String username)
                throws Exception
Get the permission to edit of user on the calendar

Specified by:
canEdit in interface DataStorage
Returns:
Throws:
Exception

getEvents

public List<CalendarEvent> getEvents(String username,
                                     EventQuery eventQuery,
                                     String[] publicCalendarIds)
                              throws Exception

Specified by:
getEvents in interface DataStorage
Returns:
Throws:
Exception

getOriginalRecurrenceEvents

public List<CalendarEvent> getOriginalRecurrenceEvents(String username,
                                                       Calendar from,
                                                       Calendar to,
                                                       String[] publicCalendarIds)
                                                throws Exception
Get all active 'original' recurrence event
The result list includes all 'original' recurrence event in all three types: private, public and shared

Parameters:
username -
Returns:
Throws:
Exception

getOriginalRecurrenceEvents

public List<CalendarEvent> getOriginalRecurrenceEvents(javax.jcr.Node calendar,
                                                       String calType,
                                                       Calendar from,
                                                       Calendar to,
                                                       String[] calendarIds,
                                                       String[] filterCalendarIds)
                                                throws Exception
Throws:
Exception

getExceptionEvents

public List<CalendarEvent> getExceptionEvents(String username,
                                              CalendarEvent recurEvent)
                                       throws Exception
Get all exception occurrence from original recurrence event

Parameters:
username -
recurEvent -
Returns:
Throws:
Exception

getOccurrenceEvents

public Map<String,CalendarEvent> getOccurrenceEvents(CalendarEvent recurEvent,
                                                     Calendar from,
                                                     Calendar to,
                                                     String timezone)
                                              throws Exception
Query all occurrences of recurrence event between from and to date.
The result contains only 'virtual' occurrence events, no exception occurrences

Parameters:
recurEvent - the original recurrence event
from -
to -
timezone -
Returns:
Throws:
Exception

calculateRecurrenceFinishDate

public Date calculateRecurrenceFinishDate(CalendarEvent originalEvent)
                                   throws Exception
Calculate the end-date of recurrence event

Parameters:
originalEvent -
Returns:
Throws:
Exception

getICalendarRecur

public net.fortuna.ical4j.model.Recur getICalendarRecur(CalendarEvent recurEvent)
                                                 throws Exception
Throws:
Exception

checkFreeBusy

public Map<String,String> checkFreeBusy(EventQuery eventQuery)
                                 throws Exception

Specified by:
checkFreeBusy in interface DataStorage
Returns:
Throws:
Exception

checkFreeBusy

public Map<String,String> checkFreeBusy(EventQuery eventQuery,
                                        Date date)
                                 throws Exception
Throws:
Exception

removeSharedEvent

public void removeSharedEvent(String username,
                              String calendarId,
                              String eventId)
                       throws Exception

Specified by:
removeSharedEvent in interface DataStorage
Throws:
Exception

moveEvent

public void moveEvent(String formCalendar,
                      String toCalendar,
                      String fromType,
                      String toType,
                      List<CalendarEvent> calEvents,
                      String username)
               throws Exception
Move events between calendars

Specified by:
moveEvent in interface DataStorage
Throws:
Exception

updateOccurrenceEvent

public void updateOccurrenceEvent(String fromCalendar,
                                  String toCalendar,
                                  String fromCalendarType,
                                  String toCalendarType,
                                  List<CalendarEvent> events,
                                  String username)
                           throws Exception
This function is used to update a occurrence event.
A occurrence event after update will be an exception occurrence from recurrence series and will be saved as an new event node refers to original node

Parameters:
fromCalendar -
toCalendar -
fromCalendarType -
toCalendarType -
events -
username -
Throws:
Exception

updateRecurrenceSeries

public void updateRecurrenceSeries(String fromCalendar,
                                   String toCalendar,
                                   String fromType,
                                   String toType,
                                   CalendarEvent occurrence,
                                   String username)
                            throws Exception
Update recurrence series

Parameters:
fromCalendar -
toCalendar -
fromType -
toType -
occurrence -
username -
Throws:
Exception

confirmInvitation

public void confirmInvitation(String fromUserId,
                              String toUserId,
                              int calType,
                              String calendarId,
                              String eventId,
                              int answer)

Specified by:
confirmInvitation in interface DataStorage

confirmInvitation

public void confirmInvitation(String fromUserId,
                              String confirmingEmail,
                              String confirmingUser,
                              int calType,
                              String calendarId,
                              String eventId,
                              int answer)
                       throws Exception

Specified by:
confirmInvitation in interface DataStorage
Throws:
Exception

getTypeOfCalendar

public int getTypeOfCalendar(String userName,
                             String calendarId)

Specified by:
getTypeOfCalendar in interface DataStorage
Returns:

createSessionProvider

public org.exoplatform.services.jcr.ext.common.SessionProvider createSessionProvider()
Create a session provider for current context. The method first try to get a normal session provider, then attempts to create a system provider if the first one was not available.

Specified by:
createSessionProvider in interface DataStorage
Returns:
a SessionProvider initialized by current SessionProviderService see SessionProviderService#getSessionProvider(null)

createUserProvider

public org.exoplatform.services.jcr.ext.common.SessionProvider createUserProvider()

Specified by:
createUserProvider in interface DataStorage

createSystemProvider

public org.exoplatform.services.jcr.ext.common.SessionProvider createSystemProvider()

Specified by:
createSystemProvider in interface DataStorage

closeSessionProvider

public void closeSessionProvider(org.exoplatform.services.jcr.ext.common.SessionProvider sessionProvider)
Safely closes JCR session provider. Call this method in finally to clean any provider initialized by createSessionProvider()

Specified by:
closeSessionProvider in interface DataStorage
Parameters:
sessionProvider - the sessionProvider to close
See Also:
SessionProvider.close();

getNodeByPath

public javax.jcr.Node getNodeByPath(String nodePath,
                                    org.exoplatform.services.jcr.ext.common.SessionProvider sessionProvider)
                             throws Exception

Specified by:
getNodeByPath in interface DataStorage
Throws:
Exception

getSession

public javax.jcr.Session getSession(org.exoplatform.services.jcr.ext.common.SessionProvider sprovider)
                             throws Exception

Specified by:
getSession in interface DataStorage
Throws:
Exception

autoShareCalendar

public void autoShareCalendar(List<String> groupsOfUser,
                              String receiver)
                       throws Exception
Specified by:
autoShareCalendar in interface DataStorage
Throws:
Exception

removeSharedCalendar

public void removeSharedCalendar(String username,
                                 String calendarId)
                          throws Exception
Remove a shared calendar

Specified by:
removeSharedCalendar in interface DataStorage
Parameters:
username - the username
calendarId - the calendar id
Throws:
Exception

removeSharedCalendarFolder

public void removeSharedCalendarFolder(String username)
                                throws Exception
Throws:
Exception

autoRemoveShareCalendar

public void autoRemoveShareCalendar(String groupId,
                                    String username)
                             throws Exception
Specified by:
autoRemoveShareCalendar in interface DataStorage
Throws:
Exception

assignGroupTask

public void assignGroupTask(String taskId,
                            String calendarId,
                            String assignee)
                     throws Exception
Throws:
Exception

setGroupTaskStatus

public void setGroupTaskStatus(String taskId,
                               String calendarId,
                               String status)
                        throws Exception
Throws:
Exception

isRemoteCalendar

public boolean isRemoteCalendar(String username,
                                String calendarId)
                         throws Exception
Description copied from interface: DataStorage
Check if a calendar is a remote calendar by checking mixin type of calendar node

Specified by:
isRemoteCalendar in interface DataStorage
Parameters:
username - owner of this calendar
calendarId - id of this calendar
Returns:
true if calendar node has mixin type exo:remoteCalendar, false if otherwise
Throws:
Exception

updateRemoteCalendarInfo

public Calendar updateRemoteCalendarInfo(RemoteCalendar remoteCalendar)
                                  throws Exception
Description copied from interface: DataStorage
Update information about remote calendar

Specified by:
updateRemoteCalendarInfo in interface DataStorage
Parameters:
remoteCalendar - object content all properties for remote calendar.
Returns:
Throws:
Exception

getRemoteCalendar

public RemoteCalendar getRemoteCalendar(String username,
                                        String remoteCalendarId)
                                 throws Exception
Throws:
Exception

createRemoteCalendar

public Calendar createRemoteCalendar(RemoteCalendar remoteCalendar)
                              throws Exception
Description copied from interface: DataStorage
Create a new eXo calendar with mixin type 'exo:remoteCalendar' to store data from remote calendar, this method also creates a 'Remote' category

Specified by:
createRemoteCalendar in interface DataStorage
Parameters:
remoteCalendar - object content all properties for remote calendar.
Returns:
Calendar object
Throws:
Exception

setRemoteEvent

public void setRemoteEvent(String username,
                           String calendarId,
                           String eventId,
                           String href,
                           String etag)
                    throws Exception
Specified by:
setRemoteEvent in interface DataStorage
Throws:
Exception

setRemoteCalendarLastUpdated

public void setRemoteCalendarLastUpdated(String username,
                                         String calendarId,
                                         Calendar timeGMT)
                                  throws Exception
Specified by:
setRemoteCalendarLastUpdated in interface DataStorage
Throws:
Exception

getRemoteCalendar

public Calendar getRemoteCalendar(String username,
                                  String remoteUrl,
                                  String remoteType)
                           throws Exception
Specified by:
getRemoteCalendar in interface DataStorage
Throws:
Exception

getRemoteCalendarCount

public int getRemoteCalendarCount(String username)
                           throws Exception
Specified by:
getRemoteCalendarCount in interface DataStorage
Throws:
Exception

setCalDavResourceHref

public void setCalDavResourceHref(String username,
                                  String calendarId,
                                  String eventId,
                                  String href)
                           throws Exception
Specified by:
setCalDavResourceHref in interface DataStorage
Throws:
Exception

setCalDavResourceEtag

public void setCalDavResourceEtag(String username,
                                  String calendarId,
                                  String eventId,
                                  String etag)
                           throws Exception
Specified by:
setCalDavResourceEtag in interface DataStorage
Throws:
Exception

getEventById

public CalendarEvent getEventById(String eventId)
                           throws Exception
Throws:
Exception

getCalendarById

public Calendar getCalendarById(String calId)
                         throws Exception
Specified by:
getCalendarById in interface DataStorage
Throws:
Exception


Copyright © 2003-2013 eXo Platform SAS. All Rights Reserved.