Skip to content

Commit

Permalink
#156 check for missing contact information
Browse files Browse the repository at this point in the history
  • Loading branch information
p-a-s-c-a-l committed May 19, 2017
1 parent fe9198a commit 01e4e86
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -558,8 +558,12 @@ private ObjectNode copyMetadata(final ObjectNode deposition, final CidsBean reso
if ((contact.getProperty("name") == null) || contact.getProperty("name").toString().isEmpty()) {
if ((contact.getProperty("organisation") == null)
|| contact.getProperty("oranisation").toString().isEmpty()) {
throw new Exception("resource " + resourceBean.getPrimaryKeyValue() + " '"
+ resourceBean.getProperty("name") + "' does not have valid contact information");
LOGGER.error("resource " + resourceBean.getPrimaryKeyValue() + " '"
+ resourceBean.getProperty("name") + "' does not have valid contact information. Setting to 'SWITCH-ON Consortium'");

final ObjectNode creator = creators.addObject();
creator.put("name", "SWITCH-ON Consortium");
creator.put("affiliation", "SWITCH-ON Project");
} else {
final ObjectNode creator = creators.addObject();
creator.put("name", contact.getProperty("organisation").toString());
Expand Down Expand Up @@ -605,7 +609,8 @@ private ObjectNode copyMetadata(final ObjectNode deposition, final CidsBean reso

// notes ---------------------------------------------------------------
for (final CidsBean metadataBean : resourceBean.getBeanCollectionProperty("metadata")) {
if (((CidsBean)metadataBean.getProperty("type")).getProperty("name").toString().equalsIgnoreCase(
if (metadataBean.getProperty("type") != null
&& ((CidsBean)metadataBean.getProperty("type")).getProperty("name").toString().equalsIgnoreCase(
"lineage meta-data")) {
if ((metadataBean.getProperty("description") != null)
&& !metadataBean.getProperty("description").toString().isEmpty()) {
Expand Down

0 comments on commit 01e4e86

Please # to comment.