Changeset 2805


Ignore:
Timestamp:
04/11/13 13:02:15 (11 years ago)
Author:
keeloo
Message:

Added parameter for language link prefix.

Location:
vlo/trunk/vlo_importer/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • vlo/trunk/vlo_importer/src/main/java/eu/clarin/cmdi/vlo/FacetConstants.java

    r2774 r2805  
    11package eu.clarin.cmdi.vlo;
     2
     3import eu.clarin.cmdi.vlo.config.VloConfig;
    24
    35/**
     
    3234    public static final String FIELD_LANDINGPAGE = "_landingPageRef";
    3335   
    34     // PREFIX URL for the language-link
    35     public static final String LANGUAGE_LINK_PREFIX = "http://www.clarin.eu/external/language.php?code=";
     36    // PREFIX URL for the language-link   
     37    public static final String LANGUAGE_LINK_PREFIX = VloConfig.getLanguageLinkPrefix();
    3638
    3739    //Normalized mimeTypes
  • vlo/trunk/vlo_importer/src/main/java/eu/clarin/cmdi/vlo/config/VloConfig.java

    r2798 r2805  
    191191    private static String imdiBrowserUrl = "";
    192192   
     193    @Element
     194    private static String languageLinkPrefix =
     195            "http://infra.clarin.eu/service/language/info.php?code=";
     196   
    193197    /**
    194198     * Note: the national project mapping itself is not part of the web
     
    488492
    489493    /**
    490      * Set the value of the IMDIBrowserUrl parameter<br><br>
    491      *
    492      * For a description of the parameter, refer to the general VLO
    493      * documentation.
    494      *
    495      * @param param the value
    496      */
    497     public static void setIMDIBrowserUrl(String param) {
    498         imdiBrowserUrl = param;
    499     }
    500 
    501     /**
    502494     * Get the value of the ProfileSchemaUrl parameter combined with a handle<br><br>
    503495     *
    504496     * For a description of the schema, refer to the general VLO documentation.
    505497     *
     498     * @param handle the handle the URL is based on
    506499     * @return the value
    507500     */
     
    517510
    518511    /**
     512     * Set the value of the IMDIBrowserUrl parameter<br><br>
     513     *
     514     * For a description of the parameter, refer to the general VLO
     515     * documentation.
     516     *
     517     * @param param the value
     518     */
     519    public static void setIMDIBrowserUrl(String param) {
     520        imdiBrowserUrl = param;
     521    }
     522
     523    /**
     524     * Get the value of the languageLinkPrefix parameter<br><br>
     525     *
     526     * For a description of the parameter, refer to the general VLO
     527     * documentation.
     528     *
     529     * @return the value
     530     */
     531    public static String getLanguageLinkPrefix() {
     532        return languageLinkPrefix;
     533    }
     534   
     535    /**
     536     * Set the value of the languageLinkPrefix parameter<br><br>
     537     *
     538     * For a description of the parameter, refer to the general VLO
     539     * documentation.
     540     *
     541     * @param param the value
     542     */
     543    public static void setLanguageLinkPrefix(String param) {
     544        languageLinkPrefix = param;
     545    }
     546   
     547    /**
    519548     * Get the value of the FederatedContentSearchUrl parameter<br><br>
    520549     *
  • vlo/trunk/vlo_importer/src/main/java/eu/clarin/cmdi/vlo/importer/CMDIParserVTDXML.java

    r2774 r2805  
    9999    }
    100100   
    101     /*
    102      * kj: describe
    103      */
    104101    private void processResources(CMDIData result, VTDNav nav) throws VTDException {
    105102       
     
    119116            String mimeType = resourceMimeType.evalXPathToString();
    120117           
    121          // if (!ref.equals("") && !type.equals("")){
    122             if (!ref.equals("")){
    123                 // mime type is allowed to be an empty string, kj: check if this is allowed in general
     118            if (!ref.equals("") && !type.equals("")) {
     119                // note that the mime type could be empty
    124120                result.addResource(ref, type, mimeType);
    125121            }
  • vlo/trunk/vlo_importer/src/main/java/eu/clarin/cmdi/vlo/importer/MetadataImporter.java

    r2774 r2805  
    303303        for (Resource resource : cmdiData.getLandingPageResources()) {
    304304            solrDocument.addField(FacetConstants.FIELD_LANDINGPAGE, resource.getResourceName());
     305            // solrDocument.addField(FacetConstants.FIELD_RESOURCE, resource.getResourceName());
     306            // keeloo: this works, the web application stumbles because it assumes a mime type however
    305307        }
    306308       
  • vlo/trunk/vlo_importer/src/main/resources/VloConfig.xml

    r2800 r2805  
    6363   
    6464    <countryComponentUrl>http://catalog.clarin.eu/ds/ComponentRegistry/rest/registry/components/clarin.eu:cr1:c_1271859438104/xml</countryComponentUrl>
     65   
     66    <languageLinkPrefix>http://infra.clarin.eu/service/language/info.php?code=</languageLinkPrefix>
    6567
    6668    <language2LetterCodeComponentUrl>http://catalog.clarin.eu/ds/ComponentRegistry/rest/registry/components/clarin.eu:cr1:c_1271859438109/xml</language2LetterCodeComponentUrl>
  • vlo/trunk/vlo_importer/src/test/java/eu/clarin/cmdi/vlo/config/VloConfigTest.java

    r2799 r2805  
    391391    }
    392392   
     393        /**
     394     * Test the getHandleServerUrl method
     395     */
     396    @Test
     397    public void testGetLanguageLinkPrefix() {
     398       
     399        System.out.println("getLanguageLinkPrefix");
     400       
     401        String expResult = "http://infra.clarin.eu/service/language/info.php?code=";
     402        String result = VloConfig.getLanguageLinkPrefix();
     403       
     404        assertEquals(expResult, result);
     405    }
     406
     407    /**
     408     * Test the setHandleServerUrl method
     409     */
     410    @Test
     411    public void testSetLanguageLinkPrefix() {
     412       
     413        System.out.println("setLanguageLinkPrefix");
     414       
     415        String param = "http://infra.clarin.eu/service/language/info.php?code=";
     416       
     417        VloConfig.setLanguageLinkPrefix(param);
     418
     419        String result = VloConfig.getLanguageLinkPrefix();
     420       
     421        assertEquals(param, result);
     422    }
     423   
    393424    /**
    394425     * Test the getFederatedContentSearchUrl method
Note: See TracChangeset for help on using the changeset viewer.