def get_services_uids(context=None, analyses_serv=None, values=None):
    """
    This function returns a list of UIDs from analyses services from its
    parameters.
    :param analyses_serv: A list (or one object) of service-related info items.
        see _resolve_items_to_service_uids() docstring.
    :type analyses_serv: list
    :param values: a dict, where keys are AR|Sample schema field names.
    :type values: dict
    :returns: a list of analyses services UIDs
    """
    if not analyses_serv:
        analyses_serv = []
    if not values:
        values = {}

    if not context or (not analyses_serv and not values):
        raise RuntimeError(
            "get_services_uids: Missing or wrong parameters.")

    # Merge analyses from analyses_serv and values into one list
    analyses_services = analyses_serv + (values.get("Analyses", None) or [])

    # It is possible to create analysis requests
    # by JSON petitions and services, profiles or types aren't allways send.
    # Sometimes we can get analyses and profiles that doesn't match and we
    # should act in consequence.
    # Getting the analyses profiles
    analyses_profiles = values.get('Profiles', [])
    if not isinstance(analyses_profiles, (list, tuple)):
        # Plone converts the incoming form value to a list, if there are
        # multiple values; but if not, it will send a string (a single UID).
        analyses_profiles = [analyses_profiles]

    if not analyses_services and not analyses_profiles:
        return []

    # Add analysis services UIDs from profiles to analyses_services variable.
    if analyses_profiles:
        uid_catalog = getToolByName(context, 'uid_catalog')
        for brain in uid_catalog(UID=analyses_profiles):
            profile = api.get_object(brain)
            # Only services UIDs
            services_uids = profile.getRawService()
            # _resolve_items_to_service_uids() will remove duplicates
            analyses_services += services_uids

    return _resolve_items_to_service_uids(analyses_services)
def get_services_uids ( context = None , analyses_serv = None , values = None ) : if not analyses_serv : analyses_serv = [ ] if not values : values = { } if not context or ( not analyses_serv and not values ) : raise RuntimeError ( "get_services_uids: Missing or wrong parameters." ) analyses_services = analyses_serv + ( values . get ( "Analyses" , None ) or [ ] ) analyses_profiles = values . get ( 'Profiles' , [ ] ) if not isinstance ( analyses_profiles , ( list , tuple ) ) : analyses_profiles = [ analyses_profiles ] if not analyses_services and not analyses_profiles : return [ ] if analyses_profiles : uid_catalog = getToolByName ( context , 'uid_catalog' ) for brain in uid_catalog ( UID = analyses_profiles ) : profile = api . get_object ( brain ) services_uids = profile . getRawService ( ) analyses_services += services_uids return _resolve_items_to_service_uids ( analyses_services )
This function returns a list of UIDs from analyses services from its
    parameters.
    :param analyses_serv: A list (or one object) of service-related info items.
        see _resolve_items_to_service_uids() docstring.
    :type analyses_serv: list
    :param values: a dict, where keys are AR|Sample schema field names.
    :type values: dict
    :returns: a list of analyses services UIDs