Beispiel #1
0
    def _extract_response(self, method, soap_response):
        path = "./%sResponse".replace("/", "/{%s}" % NS_STORAGE) % method
        if soap_response.body.find(path) is None: 
            raise StorageError(soap_response.body)

        if method == "GetProfile":
            # TODO : grab data in the response
            return (soap_response,)
        if method == "UpdateProfile":
            return (soap_response,)
        if method == "CreateRelationships":
            return (soap_response,)
        if method == "DeleteRelationships":
            return (soap_response,)
        if method == "CreateDocument":
            path = "./CreateDocumentResponse/CreateDocumentResult".\
                replace("/", "/{%s}" % NS_STORAGE)
            rid =  soap_response.body.find(path)
            return (soap_response, rid.text)
        if method == "FindDocuments":
            path = "./FindDocumentsResponse/FindDocumentsResult/Document/ResourceID".\
                replace("/", "/{%s}" % NS_STORAGE)
            rid =  soap_response.body.find(path)
            path = "./FindDocumentsResponse/FindDocumentsResult/Document/Name".\
                replace("/", "/{%s}" % NS_STORAGE)
            name =  soap_response.body.find(path)
            return (soap_response, rid.text, name.text)
        else:
            return SOAPService._extract_response(self, method, soap_response)
Beispiel #2
0
    def _extract_response(self, method, soap_response):
        path = "./%sResponse".replace("/", "/{%s}" % NS_ADDRESSBOOK) % method
        if soap_response.body.find(path) is None: 
            raise SharingError(soap_response.body)

        if method == "FindMembership":
            path = "./FindMembershipResponse/FindMembershipResult/Services/Service/Memberships".\
                    replace("/", "/{%s}" % NS_ADDRESSBOOK)
            memberships = soap_response.body.find(path)
            result = {}
            for membership in memberships:
                role = membership.find("./{%s}MemberRole" % NS_ADDRESSBOOK)
                members = membership.find("./{%s}Members" % NS_ADDRESSBOOK)
                if role is None or members is None:
                    continue
                result[role.text] = []
                for member in members:
                    result[role.text].append(Member(member))
            return (soap_response, result)
        elif method == "AddMember":
            pass
        elif method == "DeleteMember":
            pass
        else:
            return SOAPService._extract_response(self, method, soap_response)
Beispiel #3
0
    def _extract_response(self, method, soap_response):
        path = "./%sResponse".replace("/", "/{%s}" % NS_STORAGE) % method
        if soap_response.body.find(path) is None: 
            raise OIMError(soap_response.body)

        if method == "Store":
            return (soap_reponse,)
        else:
            return SOAPService._extract_response(self, method, soap_response)
Beispiel #4
0
    def _extract_response(self, method, soap_response):
        path = "./%sResponse".replace("/", "/{%s}" % NS_STORAGE) % method
        if soap_response.body.find(path) is None: 
            raise RSIError(soap_response.body)

        if method == "GetMetadata":
            # TODO : process xml metadata
            return (soap_response,)
        elif method == "GetMessage":
            # TODO : process e-mail data
            return (soap_response,)
        elif method == "DeleteMessages":
            return (soap_response,)
        else:
            return SOAPService._extract_response(self, method, soap_response)
Beispiel #5
0
    def _extract_response(self, method, soap_response):
        path = "./%sResponse".replace("/", "/{%s}" % NS_ADDRESSBOOK) % method
        if soap_response.body.find(path) is None: 
            raise AddressBookError(soap_response.body)

        if method == "ABFindAll":
            path = "./ABFindAllResponse/ABFindAllResult/groups".\
                replace("/", "/{%s}" % NS_ADDRESSBOOK)
            groups =  soap_response.body.find(path)
            groups_result = []
            for group in groups:
                groups_result.append(Group(group))
            path = "./ABFindAllResponse/ABFindAllResult/contacts".\
                    replace("/", "/{%s}" % NS_ADDRESSBOOK)
            contacts = soap_response.body.find(path)
            contacts_result = []
            for contact in contacts:
                contacts_result.append(Contact(contact))
            return (soap_response, groups_result, contacts_result)
        elif method == "ABContactAdd":
            path = "./ABContactAddResponse/ABContactAddResult/guid".\
                    replace("/", "/{%s}" % NS_ADDRESSBOOK)
            contact = self._contacts_queue.pop(0)
            contact.id = soap_response.body.find(path).text
            return (soap_response, contact)
        elif method == "ABContactDelete":
            return (soap_response,)
        elif method == "ABContactUpdate":
            return (soap_response,)
        elif method == "ABGroupAdd":
            path = "./ABGroupAddResponse/ABGroupAddResult/guid".\
                replace("/", "/{%s}" % NS_ADDRESSBOOK)
            guid = soap_response.body.find(path)
            return (soap_response, guid.text)
        elif method == "ABGroupDelete":
            return (soap_response,)
        elif method == "ABGroupUpdate":
            return (soap_response,)
        elif method == "ABGroupContactAdd":
            return (soap_response,)
        elif method == "ABGroupContactDelete":
            return (soap_response,)
        elif method == "UpdateDynamicItem":
            return (soap_response,)
        else:
            return SOAPService._extract_response(self, method, soap_response)
Beispiel #6
0
    def __init__(self, sso, proxies=None):
        self._sso = sso
        self._tokens = {}
        SOAPService.__init__(self, "Sharing", proxies)

        self._last_changes = "0001-01-01T00:00:00.0000000-08:00"
Beispiel #7
0
 def __init__(self, storage_security_token):
     BaseStorage.__init__(self, storage_security_token)
     SOAPService.__init__(self, STORAGE_SERVICE_URL)
Beispiel #8
0
 def __init__(self, passport_security_token):
     BaseOIM.__init__(self, passport_security_token)
     SOAPService.__init__(self, OIM_SERVICE_URL)
Beispiel #9
0
 def __init__(self, contacts_security_token, http_proxy=None):
     BaseAddressBook.__init__(self, contacts_security_token)
     SOAPService.__init__(self, SHARING_SERVICE_URL, http_proxy)
Beispiel #10
0
 def __init__(self, sso, proxies=None):
     self._sso = sso
     self._tokens = {}
     SOAPService.__init__(self, "RSI", proxies)
Beispiel #11
0
 def __init__(self, passport_security_token):
     BaseRSI.__init__(self, passport_security_token)
     SOAPService.__init__(self, RSI_SERVICE_URL)
Beispiel #12
0
 def __init__(self, sso, proxies=None):
     self._sso = sso
     self._tokens = {}
     SOAPService.__init__(self, "SchematizedStore", proxies)
Beispiel #13
0
 def __init__(self, sso, proxies=None):
     self._sso = sso
     self._tokens = {}
     self.__lock_key = ""
     SOAPService.__init__(self, "OIM", proxies)
Beispiel #14
0
 def __init__(self, contacts_security_token, http_proxy=None):
     BaseAddressBook.__init__(self, contacts_security_token)
     SOAPService.__init__(self, AB_SERVICE_URL, http_proxy)
     self._contacts_queue = []