Class JCRCalendar
- java.lang.Object
-
- org.ametys.plugins.repository.AbstractAmetysObject
-
- org.ametys.plugins.repository.jcr.SimpleAmetysObject<F>
-
- org.ametys.plugins.repository.jcr.DefaultTraversableAmetysObject<JCRCalendarFactory>
-
- org.ametys.plugins.workspaces.calendars.jcr.JCRCalendar
-
- All Implemented Interfaces:
ExplorerNode
,ModifiableExplorerNode
,ACLAmetysObject
,AmetysObject
,DataAwareAmetysObject
,ModelAwareDataAwareAmetysObject
,ModifiableModelAwareDataAwareAmetysObject
,DataHolder
,ModelAwareDataHolder
,ModifiableDataHolder
,ModifiableModelAwareDataHolder
,JCRAmetysObject
,JCRTraversableAmetysObject
,MetadataAwareAmetysObject
,ModifiableMetadataAwareAmetysObject
,ModifiableACLAmetysObject
,ModifiableAmetysObject
,ModifiableTraversableAmetysObject
,RemovableAmetysObject
,TraversableAmetysObject
,Calendar
,ModifiableCalendar
public class JCRCalendar extends DefaultTraversableAmetysObject<JCRCalendarFactory> implements ModifiableCalendar
Default implementation of anCalendar
, backed by a JCR node.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.ametys.plugins.workspaces.calendars.Calendar
Calendar.CalendarVisibility
-
-
Field Summary
Fields Modifier and Type Field Description static String
APPLICATION_ID
application id for resources collections.static String
CALENDAR_COLOR
Constants for color Calendar*static String
CALENDAR_DESC
Constants for description Calendar*static String
CALENDAR_ICS_TOKEN
Constants for Calendar ICS tokenstatic String
CALENDAR_TEMPLATE_DESC
Constants for template description Calendar*static String
CALENDAR_TITLE
Constants for title Calendar*static String
CALENDAR_VISIBILITY
Constants for color Visibility*static String
CALENDAR_WORKFLOW_NAME
Constants for workflowName Calendar*-
Fields inherited from interface org.ametys.plugins.repository.data.holder.ModelAwareDataHolder
ALTERNATIVE_SUFFIX, COMMENTS_SUFFIX, STATUS_SUFFIX
-
-
Constructor Summary
Constructors Constructor Description JCRCalendar(Node node, String parentPath, JCRCalendarFactory factory)
Creates anJCRCalendar
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getApplicationId()
Returns the application id corresponding to this Node.String
getColor()
Get the color of the calendarModifiableModelAwareDataHolder
getDataHolder()
Returns theDataHolder
of thisAmetysObject
.String
getDescription()
Get the description of the applicationMap<CalendarEvent,List<CalendarEventOccurrence>>
getEvents(ZonedDateTime startDate, ZonedDateTime endDate)
Get the events and its occurrences of the calendar between two datesString
getExplorerPath()
Returns the path of this explorer node in the explorer hierarchy (which is a subset of the whole repository).
If this collection is the root explorer node, "" is returned.String
getIconCls()
Returns the icon css class for this Node.String
getIcsUrlToken()
Get the token used by the ICS public URLString
getTemplateDescription()
Get the template description of the calendarCalendar.CalendarVisibility
getVisibility()
Get the calendar visibilityString
getWorkflowName()
Get the name of the workflow of the calendarboolean
hasChildExplorerNodes()
Returns true if this explorer node contains child explorer nodes.void
setColor(String color)
set the color of the calendarvoid
setDescription(String desc)
set the description of the calendarvoid
setIcsUrlToken(String token)
Set the token used by the ICS public URLvoid
setTemplateDescription(String templateDesc)
set the template description of the calendarvoid
setVisibility(Calendar.CalendarVisibility visibility)
Set the visibility of the calendarvoid
setWorkflowName(String workflowName)
set the name of the workflow of the calendar-
Methods inherited from class org.ametys.plugins.repository.jcr.DefaultTraversableAmetysObject
addAllowedGroups, addAllowedProfilesForAnonymous, addAllowedProfilesForAnyConnectedUser, addAllowedUsers, addDeniedGroups, addDeniedProfilesForAnonymous, addDeniedProfilesForAnyConnectedUser, addDeniedUsers, createChild, disallowInheritance, getChild, getChildren, getProfilesForAnonymousAndAnyConnectedUser, getProfilesForGroups, getProfilesForUsers, hasChild, isInheritanceDisallowed, removeAllowedGroups, removeAllowedGroups, removeAllowedProfilesForAnonymous, removeAllowedProfilesForAnyConnectedUser, removeAllowedUsers, removeAllowedUsers, removeDeniedGroups, removeDeniedGroups, removeDeniedProfilesForAnonymous, removeDeniedProfilesForAnyConnectedUser, removeDeniedUsers, removeDeniedUsers
-
Methods inherited from class org.ametys.plugins.repository.jcr.SimpleAmetysObject
_getFactory, _invalidateName, _invalidateParentPath, getId, getMetadataHolder, getName, getNode, getParent, getParentPath, getPath, needsSave, remove, rename, revertChanges, saveChanges
-
Methods inherited from class org.ametys.plugins.repository.AbstractAmetysObject
equals, hashCode, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.ametys.plugins.repository.AmetysObject
equals, getId, getName, getParent, getParentPath, getPath, hashCode
-
Methods inherited from interface org.ametys.plugins.repository.data.ametysobject.DataAwareAmetysObject
copyTo, dataToSAX, dataToSAX
-
Methods inherited from interface org.ametys.plugins.repository.jcr.JCRAmetysObject
getNode
-
Methods inherited from interface org.ametys.plugins.repository.data.ametysobject.ModelAwareDataAwareAmetysObject
getComments, getDataNames, getDefinition, getExternalValue, getLocalValue, getModel, getStatus, getValue, getValue, hasComments, hasDefinition, hasExternalValue, hasExternalValueOrEmpty, hasLocalValue, hasLocalValueOrEmpty, hasValue, hasValueOrEmpty
-
Methods inherited from interface org.ametys.plugins.repository.data.holder.ModelAwareDataHolder
commentsToSAX, dataToMap, dataToMap, dataToMap, dataToMap, dataToSAX, dataToSAX, dataToSAX, dataToSAX, dataToSAXForEdition, getDataNames, getType, getValue, hasValue, hasValueOrEmpty, isMultiple
-
Methods inherited from interface org.ametys.plugins.repository.ModifiableAmetysObject
needsSave, rename, revertChanges, saveChanges
-
Methods inherited from interface org.ametys.plugins.repository.metadata.ModifiableMetadataAwareAmetysObject
getMetadataHolder
-
Methods inherited from interface org.ametys.plugins.repository.data.ametysobject.ModifiableModelAwareDataAwareAmetysObject
getComposite, getComposite, getExternalComposite, getExternalComposite, getExternalRepeater, getExternalRepeater, getLocalComposite, getLocalComposite, getLocalRepeater, getLocalRepeater, getParentDataHolder, getRepeater, getRepeater, getRepositoryData, getRootDataHolder, removeExternalizableMetadataIfExists, removeExternalValue, removeLocalValue, removeValue, setComments, setExternalValue, setLocalValue, setStatus, setValue, synchronizeValues, synchronizeValues, synchronizeValues, synchronizeValues
-
Methods inherited from interface org.ametys.plugins.repository.ModifiableTraversableAmetysObject
createChild
-
Methods inherited from interface org.ametys.plugins.repository.RemovableAmetysObject
remove
-
Methods inherited from interface org.ametys.plugins.repository.TraversableAmetysObject
getChild, getChildAt, getChildPosition, getChildren, hasChild
-
-
-
-
Field Detail
-
APPLICATION_ID
public static final String APPLICATION_ID
application id for resources collections.- See Also:
- Constant Field Values
-
CALENDAR_TITLE
public static final String CALENDAR_TITLE
Constants for title Calendar*- See Also:
- Constant Field Values
-
CALENDAR_DESC
public static final String CALENDAR_DESC
Constants for description Calendar*- See Also:
- Constant Field Values
-
CALENDAR_COLOR
public static final String CALENDAR_COLOR
Constants for color Calendar*- See Also:
- Constant Field Values
-
CALENDAR_VISIBILITY
public static final String CALENDAR_VISIBILITY
Constants for color Visibility*- See Also:
- Constant Field Values
-
CALENDAR_WORKFLOW_NAME
public static final String CALENDAR_WORKFLOW_NAME
Constants for workflowName Calendar*- See Also:
- Constant Field Values
-
CALENDAR_TEMPLATE_DESC
public static final String CALENDAR_TEMPLATE_DESC
Constants for template description Calendar*- See Also:
- Constant Field Values
-
CALENDAR_ICS_TOKEN
public static final String CALENDAR_ICS_TOKEN
Constants for Calendar ICS token- See Also:
- Constant Field Values
-
-
Constructor Detail
-
JCRCalendar
public JCRCalendar(Node node, String parentPath, JCRCalendarFactory factory)
Creates anJCRCalendar
.- Parameters:
node
- the node backing thisAmetysObject
parentPath
- the parentPath in the Ametys hierarchyfactory
- the DefaultAmetysObjectFactory which created the AmetysObject
-
-
Method Detail
-
getIconCls
public String getIconCls()
Description copied from interface:ExplorerNode
Returns the icon css class for this Node.- Specified by:
getIconCls
in interfaceExplorerNode
- Returns:
- the icon css class for this Node for rendering in the tree.
-
getApplicationId
public String getApplicationId()
Description copied from interface:ExplorerNode
Returns the application id corresponding to this Node.- Specified by:
getApplicationId
in interfaceExplorerNode
- Returns:
- the application id corresponding to this Node.
-
getExplorerPath
public String getExplorerPath()
Description copied from interface:ExplorerNode
Returns the path of this explorer node in the explorer hierarchy (which is a subset of the whole repository).
If this collection is the root explorer node, "" is returned.- Specified by:
getExplorerPath
in interfaceExplorerNode
- Returns:
- the path of this node in its hierarchy.
-
getDescription
public String getDescription()
Description copied from interface:ExplorerNode
Get the description of the application- Specified by:
getDescription
in interfaceExplorerNode
- Returns:
- the description
-
getColor
public String getColor()
Description copied from interface:Calendar
Get the color of the calendar
-
getVisibility
public Calendar.CalendarVisibility getVisibility()
Description copied from interface:Calendar
Get the calendar visibility- Specified by:
getVisibility
in interfaceCalendar
- Returns:
- the calendar visibility
-
getWorkflowName
public String getWorkflowName()
Description copied from interface:Calendar
Get the name of the workflow of the calendar- Specified by:
getWorkflowName
in interfaceCalendar
- Returns:
- the name of the workflow of the calendar
-
getTemplateDescription
public String getTemplateDescription()
Description copied from interface:Calendar
Get the template description of the calendar- Specified by:
getTemplateDescription
in interfaceCalendar
- Returns:
- the template description of the calendar
-
getEvents
public Map<CalendarEvent,List<CalendarEventOccurrence>> getEvents(ZonedDateTime startDate, ZonedDateTime endDate)
Description copied from interface:Calendar
Get the events and its occurrences of the calendar between two dates
-
setDescription
public void setDescription(String desc)
Description copied from interface:ModifiableCalendar
set the description of the calendar- Specified by:
setDescription
in interfaceModifiableCalendar
- Specified by:
setDescription
in interfaceModifiableExplorerNode
- Parameters:
desc
- The description
-
setColor
public void setColor(String color)
Description copied from interface:ModifiableCalendar
set the color of the calendar- Specified by:
setColor
in interfaceModifiableCalendar
- Parameters:
color
- The color to set
-
setVisibility
public void setVisibility(Calendar.CalendarVisibility visibility)
Description copied from interface:ModifiableCalendar
Set the visibility of the calendar- Specified by:
setVisibility
in interfaceModifiableCalendar
- Parameters:
visibility
- The visibility
-
setWorkflowName
public void setWorkflowName(String workflowName)
Description copied from interface:ModifiableCalendar
set the name of the workflow of the calendar- Specified by:
setWorkflowName
in interfaceModifiableCalendar
- Parameters:
workflowName
- The workflow name
-
setTemplateDescription
public void setTemplateDescription(String templateDesc)
Description copied from interface:ModifiableCalendar
set the template description of the calendar- Specified by:
setTemplateDescription
in interfaceModifiableCalendar
- Parameters:
templateDesc
- The template description
-
hasChildExplorerNodes
public boolean hasChildExplorerNodes() throws AmetysRepositoryException
Description copied from interface:ExplorerNode
Returns true if this explorer node contains child explorer nodes.- Specified by:
hasChildExplorerNodes
in interfaceExplorerNode
- Returns:
- true if this explorer node contains child explorer nodes.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getIcsUrlToken
public String getIcsUrlToken()
Description copied from interface:Calendar
Get the token used by the ICS public URL- Specified by:
getIcsUrlToken
in interfaceCalendar
- Returns:
- The token, or null if no token exists for the calendar
-
setIcsUrlToken
public void setIcsUrlToken(String token)
Description copied from interface:ModifiableCalendar
Set the token used by the ICS public URL- Specified by:
setIcsUrlToken
in interfaceModifiableCalendar
- Parameters:
token
- The token, or null to delete the existing token
-
getDataHolder
public ModifiableModelAwareDataHolder getDataHolder()
Description copied from interface:DataAwareAmetysObject
Returns theDataHolder
of thisAmetysObject
.- Specified by:
getDataHolder
in interfaceDataAwareAmetysObject
- Specified by:
getDataHolder
in interfaceModelAwareDataAwareAmetysObject
- Specified by:
getDataHolder
in interfaceModifiableModelAwareDataAwareAmetysObject
- Returns:
- the
DataHolder
of thisAmetysObject
-
-