Changeset 7195 for FCSSimpleClient


Ignore:
Timestamp:
10/11/18 12:12:44 (6 years ago)
Author:
Oliver Schonefeld
Message:
  • move some constants to ClarinFCSConstants to make them public
Location:
FCSSimpleClient/trunk/src/main/java/eu/clarin/sru/client/fcs
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • FCSSimpleClient/trunk/src/main/java/eu/clarin/sru/client/fcs/ClarinFCSConstants.java

    r7078 r7195  
    1717package eu.clarin.sru.client.fcs;
    1818
     19import java.net.URI;
     20
    1921import eu.clarin.sru.client.SRUClientConstants;
    2022
     
    2325    /** constant for CQL query type */
    2426    public static final String QUERY_TYPE_FCS = "fcs";
     27
    2528
    2629    /** constant for CQL query type */
     
    3336    public static final String X_FCS_ENDPOINT_DESCRIPTION  =
    3437            "x-fcs-endpoint-description";
     38
     39
     40    /**
     41     * constant for Basic Search capability
     42     */
     43    public static final URI CAPABILITY_BASIC_SEARCH =
     44            URI.create("http://clarin.eu/fcs/capability/basic-search");
     45
     46
     47    /**
     48     * constant for Advanced Search capability
     49     */
     50    public static final URI CAPABILITY_ADVANCED_SEARCH =
     51            URI.create("http://clarin.eu/fcs/capability/advanced-search");
     52
    3553
    3654    /**
  • FCSSimpleClient/trunk/src/main/java/eu/clarin/sru/client/fcs/ClarinFCSEndpointDescriptionParser.java

    r7073 r7195  
    6666    private static final String CAPABILITY_PREFIX =
    6767            "http://clarin.eu/fcs/capability/";
    68     private static final URI CAPABILITY_BASIC_SEARCH =
    69             URI.create("http://clarin.eu/fcs/capability/basic-search");
    70     private static final URI CAPABILITY_ADVANCED_SEARCH =
    71             URI.create("http://clarin.eu/fcs/capability/advanced-search");
    7268    private static final String MIMETYPE_HITS_DATAVIEW =
    7369            "application/x-clarin-fcs-hits+xml";
     
    147143                    "least one capability!");
    148144        }
    149         final boolean hasBasicSearch =
    150                 (capabilities.indexOf(CAPABILITY_BASIC_SEARCH) != -1);
    151         final boolean hasAdvancedSearch =
    152                 (capabilities.indexOf(CAPABILITY_ADVANCED_SEARCH) != -1);
     145        final boolean hasBasicSearch = (capabilities
     146                .indexOf(ClarinFCSConstants.CAPABILITY_BASIC_SEARCH) != -1);
     147        final boolean hasAdvancedSearch = (capabilities
     148                .indexOf(ClarinFCSConstants.CAPABILITY_ADVANCED_SEARCH) != -1);
    153149        if (!hasBasicSearch) {
    154             throw new SRUClientException("Endpoint must support " +
    155                     "'basic-search' (" + CAPABILITY_BASIC_SEARCH +
    156                     ") to conform to CLARIN-FCS specification");
     150            throw new SRUClientException(
     151                    "Endpoint must support " + "'basic-search' (" +
     152                            ClarinFCSConstants.CAPABILITY_BASIC_SEARCH +
     153                            ") to conform to CLARIN-FCS specification");
    157154        }
    158155
     
    276273                    "all supported layers (<SupportedLayers>) if they " +
    277274                    "provide the 'advanced-search' (" +
    278                     CAPABILITY_ADVANCED_SEARCH + ") capability");
     275                    ClarinFCSConstants.CAPABILITY_ADVANCED_SEARCH +
     276                    ") capability");
    279277        }
    280278        if (!hasAdvancedSearch && (supportedLayers != null)) {
     
    282280            logger.warn("Endpoint superflously declared supported " +
    283281                    "layers (<SupportedLayers> without providing the " +
    284                     "'advanced-search' (" + CAPABILITY_ADVANCED_SEARCH + ") capability");
     282                    "'advanced-search' (" +
     283                    ClarinFCSConstants.CAPABILITY_ADVANCED_SEARCH +
     284                    ") capability");
    285285        }
    286286
Note: See TracChangeset for help on using the changeset viewer.