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 |
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.
NonePropertyStore
,
which cannot store dead properties. Subclasses must override this method
if they wish to store dead properties.
Returns | a 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.
|
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
.
Returns | a list of qnames of properties which are defined and are appropriate
for use in response to a DAV:allprop query.
|
hasProperty
,
but bypasses the live property store and checks directly from the dead
property store.
readProperty
,
but bypasses the live property store and reads directly from the dead
property store.
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
.
removeProperty
,
but bypasses the live property store and acts directly on the dead
property store.
Returns | The display name of the resource if available, None otherwise. |