@Override public void setType(String type) throws DiscoveryConfigurationException { if (type.equalsIgnoreCase(DiscoveryConfigurationParameters.TYPE_HIERARCHICAL)) { this.type = type; } else { throw new DiscoveryConfigurationException( "The " + type + " can't be used with a hierarchical facet side bar facet use the " + "\"DiscoverySearchFilterFacet\" class instead."); } } }
/** * Sets the type of the DiscoverySearchFilter to the one given in the parameter if it matches * a set of possible types * The possible types are described in: {@link org.dspace.discovery.configuration.DiscoveryConfigurationParameters} * For the DiscoverySearchFilter only the TYPE_TEXT, TYPE_DATE and TYPE_HIERARCHICAL are allowed * * @param type The type for this DiscoverySearchFilter * @throws DiscoveryConfigurationException If none of the types match, this error will be thrown indiciating this */ public void setType(String type) throws DiscoveryConfigurationException { if (type.equalsIgnoreCase(DiscoveryConfigurationParameters.TYPE_TEXT)) { this.type = DiscoveryConfigurationParameters.TYPE_TEXT; } else if (type.equalsIgnoreCase(DiscoveryConfigurationParameters.TYPE_DATE)) { this.type = DiscoveryConfigurationParameters.TYPE_DATE; } else if (type.equalsIgnoreCase(DiscoveryConfigurationParameters.TYPE_HIERARCHICAL)) { throw new DiscoveryConfigurationException( "The " + type + " can't be used with a default side bar facet use the " + "\"HierarchicalSidebarFacetConfiguration\" class instead."); } else { this.type = type; } }
throw new DiscoveryConfigurationException(error.toString()); throw new DiscoveryConfigurationException(error.toString());