Exemplo n.º 1
0
 def __handle_rdf_entry(self, entry):
     # only return useful info instead of the whole object
     return_fields = ["rtc_cm:userId", "dc:title", "dc:description"]
     subkeys = entry.keys()
     for return_field in return_fields:
         if return_field in subkeys:
             return entry.get(return_field)
     raise exception.RTCException()
Exemplo n.º 2
0
    def runSavedQuery(self, saved_query_obj, returned_properties=None):
        """Query workitems using the :class:`rtcclient.models.SavedQuery`
        object

        :param saved_query_obj: the :class:`rtcclient.models.SavedQuery`
            object
        :param returned_properties: the returned properties that you want.
            Refer to :class:`rtcclient.client.RTCClient` for more explanations
        :return: a :class:`list` that contains the queried
            :class:`rtcclient.workitem.Workitem` objects
        :rtype: list
        """

        try:
            saved_query_id = saved_query_obj.results.split("/")[-2]
        except:
            error_msg = "Cannot get the correct saved query id"
            self.log.error(error_msg)
            raise exception.RTCException(error_msg)
        return self._runSavedQuery(saved_query_id,
                                   returned_properties=returned_properties)