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