Changeset 6409


Ignore:
Timestamp:
07/23/15 12:59:01 (9 years ago)
Author:
Twan Goosen
Message:

Data roots are include via XInclude, file to include determined via property. Default build has not changed (now a profile called 'test-local'). Filtered (post-build) config files are now included in the distribution package instead of from source.
Fixes #746

Location:
vlo/trunk
Files:
1 added
7 edited
3 copied

Legend:

Unmodified
Added
Removed
  • vlo/trunk/vlo-commons/pom.xml

    r6408 r6409  
    3030            </resource>
    3131        </resources>
     32        <testResources>
     33            <testResource>
     34                <directory>src/test/resources</directory>
     35                <filtering>true</filtering>
     36            </testResource>
     37        </testResources>
    3238    </build>
    3339   
     
    4248            <properties>
    4349                <vloconfig.solrUrl>http://localhost:8080/vlo-solr/core0/</vloconfig.solrUrl>
    44                 <!--TODO: xinclude dataroots -->
     50                <vloconfig.dataRootsFile>dataroots-local.xml</vloconfig.dataRootsFile>
    4551            </properties>
    4652        </profile>
     
    5460                <vloconfig.solrUrl>http://localhost:8080/solr/core0/</vloconfig.solrUrl>
    5561                <vloconfig.homeUrl>http://vlo.clarin.eu</vloconfig.homeUrl>
    56                 <!--TODO: xinclude dataroots -->
     62                <vloconfig.dataRootsFile>dataroots-production.xml</vloconfig.dataRootsFile>
    5763            </properties>
    5864        </profile>
     
    6369            <properties>
    6470                <vloconfig.solrUrl>http://localhost:8080/vlo-solr/core0/</vloconfig.solrUrl>
    65                 <!--TODO: xinclude dataroots -->
     71                <vloconfig.dataRootsFile>dataroots-testvm.xml</vloconfig.dataRootsFile>
    6672            </properties>
    6773        </profile>
     
    7379                <vloconfig.solrUrl><!-- TODO!!! --></vloconfig.solrUrl>
    7480                <vloconfig.homeUrl>http://beta.vlo.clarin.eu</vloconfig.homeUrl>
    75                 <!--TODO: xinclude dataroots -->
     81                <vloconfig.dataRootsFile>dataroots-production.xml</vloconfig.dataRootsFile>
    7682            </properties>
    7783        </profile>
  • vlo/trunk/vlo-commons/src/main/java/eu/clarin/cmdi/vlo/config/AbstractXmlVloConfigFactory.java

    r6203 r6409  
    4242        final InputStream fileStream = getXmlConfigurationInputStream();
    4343        try {
    44             final VloConfig config = marshaller.unmarshal(new StreamSource(fileStream));
     44            final VloConfig config = marshaller.unmarshal(new StreamSource(fileStream, getLocation().toString()));
    4545            config.setConfigLocation(getLocation());
    4646            return config;
     
    5959     */
    6060    protected abstract InputStream getXmlConfigurationInputStream() throws IOException;
    61    
     61
    6262    protected abstract URI getLocation();
    6363
  • vlo/trunk/vlo-commons/src/main/java/eu/clarin/cmdi/vlo/config/VloConfigMarshaller.java

    r4517 r6409  
    2121import javax.xml.bind.Marshaller;
    2222import javax.xml.bind.Unmarshaller;
     23import javax.xml.parsers.ParserConfigurationException;
     24import javax.xml.parsers.SAXParserFactory;
    2325import javax.xml.transform.Result;
    2426import javax.xml.transform.Source;
     27import javax.xml.transform.sax.SAXSource;
    2528import javax.xml.transform.stream.StreamResult;
     29import org.xml.sax.InputSource;
     30import org.xml.sax.SAXException;
     31import org.xml.sax.XMLReader;
    2632
    2733/**
     
    6066     */
    6167    public final VloConfig unmarshal(Source source) throws JAXBException {
    62         Unmarshaller unmarshaller = jc.createUnmarshaller();
    63         return (VloConfig) unmarshaller.unmarshal(source);
     68        final Unmarshaller unmarshaller = jc.createUnmarshaller();
     69       
     70        // custom parser, so that we can make it XInclude aware
     71        final SAXParserFactory spf = SAXParserFactory.newInstance();
     72        spf.setXIncludeAware(true);
     73        spf.setNamespaceAware(true);
     74
     75        try {
     76            final XMLReader xr = spf.newSAXParser().getXMLReader();
     77            // XML transformation 'source' needs to be converted to a SAX 'input source'
     78            final InputSource inputSource = SAXSource.sourceToInputSource(source);
     79            final SAXSource saxSource = new SAXSource(xr, inputSource);
     80
     81            return (VloConfig) unmarshaller.unmarshal(saxSource);
     82        } catch (ParserConfigurationException ex) {
     83            throw new JAXBException(ex);
     84        } catch (SAXException ex) {
     85            throw new JAXBException(ex);
     86        }
    6487    }
    6588
  • vlo/trunk/vlo-commons/src/main/resources/VloConfig.xml

    r6408 r6409  
    1111    <helpUrl>${vloconfig.helpUrl}</helpUrl>
    1212   
    13     <dataRoots>
    14         <DataRoot>
    15             <originName>CLARIN Centres</originName>
    16             <rootFile>/lat/apache/htdocs/oai-harvester/clarin/results/cmdi/</rootFile>           
    17             <prefix>http://catalog.clarin.eu/</prefix>
    18             <tostrip>/lat/apache/htdocs/</tostrip>
    19             <deleteFirst>false</deleteFirst>
    20         </DataRoot>
    21 
    22         <DataRoot>
    23             <originName>Other</originName>
    24             <rootFile>/lat/apache/htdocs/oai-harvester/others/results/cmdi</rootFile>           
    25             <prefix>http://catalog.clarin.eu/</prefix>
    26             <tostrip>/lat/apache/htdocs/</tostrip>
    27             <deleteFirst>false</deleteFirst>
    28         </DataRoot>
    29     </dataRoots>
     13    <xi:include href="${vloconfig.dataRootsFile}" xmlns:xi="http://www.w3.org/2001/XInclude"></xi:include>
    3014   
    3115    <!-- Sets the maximum number of page instances which will be stored in the application scoped second level cache for faster retrieval -->
  • vlo/trunk/vlo-commons/src/main/resources/dataroots-local.xml

    r6408 r6409  
    1 <VloConfig>
    2    
    3     <deleteAllFirst>${vloconfig.deleteAllFirst}</deleteAllFirst>
    4    
    5     <maxDaysInSolr>${vloconfig.maxDaysInSolr}</maxDaysInSolr>
    6    
    7     <solrUrl>${vloconfig.solrUrl}</solrUrl>
    8    
    9     <homeUrl>${vloconfig.homeUrl}</homeUrl>
    10    
    11     <helpUrl>${vloconfig.helpUrl}</helpUrl>
    12    
    13     <dataRoots>
    14         <DataRoot>
    15             <originName>CLARIN Centres</originName>
    16             <rootFile>/lat/apache/htdocs/oai-harvester/clarin/results/cmdi/</rootFile>           
    17             <prefix>http://catalog.clarin.eu/</prefix>
    18             <tostrip>/lat/apache/htdocs/</tostrip>
    19             <deleteFirst>false</deleteFirst>
    20         </DataRoot>
     1<dataRoots>
     2    <DataRoot>
     3        <originName>CLARIN Centres</originName>
     4        <rootFile>/lat/apache/htdocs/oai-harvester/clarin/results/cmdi/</rootFile>           
     5        <prefix>http://catalog.clarin.eu/</prefix>
     6        <tostrip>/lat/apache/htdocs/</tostrip>
     7        <deleteFirst>false</deleteFirst>
     8    </DataRoot>
    219
    22         <DataRoot>
    23             <originName>Other</originName>
    24             <rootFile>/lat/apache/htdocs/oai-harvester/others/results/cmdi</rootFile>           
    25             <prefix>http://catalog.clarin.eu/</prefix>
    26             <tostrip>/lat/apache/htdocs/</tostrip>
    27             <deleteFirst>false</deleteFirst>
    28         </DataRoot>
    29     </dataRoots>
    30    
    31     <!-- Sets the maximum number of page instances which will be stored in the application scoped second level cache for faster retrieval -->
    32     <pagesInApplicationCache>40</pagesInApplicationCache>
    33    
    34     <!-- Sets the maximum size (in KILOBYTES) of the File where page instances per session are stored. -->
    35     <sessionCacheSize>10000</sessionCacheSize>
    36    
    37     <maxDocsInList>128</maxDocsInList>
    38    
    39     <minDocsInSolrQueue>128</minDocsInSolrQueue>
    40    
    41     <solrTimeOut>300</solrTimeOut>
    42    
    43     <maxFileSize>10000000</maxFileSize>
    44    
    45     <useHandleResolver>false</useHandleResolver>
    46    
    47     <printMapping>false</printMapping>
    48    
    49     <!-- leave empty to use default packaged definition -->
    50     <facetConceptsFile><!-- use default packaged definition --></facetConceptsFile>
    51    
    52     <profileSchemaUrl>http://catalog.clarin.eu/ds/ComponentRegistry/rest/registry/profiles/{PROFILE_ID}/xsd</profileSchemaUrl>
    53    
    54     <componentRegistryRESTURL>http://catalog.clarin.eu/ds/ComponentRegistry/rest/registry/profiles/</componentRegistryRESTURL>
    55    
    56     <handleServerUrl>http://hdl.handle.net/</handleServerUrl>
    57    
    58     <nationalProjectMapping>/nationalProjectsMapping.xml</nationalProjectMapping>
    59    
    60     <organisationNamesUrl>/OrganisationControlledVocabulary.xml</organisationNamesUrl>
    61    
    62     <languageNameVariantsUrl>/LanguageNameVariantsMap.xml</languageNameVariantsUrl>
    63    
    64     <licenseAvailabilityMapUrl>/LicenseAvailabilityMap.xml</licenseAvailabilityMapUrl>
    65    
    66     <!-- resourceAvailabilityMapUrl
    67         Facet field used to populate collection selector on search page
    68         If disabled, the collection facet will not be shown (can be used to
    69         move the collection facet in with the other facets).
    70        
    71         Uncomment to activate the separate collection facet display item.
    72     -->
    73     <!--<collectionFacet>collection</collectionFacet>-->
    74    
    75     <!-- Fields shown as facets on the search page -->
    76     <facetFields>       
    77         <facetField>languageCode</facetField>
    78         <facetField>collection</facetField>
    79         <facetField>resourceClass</facetField>
    80         <facetField>continent</facetField>
    81         <facetField>country</facetField>
    82         <facetField>modality</facetField>
    83         <facetField>genre</facetField>
    84         <facetField>subject</facetField>
    85         <facetField>format</facetField>
    86         <facetField>organisation</facetField>
    87         <facetField>availability</facetField>
    88         <facetField>nationalProject</facetField>
    89         <facetField>keywords</facetField>
    90         <facetField>dataProvider</facetField>
    91     </facetFields>
    92        
    93     <simpleSearchFacetFields>
    94         <simpleSearchFacetField>languageCode</simpleSearchFacetField>
    95         <simpleSearchFacetField>collection</simpleSearchFacetField>
    96         <simpleSearchFacetField>resourceClass</simpleSearchFacetField>
    97         <simpleSearchFacetField>modality</simpleSearchFacetField>
    98         <simpleSearchFacetField>genre</simpleSearchFacetField>
    99     </simpleSearchFacetFields>
    100    
    101     <!-- Fields shown in expanded search results on the search page -->
    102     <searchResultFields>
    103         <searchResultField>name</searchResultField>
    104         <searchResultField>country</searchResultField>
    105         <searchResultField>languageCode</searchResultField>
    106         <searchResultField>modality</searchResultField>
    107         <searchResultField>subject</searchResultField>
    108         <searchResultField>genre</searchResultField>
    109         <searchResultField>organisation</searchResultField>
    110         <searchResultField>collection</searchResultField>
    111         <searchResultField>nationalProject</searchResultField>
    112     </searchResultFields>
    113    
    114     <!-- Fields ignored in the record page -->
    115     <ignoredFields>
    116         <ignoredField>format</ignoredField>
    117         <ignoredField>score</ignoredField>
    118     </ignoredFields>
    119    
    120     <!-- Fields shown as technical fields in the record page -->
    121     <technicalFields>
    122         <technicalField>id</technicalField>
    123         <technicalField>_selfLink</technicalField>
    124         <technicalField>dataProvider</technicalField>
    125         <technicalField>metadataSource</technicalField>
    126         <technicalField>_landingPageRef</technicalField>
    127         <technicalField>_searchPageRef</technicalField>
    128         <technicalField>_contentSearchRef</technicalField>
    129         <technicalField>_lastSeen</technicalField>
    130         <technicalField>_componentProfile</technicalField>
    131         <technicalField>_hierarchyWeight</technicalField>
    132         <technicalField>_hasPart</technicalField>
    133         <technicalField>_isPartOf</technicalField>
    134     </technicalFields>
    135    
    136     <languageFilters>
    137         <languageFilter>filterOne</languageFilter>
    138         <languageFilter>filterTwo</languageFilter>
    139         <languageFilter>filterThree</languageFilter>
    140     </languageFilters>
    141    
    142     <facetOverviewLength>30</facetOverviewLength>
    143    
    144     <countryComponentUrl>http://catalog.clarin.eu/ds/ComponentRegistry/rest/registry/components/clarin.eu:cr1:c_1271859438104/xml</countryComponentUrl>
    145    
    146     <languageLinkTemplate>https://infra.clarin.eu/content/language_info/data/{}.html</languageLinkTemplate>
    147    
    148     <feedbackFromUrl>http://www.clarin.eu/node/3759?url=</feedbackFromUrl>
    149 
    150     <language2LetterCodeComponentUrl>http://catalog.clarin.eu/ds/ComponentRegistry/rest/registry/components/clarin.eu:cr1:c_1271859438109/xml</language2LetterCodeComponentUrl>
    151    
    152     <language3LetterCodeComponentUrl>http://catalog.clarin.eu/ds/ComponentRegistry/rest/registry/components/clarin.eu:cr1:c_1271859438110/xml</language3LetterCodeComponentUrl>
    153    
    154     <silToISO639CodesUrl>http://www.clarin.eu/cmd/xslt/sil_to_iso6393.xml</silToISO639CodesUrl>
    155    
    156     <reverseProxyPrefix></reverseProxyPrefix>
    157    
    158     <FederatedContentSearchUrl>http://weblicht.sfs.uni-tuebingen.de/Aggregator/</FederatedContentSearchUrl>
    159    
    160     <cqlEndpointFilter>http://cqlservlet.mpi.nl/</cqlEndpointFilter>
    161    
    162     <cqlEndpointAlternative>http://cqlservlet.mpi.nl/</cqlEndpointAlternative>
    163    
    164     <!-- makes the score for the result ranking visible in the search results -->
    165     <showResultScores>true</showResultScores>
    166 </VloConfig>
     10    <DataRoot>
     11        <originName>Other</originName>
     12        <rootFile>/lat/apache/htdocs/oai-harvester/others/results/cmdi</rootFile>           
     13        <prefix>http://catalog.clarin.eu/</prefix>
     14        <tostrip>/lat/apache/htdocs/</tostrip>
     15        <deleteFirst>false</deleteFirst>
     16    </DataRoot>
     17</dataRoots>
  • vlo/trunk/vlo-commons/src/main/resources/dataroots-production.xml

    r6408 r6409  
    1 <VloConfig>
    2    
    3     <deleteAllFirst>${vloconfig.deleteAllFirst}</deleteAllFirst>
    4    
    5     <maxDaysInSolr>${vloconfig.maxDaysInSolr}</maxDaysInSolr>
    6    
    7     <solrUrl>${vloconfig.solrUrl}</solrUrl>
    8    
    9     <homeUrl>${vloconfig.homeUrl}</homeUrl>
    10    
    11     <helpUrl>${vloconfig.helpUrl}</helpUrl>
    12    
    13     <dataRoots>
    14         <DataRoot>
    15             <originName>CLARIN Centres</originName>
    16             <rootFile>/lat/apache/htdocs/oai-harvester/clarin/results/cmdi/</rootFile>           
    17             <prefix>http://catalog.clarin.eu/</prefix>
    18             <tostrip>/lat/apache/htdocs/</tostrip>
    19             <deleteFirst>false</deleteFirst>
    20         </DataRoot>
    21 
    22         <DataRoot>
    23             <originName>Other</originName>
    24             <rootFile>/lat/apache/htdocs/oai-harvester/others/results/cmdi</rootFile>           
    25             <prefix>http://catalog.clarin.eu/</prefix>
    26             <tostrip>/lat/apache/htdocs/</tostrip>
    27             <deleteFirst>false</deleteFirst>
    28         </DataRoot>
    29     </dataRoots>
    30    
    31     <!-- Sets the maximum number of page instances which will be stored in the application scoped second level cache for faster retrieval -->
    32     <pagesInApplicationCache>40</pagesInApplicationCache>
    33    
    34     <!-- Sets the maximum size (in KILOBYTES) of the File where page instances per session are stored. -->
    35     <sessionCacheSize>10000</sessionCacheSize>
    36    
    37     <maxDocsInList>128</maxDocsInList>
    38    
    39     <minDocsInSolrQueue>128</minDocsInSolrQueue>
    40    
    41     <solrTimeOut>300</solrTimeOut>
    42    
    43     <maxFileSize>10000000</maxFileSize>
    44    
    45     <useHandleResolver>false</useHandleResolver>
    46    
    47     <printMapping>false</printMapping>
    48    
    49     <!-- leave empty to use default packaged definition -->
    50     <facetConceptsFile><!-- use default packaged definition --></facetConceptsFile>
    51    
    52     <profileSchemaUrl>http://catalog.clarin.eu/ds/ComponentRegistry/rest/registry/profiles/{PROFILE_ID}/xsd</profileSchemaUrl>
    53    
    54     <componentRegistryRESTURL>http://catalog.clarin.eu/ds/ComponentRegistry/rest/registry/profiles/</componentRegistryRESTURL>
    55    
    56     <handleServerUrl>http://hdl.handle.net/</handleServerUrl>
    57    
    58     <nationalProjectMapping>/nationalProjectsMapping.xml</nationalProjectMapping>
    59    
    60     <organisationNamesUrl>/OrganisationControlledVocabulary.xml</organisationNamesUrl>
    61    
    62     <languageNameVariantsUrl>/LanguageNameVariantsMap.xml</languageNameVariantsUrl>
    63    
    64     <licenseAvailabilityMapUrl>/LicenseAvailabilityMap.xml</licenseAvailabilityMapUrl>
    65    
    66     <!-- resourceAvailabilityMapUrl
    67         Facet field used to populate collection selector on search page
    68         If disabled, the collection facet will not be shown (can be used to
    69         move the collection facet in with the other facets).
    70        
    71         Uncomment to activate the separate collection facet display item.
    72     -->
    73     <!--<collectionFacet>collection</collectionFacet>-->
    74    
    75     <!-- Fields shown as facets on the search page -->
    76     <facetFields>       
    77         <facetField>languageCode</facetField>
    78         <facetField>collection</facetField>
    79         <facetField>resourceClass</facetField>
    80         <facetField>continent</facetField>
    81         <facetField>country</facetField>
    82         <facetField>modality</facetField>
    83         <facetField>genre</facetField>
    84         <facetField>subject</facetField>
    85         <facetField>format</facetField>
    86         <facetField>organisation</facetField>
    87         <facetField>availability</facetField>
    88         <facetField>nationalProject</facetField>
    89         <facetField>keywords</facetField>
    90         <facetField>dataProvider</facetField>
    91     </facetFields>
    92        
    93     <simpleSearchFacetFields>
    94         <simpleSearchFacetField>languageCode</simpleSearchFacetField>
    95         <simpleSearchFacetField>collection</simpleSearchFacetField>
    96         <simpleSearchFacetField>resourceClass</simpleSearchFacetField>
    97         <simpleSearchFacetField>modality</simpleSearchFacetField>
    98         <simpleSearchFacetField>genre</simpleSearchFacetField>
    99     </simpleSearchFacetFields>
    100    
    101     <!-- Fields shown in expanded search results on the search page -->
    102     <searchResultFields>
    103         <searchResultField>name</searchResultField>
    104         <searchResultField>country</searchResultField>
    105         <searchResultField>languageCode</searchResultField>
    106         <searchResultField>modality</searchResultField>
    107         <searchResultField>subject</searchResultField>
    108         <searchResultField>genre</searchResultField>
    109         <searchResultField>organisation</searchResultField>
    110         <searchResultField>collection</searchResultField>
    111         <searchResultField>nationalProject</searchResultField>
    112     </searchResultFields>
    113    
    114     <!-- Fields ignored in the record page -->
    115     <ignoredFields>
    116         <ignoredField>format</ignoredField>
    117         <ignoredField>score</ignoredField>
    118     </ignoredFields>
    119    
    120     <!-- Fields shown as technical fields in the record page -->
    121     <technicalFields>
    122         <technicalField>id</technicalField>
    123         <technicalField>_selfLink</technicalField>
    124         <technicalField>dataProvider</technicalField>
    125         <technicalField>metadataSource</technicalField>
    126         <technicalField>_landingPageRef</technicalField>
    127         <technicalField>_searchPageRef</technicalField>
    128         <technicalField>_contentSearchRef</technicalField>
    129         <technicalField>_lastSeen</technicalField>
    130         <technicalField>_componentProfile</technicalField>
    131         <technicalField>_hierarchyWeight</technicalField>
    132         <technicalField>_hasPart</technicalField>
    133         <technicalField>_isPartOf</technicalField>
    134     </technicalFields>
    135    
    136     <languageFilters>
    137         <languageFilter>filterOne</languageFilter>
    138         <languageFilter>filterTwo</languageFilter>
    139         <languageFilter>filterThree</languageFilter>
    140     </languageFilters>
    141    
    142     <facetOverviewLength>30</facetOverviewLength>
    143    
    144     <countryComponentUrl>http://catalog.clarin.eu/ds/ComponentRegistry/rest/registry/components/clarin.eu:cr1:c_1271859438104/xml</countryComponentUrl>
    145    
    146     <languageLinkTemplate>https://infra.clarin.eu/content/language_info/data/{}.html</languageLinkTemplate>
    147    
    148     <feedbackFromUrl>http://www.clarin.eu/node/3759?url=</feedbackFromUrl>
    149 
    150     <language2LetterCodeComponentUrl>http://catalog.clarin.eu/ds/ComponentRegistry/rest/registry/components/clarin.eu:cr1:c_1271859438109/xml</language2LetterCodeComponentUrl>
    151    
    152     <language3LetterCodeComponentUrl>http://catalog.clarin.eu/ds/ComponentRegistry/rest/registry/components/clarin.eu:cr1:c_1271859438110/xml</language3LetterCodeComponentUrl>
    153    
    154     <silToISO639CodesUrl>http://www.clarin.eu/cmd/xslt/sil_to_iso6393.xml</silToISO639CodesUrl>
    155    
    156     <reverseProxyPrefix></reverseProxyPrefix>
    157    
    158     <FederatedContentSearchUrl>http://weblicht.sfs.uni-tuebingen.de/Aggregator/</FederatedContentSearchUrl>
    159    
    160     <cqlEndpointFilter>http://cqlservlet.mpi.nl/</cqlEndpointFilter>
    161    
    162     <cqlEndpointAlternative>http://cqlservlet.mpi.nl/</cqlEndpointAlternative>
    163    
    164     <!-- makes the score for the result ranking visible in the search results -->
    165     <showResultScores>true</showResultScores>
    166 </VloConfig>
     1<dataRoots>
     2    <DataRoot>
     3        <originName>CLARIN Centres</originName>
     4        <rootFile>/srv/vlo-data/clarin/results/cmdi/</rootFile>           
     5        <prefix>http://vlo.clarin.eu/data/</prefix>
     6        <tostrip>/srv/vlo-data/</tostrip>
     7        <deleteFirst>false</deleteFirst>
     8    </DataRoot>
     9    <DataRoot>
     10        <originName>Other</originName>
     11        <rootFile>/srv/vlo-data/others/results/cmdi</rootFile>           
     12        <prefix>http://vlo.clarin.eu/data/</prefix>
     13        <tostrip>/srv/vlo-data/</tostrip>
     14        <deleteFirst>false</deleteFirst>
     15    </DataRoot>
     16</dataRoots>
  • vlo/trunk/vlo-commons/src/main/resources/dataroots-testvm.xml

    r6408 r6409  
    1 <VloConfig>
     1<dataRoots>
     2
     3    <DataRoot>
     4        <originName>European Library</originName>
     5        <rootFile>/lat/apache/htdocs/oai-harvester/work/european-library/results/cmdi/</rootFile>           
     6        <prefix>http://catalog-clarin.esc.rzg.mpg.de/cmdi/</prefix>
     7        <tostrip>/lat/apache/htdocs/oai-harvester/work/</tostrip>
     8        <deleteFirst>false</deleteFirst>
     9    </DataRoot>
    210   
    3     <deleteAllFirst>${vloconfig.deleteAllFirst}</deleteAllFirst>
     11    <DataRoot>
     12        <originName>CLARIN Centres</originName>
     13        <rootFile>/data2/harvester/clarin/results/cmdi/</rootFile>           
     14        <prefix>http://catalog-clarin.esc.rzg.mpg.de/cmdi/</prefix>
     15        <tostrip>/data2/harvester/</tostrip>
     16        <deleteFirst>false</deleteFirst>
     17    </DataRoot>
    418   
    5     <maxDaysInSolr>${vloconfig.maxDaysInSolr}</maxDaysInSolr>
    6    
    7     <solrUrl>${vloconfig.solrUrl}</solrUrl>
    8    
    9     <homeUrl>${vloconfig.homeUrl}</homeUrl>
    10    
    11     <helpUrl>${vloconfig.helpUrl}</helpUrl>
    12    
    13     <dataRoots>
    14         <DataRoot>
    15             <originName>CLARIN Centres</originName>
    16             <rootFile>/lat/apache/htdocs/oai-harvester/clarin/results/cmdi/</rootFile>           
    17             <prefix>http://catalog.clarin.eu/</prefix>
    18             <tostrip>/lat/apache/htdocs/</tostrip>
    19             <deleteFirst>false</deleteFirst>
    20         </DataRoot>
    21 
    22         <DataRoot>
    23             <originName>Other</originName>
    24             <rootFile>/lat/apache/htdocs/oai-harvester/others/results/cmdi</rootFile>           
    25             <prefix>http://catalog.clarin.eu/</prefix>
    26             <tostrip>/lat/apache/htdocs/</tostrip>
    27             <deleteFirst>false</deleteFirst>
    28         </DataRoot>
    29     </dataRoots>
    30    
    31     <!-- Sets the maximum number of page instances which will be stored in the application scoped second level cache for faster retrieval -->
    32     <pagesInApplicationCache>40</pagesInApplicationCache>
    33    
    34     <!-- Sets the maximum size (in KILOBYTES) of the File where page instances per session are stored. -->
    35     <sessionCacheSize>10000</sessionCacheSize>
    36    
    37     <maxDocsInList>128</maxDocsInList>
    38    
    39     <minDocsInSolrQueue>128</minDocsInSolrQueue>
    40    
    41     <solrTimeOut>300</solrTimeOut>
    42    
    43     <maxFileSize>10000000</maxFileSize>
    44    
    45     <useHandleResolver>false</useHandleResolver>
    46    
    47     <printMapping>false</printMapping>
    48    
    49     <!-- leave empty to use default packaged definition -->
    50     <facetConceptsFile><!-- use default packaged definition --></facetConceptsFile>
    51    
    52     <profileSchemaUrl>http://catalog.clarin.eu/ds/ComponentRegistry/rest/registry/profiles/{PROFILE_ID}/xsd</profileSchemaUrl>
    53    
    54     <componentRegistryRESTURL>http://catalog.clarin.eu/ds/ComponentRegistry/rest/registry/profiles/</componentRegistryRESTURL>
    55    
    56     <handleServerUrl>http://hdl.handle.net/</handleServerUrl>
    57    
    58     <nationalProjectMapping>/nationalProjectsMapping.xml</nationalProjectMapping>
    59    
    60     <organisationNamesUrl>/OrganisationControlledVocabulary.xml</organisationNamesUrl>
    61    
    62     <languageNameVariantsUrl>/LanguageNameVariantsMap.xml</languageNameVariantsUrl>
    63    
    64     <licenseAvailabilityMapUrl>/LicenseAvailabilityMap.xml</licenseAvailabilityMapUrl>
    65    
    66     <!-- resourceAvailabilityMapUrl
    67         Facet field used to populate collection selector on search page
    68         If disabled, the collection facet will not be shown (can be used to
    69         move the collection facet in with the other facets).
    70        
    71         Uncomment to activate the separate collection facet display item.
    72     -->
    73     <!--<collectionFacet>collection</collectionFacet>-->
    74    
    75     <!-- Fields shown as facets on the search page -->
    76     <facetFields>       
    77         <facetField>languageCode</facetField>
    78         <facetField>collection</facetField>
    79         <facetField>resourceClass</facetField>
    80         <facetField>continent</facetField>
    81         <facetField>country</facetField>
    82         <facetField>modality</facetField>
    83         <facetField>genre</facetField>
    84         <facetField>subject</facetField>
    85         <facetField>format</facetField>
    86         <facetField>organisation</facetField>
    87         <facetField>availability</facetField>
    88         <facetField>nationalProject</facetField>
    89         <facetField>keywords</facetField>
    90         <facetField>dataProvider</facetField>
    91     </facetFields>
    92        
    93     <simpleSearchFacetFields>
    94         <simpleSearchFacetField>languageCode</simpleSearchFacetField>
    95         <simpleSearchFacetField>collection</simpleSearchFacetField>
    96         <simpleSearchFacetField>resourceClass</simpleSearchFacetField>
    97         <simpleSearchFacetField>modality</simpleSearchFacetField>
    98         <simpleSearchFacetField>genre</simpleSearchFacetField>
    99     </simpleSearchFacetFields>
    100    
    101     <!-- Fields shown in expanded search results on the search page -->
    102     <searchResultFields>
    103         <searchResultField>name</searchResultField>
    104         <searchResultField>country</searchResultField>
    105         <searchResultField>languageCode</searchResultField>
    106         <searchResultField>modality</searchResultField>
    107         <searchResultField>subject</searchResultField>
    108         <searchResultField>genre</searchResultField>
    109         <searchResultField>organisation</searchResultField>
    110         <searchResultField>collection</searchResultField>
    111         <searchResultField>nationalProject</searchResultField>
    112     </searchResultFields>
    113    
    114     <!-- Fields ignored in the record page -->
    115     <ignoredFields>
    116         <ignoredField>format</ignoredField>
    117         <ignoredField>score</ignoredField>
    118     </ignoredFields>
    119    
    120     <!-- Fields shown as technical fields in the record page -->
    121     <technicalFields>
    122         <technicalField>id</technicalField>
    123         <technicalField>_selfLink</technicalField>
    124         <technicalField>dataProvider</technicalField>
    125         <technicalField>metadataSource</technicalField>
    126         <technicalField>_landingPageRef</technicalField>
    127         <technicalField>_searchPageRef</technicalField>
    128         <technicalField>_contentSearchRef</technicalField>
    129         <technicalField>_lastSeen</technicalField>
    130         <technicalField>_componentProfile</technicalField>
    131         <technicalField>_hierarchyWeight</technicalField>
    132         <technicalField>_hasPart</technicalField>
    133         <technicalField>_isPartOf</technicalField>
    134     </technicalFields>
    135    
    136     <languageFilters>
    137         <languageFilter>filterOne</languageFilter>
    138         <languageFilter>filterTwo</languageFilter>
    139         <languageFilter>filterThree</languageFilter>
    140     </languageFilters>
    141    
    142     <facetOverviewLength>30</facetOverviewLength>
    143    
    144     <countryComponentUrl>http://catalog.clarin.eu/ds/ComponentRegistry/rest/registry/components/clarin.eu:cr1:c_1271859438104/xml</countryComponentUrl>
    145    
    146     <languageLinkTemplate>https://infra.clarin.eu/content/language_info/data/{}.html</languageLinkTemplate>
    147    
    148     <feedbackFromUrl>http://www.clarin.eu/node/3759?url=</feedbackFromUrl>
    149 
    150     <language2LetterCodeComponentUrl>http://catalog.clarin.eu/ds/ComponentRegistry/rest/registry/components/clarin.eu:cr1:c_1271859438109/xml</language2LetterCodeComponentUrl>
    151    
    152     <language3LetterCodeComponentUrl>http://catalog.clarin.eu/ds/ComponentRegistry/rest/registry/components/clarin.eu:cr1:c_1271859438110/xml</language3LetterCodeComponentUrl>
    153    
    154     <silToISO639CodesUrl>http://www.clarin.eu/cmd/xslt/sil_to_iso6393.xml</silToISO639CodesUrl>
    155    
    156     <reverseProxyPrefix></reverseProxyPrefix>
    157    
    158     <FederatedContentSearchUrl>http://weblicht.sfs.uni-tuebingen.de/Aggregator/</FederatedContentSearchUrl>
    159    
    160     <cqlEndpointFilter>http://cqlservlet.mpi.nl/</cqlEndpointFilter>
    161    
    162     <cqlEndpointAlternative>http://cqlservlet.mpi.nl/</cqlEndpointAlternative>
    163    
    164     <!-- makes the score for the result ranking visible in the search results -->
    165     <showResultScores>true</showResultScores>
    166 </VloConfig>
     19</dataRoots>
  • vlo/trunk/vlo-commons/src/test/java/eu/clarin/cmdi/vlo/config/DefaultVloConfigFactoryTest.java

    r6284 r6409  
    44import java.util.Arrays;
    55import java.util.List;
     6import java.util.Properties;
    67import java.util.Set;
    78import static org.hamcrest.CoreMatchers.hasItems;
     
    2021
    2122    private VloConfig config;
     23    private Properties testProps;
    2224
    2325    @Before
    2426    public void setUp() throws Exception {
    2527        config = new DefaultVloConfigFactory().newConfig();
     28        testProps = new Properties();
     29        testProps.load(getClass().getResourceAsStream("/vloconfig.properties"));
    2630    }
    2731
     
    3438    @Test
    3539    public void testGetDataRoots() {
    36 
    37         List<DataRoot> dataRoots = Arrays.asList(
    38                 new DataRoot("CLARIN Centres",
    39                         new File("/lat/apache/htdocs/oai-harvester/clarin/results/cmdi/"),
    40                         "http://catalog.clarin.eu/",
    41                         "/lat/apache/htdocs/", false),
    42                 new DataRoot("Other",
    43                         new File("/lat/apache/htdocs/oai-harvester/others/results/cmdi"),
    44                         "http://catalog.clarin.eu/",
    45                         "/lat/apache/htdocs/", false));
    46 
    47         List<DataRoot> rootsReturned = config.getDataRoots();
    48         assertArrayEquals(dataRoots.toArray(), rootsReturned.toArray());
     40        final List<DataRoot> rootsReturned = config.getDataRoots();
     41
     42        assertNotNull(rootsReturned);
     43        assertTrue("One or more data roots should be defined", rootsReturned.size() > 0);
     44        assertNotNull(rootsReturned.get(0).getOriginName());
     45        assertTrue("Origin name cannot be empty", rootsReturned.get(0).getOriginName().length() > 0);
     46        assertNotNull(rootsReturned.get(0).getPrefix());
     47        assertTrue("Prefix cannot be empty", rootsReturned.get(0).getPrefix().length() > 0);
     48        assertNotNull(rootsReturned.get(0).getRootFile());
     49        assertTrue("Root file cannot be empty", rootsReturned.get(0).getRootFile().getName().length() > 0);
     50        assertNotNull(rootsReturned.get(0).getToStrip());
    4951    }
    5052
     
    272274        System.out.println("deleteAllFirst");
    273275
    274         boolean expResult = true;
     276        boolean expResult = Boolean.valueOf(testProps.getProperty("deleteAllFirst"));
    275277        boolean result = config.getDeleteAllFirst();
    276278
     
    333335        System.out.println("getVloHomeLink");
    334336
    335         String expResult = "http://www.clarin.eu/vlo";
     337        String expResult = testProps.getProperty("homeUrl");
    336338        String result = config.getHomeUrl();
    337339
     
    364366        System.out.println("getHelpUrl");
    365367
    366         String expResult = "http://www.clarin.eu/vlo";
     368        String expResult = testProps.getProperty("helpUrl");
    367369        String result = config.getHelpUrl();
    368370
     
    395397        System.out.println("getSolrUrl");
    396398
    397         String expResult = "http://localhost:8080/vlo-solr/core0/";
     399        String expResult = testProps.getProperty("solrUrl");
    398400        String result = config.getSolrUrl();
    399401
  • vlo/trunk/vlo-commons/src/test/java/eu/clarin/cmdi/vlo/config/VloConfigMarshallerTest.java

    r6087 r6409  
    2121import java.io.StringWriter;
    2222import java.util.Arrays;
     23import java.util.Properties;
    2324import javax.xml.transform.stream.StreamResult;
    2425import javax.xml.transform.stream.StreamSource;
     
    3132
    3233/**
    33  * 
     34 *
    3435 * @author twagoo
    3536 */
    3637public class VloConfigMarshallerTest {
    3738   
     39    private final static String VLO_CONFIG_FILE = "/VloConfig.xml";
    3840    private final static Logger logger = LoggerFactory.getLogger(VloConfigMarshallerTest.class);
    3941    private VloConfigMarshaller instance;
     42    private Properties testProps;
    4043   
    4144    @Before
    4245    public void setUp() throws Exception {
    4346        instance = new VloConfigMarshaller();
     47        testProps = new Properties();
     48        testProps.load(getClass().getResourceAsStream("/vloconfig.properties"));
    4449    }
    4550
     
    4954    @Test
    5055    public void testUnmarshal() throws Exception {
    51         InputStream configFile = getClass().getResourceAsStream("/VloConfig.xml");
    52         VloConfig config = instance.unmarshal(new StreamSource(configFile));
     56        InputStream configFile = getClass().getResourceAsStream(VLO_CONFIG_FILE);
     57        VloConfig config = instance.unmarshal(new StreamSource(configFile, getClass().getResource(VLO_CONFIG_FILE).toString()));
    5358        configFile.close();
    5459       
    5560        assertNotNull(config);
    56         assertEquals("http://localhost:8080/vlo-solr/core0/", config.getSolrUrl());
    57         assertEquals(2, config.getDataRoots().size());
     61        assertEquals(testProps.getProperty("solrUrl"), config.getSolrUrl());
    5862        assertEquals(14, config.getFacetFields().size());
    5963    }
  • vlo/trunk/vlo-distribution/src/main/assembly/installPackageBuilder.xml

    r6294 r6409  
    9999        <!-- config -->
    100100        <fileSet>
    101             <directory>${project.parent.basedir}/vlo-commons/src/main/resources</directory>
     101            <directory>${project.parent.basedir}/vlo-commons/target/classes</directory>
    102102            <includes>
    103103                <include>VloConfig.xml</include>
    104                  <include>facetConcepts.xml</include>
     104                <include>facetConcepts.xml</include>
     105                <include>dataroots*.xml</include>
    105106            </includes>
    106107            <outputDirectory>config</outputDirectory>
Note: See TracChangeset for help on using the changeset viewer.