# HG changeset patch # User casties # Date 1474480395 -7200 # Node ID c000b4b386bce817b21bd4aed6728c2e8d36298d # Parent 0d5d36c83e7758cad656b19046754b85b9f93b83 better "internal error" message. fix NPE when codex has no identifier. diff -r 0d5d36c83e77 -r c000b4b386bc src/main/java/de/mpiwg/itgroup/ismi/entry/beans/AbstractBean.java --- a/src/main/java/de/mpiwg/itgroup/ismi/entry/beans/AbstractBean.java Mon Aug 29 20:18:04 2016 +0200 +++ b/src/main/java/de/mpiwg/itgroup/ismi/entry/beans/AbstractBean.java Wed Sep 21 19:53:15 2016 +0200 @@ -44,9 +44,11 @@ protected void printInternalError(Exception e){ addErrorMsg("Internal Error, this action could not be executed correctly."); - addErrorMsg(e.getMessage()); + addErrorMsg("Error:"); + addErrorMsg(e.toString()); + addErrorMsg(e.getStackTrace()[0].toString()); addErrorMsg("Server time: " + DateFormat.getDateTimeInstance().format(new Date())); - addErrorMsg("Please inform support: jurzua@mpiwg-berlin.mpg.de"); + addErrorMsg("Please inform support: casties@mpiwg-berlin.mpg.de"); } protected SessionBean getSessionBean() { diff -r 0d5d36c83e77 -r c000b4b386bc src/main/java/de/mpiwg/itgroup/ismi/entry/beans/CodexEditorTemplate.java --- a/src/main/java/de/mpiwg/itgroup/ismi/entry/beans/CodexEditorTemplate.java Mon Aug 29 20:18:04 2016 +0200 +++ b/src/main/java/de/mpiwg/itgroup/ismi/entry/beans/CodexEditorTemplate.java Wed Sep 21 19:53:15 2016 +0200 @@ -427,7 +427,7 @@ boolean consistent = false; Entity country = this.getCountryLo().entity; - if(country != null && country.isPersistent() && StringUtils.isNotEmpty(getCountryLo().getAttribute().getValue())){ + if(country != null && country.isPersistent() && getCountryLo().getAttribute() != null &&StringUtils.isNotEmpty(getCountryLo().getAttribute().getValue())){ Attribute att = getWrapper().getAttributeByName(country.getId(), "name"); @@ -452,7 +452,7 @@ boolean consistent = false; Entity city = this.getCityLo().entity; - if(city != null && city.isPersistent() && StringUtils.isNotEmpty(getCityLo().getAttribute().getValue())){ + if(city != null && city.isPersistent() && getCityLo().getAttribute() != null &&StringUtils.isNotEmpty(getCityLo().getAttribute().getValue())){ List list = getWrapper().getTargetsForSourceRelation(city, is_part_of, PLACE, 1); @@ -477,7 +477,7 @@ boolean consistent = false; Entity repository = this.getRepositoryLo().entity; - if(repository != null && repository.isPersistent() && StringUtils.isNotEmpty(getRepositoryLo().getAttribute().getValue())){ + if(repository != null && repository.isPersistent() && getCollectionLo().getAttribute() != null && StringUtils.isNotEmpty(getRepositoryLo().getAttribute().getValue())){ //juc List list = getSearchServ().getTargetsForSourceRelation(repository, is_in, PLACE, 1); List list = getWrapper().getTargetsForSourceRelation(repository, is_in, PLACE, 1); @@ -502,7 +502,7 @@ boolean consistent = false; Entity collection = this.getCollectionLo().entity; - if(collection != null && collection.isPersistent() && StringUtils.isNotEmpty(getCollectionLo().getAttribute().getValue())){ + if(collection != null && collection.isPersistent() && getCollectionLo().getAttribute() != null && StringUtils.isNotEmpty(getCollectionLo().getAttribute().getValue())){ List list = getWrapper().getTargetsForSourceRelation(collection, is_part_of, REPOSITORY, 1); @@ -526,7 +526,7 @@ private void checkConsistencyOfCodex(Entity collection){ Entity codex = this.getCodexLo().entity; - if(codex != null && codex.isPersistent() && StringUtils.isNotEmpty(getCodexLo().getAttribute().getValue())){ + if(codex != null && codex.isPersistent() && getCodexLo().getAttribute() != null && StringUtils.isNotEmpty(getCodexLo().getAttribute().getValue())){ Attribute identifier = getWrapper().getAttributeByName(codex.getId(), "identifier"); @@ -558,7 +558,7 @@ if(bCodex){ Entity codex = this.getCodexLo().entity; - if(codex != null && codex.isPersistent() && StringUtils.isNotEmpty(getCodexLo().getAttribute().getValue())) + if(codex != null && codex.isPersistent() && getCodexLo().getAttribute() != null && StringUtils.isNotEmpty(getCodexLo().getAttribute().getValue())) this.getCodexLo().statusImage.setStatus(StatusImage.STATUS_FALSE); else this.getCodexLo().statusImage.setStatus(StatusImage.STATUS_UNSET); @@ -566,7 +566,7 @@ if(bCollection){ Entity collection = this.getCollectionLo().entity; - if(collection != null && collection.isPersistent() && StringUtils.isNotEmpty(this.getCollectionLo().getAttribute().getValue())) + if(collection != null && collection.isPersistent() && this.getCollectionLo().getAttribute() != null && StringUtils.isNotEmpty(this.getCollectionLo().getAttribute().getValue())) this.getCollectionLo().statusImage.setStatus(StatusImage.STATUS_FALSE); else this.getCollectionLo().statusImage.setStatus(StatusImage.STATUS_UNSET); @@ -574,7 +574,7 @@ if(bRepository){ Entity repository = this.getRepositoryLo().entity; - if(repository != null && repository.isPersistent() && StringUtils.isNotEmpty(this.getRepositoryLo().getAttribute().getValue())) + if(repository != null && repository.isPersistent() && this.getRepositoryLo().getAttribute() != null && StringUtils.isNotEmpty(this.getRepositoryLo().getAttribute().getValue())) this.getRepositoryLo().statusImage.setStatus(StatusImage.STATUS_FALSE); else this.getRepositoryLo().statusImage.setStatus(StatusImage.STATUS_UNSET); @@ -582,7 +582,7 @@ if(bCity){ Entity city = this.getCityLo().entity; - if(city != null && city.isPersistent() && StringUtils.isNotEmpty(this.getCityLo().getAttribute().getValue())) + if(city != null && city.isPersistent() && this.getCityLo().getAttribute() != null && StringUtils.isNotEmpty(this.getCityLo().getAttribute().getValue())) this.getCityLo().statusImage.setStatus(StatusImage.STATUS_FALSE); else this.getCityLo().statusImage.setStatus(StatusImage.STATUS_UNSET); @@ -590,7 +590,7 @@ if(bCountry){ Entity country = this.getCountryLo().entity; - if(country != null && country.isPersistent() && StringUtils.isNotEmpty(this.getCountryLo().getAttribute().getValue())) + if(country != null && country.isPersistent() && this.getCountryLo().getAttribute() != null && StringUtils.isNotEmpty(this.getCountryLo().getAttribute().getValue())) this.getCountryLo().statusImage.setStatus(StatusImage.STATUS_FALSE); else this.getCountryLo().statusImage.setStatus(StatusImage.STATUS_UNSET);