def persistDocument(self, ann, **kwargs): try: from utopia import auth kwargs['annotation'] = ann self._request(auth._getServiceBaseUri('documents'), method = 'POST', body_data = kwargs) except urllib2.HTTPError, e: logger.error("Failed to save annotations to server: %s" % repr(e))
def persistDocument(self, ann, **kwargs): try: from utopia import auth kwargs['annotation'] = ann self._request(auth._getServiceBaseUri('documents'), method = 'POST', body_data = kwargs) except urllib2.HTTPError, e: log.error("Failed to save annotations to server: %s" % repr(e))
def persistAnnotation(self, annotation, **kwargs): try: from utopia import auth if annotation.edit is not None: return self._request(annotation.edit, method = 'PUT', body_data = annotation, query_data = kwargs) else: return self._request(auth._getServiceBaseUri('annotations'), method = 'POST', body_data = annotation, query_data = kwargs) except urllib2.HTTPError, e: log.error("Failed to save annotation to server: %s" % repr(e))
def persistAnnotation(self, annotation, **kwargs): try: from utopia import auth if annotation.edit is not None: return self._request(annotation.edit, method = 'PUT', body_data = annotation, query_data = kwargs) else: return self._request(auth._getServiceBaseUri('annotations'), method = 'POST', body_data = annotation, query_data = kwargs) except urllib2.HTTPError, e: logger.error("Failed to save annotation to server: %s" % repr(e))
def annotations(self, **kwargs): try: from utopia import auth return self._request(auth._getServiceBaseUri('annotations'), query_data=kwargs) except ImportError: return self._request( 'https://utopia.cs.manchester.ac.uk/kend/0.7/annotations', query_data=kwargs)
def document(self, uri): try: from utopia import auth return self._request(auth._getServiceBaseUri('documents'), query_data={'document': uri}) except ImportError: return self._request( 'https://utopia.cs.manchester.ac.uk/kend/0.7/documents', query_data={'document': uri})
def documents(self, documentref): try: from utopia import auth return self._request(auth._getServiceBaseUri('documents'), method='POST', body_data=documentref) except ImportError: return self._request( 'https://utopia.cs.manchester.ac.uk/kend/0.7/documents', method='POST', body_data=documentref)
def annotations(self, **kwargs): try: from utopia import auth return self._request(auth._getServiceBaseUri('annotations'), query_data = kwargs) except ImportError: return self._request('https://utopia.cs.manchester.ac.uk/kend/0.7/annotations', query_data = kwargs)
def searchDocuments(self, **kwargs): from utopia import auth return self._request(auth._getServiceBaseUri('documents'), query_data=kwargs)
def documents(self, documentref): try: from utopia import auth return self._request(auth._getServiceBaseUri('documents'), method = 'POST', body_data = documentref) except ImportError: return self._request('https://utopia.cs.manchester.ac.uk/kend/0.7/documents', method = 'POST', body_data = documentref)
def annotations(self, **kwargs): try: from utopia import auth return self._request(auth._getServiceBaseUri('annotations'), query_data = kwargs) except ImportError: return self._request(self.service.resources['annotations']['href'], query_data = kwargs)
def document(self, uri): try: from utopia import auth return self._request(auth._getServiceBaseUri('documents'), query_data={'document': uri}) except ImportError: return self._request(self.service.resources['documents']['href'], query_data={'document': uri})
def documents(self, documentref): try: from utopia import auth return self._request(auth._getServiceBaseUri('documents'), method = 'POST', body_data = documentref) except ImportError: return self._request(self.service.resources['documents']['href'], method = 'POST', body_data = documentref)