mò /á¸Ec@sÃdZdklZdklZdklZdklZl Z dk l Z dk Z dk Z dklZlZdklZlZd klZd klZd efd „ƒYZeeƒdS( s[WebDAV support - collection objects. $Id: Collection.py 40300 2005-11-21 16:54:03Z efge $ (sunquote(sInitializeClass(sgetSecurityManager(sMethodNotAllowedsNotFound(s implementsN(sLockedsPreconditionFailed(surlfixs rfc1123_date(sIDAVCollection(sResourcet CollectioncBsKtZdZeeƒdZd„Zd„Zd„Zd„Z d„Z RS(sThe Collection class provides basic WebDAV support for collection objects. It provides default implementations for all supported WebDAV HTTP methods. The behaviors of some WebDAV HTTP methods for collections are slightly different than those for non-collection resources.icCsy|iddƒ}|o3|ddjo"d|d}|id|ƒn|idd d ƒ|id tƒd ƒdS( Nt PATH_INFOtiÿÿÿÿt/s%s/tURL1sContent-Locationt ConnectiontcloseitDate(trequesttgettpathinfotlocationtresponset setHeadert rfc1123_date(tselfRR R R ((t0/data/zmath/zope/lib/python/webdav/Collection.pyt dav__init-s cCsd|i||ƒt|dƒo7t|idƒo|ii||ƒSntd‚ntd‚dS(s6Retrieve resource information without a response body.t index_htmltHEADs'Method not supported for this resource.s&The requested resource does not exist.N( RRtREQUESTtRESPONSEthasattrRRtMethodNotAllowedtNotFound(RRR((RR9s cCs|i||ƒtd‚dS(sõThe PUT method has no inherent meaning for collection resources, though collections are not specifically forbidden to handle PUT requests. The default response to a PUT request for collections is 405 (Method Not Allowed).s%Method not supported for collections.N(RRRRR(RRR((RtPUTGsc Cs×|i||ƒ|iddƒ}t|ddƒ} tt d| i dƒƒdƒ} |i }tƒiƒ}d} ti|ƒo.|o|i||dddƒqñt‚n?ti|ƒo.|o|i||dddƒqñt‚n|oA|iƒ}x2|D]&}|i|ƒdjo |} q q Wntiƒ} | i|| ||dƒ}|o.|i!d ƒ|i"d d ƒ|i#|ƒn>|i$| gd dƒdjo|i!d ƒn|i!dƒ|S(sDelete a collection resource. For collection resources, DELETE may return either 200 (OK) or 204 (No Content) to indicate total success, or may return 207 (Multistatus) to indicate partial success. Note that in Zope a DELETE currently never returns 207.tIfRtURLtDELETERiÿÿÿÿtcoliiÏs Content-Typestext/xml; charset="utf-8"RiÌi“N(%RRRRt get_headertifhdrturlfixturltunquotetfiltertNonetsplittnamet aq_parenttparenttgetSecurityManagertgetUsertuserttokentLockablet wl_isLockedtdav__simpleifhandlertLockedtPreconditionFailedt wl_lockTokensttokensttoktfindtdavcmdstDeleteCollectiontcmdtapplytresultt setStatusR tsetBodytmanage_delObjects( RRRR:R4RR(R3R+R&R!R8R,((RROs@"       cCs.t|ddƒ}|dj o |ƒSngS(Nt objectValues(tgetattrRR$R>(RR>((RtlistDAVObjects‹s  ( t__name__t __module__t__doc__t implementstIDAVCollectiont__dav_collection__RRRRR@(((RR!s     <(RCturllibR"tGlobalstInitializeClasst AccessControlR)t zExceptionsRRtzope.interfaceRDR6R-tcommonR0R1R Rt interfacesREtResourceR(R"RDR0RR)R R1RORIRR6RER-RR((Rt?s        p