Changeset 6409
- Timestamp:
- 07/23/15 12:59:01 (9 years ago)
- Location:
- vlo/trunk
- Files:
-
- 1 added
- 7 edited
- 3 copied
Legend:
- Unmodified
- Added
- Removed
-
vlo/trunk/vlo-commons/pom.xml
r6408 r6409 30 30 </resource> 31 31 </resources> 32 <testResources> 33 <testResource> 34 <directory>src/test/resources</directory> 35 <filtering>true</filtering> 36 </testResource> 37 </testResources> 32 38 </build> 33 39 … … 42 48 <properties> 43 49 <vloconfig.solrUrl>http://localhost:8080/vlo-solr/core0/</vloconfig.solrUrl> 44 < !--TODO: xinclude dataroots -->50 <vloconfig.dataRootsFile>dataroots-local.xml</vloconfig.dataRootsFile> 45 51 </properties> 46 52 </profile> … … 54 60 <vloconfig.solrUrl>http://localhost:8080/solr/core0/</vloconfig.solrUrl> 55 61 <vloconfig.homeUrl>http://vlo.clarin.eu</vloconfig.homeUrl> 56 < !--TODO: xinclude dataroots -->62 <vloconfig.dataRootsFile>dataroots-production.xml</vloconfig.dataRootsFile> 57 63 </properties> 58 64 </profile> … … 63 69 <properties> 64 70 <vloconfig.solrUrl>http://localhost:8080/vlo-solr/core0/</vloconfig.solrUrl> 65 < !--TODO: xinclude dataroots -->71 <vloconfig.dataRootsFile>dataroots-testvm.xml</vloconfig.dataRootsFile> 66 72 </properties> 67 73 </profile> … … 73 79 <vloconfig.solrUrl><!-- TODO!!! --></vloconfig.solrUrl> 74 80 <vloconfig.homeUrl>http://beta.vlo.clarin.eu</vloconfig.homeUrl> 75 < !--TODO: xinclude dataroots -->81 <vloconfig.dataRootsFile>dataroots-production.xml</vloconfig.dataRootsFile> 76 82 </properties> 77 83 </profile> -
vlo/trunk/vlo-commons/src/main/java/eu/clarin/cmdi/vlo/config/AbstractXmlVloConfigFactory.java
r6203 r6409 42 42 final InputStream fileStream = getXmlConfigurationInputStream(); 43 43 try { 44 final VloConfig config = marshaller.unmarshal(new StreamSource(fileStream ));44 final VloConfig config = marshaller.unmarshal(new StreamSource(fileStream, getLocation().toString())); 45 45 config.setConfigLocation(getLocation()); 46 46 return config; … … 59 59 */ 60 60 protected abstract InputStream getXmlConfigurationInputStream() throws IOException; 61 61 62 62 protected abstract URI getLocation(); 63 63 -
vlo/trunk/vlo-commons/src/main/java/eu/clarin/cmdi/vlo/config/VloConfigMarshaller.java
r4517 r6409 21 21 import javax.xml.bind.Marshaller; 22 22 import javax.xml.bind.Unmarshaller; 23 import javax.xml.parsers.ParserConfigurationException; 24 import javax.xml.parsers.SAXParserFactory; 23 25 import javax.xml.transform.Result; 24 26 import javax.xml.transform.Source; 27 import javax.xml.transform.sax.SAXSource; 25 28 import javax.xml.transform.stream.StreamResult; 29 import org.xml.sax.InputSource; 30 import org.xml.sax.SAXException; 31 import org.xml.sax.XMLReader; 26 32 27 33 /** … … 60 66 */ 61 67 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 } 64 87 } 65 88 -
vlo/trunk/vlo-commons/src/main/resources/VloConfig.xml
r6408 r6409 11 11 <helpUrl>${vloconfig.helpUrl}</helpUrl> 12 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> 13 <xi:include href="${vloconfig.dataRootsFile}" xmlns:xi="http://www.w3.org/2001/XInclude"></xi:include> 30 14 31 15 <!-- 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> 21 9 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> 2 10 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> 4 18 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 4 4 import java.util.Arrays; 5 5 import java.util.List; 6 import java.util.Properties; 6 7 import java.util.Set; 7 8 import static org.hamcrest.CoreMatchers.hasItems; … … 20 21 21 22 private VloConfig config; 23 private Properties testProps; 22 24 23 25 @Before 24 26 public void setUp() throws Exception { 25 27 config = new DefaultVloConfigFactory().newConfig(); 28 testProps = new Properties(); 29 testProps.load(getClass().getResourceAsStream("/vloconfig.properties")); 26 30 } 27 31 … … 34 38 @Test 35 39 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()); 49 51 } 50 52 … … 272 274 System.out.println("deleteAllFirst"); 273 275 274 boolean expResult = true;276 boolean expResult = Boolean.valueOf(testProps.getProperty("deleteAllFirst")); 275 277 boolean result = config.getDeleteAllFirst(); 276 278 … … 333 335 System.out.println("getVloHomeLink"); 334 336 335 String expResult = "http://www.clarin.eu/vlo";337 String expResult = testProps.getProperty("homeUrl"); 336 338 String result = config.getHomeUrl(); 337 339 … … 364 366 System.out.println("getHelpUrl"); 365 367 366 String expResult = "http://www.clarin.eu/vlo";368 String expResult = testProps.getProperty("helpUrl"); 367 369 String result = config.getHelpUrl(); 368 370 … … 395 397 System.out.println("getSolrUrl"); 396 398 397 String expResult = "http://localhost:8080/vlo-solr/core0/";399 String expResult = testProps.getProperty("solrUrl"); 398 400 String result = config.getSolrUrl(); 399 401 -
vlo/trunk/vlo-commons/src/test/java/eu/clarin/cmdi/vlo/config/VloConfigMarshallerTest.java
r6087 r6409 21 21 import java.io.StringWriter; 22 22 import java.util.Arrays; 23 import java.util.Properties; 23 24 import javax.xml.transform.stream.StreamResult; 24 25 import javax.xml.transform.stream.StreamSource; … … 31 32 32 33 /** 33 * 34 * 34 35 * @author twagoo 35 36 */ 36 37 public class VloConfigMarshallerTest { 37 38 39 private final static String VLO_CONFIG_FILE = "/VloConfig.xml"; 38 40 private final static Logger logger = LoggerFactory.getLogger(VloConfigMarshallerTest.class); 39 41 private VloConfigMarshaller instance; 42 private Properties testProps; 40 43 41 44 @Before 42 45 public void setUp() throws Exception { 43 46 instance = new VloConfigMarshaller(); 47 testProps = new Properties(); 48 testProps.load(getClass().getResourceAsStream("/vloconfig.properties")); 44 49 } 45 50 … … 49 54 @Test 50 55 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())); 53 58 configFile.close(); 54 59 55 60 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()); 58 62 assertEquals(14, config.getFacetFields().size()); 59 63 } -
vlo/trunk/vlo-distribution/src/main/assembly/installPackageBuilder.xml
r6294 r6409 99 99 <!-- config --> 100 100 <fileSet> 101 <directory>${project.parent.basedir}/vlo-commons/ src/main/resources</directory>101 <directory>${project.parent.basedir}/vlo-commons/target/classes</directory> 102 102 <includes> 103 103 <include>VloConfig.xml</include> 104 <include>facetConcepts.xml</include> 104 <include>facetConcepts.xml</include> 105 <include>dataroots*.xml</include> 105 106 </includes> 106 107 <outputDirectory>config</outputDirectory>
Note: See TracChangeset
for help on using the changeset viewer.