Mercurial > hg > ismi-richfaces
annotate src/main/java/de/mpiwg/itgroup/ismi/entry/beans/CurrentWitnessBean.java @ 111:22a18bfc66b0
new completion that uses ALIASes: AbstractListenerObject. was_copied_in in WITNESS form can use PLACE aliases now. some cleanup.
author | casties |
---|---|
date | Fri, 09 Dec 2016 21:18:27 +0100 |
parents | 2e911857a759 |
children | 59f26a5ef2b3 |
rev | line source |
---|---|
1 | 1 package de.mpiwg.itgroup.ismi.entry.beans; |
2 | |
3 import java.io.Serializable; | |
4 import java.util.ArrayList; | |
5 import java.util.List; | |
6 | |
7 import javax.faces.component.UIComponent; | |
8 import javax.faces.event.ActionEvent; | |
9 import javax.faces.event.ValueChangeEvent; | |
10 import javax.faces.model.SelectItem; | |
11 | |
12 import org.apache.commons.lang.StringUtils; | |
13 import org.apache.log4j.Logger; | |
14 import org.mpi.openmind.repository.bo.Attribute; | |
15 import org.mpi.openmind.repository.bo.Entity; | |
16 import org.mpi.openmind.repository.bo.Node; | |
17 import org.mpi.openmind.repository.bo.Relation; | |
18 import org.mpi.openmind.security.bo.User; | |
19 | |
111
22a18bfc66b0
new completion that uses ALIASes: AbstractListenerObject. was_copied_in in WITNESS form can use PLACE aliases now. some cleanup.
casties
parents:
1
diff
changeset
|
20 import de.mpiwg.itgroup.ismi.auxObjects.AliasListenerObject; |
1 | 21 import de.mpiwg.itgroup.ismi.auxObjects.ListenerObject; |
22 import de.mpiwg.itgroup.ismi.auxObjects.lo.WitnessAuthorLO; | |
23 import de.mpiwg.itgroup.ismi.auxObjects.lo.WitnessTextLO; | |
24 import de.mpiwg.itgroup.ismi.util.guiComponents.Calendar; | |
25 import de.mpiwg.itgroup.ismi.util.guiComponents.EntityList; | |
26 import de.mpiwg.itgroup.ismi.util.guiComponents.StatusImage; | |
27 | |
28 public class CurrentWitnessBean extends CodexEditorTemplate implements Serializable{ | |
29 | |
30 private static final long serialVersionUID = -7645136722251494419L; | |
31 | |
32 private static Logger logger = Logger.getLogger(CurrentWitnessBean.class); | |
33 | |
34 private Boolean codicesOverviewRendered = false; | |
35 private List <CodexForList> codicesAll = new ArrayList<CodexForList>(); | |
36 | |
37 private List<SelectItem> titles_list = new ArrayList<SelectItem>(); | |
38 private Long selectedTitleId; | |
39 private Boolean selectTitleRendered = false; | |
40 private String selectPersonType; | |
41 | |
42 private List<SelectItem> persons_list = new ArrayList<SelectItem>(); | |
43 private Long selectedPersonId; | |
44 private Boolean selectPersonRendered = false; | |
45 private Boolean restrictedByRole = true; | |
46 | |
47 //private Entity witness; | |
48 | |
49 private ListenerObject titleLo = new WitnessTextLO(TEXT, full_title_translit, this); | |
50 | |
51 private String valueTitle = ""; | |
52 | |
53 // WITNESS -> has_title_written_as -> ALIAS | |
54 private String valueTextWritten = ""; | |
55 private List<SelectItem> suggestedTitlesWritten = new ArrayList<SelectItem>(); | |
56 private Long valueTitleSelectedId; | |
57 | |
58 // WITNESS -> has_authorWritten_as -> ALIAS | |
59 private String valueAuthorWritten = ""; | |
60 private List<SelectItem> suggestedAuthorsWritten = new ArrayList<SelectItem>(); | |
61 private Long valueAuthorSelectedId; | |
62 | |
63 // WITNESS -> is_exemplar_of -> TEXT -> was_created_by -> PERSON | |
64 private ListenerObject authorLo = new WitnessAuthorLO(PERSON, name_translit, this); | |
65 private String valueAuthor = ""; | |
66 | |
67 private boolean textUnknown = false; | |
68 private static String UNKNOWN = "UNKNOWN"; | |
69 | |
70 | |
71 // WITENSS -> was_copied_by -> PERSON | |
72 private ListenerObject copyistLo = new ListenerObject(PERSON, name_translit); | |
73 | |
74 // WITENSS -> was_copied_at -> PLACE | |
111
22a18bfc66b0
new completion that uses ALIASes: AbstractListenerObject. was_copied_in in WITNESS form can use PLACE aliases now. some cleanup.
casties
parents:
1
diff
changeset
|
75 private ListenerObject copyPlaceLo = new AliasListenerObject(PLACE, name, "is_alias_name_of"); |
1 | 76 |
77 // WITNESS -> xx -> PERSON | |
78 private ListenerObject patronageLo = new ListenerObject(PERSON, name_translit); | |
79 | |
80 //private List<SelectItem> citiesWithRepositories; | |
81 private boolean foundCodex; | |
82 | |
83 private boolean lockValueAuthor = false; | |
84 private boolean lockValueTitle = false; | |
85 | |
86 private boolean createCodexRendered = false; | |
87 private boolean renderShowAllCodexCandidates = false; | |
88 //private Entity witness_old; | |
89 | |
90 private String newIdentifier; | |
91 | |
92 //private IslamicCalendar islamicCalCopyDate; | |
93 private transient Calendar copyDate; | |
94 | |
95 private EntityList studiedByList; | |
96 private EntityList possibleExamplerOfList; | |
97 | |
98 public CurrentWitnessBean() { | |
99 super(); | |
100 this.entity = new Entity(Node.TYPE_ABOX, WITNESS, false); | |
101 setDefObjectClass(WITNESS); | |
102 | |
103 registerChecker(copyistLo.statusImage, "Copyist not valid"); | |
104 registerChecker(copyPlaceLo.statusImage, "Copyist not valid"); | |
105 registerChecker(patronageLo.statusImage,"Patron not valid"); | |
106 | |
107 } | |
108 | |
109 @Override | |
110 public void reset(){ | |
111 super.reset(); | |
112 this.entity = new Entity(Node.TYPE_ABOX, WITNESS, false); | |
113 this.studiedByList = new EntityList(PERSON, "name_translit", "Studied by"); | |
114 this.possibleExamplerOfList = new EntityList(TEXT, "full_title_translit", "Possible titles"); | |
115 | |
116 this.codicesOverviewRendered = false; | |
117 this.codicesAll = new ArrayList<CodexForList>(); | |
118 | |
119 this.titles_list = new ArrayList<SelectItem>(); | |
120 this.selectedTitleId = null; | |
121 this.selectTitleRendered = false; | |
122 this.selectPersonType = ""; | |
123 | |
124 this.persons_list = new ArrayList<SelectItem>(); | |
125 this.selectedPersonId = null; | |
126 this.selectPersonRendered = false; | |
127 this.restrictedByRole = true; | |
128 | |
129 if(titleLo != null) | |
130 this.titleLo.reset(); | |
131 | |
132 this.valueTitle = ""; | |
133 | |
134 // WITNESS -> has_title_written_as -> ALIAS | |
135 this.valueTextWritten = ""; | |
136 this.suggestedTitlesWritten = new ArrayList<SelectItem>(); | |
137 this.valueTitleSelectedId = null; | |
138 | |
139 // WITNESS -> has_author_written_as -> ALIAS | |
140 this.valueAuthorWritten = ""; | |
141 this.suggestedAuthorsWritten = new ArrayList<SelectItem>(); | |
142 this.valueAuthorSelectedId = null; | |
143 | |
144 // WITNESS -> is_exemplar_of -> TEXT -> was_created_by -> PERSON | |
145 if(this.authorLo != null) | |
146 this.authorLo.reset(); | |
147 this.valueAuthor = ""; | |
148 | |
149 // WITENSS -> was_copied_by -> PERSON | |
150 if(copyistLo != null) | |
151 this.copyistLo.reset(); | |
152 | |
153 // WITENSS -> was_copied_in -> PLACE | |
154 if(this.copyPlaceLo != null) | |
155 this.copyPlaceLo.reset(); | |
156 | |
157 // WITNESS -> xx -> PERSON | |
158 if(patronageLo != null) | |
159 this.patronageLo.reset(); | |
160 | |
161 //this.citiesWithRepositories = null; | |
162 this.foundCodex = false; | |
163 | |
164 this.lockValueAuthor = true; | |
165 this.lockValueTitle = true; | |
166 | |
167 this.createCodexRendered = false; | |
168 this.renderShowAllCodexCandidates = false; | |
169 | |
170 this.newIdentifier = ""; | |
171 | |
172 //this.islamicCalCopyDate = new IslamicCalendar(); | |
173 this.copyDate = new Calendar(); | |
174 } | |
175 | |
176 @Override | |
177 public String save() { | |
178 super.save(); | |
179 try { | |
180 | |
181 User user = getSessionUser(); | |
182 | |
183 if(!isCodexIdentifierSet(user.getEmail())){ | |
184 return "SAVE_ERROR"; | |
185 } | |
186 | |
187 if(!isWitnessConsistentBeforeSave()){ | |
188 return "SAVE_ERROR"; | |
189 } | |
190 | |
191 //checking if some LO is not OK. | |
192 CheckResults cr = getCheckResults(); | |
193 if (cr.hasErrors){ | |
194 getSessionBean().setErrorMessages(cr); | |
195 getSessionBean().setDisplayError(true); | |
196 this.setSelectedSaveAsNew(false); | |
197 return "SAVE_ERROR"; | |
198 } | |
199 | |
200 getAttributes().put("creation_date", this.copyDate.toJSONString()); | |
201 | |
202 this.entity = this.updateEntityAttributes(this.entity); | |
203 | |
204 // WITNESS -> is_part_of -> CODEX | |
205 this.entity.replaceSourceRelation(getCodexLo().entity, CODEX, is_part_of); | |
206 | |
207 // WITNESS -> is_exemplar_of -> TEXT -> was_created_by -> PERSON | |
208 //replaceSourceRelation(this.entity, this.author, PERSON, was_created_by); | |
209 | |
210 // WITENSS -> was_copied_by -> PERSON | |
211 this.entity.replaceSourceRelation(this.copyistLo.entity, PERSON, rel_was_copied_by); | |
212 | |
111
22a18bfc66b0
new completion that uses ALIASes: AbstractListenerObject. was_copied_in in WITNESS form can use PLACE aliases now. some cleanup.
casties
parents:
1
diff
changeset
|
213 // WITNESS -> was_copied_in -> PLACE |
22a18bfc66b0
new completion that uses ALIASes: AbstractListenerObject. was_copied_in in WITNESS form can use PLACE aliases now. some cleanup.
casties
parents:
1
diff
changeset
|
214 Entity copyPlace = this.copyPlaceLo.entity; |
22a18bfc66b0
new completion that uses ALIASes: AbstractListenerObject. was_copied_in in WITNESS form can use PLACE aliases now. some cleanup.
casties
parents:
1
diff
changeset
|
215 if (copyPlace != null && copyPlace.getObjectClass().equals(PLACE)) { |
22a18bfc66b0
new completion that uses ALIASes: AbstractListenerObject. was_copied_in in WITNESS form can use PLACE aliases now. some cleanup.
casties
parents:
1
diff
changeset
|
216 // regular PLACE |
22a18bfc66b0
new completion that uses ALIASes: AbstractListenerObject. was_copied_in in WITNESS form can use PLACE aliases now. some cleanup.
casties
parents:
1
diff
changeset
|
217 this.entity.replaceSourceRelation(copyPlace, PLACE, "was_copied_in"); |
22a18bfc66b0
new completion that uses ALIASes: AbstractListenerObject. was_copied_in in WITNESS form can use PLACE aliases now. some cleanup.
casties
parents:
1
diff
changeset
|
218 } else if (copyPlace != null && copyPlace.getObjectClass().equals("ALIAS")) { |
22a18bfc66b0
new completion that uses ALIASes: AbstractListenerObject. was_copied_in in WITNESS form can use PLACE aliases now. some cleanup.
casties
parents:
1
diff
changeset
|
219 // WITNESS -> was_copied_in_as -> ALIAS |
22a18bfc66b0
new completion that uses ALIASes: AbstractListenerObject. was_copied_in in WITNESS form can use PLACE aliases now. some cleanup.
casties
parents:
1
diff
changeset
|
220 this.entity.replaceSourceRelation(copyPlace, "ALIAS", "was_copied_in_as"); |
22a18bfc66b0
new completion that uses ALIASes: AbstractListenerObject. was_copied_in in WITNESS form can use PLACE aliases now. some cleanup.
casties
parents:
1
diff
changeset
|
221 // ALIAS -> is_alias_name_of -> PLACE |
22a18bfc66b0
new completion that uses ALIASes: AbstractListenerObject. was_copied_in in WITNESS form can use PLACE aliases now. some cleanup.
casties
parents:
1
diff
changeset
|
222 List<Entity> places = getWrapper().getTargetsForSourceRelation(copyPlace, "is_alias_name_of", "PLACE", 1); |
22a18bfc66b0
new completion that uses ALIASes: AbstractListenerObject. was_copied_in in WITNESS form can use PLACE aliases now. some cleanup.
casties
parents:
1
diff
changeset
|
223 if (! places.isEmpty()) { |
22a18bfc66b0
new completion that uses ALIASes: AbstractListenerObject. was_copied_in in WITNESS form can use PLACE aliases now. some cleanup.
casties
parents:
1
diff
changeset
|
224 // WITNESS -> was_copied_in -> PLACE |
22a18bfc66b0
new completion that uses ALIASes: AbstractListenerObject. was_copied_in in WITNESS form can use PLACE aliases now. some cleanup.
casties
parents:
1
diff
changeset
|
225 this.entity.replaceSourceRelation(places.get(0), PLACE, "was_copied_in"); |
22a18bfc66b0
new completion that uses ALIASes: AbstractListenerObject. was_copied_in in WITNESS form can use PLACE aliases now. some cleanup.
casties
parents:
1
diff
changeset
|
226 } |
22a18bfc66b0
new completion that uses ALIASes: AbstractListenerObject. was_copied_in in WITNESS form can use PLACE aliases now. some cleanup.
casties
parents:
1
diff
changeset
|
227 } |
1 | 228 |
229 //REFERENCE -> is_reference_of -> WITNESS | |
230 //this.entity = this.prepareReferencesToSave(this.entity); | |
231 this.prepareEndNoteRefs2Save(); | |
232 | |
233 //WITNESS -> was studied by manyToMany -> PERSON | |
234 this.entity.removeAllSourceRelationsByName(rel_was_studied_by); | |
235 for(Entity target : this.studiedByList.getEntities()){ | |
236 Entity target0 = getWrapper().getEntityByIdWithContent(target.getId()); | |
237 Relation wasStudiedBy = new Relation(this.entity, target0, rel_was_studied_by); | |
238 } | |
239 | |
240 // WITNESS -> had_patron -> PERSON | |
241 this.entity.replaceSourceRelation(this.patronageLo.entity, PERSON, rel_had_patron); | |
242 | |
243 | |
244 // WITNESS -> is_exemplar_of -> TEXT | |
245 this.entity.replaceSourceRelation(this.titleLo.entity, TEXT, is_exemplar_of); | |
246 | |
247 this.entity.removeAllSourceRelationsByName(is_possible_exemplar_of); | |
248 this.entity.removeAllSourceRelations(rel_has_title_written_as, ALIAS); | |
249 this.entity.removeAllSourceRelations(rel_has_author_written_as, ALIAS); | |
250 | |
251 if(textUnknown){ | |
252 for(Entity target : this.possibleExamplerOfList.getEntities()){ | |
253 Entity target0 = getWrapper().getEntityByIdWithContent(target.getId()); | |
254 Relation tmp = new Relation(this.entity, target0, is_possible_exemplar_of); | |
255 } | |
256 }else{ | |
257 this.saveIndirectedAliases(); | |
258 } | |
259 | |
260 // WITNESS -> is_part_of_codex | |
261 if(this.isSelectedSaveAsNew()){ | |
262 this.entity = getWrapper().saveEntityAsNew(this.entity, user.getEmail()); | |
263 }else{ | |
264 this.entity = getWrapper().saveEntity(this.entity, user.getEmail()); | |
265 } | |
266 this.setEntity(this.entity); | |
267 | |
268 logger.info("Entity saved - Time = " + (System.currentTimeMillis() - start) + ", " + entity); | |
269 this.printSuccessSavingEntity(); | |
270 | |
271 this.setSelectedSaveAsNew(false); | |
272 } catch (Exception e) { | |
273 logger.error(e.getMessage(), e); | |
274 e.printStackTrace(); | |
275 this.printInternalError(e); | |
276 } | |
277 | |
278 saveEnd(); | |
279 return PAGE_EDITOR; | |
280 } | |
281 | |
282 private void saveIndirectedAliases() throws Exception{ | |
283 | |
284 User user = getSessionUser(); | |
285 | |
286 //WITNESS -> has_title_written_as -> ALIAS | |
287 if(StringUtils.isNotEmpty(valueTextWritten)){ | |
288 Entity alias = null; | |
289 if(this.suggestedTitlesWritten != null){ | |
290 for(SelectItem item : this.suggestedTitlesWritten){ | |
291 Long id = (Long)item.getValue(); | |
292 if(id != null){ | |
293 Entity candidate = getWrapper().getEntityById(id); | |
294 if(candidate != null && valueTextWritten.equals(candidate.getOwnValue())){ | |
295 alias = candidate; | |
296 break; | |
297 } | |
298 } | |
299 } | |
300 } | |
301 | |
302 if(alias == null){ | |
303 alias = new Entity(Node.TYPE_ABOX, ALIAS, false); | |
304 alias.addAttribute(new Attribute(ALIAS, "text", valueTextWritten)); | |
305 alias = getWrapper().saveEntity(alias, user.getEmail()); | |
306 Relation rel = new Relation(alias, this.titleLo.getEntity(), "is_alias_title_of"); | |
307 alias = getWrapper().saveEntity(alias, user.getEmail()); | |
308 } | |
309 if(alias.isLightweight()){ | |
310 alias = getWrapper().getEntityByIdWithContent(alias.getId()); | |
311 } | |
312 this.entity.replaceSourceRelation(alias, ALIAS, rel_has_title_written_as); | |
313 } | |
314 | |
315 | |
316 if(StringUtils.isNotEmpty(this.valueAuthorWritten)){ | |
317 Entity alias = null; | |
318 if(suggestedAuthorsWritten != null){ | |
319 for(SelectItem item : this.suggestedAuthorsWritten){ | |
320 Long id = (Long)item.getValue(); | |
321 if(id != null){ | |
322 Entity candidate = getWrapper().getEntityById(id); | |
323 if(candidate != null && valueAuthorWritten.equals(candidate.getOwnValue())){ | |
324 alias = candidate; | |
325 break; | |
326 } | |
327 } | |
328 } | |
329 } | |
330 | |
331 if(alias == null){ | |
332 alias = new Entity(Node.TYPE_ABOX, ALIAS, false); | |
333 alias.addAttribute(new Attribute(ALIAS, "text", valueAuthorWritten)); | |
334 alias = getWrapper().saveEntity(alias, user.getEmail()); | |
335 Relation rel = new Relation(alias, this.authorLo.getEntity(), "is_alias_name_of"); | |
336 alias = getWrapper().saveEntity(alias, user.getEmail()); | |
337 } | |
338 if(alias.isLightweight()){ | |
339 alias = getWrapper().getEntityByIdWithContent(alias.getId()); | |
340 } | |
341 this.entity.replaceSourceRelation(alias, ALIAS, rel_has_author_written_as); | |
342 } | |
343 } | |
344 | |
345 public String saveAsNewEntity() { | |
346 this.setSelectedSaveAsNew(true); | |
347 return save(); | |
348 } | |
349 | |
350 /* rich | |
351 public void patronageChangeListener(ValueChangeEvent event) { | |
352 //patronageLo = changeListener(event, patronageLo, PERSON, "name"); | |
353 patronageLo = changeValuePersonByRole(event, patronageLo, "Patron"); | |
354 | |
355 } | |
356 | |
357 public void copyistChangeListener(ValueChangeEvent event) { | |
358 copyistLo = changeValuePersonByRole(event, copyistLo, "Copyist"); | |
359 } | |
360 | |
361 public void copyPlacesChangeListener(ValueChangeEvent event) { | |
362 copyPlaceLo = changeListener(event, copyPlaceLo,"PLACE", "name"); | |
363 }*/ | |
364 | |
365 public void updateTitle(){ | |
366 | |
367 if(titleLo.entity != null && titleLo.entity.isPersistent()){ | |
368 | |
369 this.textUnknown = UNKNOWN.equals(titleLo.entity.getOwnValue()); | |
370 | |
371 List<Entity> targets = getWrapper().getTargetsForSourceRelation(titleLo.getEntity(), rel_was_created_by, PERSON, 1); | |
372 if(targets.size() > 0){ | |
111
22a18bfc66b0
new completion that uses ALIASes: AbstractListenerObject. was_copied_in in WITNESS form can use PLACE aliases now. some cleanup.
casties
parents:
1
diff
changeset
|
373 this.authorLo.setEntityAndAttribute(targets.get(0)); |
1 | 374 |
375 }else{ | |
376 this.authorLo.reset(); | |
377 /* rich | |
378 this.authorLo.setEntityAndAttribute(null, name_translit); | |
379 this.authorLo.statusImage.setStatus(StatusImage.STATUS_UNSET); | |
380 */ | |
381 | |
382 } | |
383 this.suggestedAuthorsWritten = getAuthorAliases(authorLo.entity); | |
384 this.suggestedTitlesWritten = getTitleAliases(titleLo.entity); | |
385 } | |
386 } | |
387 | |
388 public void updateAuthor(){ | |
389 | |
390 if(authorLo.getEntity() != null && authorLo.getEntity().isPersistent()){ | |
391 | |
392 this.titleLo.reset(); | |
393 | |
394 List <Entity> sources = getWrapper().getSourcesForTargetRelation(authorLo.getEntity(), rel_was_created_by, TEXT, -1); | |
395 | |
396 ArrayList<SelectItem> options = new ArrayList<SelectItem>(); | |
397 for (Entity title : sources){ | |
398 options.add(new SelectItem(title.getId(), title.getOwnValue() + " [" + title.getId() + "]")); | |
399 } | |
400 | |
401 titles_list = options; | |
402 this.suggestedAuthorsWritten = getAuthorAliases(authorLo.entity); | |
403 this.suggestedTitlesWritten = getTitleAliases(null); | |
404 } | |
405 } | |
406 | |
407 | |
408 private List<SelectItem> getTitleAliases(Entity title) { | |
409 List<SelectItem> items = new ArrayList<SelectItem>(); | |
410 this.valueTextWritten = null; | |
411 if(title != null && title.isPersistent()){ | |
412 items.add(new SelectItem(new Long(-1), "-- choose --")); | |
413 List<Entity> aliasTitleList = getWrapper().getSourcesForTargetRelation(title, is_alias_title_of, ALIAS, -1); | |
414 for(Entity alias : aliasTitleList){ | |
415 items.add(new SelectItem(alias.getId(), alias.getOwnValue())); | |
416 } | |
417 | |
418 List<Entity> primeAliasTitleList = getWrapper().getSourcesForTargetRelation(title, is_prime_alias_title_of, ALIAS, -1); | |
419 for(Entity alias : primeAliasTitleList){ | |
420 items.add(new SelectItem(alias.getId(), alias.getOwnValue())); | |
421 } | |
422 } | |
423 | |
424 return items; | |
425 } | |
426 private List<SelectItem> getAuthorAliases(Entity author) { | |
427 List<SelectItem> items = new ArrayList<SelectItem>(); | |
428 this.valueAuthorWritten = null; | |
429 if(author != null && author.isPersistent()){ | |
430 //items.add(new SelectItem(null, "-- choose --")); | |
431 List<Entity> aliasAuthorList = getWrapper().getSourcesForTargetRelation(author, is_alias_name_of, ALIAS, -1); | |
432 for(Entity alias : aliasAuthorList){ | |
433 items.add(new SelectItem(alias.getId(), alias.getOwnValue())); | |
434 } | |
435 | |
436 List<Entity> primeAliasAuthorList = getWrapper().getSourcesForTargetRelation(author, is_prime_alias_name_of, ALIAS, -1); | |
437 for(Entity alias : primeAliasAuthorList){ | |
438 items.add(new SelectItem(alias.getId(), alias.getOwnValue())); | |
439 } | |
440 } | |
441 return items; | |
442 | |
443 } | |
444 | |
445 @Override | |
446 public void setEntity(Entity witness) { | |
447 this.reset(); | |
448 this.entity = witness; | |
449 | |
450 if(this.entity.isPersistent()){ | |
451 if (witness.isLightweight()) { | |
452 witness = getWrapper().getEntityContent(witness); | |
453 } | |
454 | |
455 Attribute attCreationDate = this.entity.getAttributeByName("creation_date"); | |
456 if(attCreationDate != null && StringUtils.isNotEmpty(attCreationDate.getOwnValue())){ | |
457 this.copyDate = new Calendar(attCreationDate.getOwnValue()); | |
458 }else{ | |
459 this.copyDate = new Calendar(); | |
460 } | |
461 | |
462 // Loading attributes | |
463 this.loadAttributes(this.entity); | |
464 | |
465 // Loading the relations | |
466 // TODO loading target's relations | |
467 for (Relation rel : witness.getSourceRelations()) { | |
468 Entity target = null; | |
469 if (rel.getOwnValue().equals(is_exemplar_of)) { | |
470 // WITNESS -> is_exemplar_of -> TEXT | |
471 target = getTargetRelation(rel); | |
111
22a18bfc66b0
new completion that uses ALIASes: AbstractListenerObject. was_copied_in in WITNESS form can use PLACE aliases now. some cleanup.
casties
parents:
1
diff
changeset
|
472 titleLo.setEntityAndAttribute(target); |
1 | 473 this.updateTitle(); |
474 } else if (rel.getOwnValue().equals(is_possible_exemplar_of)) { | |
475 // WITNESS -> is_possible_exemplar_of -> TEXT | |
476 target = getTargetRelation(rel); | |
477 possibleExamplerOfList.add(target); | |
478 } else if (rel.getOwnValue().equals(rel_was_studied_by)) { | |
479 target = getTargetRelation(rel); | |
480 studiedByList.add(target); | |
481 } else if (rel.getOwnValue().equals(rel_was_copied_by)) { | |
482 // WITENSS -> was_copied_by -> PERSON | |
483 target = getTargetRelation(rel); | |
111
22a18bfc66b0
new completion that uses ALIASes: AbstractListenerObject. was_copied_in in WITNESS form can use PLACE aliases now. some cleanup.
casties
parents:
1
diff
changeset
|
484 copyistLo.setEntityAndAttribute(target); |
1 | 485 } else if (rel.getOwnValue().equals("was_copied_in")) { |
486 // WITENSS -> was_copied_in -> PLACE | |
487 target = getTargetRelation(rel); | |
111
22a18bfc66b0
new completion that uses ALIASes: AbstractListenerObject. was_copied_in in WITNESS form can use PLACE aliases now. some cleanup.
casties
parents:
1
diff
changeset
|
488 // don't use place if there is an alias |
22a18bfc66b0
new completion that uses ALIASes: AbstractListenerObject. was_copied_in in WITNESS form can use PLACE aliases now. some cleanup.
casties
parents:
1
diff
changeset
|
489 if (copyPlaceLo.getEntity().getObjectClass() == null) { |
22a18bfc66b0
new completion that uses ALIASes: AbstractListenerObject. was_copied_in in WITNESS form can use PLACE aliases now. some cleanup.
casties
parents:
1
diff
changeset
|
490 copyPlaceLo.setEntityAndAttribute(target); |
22a18bfc66b0
new completion that uses ALIASes: AbstractListenerObject. was_copied_in in WITNESS form can use PLACE aliases now. some cleanup.
casties
parents:
1
diff
changeset
|
491 } |
22a18bfc66b0
new completion that uses ALIASes: AbstractListenerObject. was_copied_in in WITNESS form can use PLACE aliases now. some cleanup.
casties
parents:
1
diff
changeset
|
492 } else if (rel.getOwnValue().equals("was_copied_in_as")) { |
22a18bfc66b0
new completion that uses ALIASes: AbstractListenerObject. was_copied_in in WITNESS form can use PLACE aliases now. some cleanup.
casties
parents:
1
diff
changeset
|
493 // WITENSS -> was_copied_in_as -> ALIAS |
22a18bfc66b0
new completion that uses ALIASes: AbstractListenerObject. was_copied_in in WITNESS form can use PLACE aliases now. some cleanup.
casties
parents:
1
diff
changeset
|
494 target = getTargetRelation(rel); |
22a18bfc66b0
new completion that uses ALIASes: AbstractListenerObject. was_copied_in in WITNESS form can use PLACE aliases now. some cleanup.
casties
parents:
1
diff
changeset
|
495 copyPlaceLo.setEntityAndAttribute(target); |
1 | 496 } else if (rel.getOwnValue().equals(rel_had_patron)) { |
497 // WITNESS -> had_patron -> PERSON | |
498 target = getTargetRelation(rel); | |
111
22a18bfc66b0
new completion that uses ALIASes: AbstractListenerObject. was_copied_in in WITNESS form can use PLACE aliases now. some cleanup.
casties
parents:
1
diff
changeset
|
499 patronageLo.setEntityAndAttributeName(target, name_translit); |
1 | 500 } else if (rel.getOwnValue().equals(is_part_of)) { |
111
22a18bfc66b0
new completion that uses ALIASes: AbstractListenerObject. was_copied_in in WITNESS form can use PLACE aliases now. some cleanup.
casties
parents:
1
diff
changeset
|
501 // WITNESS -> is_part_of -> CODEX |
22a18bfc66b0
new completion that uses ALIASes: AbstractListenerObject. was_copied_in in WITNESS form can use PLACE aliases now. some cleanup.
casties
parents:
1
diff
changeset
|
502 if (rel.getTargetObjectClass().equals(CODEX)) { |
1 | 503 target = getTargetRelation(rel); |
504 this.setCodex(target); | |
505 } | |
506 } else if (rel.getOwnValue().equals(rel_has_author_written_as)) { | |
507 //TODO this relation is no in the definitions | |
508 Entity target2 = getTargetRelation(rel); | |
509 Attribute alias = getTargetAttribute(target2, "alias"); | |
510 this.valueAuthorWritten = (alias != null) ? alias.getValue() : null; | |
511 | |
512 } else if (rel.getOwnValue().equals(rel_has_title_written_as)) { | |
513 //TODO this relation is no in the definitions | |
514 target = getTargetRelation(rel); | |
515 //this.textWritten = target; | |
516 Attribute alias = getTargetAttribute(target, "alias"); | |
517 this.valueTextWritten = (alias != null) ? alias.getValue() : null; | |
518 } | |
519 } | |
520 | |
521 //this.loadReferences(this.entity); | |
522 this.loadEndNoteRefs(); | |
523 | |
524 this.setCurrentId(this.entity.getId().toString()); | |
525 this.checkConsistencyFromCountryToCodex(); | |
526 | |
527 this.displayUrl = generateDisplayUrl(authorLo.entity, titleLo.entity, witness, getAppBean().getRoot()); | |
528 } | |
529 } | |
530 | |
531 /** | |
532 * Loads the given codex without reset of the variables, which could cause problem in CurrentWitness Class | |
533 * @param codex | |
534 */ | |
535 public void setCodex(Entity codex){ | |
111
22a18bfc66b0
new completion that uses ALIASes: AbstractListenerObject. was_copied_in in WITNESS form can use PLACE aliases now. some cleanup.
casties
parents:
1
diff
changeset
|
536 this.getCodexLo().setEntityAndAttributeName(codex, "identifier"); |
1 | 537 |
538 if(this.getCodexLo().entity != null && this.getCodexLo().entity.isPersistent()){ | |
539 | |
540 List<Entity> list = getWrapper().getTargetsForSourceRelation(codex, is_part_of, COLLECTION, 1); | |
541 if(list.size() > 0){ | |
542 this.setCollection(list.get(0)); | |
543 } | |
544 } | |
545 } | |
546 | |
547 public String getValueAuthor() { | |
548 return valueAuthor; | |
549 } | |
550 | |
551 public void setValueAuthor(String valueAuthor) { | |
552 if(!lockValueAuthor) | |
553 this.valueAuthor = valueAuthor; | |
554 this.lockValueAuthor = false; | |
555 } | |
556 | |
557 public void setValueTitle(String valueTitle) { | |
558 if(!lockValueTitle) | |
559 this.valueTitle = valueTitle; | |
560 this.lockValueTitle = false; | |
561 } | |
562 | |
563 public String getValueTitle() { | |
564 return valueTitle; | |
565 } | |
566 | |
567 public List<SelectItem> getTitles_list() { | |
568 return titles_list; | |
569 } | |
570 | |
571 public void setTitles_list(List<SelectItem> titlesList) { | |
572 titles_list = titlesList; | |
573 } | |
574 | |
575 public void setFoundCodex(boolean foundCodex) { | |
576 this.foundCodex = foundCodex; | |
577 } | |
578 | |
579 public boolean isFoundCodex() { | |
580 return foundCodex; | |
581 } | |
582 | |
583 public void listenerCreateTitleAlias(ValueChangeEvent event) { | |
584 this.valueTextWritten = (String)event.getNewValue(); | |
585 } | |
586 | |
587 public void listenerChooseTitleAlias(ValueChangeEvent event) { | |
588 if (event.getNewValue() != null) { | |
589 Long aliasId = (Long) event.getNewValue(); | |
590 if(aliasId != null){ | |
591 if(aliasId.equals(-1)){ | |
592 this.valueTextWritten = null; | |
593 }else{ | |
594 Entity alias = getWrapper().getEntityByIdWithContent(aliasId); | |
595 if(alias != null){ | |
596 this.valueTextWritten = alias.getOwnValue(); | |
597 } | |
598 } | |
599 } | |
600 } | |
601 } | |
602 | |
603 public void listenerCreateAuthorAlias(ValueChangeEvent event) { | |
604 this.valueAuthorWritten = (String)event.getNewValue(); | |
605 } | |
606 | |
607 public void listenerChooseAuthorAlias(ValueChangeEvent event) { | |
608 if (event.getNewValue() != null) { | |
609 Long aliasId = (Long) event.getNewValue(); | |
610 if(aliasId != null){ | |
611 if(aliasId.equals(-1)){ | |
612 this.valueAuthorWritten = null; | |
613 }else{ | |
614 Entity alias = getWrapper().getEntityByIdWithContent(aliasId); | |
615 if(alias != null){ | |
616 this.valueAuthorWritten = alias.getOwnValue(); | |
617 } | |
618 } | |
619 } | |
620 } | |
621 } | |
622 | |
623 @Override | |
624 public void identifierChangedListener(ValueChangeEvent event) { | |
625 super.identifierChangedListener(event); | |
626 | |
627 if (StringUtils.isEmpty(getCodexLo().attribute.getValue())){ | |
628 renderShowAllCodexCandidates = false; | |
629 this.checkConsistencyFromCountryToCodex(); | |
630 return; | |
631 } | |
632 | |
633 List<Entity> entities = getWrapper().getEntitiesByAtt(CODEX, getCodexLo().getAttName(), getCodexLo().attribute.getValue(), 10000, false); | |
634 | |
635 if (entities.size()>1){ | |
636 if ((getCollectionLo().attribute==null || getCollectionLo().getAttribute().getValue().equals("")) && | |
637 (getRepositoryLo().getAttribute()==null || getRepositoryLo().getAttribute().getValue().equals(""))){ | |
638 showAllCodexCandidates(entities); | |
639 renderShowAllCodexCandidates = true; | |
640 } | |
641 else | |
642 //renderShowAllCodexCandidates = false; | |
643 renderShowAllCodexCandidates = true; // i want to keep the selection field now | |
644 } | |
645 else | |
646 //renderShowAllCodexCandidates = false; | |
647 renderShowAllCodexCandidates = true; //i want to keep the selection field now | |
648 } | |
649 | |
650 public void searchInCurrentRepository(ActionEvent event) { | |
651 | |
652 ValueChangeEvent ne = new ValueChangeEvent((UIComponent) event | |
653 .getComponent(), "", getCollectionLo().getAttribute().getOwnValue()); | |
654 identifierChangedListener(ne); | |
655 | |
656 } | |
657 | |
658 /* rich | |
659 public String insertAuthorAction() { | |
660 return "insert"; | |
661 | |
662 }*/ | |
663 | |
664 public String showOtherTextsByAuthorAction() { | |
665 if (authorLo.entity == null || !authorLo.entity.isPersistent()) | |
666 return ""; | |
667 | |
668 List<SelectItem> options = new ArrayList<SelectItem>(); | |
669 List<Entity> titles = getWrapper().getSourcesForTargetRelation(authorLo.entity, "was_created_by", TEXT, -1); | |
670 for (Entity title: titles){ | |
671 options.add( | |
672 new SelectItem(title.getId(), title.getOwnValue() + " [" + title.getId() + "]")); | |
673 } | |
674 titles_list = options; | |
675 setSelectTitleRendered(true); | |
676 return ""; | |
677 } | |
678 | |
679 /** | |
680 * Gebe moegliche andere Codices aus. Das ist notwendig, weil nach dem jetzigen Stand der Daten ein Codex | |
681 * mehrfach im Datensatz auftachen kann. | |
682 * @return | |
683 */ | |
684 public String showAllCodexCandidates(List<Entity> entities){ | |
685 if (entities != null) { | |
686 for (Entity entity : entities) { | |
687 CodexForList entForList = getCodexData(entity); | |
688 codicesAll.add(entForList); | |
689 } | |
690 } | |
691 setCodicesOverviewRendered(true); | |
692 return ""; | |
693 } | |
694 | |
695 public String showAllTextsAction() { | |
696 titles_list = new ArrayList<SelectItem>(); | |
697 titles_list = getAppBean().getAllTexts(); | |
698 this.selectTitleRendered = true; | |
699 return ""; | |
700 } | |
701 | |
702 public void listenerSelectTitle(ActionEvent event){ | |
703 if(this.selectedTitleId != null){ | |
704 Entity title = getWrapper().getEntityById(this.selectedTitleId); | |
705 if(title != null){ | |
111
22a18bfc66b0
new completion that uses ALIASes: AbstractListenerObject. was_copied_in in WITNESS form can use PLACE aliases now. some cleanup.
casties
parents:
1
diff
changeset
|
706 this.titleLo.setEntityAndAttribute(title); |
1 | 707 this.updateTitle(); |
708 setSelectTitleRendered(false); | |
709 } | |
710 } | |
711 } | |
712 | |
713 public void listenerCancelPpSelectTitle(ActionEvent event){ | |
714 System.out.println("listenerCancelPpSelectTitle"); | |
715 this.selectTitleRendered = false; | |
716 } | |
717 | |
718 public void setSelectTitleRendered(Boolean selectTitleRendered) { | |
719 this.selectTitleRendered = selectTitleRendered; | |
720 } | |
721 | |
722 public Boolean getSelectTitleRendered() { | |
723 return selectTitleRendered; | |
724 } | |
725 | |
726 public List<SelectItem> getPersons_list() { | |
727 return persons_list; | |
728 } | |
729 | |
730 public void setPersons_list(List<SelectItem> personsList) { | |
731 persons_list = personsList; | |
732 } | |
733 | |
734 public Boolean getSelectPersonRendered() { | |
735 return selectPersonRendered; | |
736 } | |
737 | |
738 public void setSelectPersonRendered(Boolean selectPersonRendered) { | |
739 this.selectPersonRendered = selectPersonRendered; | |
740 } | |
741 | |
742 public Boolean getRestrictedByRole() { | |
743 return restrictedByRole; | |
744 } | |
745 | |
746 public void setRestrictedByRole(Boolean restrictedByRole) { | |
747 this.restrictedByRole = restrictedByRole; | |
748 } | |
749 | |
750 private void updatePersonList(){ | |
751 if (!this.restrictedByRole) | |
752 //persons_list = ((AllPersonsBean) this.getBean("AllPersons")) | |
753 // .getPersonsSelectItems(); | |
754 persons_list = getCache().getAllPersons(); | |
755 else { | |
756 //persons_list = ((AllPersonsBean) this.getBean("AllPersons")) | |
757 // .getPersonsSelectItemsByRole(this.selectPersonType); | |
758 persons_list = getCache().getPersonsByRole(selectPersonType); | |
759 } | |
760 } | |
761 | |
762 public String showAllCopyistsAction() { | |
763 this.setSelectPersonType("Copyist"); | |
764 this.updatePersonList(); | |
765 this.selectPersonRendered = true; | |
766 return ""; | |
767 } | |
768 | |
769 public String showAllPatronsAction() { | |
770 this.setSelectPersonType("Patron"); | |
771 this.updatePersonList(); | |
772 this.selectPersonRendered = true; | |
773 return ""; | |
774 } | |
775 | |
776 public String showAllAuthorsAction() { | |
777 this.setSelectPersonType("Author"); | |
778 this.updatePersonList(); | |
779 this.selectPersonRendered = true; | |
780 return ""; | |
781 } | |
782 | |
783 public void listenerCancelPpSelectAuthor(ActionEvent event){ | |
784 this.selectPersonRendered = false; | |
785 } | |
786 | |
787 public void listenerSelectPerson(ActionEvent event){ | |
788 String role = getSelectPersonType(); | |
789 if(this.selectedPersonId != null){ | |
790 Entity selectedPerson = getWrapper().getEntityByIdWithContent(selectedPersonId); | |
791 if(selectedPerson != null){ | |
792 if (role.equals("Copyist")) { | |
111
22a18bfc66b0
new completion that uses ALIASes: AbstractListenerObject. was_copied_in in WITNESS form can use PLACE aliases now. some cleanup.
casties
parents:
1
diff
changeset
|
793 copyistLo.setEntityAndAttribute(selectedPerson); |
1 | 794 } else if (role.equals("Patron")) { |
111
22a18bfc66b0
new completion that uses ALIASes: AbstractListenerObject. was_copied_in in WITNESS form can use PLACE aliases now. some cleanup.
casties
parents:
1
diff
changeset
|
795 patronageLo.setEntityAndAttribute(selectedPerson); |
1 | 796 } else if (role.equals("Author")) { |
111
22a18bfc66b0
new completion that uses ALIASes: AbstractListenerObject. was_copied_in in WITNESS form can use PLACE aliases now. some cleanup.
casties
parents:
1
diff
changeset
|
797 authorLo.setEntityAndAttribute(selectedPerson); |
1 | 798 this.updateAuthor(); |
799 } | |
800 setSelectPersonRendered(false); | |
801 } | |
802 } | |
803 } | |
804 | |
805 public void setSelectPersonType(String selectPersonType) { | |
806 this.selectPersonType = selectPersonType; | |
807 } | |
808 | |
809 public String getSelectPersonType() { | |
810 return selectPersonType; | |
811 } | |
812 | |
813 public void restrictedByRoleChange(ValueChangeEvent event) { | |
814 if (event.getNewValue().equals(event.getOldValue())) | |
815 return; | |
816 try{ | |
817 Boolean val = (Boolean) event.getNewValue(); | |
818 this.setRestrictedByRole(val); | |
819 this.updatePersonList(); | |
820 }catch(Exception ex){ | |
821 ex.printStackTrace(); | |
822 } | |
823 } | |
824 | |
825 public void listenerConvertCreationDate(ActionEvent event) { | |
826 /* | |
827 try{ | |
828 | |
829 String newDate = this.islamicCalCopyDate.islamic2Gregorian(); | |
830 String newJulianDate = this.islamicCalCopyDate.islamic2Julian(); | |
831 | |
832 getAttributes().put("creation_date_ce", newDate); | |
833 getAttributes().put("creation_date_julian", newJulianDate); | |
834 | |
835 }catch(Exception e){ | |
836 e.printStackTrace(); | |
837 addGeneralMsg("Error converting date!"); | |
838 addGeneralMsg("The islamic calendar begins on Friday, July 16th, 622 C.E. in the Julian calendar."); | |
839 addGeneralMsg("The date must be equals or bigger than yawm al-jum'a, 1.Muharram.1 (5.1.1.1)"); | |
840 } | |
841 */ | |
842 } | |
843 | |
844 | |
845 public void selectCodexFromOverviewAction(ActionEvent ae){ | |
846 /* rich | |
847 | |
848 HtmlCommandButton cp = (HtmlCommandButton)ae.getComponent(); | |
849 Long id = (Long) cp.getValue(); | |
850 //juc Entity ent = getOntology().getEntityById(id); | |
851 Entity ent = getWrapper().getEntityById(id); | |
852 this.getCodexLo().setEntityAndAttribute(ent, "identifier"); | |
853 //changeValueAttCodex(this.getCodexLo().getAttribute().getOwnValue()); | |
854 setCodicesOverviewRendered(false); | |
855 | |
856 */ | |
857 | |
858 | |
859 } | |
860 | |
861 public String closeCodicesOverview(){ | |
862 setCodicesOverviewRendered(false); | |
863 return "CLOSE"; | |
864 | |
865 } | |
866 | |
867 | |
868 private boolean isCodexIdentifierSet(String user){ | |
869 try { | |
870 | |
871 if(StatusImage.STATUS_OK.equals(getCodexLo().getStatus())){ | |
872 return true; | |
873 } | |
874 | |
875 String identifier = getNewIdentifier(); | |
876 | |
877 if(!StatusImage.STATUS_OK.equals(getCollectionLo().getStatus()) || | |
878 StringUtils.isEmpty(identifier)){ | |
879 //we can not save the witness | |
880 if(!StatusImage.STATUS_OK.equals(getCollectionLo().getStatus())){ | |
881 addErrorMsg("The Collection is not valid."); | |
882 } | |
883 if(StringUtils.isEmpty(identifier)){ | |
884 addErrorMsg("The Codex does not have an valid identifier."); | |
885 } | |
886 addErrorMsg("The Witness could not be saved."); | |
887 return false; | |
888 }else { | |
889 //two possibilities: | |
890 //1. there exist a codex with the same id | |
891 //2. there is no a codex with this id, it should be saved. | |
892 | |
893 if(StringUtils.isNotEmpty(identifier)){ | |
894 List<Entity> codexListOfCollection = | |
895 getWrapper().getSourcesForTargetRelation(getCollectionLo().getEntity(), | |
896 is_part_of, CODEX, -1); | |
897 for(Entity possibleCodex : codexListOfCollection){ | |
898 //juc Attribute att = getWrapper().getAttributeByName(possibleCodex, "identifier"); | |
899 Attribute att = getWrapper().getAttributeByName(possibleCodex.getId(), "identifier"); | |
900 if(att != null && identifier.equals(att.getValue())){ | |
111
22a18bfc66b0
new completion that uses ALIASes: AbstractListenerObject. was_copied_in in WITNESS form can use PLACE aliases now. some cleanup.
casties
parents:
1
diff
changeset
|
901 getCodexLo().setEntityAndAttributeName(possibleCodex, "identifier"); |
1 | 902 return true; |
903 } | |
904 } | |
905 } | |
906 } | |
907 | |
908 //if the Collection Status == OK && the Codex.identifier != null | |
909 Entity newCodex = new Entity(Node.TYPE_ABOX, CODEX, false); | |
910 newCodex.addAttribute(new Attribute("identifier", TEXT, identifier)); | |
911 getWrapper().saveEntity(newCodex, user); | |
912 Relation isPartOf = new Relation(newCodex, getCollectionLo().getEntity(), is_part_of); | |
913 getWrapper().saveRelationAsNode(isPartOf, user); | |
111
22a18bfc66b0
new completion that uses ALIASes: AbstractListenerObject. was_copied_in in WITNESS form can use PLACE aliases now. some cleanup.
casties
parents:
1
diff
changeset
|
914 getCodexLo().setEntityAndAttributeName(newCodex, "identifier"); |
1 | 915 |
916 } catch (Exception e) { | |
917 logger.error(e.getMessage(), e); | |
918 return false; | |
919 } | |
920 return true; | |
921 } | |
922 | |
923 public boolean isCreateCodexRendered() { | |
924 return createCodexRendered; | |
925 } | |
926 | |
927 public void setCreateCodexRendered(boolean createCodexRendered) { | |
928 this.createCodexRendered = createCodexRendered; | |
929 } | |
930 | |
931 @Override | |
932 public String loadCloneEntity(){ | |
933 this.setCodex(getCloneEntity()); | |
934 this.setRenderUnityCheckerDialog(false); | |
935 this.checkConsistencyFromCountryToCodex(); | |
936 return PAGE_EDITOR; | |
937 } | |
938 | |
939 public List<CodexForList> getCodicesAll() { | |
940 return codicesAll; | |
941 } | |
942 | |
943 public void setCodicesAll(List<CodexForList> codicesAll) { | |
944 this.codicesAll = codicesAll; | |
945 } | |
946 | |
947 public void setCodicesOverviewRendered(Boolean codicesOverviewRendered) { | |
948 this.codicesOverviewRendered = codicesOverviewRendered; | |
949 } | |
950 | |
951 public Boolean getCodicesOverviewRendered() { | |
952 return codicesOverviewRendered; | |
953 } | |
954 | |
955 /** | |
956 * Teste ob es Codices mit gleichem identifier gibt! | |
957 * @return | |
958 */ | |
959 public Boolean getRenderShowAllCodexCandidates(){ | |
960 return renderShowAllCodexCandidates; | |
961 } | |
962 | |
963 | |
964 | |
965 public List<SelectItem> getSuggestedTitlesWritten() { | |
966 return suggestedTitlesWritten; | |
967 } | |
968 | |
969 public void setSuggestedTitlesWritten(List<SelectItem> suggestedTitlesWritten) { | |
970 this.suggestedTitlesWritten = suggestedTitlesWritten; | |
971 } | |
972 | |
973 public List<SelectItem> getSuggestedAuthorsWritten() { | |
974 return suggestedAuthorsWritten; | |
975 } | |
976 | |
977 public void setSuggestedAuthorsWritten(List<SelectItem> suggestedAuthorsWritten) { | |
978 this.suggestedAuthorsWritten = suggestedAuthorsWritten; | |
979 } | |
980 | |
981 public void codexCodexChangeListener(ValueChangeEvent event) { | |
982 if (event.getNewValue() == null) { | |
983 return; | |
984 } | |
985 if (event.getNewValue().equals(event.getOldValue())) { | |
986 return; | |
987 } | |
988 this.getCodexLo().statusImage.setStatus(StatusImage.STATUS_UNSET); | |
989 this.getCodexLo().attribute.setValue(event.getNewValue().toString()); | |
990 } | |
991 public Long getValueTitleSelectedId() { | |
992 return valueTitleSelectedId; | |
993 } | |
994 | |
995 public void setValueTitleSelectedId(Long valueTitleSelectedId) { | |
996 this.valueTitleSelectedId = valueTitleSelectedId; | |
997 } | |
998 | |
999 public ListenerObject getCopyistLo() { | |
1000 return copyistLo; | |
1001 } | |
1002 | |
1003 public void setCopyistLo(ListenerObject copyistLo) { | |
1004 this.copyistLo = copyistLo; | |
1005 } | |
1006 | |
1007 public ListenerObject getCopyPlaceLo() { | |
1008 return copyPlaceLo; | |
1009 } | |
1010 | |
1011 public void setCopyPlaceLo(ListenerObject copyPlaceLo) { | |
1012 this.copyPlaceLo = copyPlaceLo; | |
1013 } | |
1014 | |
1015 public ListenerObject getPatronageLo() { | |
1016 return patronageLo; | |
1017 } | |
1018 | |
1019 public void setPatronageLo(ListenerObject patronageLo) { | |
1020 this.patronageLo = patronageLo; | |
1021 } | |
1022 | |
1023 public ListenerObject getTitleLo() { | |
1024 return titleLo; | |
1025 } | |
1026 | |
1027 public void setTitleLo(ListenerObject titleLo) { | |
1028 this.titleLo = titleLo; | |
1029 } | |
1030 | |
1031 public ListenerObject getAuthorLo() { | |
1032 return authorLo; | |
1033 } | |
1034 | |
1035 public String getNewIdentifier() { | |
1036 return newIdentifier; | |
1037 } | |
1038 | |
1039 public void setNewIdentifier(String newIdentifier) { | |
1040 this.newIdentifier = newIdentifier; | |
1041 } | |
1042 | |
1043 public EntityList getStudiedByList() { | |
1044 return studiedByList; | |
1045 } | |
1046 | |
1047 public Calendar getCopyDate() { | |
1048 return copyDate; | |
1049 } | |
1050 | |
1051 public void setCopyDate(Calendar copyDate) { | |
1052 this.copyDate = copyDate; | |
1053 } | |
1054 | |
1055 public void setStudiedByList(EntityList studiedByList) { | |
1056 this.studiedByList = studiedByList; | |
1057 } | |
1058 public Long getValueAuthorSelectedId() { | |
1059 return valueAuthorSelectedId; | |
1060 } | |
1061 | |
1062 public void setValueAuthorSelectedId(Long valueAuthorSelectedId) { | |
1063 this.valueAuthorSelectedId = valueAuthorSelectedId; | |
1064 } | |
1065 | |
1066 public String getValueTextWritten() { | |
1067 return valueTextWritten; | |
1068 } | |
1069 | |
1070 public void setValueTextWritten(String valueTextWritten) { | |
1071 //this.valueTextWritten = valueTextWritten; | |
1072 } | |
1073 | |
1074 public String getValueAuthorWritten() { | |
1075 return valueAuthorWritten; | |
1076 } | |
1077 | |
1078 public void setValueAuthorWritten(String valueAuthorWritten) { | |
1079 //this.valueAuthorWritten = valueAuthorWritten; | |
1080 } | |
1081 | |
1082 public void setAuthorLo(ListenerObject authorLo) { | |
1083 this.authorLo = authorLo; | |
1084 } | |
1085 | |
1086 public Long getSelectedTitleId() { | |
1087 return selectedTitleId; | |
1088 } | |
1089 | |
1090 public void setSelectedTitleId(Long selectedTitleId) { | |
1091 this.selectedTitleId = selectedTitleId; | |
1092 } | |
1093 public Long getSelectedPersonId() { | |
1094 return selectedPersonId; | |
1095 } | |
1096 | |
1097 public void setSelectedPersonId(Long selectedPersonId) { | |
1098 this.selectedPersonId = selectedPersonId; | |
1099 } | |
1100 | |
1101 public boolean isTextUnknown() { | |
1102 return textUnknown; | |
1103 } | |
1104 | |
1105 public void setTextUnknown(boolean textUnknown) { | |
1106 this.textUnknown = textUnknown; | |
1107 } | |
1108 | |
1109 public EntityList getPossibleExamplerOfList() { | |
1110 return possibleExamplerOfList; | |
1111 } | |
1112 | |
1113 public void setPossibleExamplerOfList(EntityList possibleExamplerOfList) { | |
1114 this.possibleExamplerOfList = possibleExamplerOfList; | |
1115 } | |
1116 | |
1117 } | |
1118 |