Пример #1
0
    def organization_facets(self, facets_dict, organization_type, package_type):

        if package_type == 'harvest':
            return OrderedDict([('frequency', 'Frequency'), ('source_type', 'Type')])

        ngds_facets = helpers.load_ngds_facets()

        if ngds_facets:
            facets_dict = ngds_facets

        return facets_dict
Пример #2
0
    def organization_facets(self, facets_dict, organization_type, package_type):

        if package_type == 'harvest':
            return OrderedDict([('frequency', 'Frequency'), ('source_type', 'Type')])

        ngds_facets = helpers.load_ngds_facets()

        if ngds_facets:
            facets_dict = ngds_facets

        return facets_dict
Пример #3
0
    def dataset_facets(self, facets_dict, package_type):
        #print "IFACETS is called.......>>>>>>>>>>>>>>>>"

        if package_type == 'harvest':
            return OrderedDict([('frequency', 'Frequency'), ('source_type', 'Type')])

        ngds_facets = helpers.load_ngds_facets()

        if ngds_facets:
            facets_dict = ngds_facets

        return facets_dict
Пример #4
0
    def after_search(self, search_results, search_params):
        def mark_wms_pkgs(pkg):
            def is_wms_resource(resource):
                if 'protocol' in resource and resource['protocol'].lower(
                ) == 'ogc:wms':
                    return True
                return False

            if True in map(is_wms_resource, pkg['resources']):
                pkg['hasWMSResources'] = True

        map(mark_wms_pkgs, search_results['results'])

        try:
            if g.facet_json_data:
                print "global value is there..."
        except AttributeError:
            print "Facet json config is not available. Returning the default facets."
            helpers.load_ngds_facets()
            #print "search_results: ",search_results
        return search_results
Пример #5
0
    def after_search(self, search_results, search_params):

        def mark_wms_pkgs(pkg):

            def is_wms_resource(resource):
                if 'protocol' in resource and resource['protocol'].lower() == 'ogc:wms':
                    return True
                return False

            if True in map(is_wms_resource, pkg['resources']):
                pkg['hasWMSResources'] = True

        map(mark_wms_pkgs, search_results['results'])

        try:
            if g.facet_json_data:
                print "global value is there..."
        except AttributeError:
            print "Facet json config is not available. Returning the default facets."
            helpers.load_ngds_facets()
            #print "search_results: ",search_results
        return search_results