Skip to content
This repository was archived by the owner on Oct 6, 2023. It is now read-only.

Commit 3bd0014

Browse files
committed
Prevent users from entering organizations with empty/null values (DOECODE-1205)
1 parent 010ad1b commit 3bd0014

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

src/main/java/gov/osti/services/Metadata.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3379,6 +3379,27 @@ else if (hasLicense && isOtherLicense && !hasPropUrl)
33793379
}
33803380
}
33813381
}
3382+
if(!(null==m.getContributingOrganizations() || m.getContributingOrganizations().isEmpty())) {
3383+
for ( ContributingOrganization org : m.getContributingOrganizations()) {
3384+
if ( StringUtils.isBlank(org.getOrganizationName()) || null == org.getContributorType()) {
3385+
reasons.add("Contributing Organizations must include both the organization name and contributor type.");
3386+
}
3387+
}
3388+
}
3389+
if(!(null==m.getSponsoringOrganizations() || m.getSponsoringOrganizations().isEmpty())) {
3390+
for ( SponsoringOrganization org : m.getSponsoringOrganizations()) {
3391+
if ( StringUtils.isBlank(org.getOrganizationName())) {
3392+
reasons.add("Sponsoring Organizations must include the organization name.");
3393+
}
3394+
}
3395+
}
3396+
if(!(null==m.getResearchOrganizations() || m.getResearchOrganizations().isEmpty())) {
3397+
for ( ResearchOrganization org : m.getResearchOrganizations()) {
3398+
if ( StringUtils.isBlank(org.getOrganizationName())) {
3399+
reasons.add("Research Organizations must include the organization name.");
3400+
}
3401+
}
3402+
}
33823403
if (!(null==m.getAwardDois() || m.getAwardDois().isEmpty())) {
33833404
for ( Award award : m.getAwardDois() ) {
33843405
if ( StringUtils.isBlank(award.getAwardDoi()) || StringUtils.isBlank(award.getFunderName()) ) {

0 commit comments

Comments
 (0)