Пример #1
0
def mk_prop_response(self, uri, good_props, bad_props, doc):
    res = _mk_prop_response(self, uri, good_props, bad_props, doc)
    dbname, uri = TrytonDAVInterface.get_dburi(uri)
    if uri in ('Contacts', 'Contacts/'):
        ad = doc.createElement('addressbook')
        ad.setAttribute('xmlns', 'urn:ietf:params:xml:ns:carddav')
        vc = doc.createElement('vcard-collection')
        vc.setAttribute('xmlns', 'http://groupdav.org/')
        cols = res.getElementsByTagName('D:collection')
        if cols:
            cols[0].parentNode.appendChild(ad)
            cols[0].parentNode.appendChild(vc)
    return res
Пример #2
0
def mk_prop_response(self, uri, good_props, bad_props, doc):
    res = _mk_prop_response(self, uri, good_props, bad_props, doc)
    parent_uri = get_uriparentpath(uri and uri.strip('/') or '')
    if not parent_uri:
        return res
    dbname, parent_uri = TrytonDAVInterface.get_dburi(parent_uri)
    # Disable groupdav attribute for iPhone
    # if  parent_uri in ('Calendars', 'Calendars/'):
    #     vc = doc.createElement('vtodo-collection')
    #     vc.setAttribute('xmlns', 'http://groupdav.org/')
    #     cols = res.getElementsByTagName('D:collection')
    #     if cols:
    #         cols[0].parentNode.appendChild(vc)
    return res
Пример #3
0
def mk_prop_response(self, uri, good_props, bad_props, doc):
    res = _mk_prop_response(self, uri, good_props, bad_props, doc)
    parent_uri = get_uriparentpath(uri and uri.strip('/') or '')
    if not parent_uri:
        return res
    dbname, parent_uri = TrytonDAVInterface.get_dburi(parent_uri)
    #Disable groupdav attribute for iPhone
    #if  parent_uri in ('Calendars', 'Calendars/'):
    #    vc = doc.createElement('vtodo-collection')
    #    vc.setAttribute('xmlns', 'http://groupdav.org/')
    #    cols = res.getElementsByTagName('D:collection')
    #    if cols:
    #        cols[0].parentNode.appendChild(vc)
    return res
Пример #4
0
def do_POST(self):
    dc = self.IFACE_CLASS

    uri = urlparse.urljoin(self.get_baseuri(dc), self.path)
    uri = urllib.unquote(uri)

    dbname, dburi = TrytonDAVInterface.get_dburi(uri)
    if dburi.startswith('Calendars'):
        # read the body
        body = None
        if 'Content-Length' in self.headers:
            l = self.headers['Content-Length']
            body = self.rfile.read(atoi(l))
        ct = None
        if 'Content-Type' in self.headers:
            ct = self.headers['Content-Type']

        try:
            DATA = '%s\n' % dc._get_caldav_post(uri, body, ct)
        except DAV_Error, exception:
            ec, _ = exception
            return self.send_status(ec)
        self.send_body(DATA, 200, 'OK', 'OK')
        return
Пример #5
0
def do_POST(self):
    dc = self.IFACE_CLASS

    uri = urlparse.urljoin(self.get_baseuri(dc), self.path)
    uri = urllib.unquote(uri)

    dbname, dburi = TrytonDAVInterface.get_dburi(uri)
    if dburi.startswith('Calendars'):
        # read the body
        body = None
        if 'Content-Length' in self.headers:
            l = self.headers['Content-Length']
            body = self.rfile.read(atoi(l))
        ct = None
        if 'Content-Type' in self.headers:
            ct = self.headers['Content-Type']

        try:
            DATA = '%s\n' % dc._get_caldav_post(uri, body, ct)
        except DAV_Error, exception:
            ec, _ = exception
            return self.send_status(ec)
        self.send_body_chunks(DATA, '200', 'OK', 'OK')
        return