Kantoor.Dav.View (Kantoor v1.0.0)

A collection as one user sees it: their own, or one shared with them.

access is :owner, :write or :read. ref is the path segment the collection has in the viewer's DAV home (the real slug for their own, shared-<id> for a share), which is what the in-app writers (Kantoor.Dav.Local) address it by. owner is the owning Kantoor.Accounts.User for a shared collection and nil for the viewer's own.

Views are always built from the database on each call, never cached: a revoked share or a deleted collection is gone on the next read.

Summary

Functions

Whether the events of this calendar count as busy time in free/busy.

The name of a collection as a person reads it. The three collections made for every user keep the English names DAV clients see ("Calendar", "Tasks", "Contacts"); the web pages show them in the language of the request. A name the user chose is shown as it is.

The collection's id.

A short label for lists: the name, with the owner for a shared collection.

The collection's display name.

The owner's display name, else their email; nil for the viewer's own.

True when the collection belongs to somebody else.

True for a calendar that is filled from an external feed.

True when the viewer may create, change and delete members. Never true for a subscribed calendar (Kantoor.Feeds): a feed fills it, whoever owns it.

Types

access()

@type access() :: :owner | :write | :read

t()

@type t() :: %Kantoor.Dav.View{
  access: access(),
  collection: Kantoor.Dav.Collection.t(),
  owner: struct() | nil,
  ref: String.t()
}

Functions

busy?(view)

@spec busy?(t()) :: boolean()

Whether the events of this calendar count as busy time in free/busy.

display_name(c)

@spec display_name(Kantoor.Dav.Collection.t()) :: String.t()

The name of a collection as a person reads it. The three collections made for every user keep the English names DAV clients see ("Calendar", "Tasks", "Contacts"); the web pages show them in the language of the request. A name the user chose is shown as it is.

id(view)

@spec id(t()) :: Ecto.UUID.t()

The collection's id.

label(view)

@spec label(t()) :: String.t()

A short label for lists: the name, with the owner for a shared collection.

name(view)

@spec name(t()) :: String.t()

The collection's display name.

owner_label(view)

@spec owner_label(t()) :: String.t() | nil

The owner's display name, else their email; nil for the viewer's own.

shared?(view)

@spec shared?(t()) :: boolean()

True when the collection belongs to somebody else.

subscribed?(view)

@spec subscribed?(t()) :: boolean()

True for a calendar that is filled from an external feed.

writable?(view)

@spec writable?(t()) :: boolean()

True when the viewer may create, change and delete members. Never true for a subscribed calendar (Kantoor.Feeds): a feed fills it, whoever owns it.