Package org.dspace.discovery.configuration

Examples of org.dspace.discovery.configuration.DiscoveryConfiguration


                DiscoverResult.FacetResult fr = searchService.getDiscoveryFacet(context, facetFieldStatus, facetValue);
                status.add(fr);
            }
        }
       
        DiscoveryConfiguration discoveryConf = SearchUtils.getDiscoveryConfigurationByName("crisproject");
       
        List<String> searchFields = new LinkedList<String>();
        for (DiscoverySearchFilter field : discoveryConf.getSearchFilters()) {
            searchFields.add(field.getIndexFieldName());
        }
        model.put("state", status);
        model.put("sponsors", sponsors);
        model.put("fields", searchFields);
View Full Code Here


      for (FacetField.Count facetValue : values) {
        DiscoverResult.FacetResult fr = searchService.getDiscoveryFacet(context, facetField, facetValue);
        faculties.add(fr);
      }
    }
    DiscoveryConfiguration discoveryConf = SearchUtils.getDiscoveryConfigurationByName("crisrp");
   
    List<String> searchFields = new LinkedList<String>();
    for (DiscoverySearchFilter field : discoveryConf.getSearchFilters()) {
      searchFields.add(field.getIndexFieldName());
    }
    model.put("faculties", faculties);
    model.put("fields", searchFields);
    return model;
View Full Code Here

            Map<String, DiscoverySortFieldConfiguration> sortFields)
    {
        try
        {
            List<DiscoveryConfiguration> discoveryConfigurations = new ArrayList<DiscoveryConfiguration>();
            DiscoveryConfiguration generalConfiguration = SearchUtils
                    .getDiscoveryConfiguration();
            if (generalConfiguration != null)
            {
                discoveryConfigurations.add(generalConfiguration);
            }
            DiscoveryConfigurationService configurationService = SearchUtils
                    .getConfigurationService();
            DiscoveryConfiguration crisConfiguration = configurationService
                    .getMap().get(confName);
            if (crisConfiguration != null)
            {
                discoveryConfigurations.add(crisConfiguration);
            }
View Full Code Here

    throws SQLException, IOException {
        // Create Document
        SolrInputDocument doc = buildDocument(Constants.COMMUNITY, community.getID(),
                community.getHandle(), null);

        DiscoveryConfiguration discoveryConfiguration = SearchUtils.getDiscoveryConfiguration(community);
        DiscoveryHitHighlightingConfiguration highlightingConfiguration = discoveryConfiguration.getHitHighlightingConfiguration();
        List<String> highlightedMetadataFields = new ArrayList<String>();
        if(highlightingConfiguration != null)
        {
            for (DiscoveryHitHighlightFieldConfiguration configuration : highlightingConfiguration.getMetadataFields())
            {
View Full Code Here

        // Create Lucene Document
        SolrInputDocument doc = buildDocument(Constants.COLLECTION, collection.getID(),
                collection.getHandle(), locations);

        DiscoveryConfiguration discoveryConfiguration = SearchUtils.getDiscoveryConfiguration(collection);
        DiscoveryHitHighlightingConfiguration highlightingConfiguration = discoveryConfiguration.getHitHighlightingConfiguration();
        List<String> highlightedMetadataFields = new ArrayList<String>();
        if(highlightingConfiguration != null)
        {
            for (DiscoveryHitHighlightFieldConfiguration configuration : highlightingConfiguration.getMetadataFields())
            {
View Full Code Here

    }

    public static DiscoveryConfiguration getDiscoveryConfiguration(DSpaceObject dso){
        DiscoveryConfigurationService configurationService = getConfigurationService();

        DiscoveryConfiguration result = null;
        if(dso == null){
            result = configurationService.getMap().get("site");
        }else{
            result = configurationService.getMap().get(dso.getHandle());
        }
View Full Code Here

    public static List<DiscoveryConfiguration> getAllDiscoveryConfigurations(Item item) throws SQLException {
        Map<String, DiscoveryConfiguration> result = new HashMap<String, DiscoveryConfiguration>();

        Collection[] collections = item.getCollections();
        for (Collection collection : collections) {
            DiscoveryConfiguration configuration = getDiscoveryConfiguration(collection);
            if(!result.containsKey(configuration.getId())){
                result.put(configuration.getId(), configuration);
            }
        }

        //Also add one for the default
        DiscoveryConfiguration configuration = getDiscoveryConfiguration(null);
        if(!result.containsKey(configuration.getId())){
            result.put(configuration.getId(), configuration);
        }

        return Arrays.asList(result.values().toArray(new DiscoveryConfiguration[result.size()]));
    }
View Full Code Here

        {
            qResults = SearchUtils.getSearchService().search(context, scope,
                    queryArgs);
            request.setAttribute("tagcloud.fresults",
                    qResults.getFacetResults());
            DiscoveryConfiguration discoveryConfiguration = SearchUtils
                    .getDiscoveryConfiguration(scope);
            List<DiscoverySearchFilterFacet> availableFacet = discoveryConfiguration
                    .getTagCloudFacetConfiguration().getTagCloudFacets();
           
            request.setAttribute("tagCloudFacetsConfig",
                    availableFacet != null ? availableFacet
                            : new ArrayList<DiscoverySearchFilterFacet>());
           
            TagCloudConfiguration tagCloudConfiguration = discoveryConfiguration.getTagCloudFacetConfiguration().getTagCloudConfiguration();
            request.setAttribute("tagCloudConfig",tagCloudConfiguration);
               
            if (scope !=null)
            {
                request.setAttribute("tagcloud.searchScope",
View Full Code Here

     */
    public static DiscoverQuery getDiscoverQuery(Context context,
            HttpServletRequest request, DSpaceObject scope, boolean enableFacet)
    {
        DiscoverQuery queryArgs = new DiscoverQuery();
        DiscoveryConfiguration discoveryConfiguration = SearchUtils
                .getDiscoveryConfiguration(scope);

        List<String> userFilters = setupBasicQuery(context,
                discoveryConfiguration, request, queryArgs);

        setPagination(request, queryArgs, discoveryConfiguration);

        if (enableFacet
                && !"submit_export_metadata".equals(UIUtil.getSubmitButton(
                        request, "submit")))
        {
            setFacet(context, request, scope, queryArgs,
                    discoveryConfiguration, userFilters, discoveryConfiguration
                    .getSidebarFacets(), TYPE_FACETS);
        }

        return queryArgs;
    }
View Full Code Here

     */
    public static DiscoverQuery getTagCloudDiscoverQuery(Context context,
            HttpServletRequest request, DSpaceObject scope, boolean enableFacet)
    {
        DiscoverQuery queryArgs = new DiscoverQuery();
        DiscoveryConfiguration discoveryConfiguration = SearchUtils
                .getDiscoveryConfiguration(scope);

        List<String> userFilters = setupBasicQuery(context,
                discoveryConfiguration, request, queryArgs);

        setPagination(request, queryArgs, discoveryConfiguration);

        if (enableFacet
                && !"submit_export_metadata".equals(UIUtil.getSubmitButton(
                        request, "submit")))
        {
            setFacet(context, request, scope, queryArgs,
                    discoveryConfiguration, userFilters, discoveryConfiguration
                    .getTagCloudFacetConfiguration().getTagCloudFacets(), TYPE_TAGCLOUD);
        }

        return queryArgs;
    }
View Full Code Here

TOP

Related Classes of org.dspace.discovery.configuration.DiscoveryConfiguration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.