Exemplo n.º 1
0
    def delcol(self):
        """ delete a collection """

        dc = self.__dataclass
        result = dc.deltree(self.__uri)

        if not len(result.items()):
            return None  # everything ok

        # create the result element
        return make_xmlresponse(result)
Exemplo n.º 2
0
	def delcol(self):
            """ delete a collection """

	    dc=self.__dataclass
	    result=dc.deltree(self.__uri)

	    if not len(result.items()):
		return None # everything ok

	    # create the result element
	    return make_xmlresponse(result)
Exemplo n.º 3
0
	def delone(self):
            """ delete a resource """

	    dc=self.__dataclass
	    result=dc.delone(self.__uri)
	    
	    if not result: return None
	    if not len(result.items()):
		return None # everything ok

	    # create the result element
	    return make_xmlresponse(result)
Exemplo n.º 4
0
    def delone(self):
        """ delete a resource """

        dc=self.__dataclass
        result=dc.delone(self.__uri)
        
        if not result: return None
        if not len(result.items()):
            return None # everything ok

        # create the result element
        return make_xmlresponse(result)
Exemplo n.º 5
0
    def tree_action(self):
        """ move a tree of resources (a collection)

        Here we return a multistatus xml element.

        """
        dc = self.__dataclass
        base = self.__src

        ### some basic tests
        # test if dest exists and overwrite is false
        if dc.exists(self.__dst) and not self.__overwrite: raise DAV_Error, 412
        # test if src and dst are the same
        # (we assume that both uris are on the same server!)
        ps = urlparse.urlparse(self.__src)[2]
        pd = urlparse.urlparse(self.__dst)[2]
        if ps == pd: raise DAV_Error, 403

        result = dc.movetree(self.__src, self.__dst, self.__overwrite)
        if not result: return None

        # create the multistatus XML element
        return make_xmlresponse(result)
Exemplo n.º 6
0
    def tree_action(self):
        """ move a tree of resources (a collection)

        Here we return a multistatus xml element.

        """
        dc=self.__dataclass
        base=self.__src

        ### some basic tests
        # test if dest exists and overwrite is false
        if dc.exists(self.__dst) and not self.__overwrite: raise DAV_Error,  412
        # test if src and dst are the same
        # (we assume that both uris are on the same server!)
        ps=urlparse.urlparse(self.__src)[2]
        pd=urlparse.urlparse(self.__dst)[2]
        if ps==pd: raise DAV_Error,  403

        result=dc.movetree(self.__src,self.__dst,self.__overwrite)
        if not result: return None

        # create the multistatus XML element
        return make_xmlresponse(result)