Class t.w.d.r.DAVPropertyMixIn(MetaDataMixin):

Part of twisted.web2.dav.resource View Source View In Hierarchy

Known subclasses: twisted.web2.dav.resource.DAVResource

Mix-in class which implements the DAV property access API in
L{IDAVResource}.

There are three categories of DAV properties, for the purposes of how this
class manages them.  A X{property} is either a X{live property} or a
X{dead property}, and live properties are split into two categories:

1. Dead properties.  There are properties that the server simply stores as
   opaque data.  These are store in the X{dead property store}, which is
   provided by subclasses via the L{deadProperties} method.

2. Live properties which are always computed.  These properties aren't
   stored anywhere (by this class) but instead are derived from the resource
   state or from data that is persisted elsewhere.  These are listed in the
   L{liveProperties} attribute and are handled explicitly by the
   L{readProperty} method.

3. Live properties may be acted on specially and are stored in the X{dead
   property store}.  These are not listed in the L{liveProperties} attribute,
   but may be handled specially by the property access methods.  For
   example, L{writeProperty} might validate the data and refuse to write
   data it deems inappropriate for a given property.

There are two sets of property access methods.  The first group
(L{hasProperty}, etc.) provides access to all properties.  They
automatically figure out which category a property falls into and act
accordingly.

The second group (L{hasDeadProperty}, etc.) accesses the dead property store
directly and bypasses any live property logic that exists in the first group
of methods.  These methods are used by the first group of methods, and there
are cases where they may be needed by other methods.  I{Accessing dead
properties directly should be done with caution.}  Bypassing the live
property logic means that values may not be the correct ones for use in
DAV requests such as PROPFIND, and may be bypassing security checks.  In
general, one should never bypass the live property logic as part of a client
request for property data.

Properties in the L{twisted_private_namespace} namespace are internal to the
server and should not be exposed to clients.  They can only be accessed via
the dead property store.
Method deadProperties Provides internal access to the WebDAV dead property store. You
Method hasProperty See IDAVResource.hasProperty.
Method readProperty See IDAVResource.readProperty.
Method writeProperty See IDAVResource.writeProperty.
Method removeProperty See IDAVResource.removeProperty.
Method listProperties See IDAVResource.listProperties.
Method listAllprop Some DAV properties should not be returned to a DAV:allprop query.
Method hasDeadProperty Same as hasProperty, but bypasses the live property store and checks
Method readDeadProperty Same as readProperty, but bypasses the live property store and reads
Method writeDeadProperty Same as writeProperty, but bypasses the live property store and
Method removeDeadProperty Same as removeProperty, but bypasses the live property store and acts
Method contentType
Method displayName

Inherited from MetaDataMixin:

Method etag
Method lastModified
Method creationDate
Method contentLength
Method contentEncoding
Method exists
def deadProperties(self): (source)

Provides internal access to the WebDAV dead property store. You probably shouldn't be calling this directly if you can use the property accessors in the IDAVResource API instead. However, a subclass must override this method to provide it's own dead property store.

This implementation returns an instance of NonePropertyStore, which cannot store dead properties. Subclasses must override this method if they wish to store dead properties.
Returnsa dict-like object from which one can read and to which one can write dead properties. Keys are qname tuples (ie. (namespace, name)) as returned by davxml.WebDAVElement.qname() and values are davxml.WebDAVElement instances.
def hasProperty(self, property, request): (source)
See IDAVResource.hasProperty.
def readProperty(self, property, request): (source)
See IDAVResource.readProperty.
def writeProperty(self, property, request): (source)
See IDAVResource.writeProperty.
def removeProperty(self, property, request): (source)
See IDAVResource.removeProperty.
def listProperties(self, request): (source)
See IDAVResource.listProperties.
def listAllprop(self, request): (source)
Some DAV properties should not be returned to a DAV:allprop query. RFC 3253 defines several such properties. This method computes a subset of the property qnames returned by listProperties by filtering out elements whose class have the .hidden attribute set to True.
Returnsa list of qnames of properties which are defined and are appropriate for use in response to a DAV:allprop query.
def hasDeadProperty(self, property): (source)
Same as hasProperty, but bypasses the live property store and checks directly from the dead property store.
def readDeadProperty(self, property): (source)
Same as readProperty, but bypasses the live property store and reads directly from the dead property store.
def writeDeadProperty(self, property): (source)
Same as writeProperty, but bypasses the live property store and writes directly to the dead property store. Note that this should not be used unless you know that you are writing to an overrideable live property, as this bypasses the logic which protects protected properties. The result of writing to a non-overrideable live property with this method is undefined; the value in the dead property store may or may not be ignored when reading the property with readProperty.
def removeDeadProperty(self, property): (source)
Same as removeProperty, but bypasses the live property store and acts directly on the dead property store.
def contentType(self): (source)
ReturnsThe MIME type of the resource if available, None otherwise.
def displayName(self): (source)
ReturnsThe display name of the resource if available, None otherwise.
API Documentation for twisted, generated by pydoctor.