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.explorer.calendars.jcr.JCRCalendar
-
- All Implemented Interfaces:
Calendar,ModifiableCalendar,ExplorerNode,ModifiableExplorerNode,ACLAmetysObject,AmetysObject,JCRAmetysObject,JCRTraversableAmetysObject,MetadataAwareAmetysObject,ModifiableMetadataAwareAmetysObject,ModifiableACLAmetysObject,ModifiableAmetysObject,ModifiableTraversableAmetysObject,RemovableAmetysObject,TraversableAmetysObject
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.explorer.calendars.Calendar
Calendar.CalendarVisibility
-
-
Field Summary
Fields Modifier and Type Field Description static StringAPPLICATION_IDapplication id for resources collections.static StringCALENDAR_COLORConstants for color Calendar*static StringCALENDAR_DESCConstants for description Calendar*static StringCALENDAR_ICS_TOKENConstants for Calendar ICS tokenstatic StringCALENDAR_TEMPLATE_DESCConstants for template description Calendar*static StringCALENDAR_TITLEConstants for title Calendar*static StringCALENDAR_VISIBILITYConstants for color Visibility*static StringCALENDAR_WORKFLOW_NAMEConstants for workflowName Calendar*
-
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 StringgetApplicationId()Returns the application id corresponding to this Node.StringgetColor()Get the color of the calendarStringgetDescription()Get the description of the applicationMap<CalendarEvent,List<Date>>getEvents(Date startDate, Date endDate)Get the events and its occurrences of the calendar between two datesStringgetExplorerPath()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.StringgetIconCls()Returns the icon css class for this Node.StringgetIcsUrlToken()Get the token used by the ICS public URLStringgetTemplateDescription()Get the template description of the calendarCalendar.CalendarVisibilitygetVisibility()Get the calendar visibilityStringgetWorkflowName()Get the name of the workflow of the calendarbooleanhasChildExplorerNodes()Returns true if this explorer node contains child explorer nodes.voidsetColor(String color)set the color of the calendarvoidsetDescription(String desc)set the description of the calendarvoidsetIcsUrlToken(String token)Set the token used by the ICS public URLvoidsetTemplateDescription(String templateDesc)set the template description of the calendarvoidsetVisibility(Calendar.CalendarVisibility visibility)Set the visibility of the calendarvoidsetWorkflowName(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, getAllowedGroups, getAllowedProfilesForAnonymous, getAllowedProfilesForAnyConnectedUser, getAllowedProfilesForGroups, getAllowedProfilesForUser, getAllowedProfilesForUsers, getAllowedUsers, getChild, getChildren, getDeniedGroups, getDeniedProfilesForAnonymous, getDeniedProfilesForAnyConnectedUser, getDeniedProfilesForGroups, getDeniedProfilesForUser, getDeniedProfilesForUsers, getDeniedUsers, 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.jcr.JCRAmetysObject
getNode
-
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.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 thisAmetysObjectparentPath- the parentPath in the Ametys hierarchyfactory- the DefaultAmetysObjectFactory which created the AmetysObject
-
-
Method Detail
-
getIconCls
public String getIconCls()
Description copied from interface:ExplorerNodeReturns the icon css class for this Node.- Specified by:
getIconClsin interfaceExplorerNode- Returns:
- the icon css class for this Node for rendering in the tree.
-
getApplicationId
public String getApplicationId()
Description copied from interface:ExplorerNodeReturns the application id corresponding to this Node.- Specified by:
getApplicationIdin interfaceExplorerNode- Returns:
- the application id corresponding to this Node.
-
getExplorerPath
public String getExplorerPath()
Description copied from interface:ExplorerNodeReturns 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:
getExplorerPathin interfaceExplorerNode- Returns:
- the path of this node in its hierarchy.
-
getDescription
public String getDescription()
Description copied from interface:ExplorerNodeGet the description of the application- Specified by:
getDescriptionin interfaceExplorerNode- Returns:
- the description
-
getColor
public String getColor()
Description copied from interface:CalendarGet the color of the calendar
-
getVisibility
public Calendar.CalendarVisibility getVisibility()
Description copied from interface:CalendarGet the calendar visibility- Specified by:
getVisibilityin interfaceCalendar- Returns:
- the calendar visibility
-
getWorkflowName
public String getWorkflowName()
Description copied from interface:CalendarGet the name of the workflow of the calendar- Specified by:
getWorkflowNamein interfaceCalendar- Returns:
- the name of the workflow of the calendar
-
getTemplateDescription
public String getTemplateDescription()
Description copied from interface:CalendarGet the template description of the calendar- Specified by:
getTemplateDescriptionin interfaceCalendar- Returns:
- the template description of the calendar
-
getEvents
public Map<CalendarEvent,List<Date>> getEvents(Date startDate, Date endDate)
Description copied from interface:CalendarGet the events and its occurrences of the calendar between two dates
-
setDescription
public void setDescription(String desc)
Description copied from interface:ModifiableCalendarset the description of the calendar- Specified by:
setDescriptionin interfaceModifiableCalendar- Specified by:
setDescriptionin interfaceModifiableExplorerNode- Parameters:
desc- The description
-
setColor
public void setColor(String color)
Description copied from interface:ModifiableCalendarset the color of the calendar- Specified by:
setColorin interfaceModifiableCalendar- Parameters:
color- The color to set
-
setVisibility
public void setVisibility(Calendar.CalendarVisibility visibility)
Description copied from interface:ModifiableCalendarSet the visibility of the calendar- Specified by:
setVisibilityin interfaceModifiableCalendar- Parameters:
visibility- The visibility
-
setWorkflowName
public void setWorkflowName(String workflowName)
Description copied from interface:ModifiableCalendarset the name of the workflow of the calendar- Specified by:
setWorkflowNamein interfaceModifiableCalendar- Parameters:
workflowName- The workflow name
-
setTemplateDescription
public void setTemplateDescription(String templateDesc)
Description copied from interface:ModifiableCalendarset the template description of the calendar- Specified by:
setTemplateDescriptionin interfaceModifiableCalendar- Parameters:
templateDesc- The template description
-
hasChildExplorerNodes
public boolean hasChildExplorerNodes() throws AmetysRepositoryException
Description copied from interface:ExplorerNodeReturns true if this explorer node contains child explorer nodes.- Specified by:
hasChildExplorerNodesin 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:CalendarGet the token used by the ICS public URL- Specified by:
getIcsUrlTokenin interfaceCalendar- Returns:
- The token, or null if no token exists for the calendar
-
setIcsUrlToken
public void setIcsUrlToken(String token)
Description copied from interface:ModifiableCalendarSet the token used by the ICS public URL- Specified by:
setIcsUrlTokenin interfaceModifiableCalendar- Parameters:
token- The token, or null to delete the existing token
-
-