Class BwCalendar

All Implemented Interfaces:
Serializable, Comparable<BwCalendar>, CategorisedEntity, CollatableEntity, OwnedEntity, PropertiesEntity, ShareableEntity, org.bedework.util.logging.Logged
Direct Known Subclasses:
BwCalendarNewWrapper, CalendarWrapper

A collection in Bedework. This is roughly equivalent to a folder with some rules attached.

These objects are used to create two tree structures rooted at the public calendars root and the user calendars root. The names of the roots are defined at system build time.

For caldav compatability we do not allow calendar collections inside calendar collections.

Collections are given a type defined below.

Entities have names which must be unique within a collection. An event, either a single non-recurring event, or a master event and all it's overrides, have a single effective name which would correspond to the name of an ics file generated for that event.

Calendar entities also have uids. These must be unique within normal calendar collections. That requirement is relaxed for other special calendars. Collections may be tombstoned - that is they are effectively deleted but remain for the purpose of synchronization reports. Currently we indicate a tombstoned collection by setting the filter value to "--TOMBSTONED--". XXX We suffix the name and path also to avoid some ugly clashes related to lastmod

Version:
1.0
Author:
Mike Douglass douglm - rpi.edu
See Also:
  • Field Details

    • minRefreshRateSeconds

      public static final int minRefreshRateSeconds
      See Also:
    • calTypeUnknown

      public static final int calTypeUnknown
      Indicate unknown type
      See Also:
    • calTypeFolder

      public static final int calTypeFolder
      Normal folder Holds other collections
      See Also:
    • calTypeCalendarCollection

      public static final int calTypeCalendarCollection
      Normal calendar collection holds events, todos etc
      See Also:
    • calTypeTrash

      public static final int calTypeTrash
      Trash - don't use
      See Also:
    • calTypeDeleted

      public static final int calTypeDeleted
      Deleted Holds annotations which effectively delete events to which the user does not have write access
      See Also:
    • calTypeBusy

      public static final int calTypeBusy
      Busy Used to store busy time - acts as a mask for freebusy
      See Also:
    • calTypeInbox

      public static final int calTypeInbox
      Inbox Mostly used for notification of meeting requests
      See Also:
    • calTypeOutbox

      public static final int calTypeOutbox
      Outbox Target for scheduling. Normally empty
      See Also:
    • calTypeAlias

      public static final int calTypeAlias
      Alias
      See Also:
    • calTypeExtSub

      public static final int calTypeExtSub
      External subscription
      See Also:
    • calTypeResourceCollection

      public static final int calTypeResourceCollection
      Resource collection According to the CalDAV spec a collection may exist inside a calendar collection but no calendar collection must be so contained at any depth. (RFC 4791 Section 4.2)
      See Also:
    • calTypeNotifications

      public static final int calTypeNotifications
      Notifications collection
      See Also:
    • calTypeEventList

      public static final int calTypeEventList
      List of events
      See Also:
    • calTypePoll

      public static final int calTypePoll
      Vpoll entities
      See Also:
    • calTypePendingInbox

      public static final int calTypePendingInbox
      Pending Inbox Unprocessed meeting requests
      See Also:
    • calTypeAttachments

      public static final int calTypeAttachments
      managed attachments
      See Also:
    • calTypeTasks

      public static final int calTypeTasks
      Tasks
      See Also:
    • entityTypes

      public static final Map<Integer,List<String>> entityTypes
    • internalAliasUriPrefix

      public static final String internalAliasUriPrefix
      See Also:
    • tombstonedFilter

      public static final String tombstonedFilter
      Value of filter for a tombstoned collection
      See Also:
    • tombstonedSuffix

      public static final String tombstonedSuffix
      Value of suffix on path for a tombstoned collection
      See Also:
  • Constructor Details

    • BwCalendar

      public BwCalendar()
      Constructor
  • Method Details

    • setName

      public void setName(String val)
      Set the name
      Parameters:
      val - String name
    • getName

      public String getName()
      Get the name
      Returns:
      String name
    • setPath

      public void setPath(String val)
      Set the path
      Parameters:
      val - String path
    • getPath

      public String getPath()
      Get the path
      Returns:
      String path
    • setSummary

      public void setSummary(String val)
      Set the summary
      Parameters:
      val - String summary
    • getSummary

      public String getSummary()
      Get the summary
      Returns:
      String summary
    • setDescription

      public void setDescription(String val)
      Set the description
      Parameters:
      val - description
    • getDescription

      public String getDescription()
      Get the description
      Returns:
      String description
    • setMailListId

      public void setMailListId(String val)
      Set the mail list id
      Parameters:
      val - String mail list id
    • getMailListId

      public String getMailListId()
      Get the mail list id
      Returns:
      String mail list id
    • setCalType

      public void setCalType(int val)
      Set the type
      Parameters:
      val - type
    • getCalType

      public int getCalType()
      Get the type
      Returns:
      int type
    • setCreated

      public void setCreated(String val)
      Parameters:
      val - - the created date
    • getCreated

      public String getCreated()
      Returns:
      String created
    • setLastmod

      public void setLastmod(BwCollectionLastmod val)
      Parameters:
      val - the lastmod
    • getLastmod

      public BwCollectionLastmod getLastmod()
      Returns:
      BwCollectionLastmod lastmod
    • setFilterExpr

      public void setFilterExpr(String val)
      Parameters:
      val - - the filter expression
    • getFilterExpr

      public String getFilterExpr()
      Returns:
      String FilterExpr
    • setRefreshRate

      public void setRefreshRate(int val)
      Set the refresh rate in seconds
      Parameters:
      val - type
    • getRefreshRate

      public int getRefreshRate()
      Get the refresh rate in seconds
      Returns:
      String description
    • setLastRefresh

      public void setLastRefresh(String val)
      Parameters:
      val - - the value
    • getLastRefresh

      public String getLastRefresh()
      Returns:
      String lastRefresh
    • setLastRefreshStatus

      public void setLastRefreshStatus(String val)
      Parameters:
      val - HTTP status or other appropriate value
    • getLastRefreshStatus

      public String getLastRefreshStatus()
      Returns:
      String lastRefreshStatus
    • setLastEtag

      public void setLastEtag(String val)
      Parameters:
      val - - the value
    • getLastEtag

      public String getLastEtag()
      Returns:
      String lastRefresh
    • setRemoteId

      public void setRemoteId(String val)
      Parameters:
      val - If non-null we have a remote id and encrypted password
    • getRemoteId

      public String getRemoteId()
      Returns:
      String remoteId
    • setRemotePw

      public void setRemotePw(String val)
      Parameters:
      val - If non-null the encrypted password
    • getRemotePw

      public String getRemotePw()
      Returns:
      String encrypted password
    • setCategories

      public void setCategories(Set<BwCategory> val)
      Description copied from interface: CategorisedEntity
      Set the categories Set
      Specified by:
      setCategories in interface CategorisedEntity
      Parameters:
      val - Set of categories
    • getCategories

      public Set<BwCategory> getCategories()
      Description copied from interface: CategorisedEntity
      Get the categories
      Specified by:
      getCategories in interface CategorisedEntity
      Returns:
      Set of categories
    • getNumCategories

      public int getNumCategories()
      Specified by:
      getNumCategories in interface CategorisedEntity
      Returns:
      int number of categories.
    • addCategory

      public boolean addCategory(BwCategory val)
      Specified by:
      addCategory in interface CategorisedEntity
      Parameters:
      val - the category to add
      Returns:
      boolean true if added.
    • removeCategory

      public boolean removeCategory(BwCategory val)
      Specified by:
      removeCategory in interface CategorisedEntity
      Parameters:
      val - the category to remove
      Returns:
      boolean true if removed.
    • hasCategory

      public boolean hasCategory(BwCategory val)
      Description copied from interface: CategorisedEntity
      Check the categories for the same entity
      Specified by:
      hasCategory in interface CategorisedEntity
      Parameters:
      val - Category to test
      Returns:
      boolean true if the event has a particular category
    • copyCategories

      public Set<BwCategory> copyCategories()
      Description copied from interface: CategorisedEntity
      Return a copy of the Set
      Specified by:
      copyCategories in interface CategorisedEntity
      Returns:
      Set of BwCategory
    • cloneCategories

      public Set<BwCategory> cloneCategories()
      Description copied from interface: CategorisedEntity
      Return a clone of the Set
      Specified by:
      cloneCategories in interface CategorisedEntity
      Returns:
      Set of BwCategory
    • setAliasUri

      public void setAliasUri(String val)
      Set the alias uri
      Parameters:
      val - String uri
    • getAliasUri

      public String getAliasUri()
      Get the alias uri
      Returns:
      String uri
    • setPwNeedsEncrypt

      public void setPwNeedsEncrypt(boolean val)
      Parameters:
      val - boolean true if the password needs encrypting
    • getPwNeedsEncrypt

      public boolean getPwNeedsEncrypt()
      Returns:
      boolean true if the password needs encrypting
    • setDisplay

      public void setDisplay(boolean val)
      Parameters:
      val - boolean true if the calendar is to be displayed
    • getDisplay

      public boolean getDisplay()
      Returns:
      boolean true if the calendar is to be displayed
    • setAffectsFreeBusy

      public void setAffectsFreeBusy(boolean val)
      Parameters:
      val - true if the calendar takes part in free/busy calculations
    • getAffectsFreeBusy

      public boolean getAffectsFreeBusy()
      Returns:
      boolean true if the calendar takes part in free/busy calculations
    • setIgnoreTransparency

      public void setIgnoreTransparency(boolean val)
      Set the ignoreTransparency flag
      Parameters:
      val - true if we ignore tranparency in free/busy calculations
    • getIgnoreTransparency

      public boolean getIgnoreTransparency()
      Do we ignore transparency?
      Returns:
      boolean true for ignoreTransparency
    • setUnremoveable

      public void setUnremoveable(boolean val)
      Parameters:
      val - boolean true if the calendar is unremoveable
    • getUnremoveable

      public boolean getUnremoveable()
      Returns:
      boolean true if the calendar is unremoveable
    • setProperties

      public void setProperties(Set<BwProperty> val)
      Specified by:
      setProperties in interface PropertiesEntity
    • getProperties

      public Set<BwProperty> getProperties()
      Specified by:
      getProperties in interface PropertiesEntity
      Returns:
      properties
    • getProperties

      public Set<BwProperty> getProperties(String name)
      Specified by:
      getProperties in interface PropertiesEntity
      Returns:
      properties with given name
    • removeProperties

      public void removeProperties(String name)
      Description copied from interface: PropertiesEntity
      Remove all with given name
      Specified by:
      removeProperties in interface PropertiesEntity
    • getNumProperties

      public int getNumProperties()
      Specified by:
      getNumProperties in interface PropertiesEntity
      Returns:
      int
    • findProperty

      public BwProperty findProperty(String name)
      Specified by:
      findProperty in interface PropertiesEntity
      Returns:
      property or null
    • addProperty

      public void addProperty(BwProperty val)
      Specified by:
      addProperty in interface PropertiesEntity
    • removeProperty

      public boolean removeProperty(BwProperty val)
      Specified by:
      removeProperty in interface PropertiesEntity
      Returns:
      boolean
    • copyProperties

      public Set<BwProperty> copyProperties()
      Specified by:
      copyProperties in interface PropertiesEntity
      Returns:
      BwProperty
    • cloneProperties

      public Set<BwProperty> cloneProperties()
      Specified by:
      cloneProperties in interface PropertiesEntity
      Returns:
      BwProperty
    • setSupportedComponents

      public void setSupportedComponents(List<String> val)
      Parameters:
      val - the supported component names e.g. "VEVENT", "VTODO" etc.
    • getSupportedComponents

      public List<String> getSupportedComponents()
      Returns:
      the supported components
    • getVpollSupportedComponents

      public List<String> getVpollSupportedComponents()
      Returns:
      the supported vpoll components
    • setColor

      public void setColor(String val)
      Set the calendar color property
      Parameters:
      val - color
    • getColor

      public String getColor()
      Get the calendar color property
      Returns:
      String calendar color
    • setSubscriptionId

      public void setSubscriptionId(String val)
      Set the subscription id
      Parameters:
      val - subscription id
    • getSubscriptionId

      public String getSubscriptionId()
      Get the subscriptionId property
      Returns:
      String subscriptionId
    • setSynchAdminCreateEprops

      public void setSynchAdminCreateEprops(boolean val)
      Set the admin can create event properties flag for synch
      Parameters:
      val - if set the admin can create event properties during synch
    • getSynchAdminCreateEprops

      public boolean getSynchAdminCreateEprops()
      Get the admin can create event properties flag for synch
      Returns:
      boolean on/off
    • setSynchXlocXcontacts

      public void setSynchXlocXcontacts(boolean val)
      Set the process contacts and locations flag for synch
      Parameters:
      val - if we process contacts and locations during synch
    • getSynchXlocXcontacts

      public boolean getSynchXlocXcontacts()
      Get the process contacts and locations flag for synch
      Returns:
      boolean on/off
    • setSynchXcategories

      public void setSynchXcategories(boolean val)
      Set the process categories flag for synch
      Parameters:
      val - if we process categories during synch
    • getSynchXcategories

      public boolean getSynchXcategories()
      Get the process categories flag for synch
      Returns:
      boolean on/off
    • setSynchDeleteSuppressed

      public void setSynchDeleteSuppressed(boolean val)
      Set the deletions suppressed flag for synch
      Parameters:
      val - true if we suppress deletions during synch
    • getSynchDeleteSuppressed

      public boolean getSynchDeleteSuppressed()
      Get the deletions suppressed flag for synch
      Returns:
      boolean on/off
    • setTimezone

      public void setTimezone(String val)
      Set the calendar timezone property
      Parameters:
      val - calendar timezone property
    • getTimezone

      public String getTimezone()
      Get the calendar timezone property
      Returns:
      String vtimezone spec
    • setSubscriptionTargetType

      public void setSubscriptionTargetType(String val)
      Set the subscription target type property
      Parameters:
      val - subscription target type
    • getSubscriptionTargetType

      public String getSubscriptionTargetType()
      Get the subscription target type property
      Returns:
      String subscription target type
    • setLocationKey

      public void setLocationKey(String val)
      Set the location key property
      Parameters:
      val - location key
    • getLocationKey

      public String getLocationKey()
      Get the location key property
      Returns:
      String location key
    • setPrimaryCollection

      public void setPrimaryCollection(boolean val)
      Mark this collection as a primary collection
      Parameters:
      val - true for primary
    • getPrimaryCollection

      public boolean getPrimaryCollection()
      Is this collection a primary collection?
      Returns:
      true/false
    • setOrgSyncPublicOnly

      public void setOrgSyncPublicOnly(Boolean val)
      Set the orgsync public only property
      Parameters:
      val - orgsync public only property
    • getOrgSyncPublicOnly

      public boolean getOrgSyncPublicOnly()
      Get the orgsync public only property property
      Returns:
      boolean subscription target type
    • setIsTopicalArea

      public void setIsTopicalArea(boolean val)
      Set the topical area property
      Parameters:
      val - topical area property
    • getIsTopicalArea

      public boolean getIsTopicalArea()
      Get the topical area property
      Returns:
      boolean on/off
    • setQproperty

      public void setQproperty(QName name, String val)
      Parameters:
      name - QName
      val - its value
    • getQproperty

      public String getQproperty(QName name)
      Parameters:
      name - QName
      Returns:
      value or null
    • removeQproperty

      public void removeQproperty(QName name)
      Parameters:
      name - QName
    • setEventList

      public void setEventList(SortedSet<EventListEntry> val)
      Set the event list property
      Parameters:
      val - event list
    • getEventList

      public SortedSet<EventListEntry> getEventList()
      Get the event list
      Returns:
      event list - never null
    • setHref

      public void setHref(String val)
      Overrides:
      setHref in class BwUnversionedDbentity<BwCalendar>
      Parameters:
      val - the href - may be ignored
    • getHref

      public String getHref()
      Overrides:
      getHref in class BwUnversionedDbentity<BwCalendar>
      Returns:
      non null unique href for the entity
    • getEtag

      public String getEtag()
      Returns:
      valid quoted etag
    • getMicrosecsVersion

      public long getMicrosecsVersion() throws CalFacadeException
      Returns:
      a version value in microseconds.
      Throws:
      CalFacadeException
    • getCalendarCollection

      public boolean getCalendarCollection()
      true if this is to 'hold' calendar objects
      Returns:
      boolean true if this is to 'hold' calendar objects
    • getSpecial

      public boolean getSpecial()
      true if this is a special collection
      Returns:
      boolean
    • getCanAlias

      public boolean getCanAlias()
      true if this can be the target of an alias
      Returns:
      boolean
    • setAliasTarget

      public void setAliasTarget(BwCalendar val)
      Set the aliased entity - this is usualy the end of the chain of aliases, e.g. in a->b->c this would be c.
      Parameters:
      val - BwCalendar object's alias target
    • getAliasTarget

      public BwCalendar getAliasTarget()
      Get the aliased entity
      Returns:
      BwCalendar the object's alias target
    • setAliasOrigin

      public void setAliasOrigin(BwCalendar val)
      Set the collection that was the root of the chain that referred to this collection, e.g. in a->b->c this would be a.
      Parameters:
      val - BwCalendar object's alias target
    • getAliasOrigin

      public BwCalendar getAliasOrigin()
      Get the aliased entity
      Returns:
      BwCalendar the object's alias target
    • setAliasCalType

      public void setAliasCalType(int val)
      the aliased entity type
      Parameters:
      val - type
    • getAliasCalType

      public int getAliasCalType()
      Returns:
      the aliased entity type
    • setDisabled

      public void setDisabled(boolean val)
      Parameters:
      val - boolean true if the target is unreachable
    • getDisabled

      public boolean getDisabled()
      Returns:
      boolean true if the target is unreachable
    • getAliasedEntity

      public BwCalendar getAliasedEntity()
      return the end of the chain of aliases or this object if not an alias. Assumes aliases have been resolved.
      Returns:
      boolean true if this is some sort of alias.
    • getAlias

      public boolean getAlias()
      true if this is some sort of alias
      Returns:
      boolean true if this is some sort of alias.
    • getInternalAlias

      public boolean getInternalAlias()
      true if this is an alias to an internal calendar.
      Returns:
      boolean true if this is an alias to an internal calendar.
    • getExternalSub

      public boolean getExternalSub()
      true if this is an alias to an external calendar.
      Returns:
      boolean true if this is an alias to an external calendar.
    • getInternalAliasPath

      public String getInternalAliasPath()
      Return path if this is an alias to an internal calendar.
      Returns:
      String path if this is an alias to an internal calendar otherwise null.
    • setChildren

      public void setChildren(Collection<BwCalendar> val)
      Parameters:
      val - Collection of children objects
    • getChildren

      public Collection<BwCalendar> getChildren()
      Returns:
      Collection of children objects
    • setCategoryHrefs

      public void setCategoryHrefs(Set<String> val)
      Set list of referenced categories
      Specified by:
      setCategoryHrefs in interface CategorisedEntity
      Parameters:
      val - list of category hrefs
    • getCategoryHrefs

      public Set<String> getCategoryHrefs()
      Description copied from interface: CategorisedEntity
      Get the categories
      Specified by:
      getCategoryHrefs in interface CategorisedEntity
      Returns:
      list of category hrefs.
    • getCollectionInfo

      public CollectionInfo getCollectionInfo()
      Returns:
      CollectionInfo for this entity
    • getCollectionInfo

      public CollectionInfo getCollectionInfo(int type)
      Parameters:
      type - of collection
      Returns:
      CollectionInfo for an entity of the given type
    • getAllCollectionInfo

      public static List<CollectionInfo> getAllCollectionInfo()
      Returns:
      CollectionInfo for all types
    • tombstone

      public void tombstone()
      Make this thing a tombstoned collection. Non-reversible
    • getShared

      public boolean getShared()
      Is this collection shared?
      Returns:
      true/false
    • setShared

      public void setShared(boolean val)
      Mark this collection shared or unshared
      Parameters:
      val - true for shared
    • getSharedWritable

      public boolean getSharedWritable()
      Is this collection shared with write access?
      Returns:
      true/false
    • setSharedWritable

      public void setSharedWritable(boolean val)
      Mark this collection writable
      Parameters:
      val - true for writable
    • getTombstoned

      public boolean getTombstoned()
      Is this collection shared?
      Returns:
      true/false
    • checkName

      public static boolean checkName(String val)
      Check a possible name for validity
      Parameters:
      val - name to check
      Returns:
      boolean true for valid calendar name
    • getEncodedPath

      public String getEncodedPath()
      Generate an encoded url referring to this calendar. XXX This should not be here
      Returns:
      String encoded url (or path)
    • updateLastmod

      public void updateLastmod(Timestamp val)
      Update last mod fields
      Parameters:
      val - timestamp
    • setProperty

      public void setProperty(String name, String val)
      Set the single valued named property
      Parameters:
      name - of property
      val - of property
    • getProperty

      public String getProperty(String name)
      Get the single valued named property
      Parameters:
      name - of property
      Returns:
      String property value
    • setCurrentAccess

      public void setCurrentAccess(org.bedework.access.CurrentAccess val)
      Parameters:
      val - CurrentAccess
    • getCurrentAccess

      public org.bedework.access.CurrentAccess getCurrentAccess()
      Returns:
      CurrentAccess
    • setVirtualPath

      public void setVirtualPath(String val)
      Parameters:
      val - virtual path for searches
    • getVirtualPath

      public String getVirtualPath()
      Returns:
      virtual path for searches
    • setOpen

      public void setOpen(boolean val)
      Parameters:
      val - ui open state
    • getOpen

      public boolean getOpen()
      Returns:
      ui open state
    • getCollateValue

      public String getCollateValue()
      Description copied from interface: CollatableEntity
      Get the value to collate with
      Specified by:
      getCollateValue in interface CollatableEntity
      Returns:
      String collation value
    • makeTombstoneCopy

      public BwCalendar makeTombstoneCopy()
      Returns:
      a copy for tombstoning.
    • getRestoreCallback

      public static org.bedework.util.xml.FromXmlCallback getRestoreCallback()
    • compareTo

      public int compareTo(BwCalendar that)
      Specified by:
      compareTo in interface Comparable<BwCalendar>
      Overrides:
      compareTo in class BwUnversionedDbentity<BwCalendar>
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class BwUnversionedDbentity<BwCalendar>
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • clone

      public Object clone()
      Description copied from class: BwUnversionedDbentity
      Make visible
      Overrides:
      clone in class BwUnversionedDbentity<BwCalendar>
      Returns:
      Object of class T
    • cloneWrapper

      public BwCalendar cloneWrapper()
      Used to provide a new wrapper for an entity
      Returns:
      Same entity with new wrapper
    • shallowClone

      public BwCalendar shallowClone()