Mercurial > hg > ismi-richfaces
changeset 113:8e3f1f81acfb
small cleanup.
author | casties |
---|---|
date | Wed, 14 Dec 2016 15:29:05 +0100 |
parents | 59f26a5ef2b3 |
children | 2b77751e4021 |
files | src/main/java/de/mpiwg/itgroup/ismi/entry/beans/AbstractISMIBean.java src/main/java/de/mpiwg/itgroup/ismi/event/beans/CopyEvent.java src/main/java/de/mpiwg/itgroup/ismi/event/beans/StudyEvent.java src/main/java/de/mpiwg/itgroup/ismi/event/beans/TransferEvent.java |
diffstat | 4 files changed, 18 insertions(+), 48 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/de/mpiwg/itgroup/ismi/entry/beans/AbstractISMIBean.java Tue Dec 13 19:04:45 2016 +0100 +++ b/src/main/java/de/mpiwg/itgroup/ismi/entry/beans/AbstractISMIBean.java Wed Dec 14 15:29:05 2016 +0100 @@ -1071,8 +1071,8 @@ } /** - * Replace the given source relations on the given entity by the contents of the AliasListenerObject (type entClass) - * using the given relName and aliasRelName. + * Replace the given source relations on the given entity by the contents of the AliasListenerObject + * (type entClass) using the given relName and aliasRelName. * * ent - relName -> targetClass, * ent - aliasRelName -> ALIAS
--- a/src/main/java/de/mpiwg/itgroup/ismi/event/beans/CopyEvent.java Tue Dec 13 19:04:45 2016 +0100 +++ b/src/main/java/de/mpiwg/itgroup/ismi/event/beans/CopyEvent.java Wed Dec 14 15:29:05 2016 +0100 @@ -106,23 +106,6 @@ this.witnessList = new ArrayList<SelectItem>(); } - /* - public void listenerChangePersonCopyingText(ValueChangeEvent event) { - this.personCopyingText = changeListener(event, personCopyingText, PERSON, name_translit); - } - - public void listenerChangePersonCopiedFor(ValueChangeEvent event) { - this.personCopiedFor = changeListener(event, personCopiedFor, PERSON, name_translit); - } - - public void listenerChangePlace(ValueChangeEvent event) { - this.place = changeListener(event, place, PLACE, name); - } - - public void listenerChangeRepository(ValueChangeEvent event) { - this.repository = changeListener(event, repository, REPOSITORY, name); - }*/ - public void listenerSave(ActionEvent event) { this.save(); } @@ -150,9 +133,9 @@ replaceAliasSourceRelation(event, placeLo, PLACE, was_copied_in, was_copied_in_as); // EVENT -> is_a_copy_of -> WITNESS - if(witness.isLightweight()){ - this.witness = getWrapper().getEntityByIdWithContent(witness.getId()); - } + if (witness.isLightweight()) { + this.witness = getWrapper().getEntityByIdWithContent(witness.getId()); + } event.replaceSourceRelation(witness, WITNESS, is_a_copy_of); getWrapper().saveEntity(event, getSessionUserName());
--- a/src/main/java/de/mpiwg/itgroup/ismi/event/beans/StudyEvent.java Tue Dec 13 19:04:45 2016 +0100 +++ b/src/main/java/de/mpiwg/itgroup/ismi/event/beans/StudyEvent.java Wed Dec 14 15:29:05 2016 +0100 @@ -102,15 +102,15 @@ } @Override - public String save(){ + public String save() { super.save(); - if(!checkConsistency()){ + if (!checkConsistency()) { addGeneralMsg("Either the Witness, the Person or the Place is empty."); addGeneralMsg("The event could not be saved."); return null; } - try{ + try { getAttributes().put("date", this.date.toJSONString()); event = updateEntityAttributes(event); @@ -133,7 +133,7 @@ printSuccessSavingEntity(); - }catch (Exception e) { + } catch (Exception e) { addGeneralMsg(e.getMessage()); logger.error(e.getMessage(), e); } @@ -141,19 +141,6 @@ return null; } - /* - public void listenerChangePerson(ValueChangeEvent event) { - this.person = changeListener(event, person, PERSON, name_translit); - } - - public void listenerChangeAdvisor(ValueChangeEvent event) { - this.advisor = changeListener(event, advisor, PERSON, name_translit); - } - - public void listenerChangeRepository(ValueChangeEvent event) { - this.repository = changeListener(event, repository, REPOSITORY, name); - } - */ @Override public void reset() { super.reset();
--- a/src/main/java/de/mpiwg/itgroup/ismi/event/beans/TransferEvent.java Tue Dec 13 19:04:45 2016 +0100 +++ b/src/main/java/de/mpiwg/itgroup/ismi/event/beans/TransferEvent.java Wed Dec 14 15:29:05 2016 +0100 @@ -150,34 +150,34 @@ } @Override - public String save(){ + public String save() { super.save(); - if(!checkConsistency()){ + if (!checkConsistency()) { addGeneralMsg("Either the Witness, the Person or the Place is empty."); addGeneralMsg("The event could not be saved."); return null; } - try{ + try { getAttributes().put("date", this.date.toJSONString()); event = updateEntityAttributes(event); // EVENT -> was_studied_by -> WITNESS - if(witness.isLightweight()){ + if (witness.isLightweight()) { this.witness = getWrapper().getEntityByIdWithContent(witness.getId()); } event.replaceSourceRelation(witness, WITNESS, is_a_transfer_of); - // EVENT -> was_transferred_from -> PERSON/REPOSITORY + // EVENT -> was_transferred_from -> PERSON event.replaceSourceRelation(personFromLo.entity, PERSON, was_transferred_from); - // EVENT -> was_transferred_to -> PERSON/REPOSITORY + // EVENT -> was_transferred_to -> PERSON event.replaceSourceRelation(personToLo.entity, PERSON, was_transferred_to); - // EVENT -> has_original_location -> PLACE/REPOSITORY + // EVENT -> has_original_location -> PLACE event.replaceSourceRelation(placeOriginalLocationLo.entity, PLACE, has_original_location); - // EVENT -> has_new_location -> PLACE/REPOSITORY + // EVENT -> has_new_location -> PLACE event.replaceSourceRelation(placeNewLocationLo.entity, PLACE, has_new_location); // EVENT -> was_transferred_in -> PLACE @@ -187,7 +187,7 @@ printSuccessSavingEntity(); - }catch (Exception e) { + } catch (Exception e) { addGeneralMsg(e.getMessage()); logger.error(e.getMessage(), e); }