'Returns a tuple of the database resource ids for the given
selections and a list of selections that didn\'t match any loaded
resources.'

def _res_ids_from_selections(self, selections):

    if (self._res_ids_from_selector_cache is None):
        cache = self._res_ids_from_selector_cache = {}
        for (cix_area_path, res_data) in self.res_index.items():
            cix_path = AreaResource(cix_area_path).path
            res_id = res_data[0]
            cache[normpath(normcase(cix_path))] = [res_id]
            name = splitext(basename(cix_path))[0].lower()
            if (name not in cache):
                cache[name] = []
            cache[name].append(res_id)
        log.debug('_res_ids_from_selector_cache:    %r', cache)
    res_ids = []
    missing_selections = []
    for (selector, selection) in self._selection_from_selector(selections).items():
        try:
            res_ids += self._res_ids_from_selector_cache[selector]
        except KeyError as ex:
            missing_selections.append(selection)
    log.debug('_res_ids_from_selections:    res_ids=%r', res_ids)
    return (tuple(res_ids), missing_selections)
