Changeset 6288
- Timestamp:
- 06/12/15 07:45:47 (9 years ago)
- Location:
- vlo/trunk/vlo-commons/src/main/java/eu/clarin/cmdi/vlo
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
vlo/trunk/vlo-commons/src/main/java/eu/clarin/cmdi/vlo/CommonUtils.java
r5153 r6288 21 21 public final class CommonUtils { 22 22 23 /** 24 * Set to true to make run/import possible without a network connection 25 * (todo: make environment variable?) 26 */ 27 public static final Boolean SWALLOW_LOOKUP_ERRORS = false; //ONLY COMMIT AS FALSE! 28 23 29 private final static Set<String> ANNOTATION_MIMETYPES = new HashSet<String>(); 30 24 31 static { 25 32 ANNOTATION_MIMETYPES.add("text/x-eaf+xml"); … … 33 40 } 34 41 private final static Set<String> TEXT_MIMETYPES = new HashSet<String>(); 42 35 43 static { 36 44 TEXT_MIMETYPES.add("application/pdf"); … … 38 46 } 39 47 private final static Set<String> VIDEO_MIMETYPES = new HashSet<String>(); 48 40 49 static { 41 50 VIDEO_MIMETYPES.add("application/mxf"); 42 51 } 43 52 private final static Set<String> AUDIO_MIMETYPES = new HashSet<String>(); 53 44 54 static { 45 55 AUDIO_MIMETYPES.add("application/ogg"); … … 75 85 76 86 /** 77 * Create a mapping out of simple CMDI components for instance: lists of items: <item AppInfo="Tigrinya (ti)">ti</item> Will become key (after removal of trailing 2 or 3 letter codes), 78 * values: ti, Tigrinya 87 * Create a mapping out of simple CMDI components for instance: lists of 88 * items: <item AppInfo="Tigrinya (ti)">ti</item> Will become key (after 89 * removal of trailing 2 or 3 letter codes), values: ti, Tigrinya 90 * 79 91 * @param urlToComponent 80 92 * @return Map with item_value, AppInfo_value pairs … … 102 114 return result; 103 115 } 104 116 105 117 /** 106 * Create a mapping out of simple CMDI components for instance: lists of items: <item AppInfo="Tigrinya">ti</item> Will become key (after removal of trailing 2 or 3 letter codes), 107 * values: Tigrinya, ti 118 * Create a mapping out of simple CMDI components for instance: lists of 119 * items: <item AppInfo="Tigrinya">ti</item> Will become key (after removal 120 * of trailing 2 or 3 letter codes), values: Tigrinya, ti 121 * 108 122 * @param urlToComponent 109 123 * @return Map with item_value, AppInfo_value pairs -
vlo/trunk/vlo-commons/src/main/java/eu/clarin/cmdi/vlo/FacetConstants.java
r6232 r6288 39 39 public static final String FIELD_FILENAME = "_fileName"; 40 40 public static final String FIELD_RESOURCE = "_resourceRef"; 41 public static final String FIELD_RESOURCE_COUNT = "_resourceRefCount"; 41 42 public static final String FIELD_CLARIN_PROFILE = "_componentProfile"; 42 43 public static final String FIELD_SEARCH_SERVICE = "_contentSearchRef"; … … 45 46 public static final String FIELD_IS_PART_OF = "_isPartOf"; 46 47 public static final String FIELD_HAS_PART = "_hasPart"; 48 public static final String FIELD_HAS_PART_COUNT = "_hasPartCount"; 47 49 48 50 /** -
vlo/trunk/vlo-commons/src/main/java/eu/clarin/cmdi/vlo/LanguageCodeUtils.java
r6036 r6288 19 19 import eu.clarin.cmdi.vlo.config.VloConfig; 20 20 import java.net.URL; 21 import java.util.HashMap; 21 22 import java.util.Map; 22 23 import java.util.concurrent.ConcurrentHashMap; … … 149 150 return result; 150 151 } catch (Exception e) { 151 throw new RuntimeException("Cannot instantiate postProcessor:", e); 152 if (CommonUtils.SWALLOW_LOOKUP_ERRORS) { 153 return new HashMap<String, String>(); 154 } else { 155 throw new RuntimeException("Cannot instantiate postProcessor:", e); 156 } 152 157 } 153 158 } … … 159 164 return result; 160 165 } catch (Exception e) { 161 throw new RuntimeException("Cannot instantiate postProcessor:", e); 166 if (CommonUtils.SWALLOW_LOOKUP_ERRORS) { 167 return new HashMap<String, String>(); 168 } else { 169 throw new RuntimeException("Cannot instantiate postProcessor:", e); 170 } 162 171 } 163 172 } … … 182 191 return result; 183 192 } catch (Exception e) { 184 throw new RuntimeException("Cannot instantiate postProcessor:", e); 193 if (CommonUtils.SWALLOW_LOOKUP_ERRORS) { 194 return new HashMap<String, String>(); 195 } else { 196 throw new RuntimeException("Cannot instantiate postProcessor:", e); 197 } 185 198 } 186 199 }
Note: See TracChangeset
for help on using the changeset viewer.