Mercurial > hg > ismi-richfaces
changeset 150:29c4b64caad0
small cleanup; add mams_number field for PERSON.
author | Robert Casties <casties@mpiwg-berlin.mpg.de> |
---|---|
date | Wed, 26 Jul 2017 16:33:26 +0200 |
parents | a279d80fae42 |
children | 1326182855ef |
files | src/main/java/de/mpiwg/itgroup/ismi/entry/beans/CurrentPersonBean.java src/main/java/de/mpiwg/itgroup/ismi/entry/utils/PrivacityUtils.java src/main/webapp/entry/person.xhtml |
diffstat | 3 files changed, 31 insertions(+), 25 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/de/mpiwg/itgroup/ismi/entry/beans/CurrentPersonBean.java Tue Jul 11 18:24:08 2017 +0200 +++ b/src/main/java/de/mpiwg/itgroup/ismi/entry/beans/CurrentPersonBean.java Wed Jul 26 16:33:26 2017 +0200 @@ -292,33 +292,34 @@ // PERSON -> lived_in -> PLACE (manyToMany) this.entity.removeAllSourceRelationsByName(lived_in); this.entity.removeAllSourceRelationsByName(lived_in_as); - for(Entity place : this.livedInPlaces.getEntities()) { + for (Entity place : this.livedInPlaces.getEntities()) { Entity placeEnt = getWrapper().getEntityByIdWithContent(place.getId()); if (placeEnt.getObjectClass().equals(PLACE)) { - // PERSON -> lived_in -> PLACE - Relation livedIn = new Relation(this.entity, placeEnt, lived_in); - Calendar cal = livedInPlaces.getCalendar(place.getId()); - if(cal != null){ - livedIn.addAttribute(new Attribute("date", "date", cal.toJSONString())); - } + // PERSON -> lived_in -> PLACE + Relation livedIn = new Relation(this.entity, placeEnt, lived_in); + Calendar cal = livedInPlaces.getCalendar(place.getId()); + if (cal != null) { + livedIn.addAttribute(new Attribute("date", "date", cal.toJSONString())); + } } else if (placeEnt.getObjectClass().equals(ALIAS)) { - // PERSON -> lived_in_as -> ALIAS - Relation livedInAs = new Relation(this.entity, placeEnt, lived_in_as); - Calendar cal = livedInPlaces.getCalendar(place.getId()); - if (cal != null) { - livedInAs.addAttribute(new Attribute("date", "date", cal.toJSONString())); - } - // ALIAS -> is_alias_name_of -> PLACE - List<Entity> places = getWrapper().getTargetsForSourceRelation(placeEnt, is_alias_name_of, PLACE, 1); - if (! places.isEmpty()) { - // PERSON -> lived_in -> PLACE - Entity realPlace = places.get(0); - Relation livedIn = new Relation(this.entity, realPlace, lived_in); - if (cal != null) { - livedIn.addAttribute(new Attribute("date", "date", cal.toJSONString())); - } - } - } + // PERSON -> lived_in_as -> ALIAS + Relation livedInAs = new Relation(this.entity, placeEnt, lived_in_as); + Calendar cal = livedInPlaces.getCalendar(place.getId()); + if (cal != null) { + livedInAs.addAttribute(new Attribute("date", "date", cal.toJSONString())); + } + // ALIAS -> is_alias_name_of -> PLACE + List<Entity> places = getWrapper().getTargetsForSourceRelation(placeEnt, is_alias_name_of, PLACE, + 1); + if (!places.isEmpty()) { + // PERSON -> lived_in -> PLACE + Entity realPlace = places.get(0); + Relation livedIn = new Relation(this.entity, realPlace, lived_in); + if (cal != null) { + livedIn.addAttribute(new Attribute("date", "date", cal.toJSONString())); + } + } + } } // Person -> has_floruit_date -> FLORUIT DATE
--- a/src/main/java/de/mpiwg/itgroup/ismi/entry/utils/PrivacityUtils.java Tue Jul 11 18:24:08 2017 +0200 +++ b/src/main/java/de/mpiwg/itgroup/ismi/entry/utils/PrivacityUtils.java Wed Jul 26 16:33:26 2017 +0200 @@ -36,7 +36,7 @@ /** * Change public state of all entities related to the given entity. * - * Sets public state to entity's state if isPublic == null. + * Sets public state to given entity's state if isPublic == null. * * @param entity * @param isPublic
--- a/src/main/webapp/entry/person.xhtml Tue Jul 11 18:24:08 2017 +0200 +++ b/src/main/webapp/entry/person.xhtml Wed Jul 26 16:33:26 2017 +0200 @@ -137,6 +137,11 @@ value="#{CurrentPerson.attributes['authority_id']}" /> <h:outputText /> + <h:outputText value="MAMS number" /> + <h:inputText size="10" + value="#{CurrentPerson.attributes['mams_number']}" /> + <h:outputText /> + <h:outputText value="Notes"/> <h:inputTextarea cols="70" rows="10" value="#{CurrentPerson.attributes['notes']}"/>