Get all saved queries created by somebody (optional)
        in a certain project area (optional, either `projectarea_id`
        or `projectarea_name` is needed if specified)

        If `saved_query_name` is specified, only the saved queries match the
        name will be fetched.

        Note: only if `creator` is added as a member, the saved queries
        can be found. Otherwise None will be returned.

        WARNING: now the RTC server cannot correctly list all the saved queries
        It seems to be a bug of RTC. Recommend using `runSavedQueryByUrl` to
        query all the workitems if the query is saved.

        Note: It will run faster when more attributes are specified.

        :param projectarea_id: the :class:`rtcclient.project_area.ProjectArea`
            id
        :param projectarea_name: the
            :class:`rtcclient.project_area.ProjectArea` name
        :param creator: the creator email address
        :param saved_query_name: the saved query name
        :return: a :class:`list` that contains the saved queried
            :class:`rtcclient.models.SavedQuery` objects
        :rtype: list

def getAllSavedQueries(self, projectarea_id=None, projectarea_name=None,
                           creator=None, saved_query_name=None):
        """Get all saved queries created by somebody (optional)
        in a certain project area (optional, either `projectarea_id`
        or `projectarea_name` is needed if specified)

        If `saved_query_name` is specified, only the saved queries match the
        name will be fetched.

        Note: only if `creator` is added as a member, the saved queries
        can be found. Otherwise None will be returned.

        WARNING: now the RTC server cannot correctly list all the saved queries
        It seems to be a bug of RTC. Recommend using `runSavedQueryByUrl` to
        query all the workitems if the query is saved.

        Note: It will run faster when more attributes are specified.

        :param projectarea_id: the :class:`rtcclient.project_area.ProjectArea`
            id
        :param projectarea_name: the
            :class:`rtcclient.project_area.ProjectArea` name
        :param creator: the creator email address
        :param saved_query_name: the saved query name
        :return: a :class:`list` that contains the saved queried
            :class:`rtcclient.models.SavedQuery` objects
        :rtype: list
        """

        pa_id = (self.rtc_obj
                     ._pre_get_resource(projectarea_id=projectarea_id,
                                        projectarea_name=projectarea_name))

        filter_rule = None
        if creator is not None:
            fcreator = self.rtc_obj.getOwnedBy(creator).url
            filter_rule = [("dc:creator", "@rdf:resource",
                            fcreator)]
            self.log.debug("Add rules for fetching all saved queries: "
                           "created by %s", creator)

        if saved_query_name is not None:
            ftitle_rule = ("dc:title", None, saved_query_name)
            if filter_rule is None:
                filter_rule = [ftitle_rule]
            else:
                filter_rule.append(ftitle_rule)
            self.log.debug("Add rules for fetching all saved queries: "
                           "saved query title is %s", saved_query_name)

        return (self.rtc_obj
                    ._get_paged_resources("SavedQuery",
                                          projectarea_id=pa_id,
                                          page_size="100",
                                          filter_rule=filter_rule))