Exemplo n.º 1
0
    def get_prop(self, uri, ns, propname):
        """ return the value of a given property

            uri        -- uri of the object to get the property of
            ns        -- namespace of the property
            pname        -- name of the property
         """
        if self.M_NS.has_key(ns):
            try:
                # if it's not in the interface class, a "DAV:" property
                # may be at the node class. So shouldn't give up early.
                return dav_interface.get_prop(self, uri, ns, propname)
            except DAV_NotFound:
                pass
        cr, uid, pool, dbname, uri2 = self.get_cr(uri)
        if not dbname:
            if cr: cr.close()
            raise DAV_NotFound
        try:
            node = self.uri2object(cr, uid, pool, uri2)
            if not node:
                raise DAV_NotFound
            res = node.get_dav_eprop(cr, ns, propname)
        finally:
            cr.close()
        return res
Exemplo n.º 2
0
    def get_prop(self, uri, ns, propname):
        """ return the value of a given property

            uri        -- uri of the object to get the property of
            ns        -- namespace of the property
            pname        -- name of the property
         """
        if self.M_NS.has_key(ns):
            try:
                # if it's not in the interface class, a "DAV:" property
                # may be at the node class. So shouldn't give up early.
                return dav_interface.get_prop(self, uri, ns, propname)
            except DAV_NotFound:
                pass
        cr, uid, pool, dbname, uri2 = self.get_cr(uri)
        if not dbname:
            if cr: cr.close()
            raise DAV_NotFound
        try:
            node = self.uri2object(cr, uid, pool, uri2)
            if not node:
                raise DAV_NotFound
            res = node.get_dav_eprop(cr, ns, propname)
        finally:
            cr.close()
        return res
Exemplo n.º 3
0
 def match_prop(self, uri, match, ns, propname):
     if self.M_NS.has_key(ns):
         return match == dav_interface.get_prop(self, uri, ns, propname)
     cr, uid, pool, dbname, uri2 = self.get_cr(uri)
     if not dbname:
         if cr: cr.close()
         raise DAV_NotFound
     node = self.uri2object(cr, uid, pool, uri2)
     if not node:
         cr.close()
         raise DAV_NotFound
     res = node.match_dav_eprop(cr, match, ns, propname)
     cr.close()
     return res
Exemplo n.º 4
0
 def match_prop(self, uri, match, ns, propname):
     if self.M_NS.has_key(ns):
         return match == dav_interface.get_prop(self, uri, ns, propname)
     cr, uid, pool, dbname, uri2 = self.get_cr(uri)
     if not dbname:
         if cr: cr.close()
         raise DAV_NotFound
     node = self.uri2object(cr, uid, pool, uri2)
     if not node:
         cr.close()
         raise DAV_NotFound
     res = node.match_dav_eprop(cr, match, ns, propname)
     cr.close()
     return res