Changeset 6657
- Timestamp:
- 10/09/15 13:53:06 (9 years ago)
- Location:
- vlo/trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
vlo/trunk
- Property svn:mergeinfo changed
/vlo/branches/vlo-3.3 (added) merged: 6438,6440,6442,6463,6467,6473,6475,6482,6484,6489,6606,6608,6611
- Property svn:mergeinfo changed
-
vlo/trunk/UPGRADE.txt
- Property svn:mergeinfo changed
/vlo/branches/vlo-3.3/UPGRADE.txt (added) merged: 6611
r6410 r6657 35 35 prepared for deployment environments at build time, so it is no longer necessary 36 36 to copy over old configuration values in all cases. 37 38 * Decide whether hierarchies should be indexed and displayed, and set the new 39 'processHierarchies' configuration element accordingly (true/false). This 40 governs the behaviour of both the importer (will simply skip the 'update 41 hierarchies' step if set to false) and the front end (will not display hierarchy 42 related UI components). 37 43 38 44 * In the context fragment for the VLO web application, ADD the following - Property svn:mergeinfo changed
-
vlo/trunk/vlo-commons/src/main/java/eu/clarin/cmdi/vlo/LanguageCodeUtils.java
r6288 r6657 151 151 } catch (Exception e) { 152 152 if (CommonUtils.SWALLOW_LOOKUP_ERRORS) { 153 LOG.warn("Ignoring exception", e); 153 154 return new HashMap<String, String>(); 154 155 } else { 155 throw new RuntimeException("Cannot instantiate postProcessor :", e);156 throw new RuntimeException("Cannot instantiate postProcessor. URL: " + url, e); 156 157 } 157 158 } … … 165 166 } catch (Exception e) { 166 167 if (CommonUtils.SWALLOW_LOOKUP_ERRORS) { 168 LOG.warn("Ignoring exception", e); 167 169 return new HashMap<String, String>(); 168 170 } else { 169 throw new RuntimeException("Cannot instantiate postProcessor :", e);171 throw new RuntimeException("Cannot instantiate postProcessor. URL: " + url, e); 170 172 } 171 173 } … … 174 176 private Map<String, String> createSilToIsoCodeMap() { 175 177 LOG.debug("Creating silToIso code map."); 178 final String urlString = config.getSilToISO639CodesUrl(); 176 179 try { 177 180 Map<String, String> result = new ConcurrentHashMap<String, String>(); 178 181 DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance(); 179 182 domFactory.setNamespaceAware(true); 180 URL url = new URL( config.getSilToISO639CodesUrl());183 URL url = new URL(urlString); 181 184 DocumentBuilder builder = domFactory.newDocumentBuilder(); 182 185 Document doc = builder.parse(url.openStream()); … … 192 195 } catch (Exception e) { 193 196 if (CommonUtils.SWALLOW_LOOKUP_ERRORS) { 197 LOG.warn("Ignoring exception", e); 194 198 return new HashMap<String, String>(); 195 199 } else { 196 throw new RuntimeException("Cannot instantiate postProcessor :", e);200 throw new RuntimeException("Cannot instantiate postProcessor. URL: " + urlString, e); 197 201 } 198 202 } -
vlo/trunk/vlo-commons/src/main/java/eu/clarin/cmdi/vlo/config/VloConfig.java
r6232 r6657 109 109 private boolean showResultScores = false; 110 110 111 private boolean processHierarchies = false; 112 111 113 /** 112 114 * A set of fields to be excluded from display<br><br> … … 1097 1099 return showResultScores; 1098 1100 } 1101 1102 /** 1103 * Get the value of processHierarchies 1104 * 1105 * @return the value of processHierarchies 1106 */ 1107 public boolean isProcessHierarchies() { 1108 return processHierarchies; 1109 } 1110 1111 /** 1112 * Set the value of processHierarchies 1113 * 1114 * @param processHierarchies new value of processHierarchies 1115 */ 1116 public void setProcessHierarchies(boolean processHierarchies) { 1117 this.processHierarchies = processHierarchies; 1118 } 1099 1119 } -
vlo/trunk/vlo-commons/src/main/resources/VloConfig.xml
r6483 r6657 146 146 <!-- makes the score for the result ranking visible in the search results --> 147 147 <showResultScores>false</showResultScores> 148 149 <processHierarchies>false</processHierarchies> 148 150 </VloConfig> -
vlo/trunk/vlo-importer/src/main/java/eu/clarin/cmdi/vlo/importer/MetadataImporter.java
r6356 r6657 166 166 } 167 167 solrServer.commit(); 168 updateDocumentHierarchy(); 168 if(config.isProcessHierarchies()){ 169 updateDocumentHierarchy(); 170 } 169 171 } 170 172 LOG.info("End of processing: " + dataRoot.getOriginName()); -
vlo/trunk/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/pages/RecordPage.java
r6437 r6657 20 20 import eu.clarin.cmdi.vlo.FacetConstants; 21 21 import eu.clarin.cmdi.vlo.VloWebAppParameters; 22 import eu.clarin.cmdi.vlo.config.VloConfig; 22 23 import eu.clarin.cmdi.vlo.pojo.QueryFacetsSelection; 23 24 import eu.clarin.cmdi.vlo.pojo.SearchContext; … … 86 87 @SpringBean(name = "documentFieldOrder") 87 88 private List<String> fieldOrder; 89 @SpringBean 90 private VloConfig config; 88 91 89 92 private final IModel<SearchContext> navigationModel; … … 153 156 add(createTechnicalDetailsPanel("technicalProperties")); 154 157 155 add(createHierarchyPanel("recordtree")); 158 if (config.isProcessHierarchies()) { 159 // show hierarchy if applicable 160 add(createHierarchyPanel("recordtree")); 161 } else { 162 // invisible stub 163 add(new WebMarkupContainer("recordtree") { 164 165 @Override 166 public boolean isVisible() { 167 return false; 168 } 169 170 }); 171 } 156 172 157 173 createSearchLinks("searchlinks"); -
vlo/trunk/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/search/AdvancedSearchOptionsPanel.html
r6315 r6657 31 31 <label for="onlyfcs">Only include resources that support content search</label> 32 32 </li> 33 <li >33 <li wicket:id="collectionsSection"> 34 34 <input wicket:id="collection" type="checkbox" id="onlycollections"/> 35 35 <label for="onlycollections">Only include collection resources</label> -
vlo/trunk/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/search/AdvancedSearchOptionsPanel.java
r6315 r6657 19 19 import com.google.common.collect.ImmutableSet; 20 20 import eu.clarin.cmdi.vlo.FacetConstants; 21 import eu.clarin.cmdi.vlo.config.VloConfig; 21 22 import eu.clarin.cmdi.vlo.pojo.ExpansionState; 22 23 import eu.clarin.cmdi.vlo.pojo.FacetSelection; … … 27 28 import eu.clarin.cmdi.vlo.wicket.panels.ExpandablePanel; 28 29 import java.util.Collection; 30 import org.apache.wicket.MarkupContainer; 29 31 import org.apache.wicket.ajax.AjaxRequestTarget; 30 32 import org.apache.wicket.ajax.form.OnChangeAjaxBehavior; 33 import org.apache.wicket.markup.html.WebMarkupContainer; 31 34 import org.apache.wicket.markup.html.basic.Label; 32 35 import org.apache.wicket.markup.html.form.CheckBox; 33 36 import org.apache.wicket.markup.html.form.Form; 34 37 import org.apache.wicket.model.IModel; 38 import org.apache.wicket.spring.injection.annot.SpringBean; 35 39 36 40 /** … … 45 49 public abstract class AdvancedSearchOptionsPanel extends ExpandablePanel<QueryFacetsSelection> { 46 50 51 @SpringBean 52 private VloConfig config; 53 47 54 /** 48 55 * The fields that this panel provides options for … … 58 65 final CheckBox fcsCheck = createFieldNotEmptyOption("fcs", FacetConstants.FIELD_SEARCH_SERVICE); 59 66 options.add(fcsCheck); 67 68 final MarkupContainer collectionsSection = new WebMarkupContainer("collectionsSection"); 60 69 final CheckBox collectionCheck = createFieldNotEmptyOption("collection", FacetConstants.FIELD_HAS_PART_COUNT); 61 options.add(collectionCheck); 70 collectionsSection.add(collectionCheck); 71 collectionsSection.setVisible(config.isProcessHierarchies()); 72 options.add(collectionsSection); 73 62 74 add(options); 63 75 }
Note: See TracChangeset
for help on using the changeset viewer.