Class AbstractCalendarWebScript
java.lang.Object
org.springframework.extensions.webscripts.AbstractWebScript
org.springframework.extensions.webscripts.DeclarativeWebScript
org.alfresco.repo.web.scripts.calendar.AbstractCalendarWebScript
- All Implemented Interfaces:
org.springframework.extensions.webscripts.WebScript
- Direct Known Subclasses:
AbstractCalendarListingWebScript
,CalendarEntryDelete
,CalendarEntryGet
,CalendarEntryPost
,CalendarEntryPut
public abstract class AbstractCalendarWebScript
extends org.springframework.extensions.webscripts.DeclarativeWebScript
- Since:
- 4.0
- Author:
- Nick Burch
-
Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.extensions.webscripts.AbstractWebScript
org.springframework.extensions.webscripts.AbstractWebScript.ScriptDetails
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ActivityService
static final String
protected CalendarService
protected static final int
When no maximum or paging info is given, what should we use?protected static final String
protected static final String
protected NodeService
protected static final String
protected static final String
protected static final String
protected static final String
protected SiteService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected 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 entrybuildError
(String message) Equivalent of jsonError in the old JavaScript controllersprotected 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 specifiedprotected 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 itexecuteImpl
(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) executeImpl
(org.springframework.extensions.webscripts.WebScriptRequest req, org.springframework.extensions.webscripts.Status status, org.springframework.extensions.webscripts.Cache cache) protected boolean
extractDates
(CalendarEntry entry, org.json.simple.JSONObject json) Extracts the Start and End details, along with the All Day flag from the JSON, and returns if the event is all day or notprotected String
protected Date
Gets the date from the String, trying the various formats (New and Legacy) until one works...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 eventprotected 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 eventvoid
setActivityService
(ActivityService activityService) void
setCalendarService
(CalendarService calendarService) void
setNodeService
(NodeService nodeService) void
setSiteService
(SiteService siteService) protected boolean
Normally the Calendar webscripts return a 200 with JSON containing the error message.Methods inherited from class org.springframework.extensions.webscripts.DeclarativeWebScript
execute, executeFinallyImpl, executeImpl, executeImpl, getTemplateModel, renderFormatTemplate
Methods inherited from class org.springframework.extensions.webscripts.AbstractWebScript
addModuleBundleToCache, checkModuleBundleCache, createArgs, createArgsM, createHeaders, createHeadersM, createScriptParameters, createStatusException, createTemplateParameters, executeScript, getContainer, getDescription, getExecuteScript, getResources, getStatusTemplate, init, renderString, renderString, renderTemplate, sendStatus, setURLModelFactory, toString
-
Field Details
-
CALENDAR_SERVICE_ACTIVITY_APP_NAME
- See Also:
-
MSG_EVENT_NOT_FOUND
- See Also:
-
MSG_INVALID_JSON
- See Also:
-
PARAM_TIMEZONE
- See Also:
-
PARAM_START_AT
- See Also:
-
PARAM_END_AT
- See Also:
-
PARAM_ISO8601
- See Also:
-
MAX_QUERY_ENTRY_COUNT
protected static final int MAX_QUERY_ENTRY_COUNTWhen no maximum or paging info is given, what should we use?- See Also:
-
nodeService
-
siteService
-
activityService
-
calendarService
-
-
Constructor Details
-
AbstractCalendarWebScript
public AbstractCalendarWebScript()
-
-
Method Details
-
setNodeService
-
setSiteService
-
setActivityService
-
setCalendarService
-
parseDate
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
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 classorg.springframework.extensions.webscripts.DeclarativeWebScript
-
removeTimeZoneIfRequired
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
-