Changeset 2828
- Timestamp:
- 04/23/13 13:56:54 (11 years ago)
- Location:
- vlo/trunk/vlo_importer/src/main/java/eu/clarin/cmdi/vlo
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
vlo/trunk/vlo_importer/src/main/java/eu/clarin/cmdi/vlo/FacetConstants.java
r2824 r2828 4 4 5 5 /** 6 * A bunch of important constants. 7 * Constants for each facet, resource types and some urls. 6 * Definition of facet, resource type and URL constants. 8 7 */ 9 8 public class FacetConstants { … … 33 32 public static final String FIELD_CLARIN_PROFILE = "_componentProfile"; 34 33 public static final String FIELD_SEARCH_SERVICE = "_contentSearchRef"; 34 35 /** Facet constant associated with the landing page type. */ 35 36 public static final String FIELD_LANDINGPAGE = "_landingPageRef"; 37 /** Facet constant associated with the search page type. */ 38 public static final String FIELD_SEARCHPAGE = "_searchPageRef"; 36 39 37 40 // PREFIX URL for the language-link … … 50 53 public static final String FIELD_RESOURCE_SPLIT_CHAR = "|"; 51 54 public static final String URN_NBN_PREFIX = "urn:nbn"; 52 53 55 } -
vlo/trunk/vlo_importer/src/main/java/eu/clarin/cmdi/vlo/Resources.java
r2787 r2828 1 1 2 package eu.clarin.cmdi.vlo; 2 3 3 4 /** 4 * Definition of keys to message texts. <br><br>5 * Definition of keys to message texts. 5 6 * 6 7 * Please note that value of a key defined in this class is defined in the … … 8 9 * pages that are subject to Wicket, for example:<br><br> 9 10 * 10 * {@literal <div class="resourceList"><span>} 11 * {@literal <wicket:message key="resources">[Resources]</wicket:message>:</span>} 12 * . 13 * . 14 * . 11 * {@literal <div class="resourceList"><span>}<br> 12 * .<br> 13 * .<br> 14 * {@literal <wicket:message key="resources">}<br> 15 * {@literal [Resources]}<br> 16 * {@literal </wicket:message>:</span>}<br> 17 * .<br> 18 * .<br> 15 19 * {@literal </div>} 16 20 */ … … 25 29 public static final String OPEN_IN_ORIGINAL_CONTEXT = "openInOriginalContext"; 26 30 public static final String ORIGINAL_CONTEXT_NOT_AVAILABLE = "originalContextNotAvailable"; 27 28 / / keys to text used in labels in the page showing search result31 32 /** Key to a text on the result page labeling a single landing page. */ 29 33 public static final String LANDING_PAGE = "landingPage"; 34 /** Key to a text on the result page labeling s list of landing pages. */ 30 35 public static final String LANDING_PAGES = "landingPages"; 36 /** Key to a text on the result page labeling a single search page. */ 37 public static final String SEARCH_PAGE = "searchPage"; 38 /** Key to a text on the result page labeling a list of search pages.*/ 39 public static final String SEARCH_PAGES = "searchPages"; 31 40 } -
vlo/trunk/vlo_importer/src/main/java/eu/clarin/cmdi/vlo/importer/CMDIData.java
r2774 r2828 10 10 11 11 /** 12 * Represents a document of cmdi data. 13 * Quite a central class to the metadata importer process. 12 * Represents a document of CMDI data. 14 13 */ 15 16 14 public class CMDIData { 17 15 private final static Logger LOG = LoggerFactory.getLogger(CMDIData.class); … … 19 17 private static final String DATA_RESOURCE_TYPE = "Resource"; 20 18 private static final String SEARCH_SERVICE_TYPE = "SearchService"; 19 //* Definition of the string denoting the landing page type. */ 21 20 private static final String LANDING_PAGE_TYPE = "LandingPage"; 21 //* Definition of the string denoting the search page type. */ 22 private static final String SEARCH_PAGE_TYPE = "SearchPage"; 22 23 23 24 /** … … 36 37 private final List<Resource> searchResources = new ArrayList<Resource>(); 37 38 private final List<Resource> landingPageResources = new ArrayList<Resource>(); 39 private final List<Resource> searchPageResources = new ArrayList<Resource>(); 38 40 39 41 public SolrInputDocument getSolrDocument() { … … 94 96 95 97 /** 96 * Return a list of landing page resources 98 * Return the list of landing page resources. 99 * 100 * @return the list 97 101 */ 98 102 public List<Resource> getLandingPageResources() { 99 103 return landingPageResources; 100 104 } 105 106 /** 107 * Return the list of search page resources. 108 * 109 * @return the list 110 */ 111 public List<Resource> getSearchPageResources() { 112 return searchPageResources; 113 } 101 114 102 115 /** 103 * Processes a resource by adding it to the internal lists. Supports meta104 * data, data, search service and landing page type of resources. Emits a105 * warning if another type of resource is encountered (not allowed according106 * to the cmdi spec, but we try to be a tad robust).116 * Add a meta data resource to the list of resources of that type. 117 * 118 * Whenever the type is not one of a type supported by the CMDI 119 * specification, a warning is logged. 107 120 * 108 * @param resource 109 * @param type 110 * @param mimeType 121 * @param resource meta data resource 122 * @param type type of the resource 123 * @param mimeType mime type associated with the resource 111 124 */ 112 125 public void addResource(String resource, String type, String mimeType) { … … 119 132 } else if (LANDING_PAGE_TYPE.equals(type)){ 120 133 landingPageResources.add(new Resource(resource,type, mimeType)); 134 } else if (SEARCH_PAGE_TYPE.equals(type)){ 135 searchPageResources.add(new Resource(resource,type, mimeType)); 121 136 } else { 122 LOG.warn(" Found unsupported resource it will be ignored: type=" +137 LOG.warn("Ignoring unsupported resource type " + 123 138 type + ", name=" + resource); 124 139 } -
vlo/trunk/vlo_importer/src/main/java/eu/clarin/cmdi/vlo/importer/MetadataImporter.java
r2826 r2828 310 310 } 311 311 312 // add search page resource 313 for (Resource resource : cmdiData.getSearchPageResources()) { 314 solrDocument.addField(FacetConstants.FIELD_SEARCHPAGE, resource.getResourceName()); 315 } 316 312 317 addResourceData(solrDocument, cmdiData); 313 318 docs.add(solrDocument);
Note: See TracChangeset
for help on using the changeset viewer.