Mercurial > hg > ismi-richfaces
annotate src/main/java/de/mpiwg/itgroup/ismi/browse/AbstractEntityRepositoryBean.java @ 103:03dcbaf8b8cf
add download-as-csv button to browse repository.
| author | casties |
|---|---|
| date | Thu, 03 Nov 2016 20:10:58 +0100 |
| parents | 0d5d36c83e77 |
| children | 42d0169904f3 |
| rev | line source |
|---|---|
| 1 | 1 package de.mpiwg.itgroup.ismi.browse; |
| 2 | |
| 3 import java.util.ArrayList; | |
| 4 import java.util.Collections; | |
| 5 import java.util.HashMap; | |
| 6 import java.util.List; | |
| 7 import java.util.Map; | |
| 8 | |
| 9 import javax.faces.event.ActionEvent; | |
| 10 import javax.faces.event.ValueChangeEvent; | |
| 11 import javax.faces.model.SelectItem; | |
| 12 | |
| 13 import org.apache.commons.lang.StringUtils; | |
| 14 import org.apache.log4j.Logger; | |
| 15 import org.mpi.openmind.repository.bo.Attribute; | |
| 16 import org.mpi.openmind.repository.bo.Entity; | |
| 17 import org.mpi.openmind.repository.services.utils.AttributeFilter; | |
| 18 | |
| 19 import de.mpiwg.itgroup.ismi.util.guiComponents.DataPaginator; | |
| 20 | |
| 21 public class AbstractEntityRepositoryBean extends AbstractBrowse { | |
| 22 | |
| 23 private static final long serialVersionUID = 3154642100627969159L; | |
| 24 | |
| 25 private static Logger logger = Logger.getLogger(AbstractEntityRepositoryBean.class); | |
| 26 | |
| 27 public static String MODE_ADVANCED = "advanced"; | |
| 28 public static String MODE_ALL = "all"; | |
| 29 public static String MODE_NONE = "none"; | |
| 30 | |
| 31 | |
| 32 private String objectClass = null; | |
| 33 private List<Entity> entities = new ArrayList<Entity>(); | |
| 34 private List<Entity> currentEntities = new ArrayList<Entity>(); | |
| 35 | |
| 36 private List<SelectItem> definitions = new ArrayList<SelectItem>(); | |
| 37 | |
| 38 private transient DataPaginator advancedPaginator = new DataPaginator(); | |
| 39 | |
| 40 private String ocTerm; | |
| 41 private String currentTab; | |
| 42 | |
| 43 private String textFullTitle; | |
| 44 private String textFullTitleTranslit; | |
| 45 private String textShortTitle; | |
| 46 | |
| 47 private String personName; | |
| 48 private String personNameTranslit; | |
| 49 | |
| 50 private String codexIdentifier; | |
| 51 | |
| 52 private String collectionName; | |
| 53 | |
| 54 private String placeName; | |
| 55 | |
| 56 private String aliasAlias; | |
| 57 | |
| 58 private String repositoryName; | |
| 59 | |
| 60 private String witnessFullTitle; | |
| 61 private String witnessFullTitleTranslit; | |
| 62 private String witnessAhlwardtNo; | |
| 63 | |
| 64 private boolean advancedSearch = false; | |
| 65 private String resultMode = MODE_NONE; | |
| 66 private String resultSummaryMsg; | |
| 67 | |
| 68 private String subjectType; | |
| 69 private List<SelectItem> suggestedSubjectTypes = new ArrayList<SelectItem>(); | |
|
81
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
70 |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
71 private String referenceBibIdNo; |
| 1 | 72 |
| 73 private String page; | |
| 74 private String pageMsg; | |
| 75 | |
| 76 public static String main_subject = "main_subject"; | |
| 77 public static String sub_subject = "sub_subject"; | |
| 78 | |
| 79 public AbstractEntityRepositoryBean(){ | |
| 80 suggestedSubjectTypes.add(new SelectItem(null, "-- choose --")); | |
| 81 suggestedSubjectTypes.add(new SelectItem(main_subject, main_subject)); | |
| 82 suggestedSubjectTypes.add(new SelectItem(sub_subject, sub_subject)); | |
| 83 this.updateDefinitions(getWrapper().getLWDefinitions()); | |
| 84 } | |
| 85 | |
| 103 | 86 /** |
| 87 * Put the current subset of this.entites in this.currentEntities. | |
| 88 */ | |
| 89 private void updateAdvancedEntities() { | |
| 90 if (StringUtils.isNotEmpty(getObjectClass())) { | |
| 91 this.advancedPaginator.initCount(); | |
| 92 int startRecord = this.advancedPaginator.getCurrentPage() * this.advancedPaginator.getItemsPerPage(); | |
| 93 if ((this.advancedPaginator.getCurrentPage() + 1) == this.advancedPaginator.getNumberOfPages()) { | |
| 94 int mod = this.entities.size() % advancedPaginator.getItemsPerPage(); | |
| 95 if (mod == 0) { | |
| 96 this.currentEntities = entities.subList(startRecord, | |
| 97 startRecord + this.advancedPaginator.getItemsPerPage()); | |
| 98 } else { | |
| 99 this.currentEntities = entities.subList(startRecord, startRecord + mod); | |
| 100 } | |
| 101 | |
| 102 } else { | |
| 103 this.currentEntities = entities.subList(startRecord, | |
| 104 startRecord + this.advancedPaginator.getItemsPerPage()); | |
| 105 } | |
| 106 } else { | |
| 107 // empty object_class | |
| 108 this.currentEntities = new ArrayList<Entity>(); | |
| 109 } | |
| 110 } | |
| 1 | 111 |
| 112 public String advancedFirst() { | |
| 113 this.advancedPaginator.first(); | |
| 114 this.updateAdvancedEntities(); | |
| 115 return GOTO_ENTITY_REPOSITORY; | |
| 116 } | |
| 117 | |
| 118 public String advancedLast() { | |
| 119 this.advancedPaginator.last(); | |
| 120 this.updateAdvancedEntities(); | |
| 121 return GOTO_ENTITY_REPOSITORY; | |
| 122 } | |
| 123 | |
| 124 public String advancedFastForward() { | |
| 125 this.advancedPaginator.fastForward(); | |
| 126 this.updateAdvancedEntities(); | |
| 127 return GOTO_ENTITY_REPOSITORY; | |
| 128 } | |
| 129 | |
| 130 public String advancedFastRewind() { | |
| 131 this.advancedPaginator.fastRewind(); | |
| 132 this.updateAdvancedEntities(); | |
| 133 return GOTO_ENTITY_REPOSITORY; | |
| 134 } | |
| 135 | |
| 136 public String advancedPrevious() { | |
| 137 this.advancedPaginator.previous(); | |
| 138 this.updateAdvancedEntities(); | |
| 139 return GOTO_ENTITY_REPOSITORY; | |
| 140 } | |
| 141 | |
| 142 public String advancedNext() { | |
| 143 this.advancedPaginator.next(); | |
| 144 this.updateAdvancedEntities(); | |
| 145 return GOTO_ENTITY_REPOSITORY; | |
| 146 } | |
| 147 | |
| 148 public void reset(){ | |
| 149 this.entities = new ArrayList<Entity>(); | |
| 150 this.currentEntities = new ArrayList<Entity>(); | |
| 151 this.resultSummaryMsg = new String(); | |
| 152 } | |
| 153 | |
| 154 public void actionGoToPageAdvancedResult(ActionEvent event){ | |
| 155 this.pageMsg = ""; | |
| 156 try{ | |
| 157 Integer page = new Integer(getPage()); | |
| 158 this.advancedPaginator.goToPage(page - 1); | |
| 159 this.updateAdvancedEntities(); | |
| 160 }catch(Exception e){ | |
| 161 this.pageMsg = "page is invalid!"; | |
| 162 } | |
| 163 } | |
| 164 | |
| 165 public DataPaginator getAdvancedPaginator() { | |
| 166 return advancedPaginator; | |
| 167 } | |
| 168 | |
| 169 public void setAdvancedPaginator(DataPaginator advancedPaginator) { | |
| 170 this.advancedPaginator = advancedPaginator; | |
| 171 } | |
| 172 | |
| 173 public void updateDefinitions(List<Entity> defs) { | |
| 174 this.definitions = new ArrayList<SelectItem>(); | |
| 175 SelectItem option = null; | |
| 176 for (Entity def : defs) { | |
| 177 if (def.getOwnValue() != null) { | |
| 178 option = new SelectItem(def.getOwnValue()); | |
| 179 this.definitions.add(option); | |
| 180 } | |
| 181 } | |
| 182 this.setEntities(new ArrayList<Entity>()); | |
| 183 if (defs.size() > 0) { | |
| 184 this.objectClass = defs.get(0).getOwnValue(); | |
| 185 } | |
| 186 } | |
| 187 | |
| 188 public void actionDisplayAdvancedSearch(ActionEvent event) { | |
| 189 this.advancedSearch = true; | |
| 190 } | |
| 191 | |
| 192 public void actionHideAdvancedSearch(ActionEvent event) { | |
| 193 this.advancedSearch = false; | |
| 194 } | |
| 195 | |
| 196 public void actionChangeDefinition(ValueChangeEvent event) { | |
| 197 this.objectClass = (String) event.getNewValue(); | |
| 198 } | |
| 199 | |
| 200 public void searchByOwnvalue(){ | |
| 201 this.resultMode = MODE_ADVANCED; | |
| 202 this.setPage(""); | |
| 203 this.currentEntities = new ArrayList<Entity>(); | |
| 204 this.entities = getWrapper().searchEntityByOwnValue(objectClass, ocTerm); | |
| 205 this.resultSummaryMsg = ""; | |
| 206 | |
| 207 if(this.entities.size() > 0){ | |
| 208 | |
| 209 this.advancedPaginator.setCurrentPage(0); | |
| 210 int entitiesCount = this.entities.size(); | |
| 211 this.advancedPaginator.resetNumberOfPages(entitiesCount); | |
| 212 this.updateAdvancedEntities(); | |
| 213 }else { | |
| 214 this.resultSummaryMsg = "No items were found!"; | |
| 215 } | |
| 216 } | |
| 217 | |
| 218 | |
|
81
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
219 public void searchByAttributes() throws Exception { |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
220 this.resultMode = MODE_ADVANCED; |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
221 this.setPage(""); |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
222 this.entities = new ArrayList<Entity>(); |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
223 this.currentEntities = new ArrayList<Entity>(); |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
224 |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
225 List<AttributeFilter> filterList = new ArrayList<AttributeFilter>(); |
| 1 | 226 |
|
81
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
227 this.resultSummaryMsg = ""; |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
228 Map<Entity, Attribute> resultMap = new HashMap<Entity, Attribute>(); |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
229 |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
230 /* |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
231 * create list of filters for the selected attributes |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
232 */ |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
233 if (this.objectClass.equals(TEXT)) { |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
234 if (StringUtils.isNotEmpty(textFullTitle)) { |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
235 filterList.add(new AttributeFilter("full_title", this.textFullTitle, TEXT)); |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
236 } |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
237 if (StringUtils.isNotEmpty(textFullTitleTranslit)) { |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
238 filterList.add(new AttributeFilter("full_title_translit", textFullTitleTranslit, TEXT)); |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
239 } |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
240 if (StringUtils.isNotEmpty(textShortTitle)) { |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
241 List<Entity> l = getWrapper().searchEntityByAttributeOfTarRelation(TEXT, "is_prime_alias_title_of", |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
242 ALIAS, "alias", textShortTitle, 20); |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
243 for (Entity e : l) { |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
244 this.entities.add(e); |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
245 } |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
246 } |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
247 } else if (this.objectClass.equals(WITNESS)) { |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
248 // witnessAhlwardtNo |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
249 if (StringUtils.isNotEmpty(this.witnessAhlwardtNo)) { |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
250 filterList.add(new AttributeFilter("ahlwardt_no", this.witnessAhlwardtNo, WITNESS)); |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
251 } |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
252 } else if (this.objectClass.equals(SUBJECT)) { |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
253 if (StringUtils.isNotEmpty(this.subjectType)) { |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
254 filterList.add(new AttributeFilter("type", this.subjectType, SUBJECT)); |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
255 } |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
256 } else if (this.objectClass.equals(ALIAS)) { |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
257 if (StringUtils.isNotEmpty(this.aliasAlias)) { |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
258 filterList.add(new AttributeFilter("alias", this.aliasAlias, ALIAS)); |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
259 } |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
260 } else if (this.objectClass.equals(COLLECTION)) { |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
261 if (StringUtils.isNotEmpty(this.collectionName)) { |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
262 filterList.add(new AttributeFilter("name", this.collectionName, COLLECTION)); |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
263 } |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
264 } else if (this.objectClass.equals(REPOSITORY)) { |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
265 if (StringUtils.isNotEmpty(this.repositoryName)) { |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
266 filterList.add(new AttributeFilter("name", this.repositoryName, REPOSITORY)); |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
267 } |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
268 } else if (this.objectClass.equals(PLACE)) { |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
269 if (StringUtils.isNotEmpty(this.placeName)) { |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
270 filterList.add(new AttributeFilter("name", this.placeName, PLACE)); |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
271 } |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
272 } else if (this.objectClass.equals(CODEX)) { |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
273 if (StringUtils.isNotEmpty(this.codexIdentifier)) { |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
274 filterList.add(new AttributeFilter("identifier", this.codexIdentifier, CODEX)); |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
275 } |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
276 } else if (this.objectClass.equals(REFERENCE)) { |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
277 // search "#bibIdNo\W" as regex in endnote-id attribute |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
278 if (StringUtils.isNotEmpty(this.referenceBibIdNo)) { |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
279 filterList.add(new AttributeFilter("endnote-id", "#" + this.referenceBibIdNo + "[[:>:]]", REFERENCE, true)); |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
280 } |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
281 } else if (this.objectClass.equals(PERSON)) { |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
282 if (StringUtils.isNotEmpty(this.personName)) { |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
283 filterList.add(new AttributeFilter("name", this.personName, PERSON)); |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
284 } |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
285 if (StringUtils.isNotEmpty(this.personNameTranslit)) { |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
286 filterList.add(new AttributeFilter("name_translit", this.personNameTranslit, PERSON)); |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
287 } |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
288 } |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
289 |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
290 /* |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
291 * run search and sort result (by ownvalue) |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
292 */ |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
293 if (filterList.size() > 0) { |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
294 resultMap = getWrapper().searchEntityByAttributeFilter(filterList, 500); |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
295 // pack entities (Map keys) into List |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
296 for (Entity ent : resultMap.keySet()) { |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
297 this.entities.add(ent); |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
298 } |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
299 // sort List (by ownvalue) |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
300 Collections.sort(entities); |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
301 } |
| 1 | 302 |
|
81
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
303 if (resultMap.size() > 0) { |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
304 this.resultSummaryMsg = resultMap.size() + " items were found!"; |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
305 this.advancedPaginator.setCurrentPage(0); |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
306 int entitiesCount = this.entities.size(); |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
307 this.advancedPaginator.resetNumberOfPages(entitiesCount); |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
308 this.updateAdvancedEntities(); |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
309 } else { |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
310 this.resultSummaryMsg = "No items were found!"; |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
311 } |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
312 } |
| 1 | 313 |
| 314 public boolean isRenderedSearch(){ | |
| 315 if(StringUtils.isNotEmpty(this.objectClass) && ( | |
| 316 objectClass.equals(SUBJECT) || | |
| 317 objectClass.equals(REPOSITORY) || | |
| 318 objectClass.equals(ALIAS) || | |
| 319 objectClass.equals(COLLECTION) || | |
| 320 objectClass.equals(TEXT) || | |
| 321 objectClass.equals(PERSON) || | |
| 322 objectClass.equals(CODEX) || | |
| 323 objectClass.equals(WITNESS) || | |
|
81
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
324 objectClass.equals(PLACE) || |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
325 objectClass.equals(REFERENCE))) { |
| 1 | 326 return true; |
| 327 } | |
| 328 return false; | |
| 329 } | |
| 330 | |
| 331 public String actionSearchByAttributes() { | |
| 332 try { | |
| 333 this.searchByAttributes(); | |
| 334 } catch (Exception e) { | |
| 335 printInternalError(e); | |
| 336 logger.error(e.getMessage(), e); | |
| 337 } | |
| 338 | |
| 339 return GOTO_ENTITY_REPOSITORY; | |
| 340 } | |
| 341 | |
| 342 public String actionSearchByOwnvalue(){ | |
| 343 try { | |
| 344 this.searchByOwnvalue(); | |
| 345 } catch (Exception e) { | |
| 346 printInternalError(e); | |
| 347 logger.error(e.getMessage(), e); | |
| 348 } | |
| 349 | |
| 350 return GOTO_ENTITY_REPOSITORY; | |
| 351 } | |
| 352 | |
| 353 public boolean isAdvancedSearch() { | |
| 354 return advancedSearch; | |
| 355 } | |
| 356 | |
| 357 public void setAdvancedSearch(boolean advancedSearch) { | |
| 358 this.advancedSearch = advancedSearch; | |
| 359 } | |
| 360 | |
| 361 public String getTextFullTitle() { | |
| 362 return textFullTitle; | |
| 363 } | |
| 364 | |
| 365 public void setTextFullTitle(String textFullTitle) { | |
| 366 this.textFullTitle = textFullTitle; | |
| 367 } | |
| 368 | |
| 369 public String getTextFullTitleTranslit() { | |
| 370 return textFullTitleTranslit; | |
| 371 } | |
| 372 | |
| 373 public void setTextFullTitleTranslit(String textFullTitleTranslit) { | |
| 374 this.textFullTitleTranslit = textFullTitleTranslit; | |
| 375 } | |
| 376 | |
| 377 public String getTextShortTitle() { | |
| 378 return textShortTitle; | |
| 379 } | |
| 380 | |
| 381 public void setTextShortTitle(String textShortTitle) { | |
| 382 this.textShortTitle = textShortTitle; | |
| 383 } | |
| 384 | |
| 385 public String getPersonName() { | |
| 386 return personName; | |
| 387 } | |
| 388 | |
| 389 public void setPersonName(String personName) { | |
| 390 this.personName = personName; | |
| 391 } | |
| 392 | |
| 393 public String getPersonNameTranslit() { | |
| 394 return personNameTranslit; | |
| 395 } | |
| 396 | |
| 397 public void setPersonNameTranslit(String personNameTranslit) { | |
| 398 this.personNameTranslit = personNameTranslit; | |
| 399 } | |
| 400 | |
| 401 public String getObjectClass() { | |
| 402 return objectClass; | |
| 403 } | |
| 404 | |
| 405 public void setObjectClass(String objectClass) { | |
| 406 this.objectClass = objectClass; | |
| 407 } | |
| 408 | |
| 409 public List<Entity> getEntities() { | |
| 410 return this.entities; | |
| 411 } | |
| 412 | |
| 413 public void setEntities(List<Entity> entities) { | |
| 414 this.entities = entities; | |
| 415 } | |
| 416 | |
| 417 public List<SelectItem> getDefinitions() { | |
| 418 return definitions; | |
| 419 } | |
| 420 | |
| 421 public void setDefinitions(List<SelectItem> definitions) { | |
| 422 this.definitions = definitions; | |
| 423 } | |
| 424 | |
| 425 public String getResultMode() { | |
| 426 return resultMode; | |
| 427 } | |
| 428 | |
| 429 public void setResultMode(String resultMode) { | |
| 430 this.resultMode = resultMode; | |
| 431 } | |
| 432 | |
| 433 public String getResultSummaryMsg() { | |
| 434 return resultSummaryMsg; | |
| 435 } | |
| 436 | |
| 437 public void setResultSummaryMsg(String resultSummaryMsg) { | |
| 438 this.resultSummaryMsg = resultSummaryMsg; | |
| 439 } | |
| 440 | |
| 441 public String getPage() { | |
| 442 return page; | |
| 443 } | |
| 444 | |
| 445 public void setPage(String page) { | |
| 446 this.page = page; | |
| 447 } | |
| 448 | |
| 449 public String getPageMsg() { | |
| 450 return pageMsg; | |
| 451 } | |
| 452 | |
| 453 public void setPageMsg(String pageMsg) { | |
| 454 this.pageMsg = pageMsg; | |
| 455 } | |
| 456 public String getCodexIdentifier() { | |
| 457 return codexIdentifier; | |
| 458 } | |
| 459 public void setCodexIdentifier(String codexIdentifier) { | |
| 460 this.codexIdentifier = codexIdentifier; | |
| 461 } | |
| 462 public String getPlaceName() { | |
| 463 return placeName; | |
| 464 } | |
| 465 public void setPlaceName(String placeName) { | |
| 466 this.placeName = placeName; | |
| 467 } | |
| 468 | |
| 469 public String getCollectionName() { | |
| 470 return collectionName; | |
| 471 } | |
| 472 | |
| 473 public void setCollectionName(String collectionName) { | |
| 474 this.collectionName = collectionName; | |
| 475 } | |
| 476 | |
| 477 public String getAliasAlias() { | |
| 478 return aliasAlias; | |
| 479 } | |
| 480 | |
| 481 public void setAliasAlias(String aliasAlias) { | |
| 482 this.aliasAlias = aliasAlias; | |
| 483 } | |
| 484 | |
| 485 public String getRepositoryName() { | |
| 486 return repositoryName; | |
| 487 } | |
| 488 | |
| 489 public void setRepositoryName(String repositoryName) { | |
| 490 this.repositoryName = repositoryName; | |
| 491 } | |
| 492 | |
| 493 public String getSubjectType() { | |
| 494 return subjectType; | |
| 495 } | |
| 496 | |
| 497 public void setSubjectType(String subjectType) { | |
| 498 this.subjectType = subjectType; | |
| 499 } | |
| 500 | |
| 501 public List<SelectItem> getSuggestedSubjectTypes() { | |
| 502 return suggestedSubjectTypes; | |
| 503 } | |
| 504 | |
| 505 public void setSuggestedSubjectTypes(List<SelectItem> suggestedTypes) { | |
| 506 this.suggestedSubjectTypes = suggestedTypes; | |
| 507 } | |
| 508 public List<Entity> getCurrentEntities() { | |
| 509 return currentEntities; | |
| 510 } | |
| 511 | |
| 512 public void setCurrentEntities(List<Entity> currentEntities) { | |
| 513 this.currentEntities = currentEntities; | |
| 514 } | |
| 515 | |
| 516 public String getWitnessFullTitle() { | |
| 517 return witnessFullTitle; | |
| 518 } | |
| 519 | |
| 520 public void setWitnessFullTitle(String witnessFullTitle) { | |
| 521 this.witnessFullTitle = witnessFullTitle; | |
| 522 } | |
| 523 | |
| 524 public String getWitnessFullTitleTranslit() { | |
| 525 return witnessFullTitleTranslit; | |
| 526 } | |
| 527 | |
| 528 public void setWitnessFullTitleTranslit(String witnessFullTitleTranslit) { | |
| 529 this.witnessFullTitleTranslit = witnessFullTitleTranslit; | |
| 530 } | |
| 531 | |
| 532 public String getWitnessAhlwardtNo() { | |
| 533 return witnessAhlwardtNo; | |
| 534 } | |
| 535 | |
| 536 public void setWitnessAhlwardtNo(String witnessAhlwardtNo) { | |
| 537 this.witnessAhlwardtNo = witnessAhlwardtNo; | |
| 538 } | |
| 539 | |
|
81
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
540 /** |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
541 * @return the referenceBibIdNo |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
542 */ |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
543 public String getReferenceBibIdNo() { |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
544 return referenceBibIdNo; |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
545 } |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
546 |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
547 /** |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
548 * @param referenceBibIdNo the referenceBibIdNo to set |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
549 */ |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
550 public void setReferenceBibIdNo(String referenceBibIdNo) { |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
551 this.referenceBibIdNo = referenceBibIdNo; |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
552 } |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
553 |
|
0d5d36c83e77
added search for bibliography id attribute for REFERENCEs.
casties
parents:
78
diff
changeset
|
554 public String getOcTerm() { |
| 1 | 555 return ocTerm; |
| 556 } | |
| 557 | |
| 558 public void setOcTerm(String ocTerm) { | |
| 559 this.ocTerm = ocTerm; | |
| 560 } | |
| 561 | |
| 562 public String getCurrentTab() { | |
| 563 return currentTab; | |
| 564 } | |
| 565 | |
| 566 public void setCurrentTab(String currentTab) { | |
| 567 this.currentTab = currentTab; | |
| 568 } | |
| 569 | |
| 570 | |
| 571 } |
