Class AbstractCalendarWebScript

    • Constructor Detail

      • AbstractCalendarWebScript

        public AbstractCalendarWebScript()
    • Method Detail

      • setNodeService

        public void setNodeService​(NodeService nodeService)
      • setSiteService

        public void setSiteService​(SiteService siteService)
      • setActivityService

        public void setActivityService​(ActivityService activityService)
      • setCalendarService

        public void setCalendarService​(CalendarService calendarService)
      • parseDate

        protected Date parseDate​(String date)
        Gets the date from the String, trying the various formats (New and Legacy) until one works...
      • extractDates

        protected boolean extractDates​(CalendarEntry entry,
                                       org.json.simple.JSONObject json)
                                throws org.json.JSONException
        Extracts the Start and End details, along with the All Day flag from the JSON, and returns if the event is all day or not
        Throws:
        org.json.JSONException
      • getOrNull

        protected String getOrNull​(org.json.simple.JSONObject json,
                                   String key)
                            throws org.json.JSONException
        Throws:
        org.json.JSONException
      • buildPagingRequest

        protected org.alfresco.query.PagingRequest buildPagingRequest​(org.springframework.extensions.webscripts.WebScriptRequest req)
        Builds up a listing Paging request, either using the defaults or the paging options specified
      • useJSONErrors

        protected boolean useJSONErrors()
        Normally the Calendar webscripts return a 200 with JSON containing the error message. Override this to switch to using HTTP status codes instead
      • buildError

        protected Map<String,​Object> buildError​(String message)
        Equivalent of jsonError in the old JavaScript controllers
      • addActivityEntry

        protected String addActivityEntry​(String event,
                                          CalendarEntry entry,
                                          SiteInfo site,
                                          org.springframework.extensions.webscripts.WebScriptRequest req,
                                          org.json.simple.JSONObject json)
        Generates an activity entry for the entry
      • createIgnoreEvent

        protected NodeRef createIgnoreEvent​(org.springframework.extensions.webscripts.WebScriptRequest req,
                                            CalendarEntry parent)
        For an event that is a recurring event, have an ignored child event generated for it
      • executeImpl

        protected Map<String,​Object> executeImpl​(org.springframework.extensions.webscripts.WebScriptRequest req,
                                                       org.springframework.extensions.webscripts.Status status,
                                                       org.springframework.extensions.webscripts.Cache cache)
        Overrides:
        executeImpl in class org.springframework.extensions.webscripts.DeclarativeWebScript
      • removeTimeZoneIfRequired

        protected String removeTimeZoneIfRequired​(Date date,
                                                  Boolean isAllDay,
                                                  Boolean removeTimezone)
        Removes the time zone for a given date if the Calendar Entry is an all day event
        Returns:
        ISO 8601 formatted date String
      • removeTimeZoneIfRequired

        protected String removeTimeZoneIfRequired​(Date date,
                                                  Boolean isAllDay,
                                                  Boolean removeTimezone,
                                                  String datePattern)
        Removes the time zone for a given date if the Calendar Entry is an all day event
        Returns:
        ISO 8601 formatted date String if datePattern is null
      • executeImpl

        protected abstract Map<String,​Object> executeImpl​(SiteInfo site,
                                                                String eventName,
                                                                org.springframework.extensions.webscripts.WebScriptRequest req,
                                                                org.json.simple.JSONObject json,
                                                                org.springframework.extensions.webscripts.Status status,
                                                                org.springframework.extensions.webscripts.Cache cache)