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

Commit 7dac9f7

Browse files
committed
Merge branch 'v1.2'
2 parents 4a8d302 + 1db1197 commit 7dac9f7

File tree

13 files changed

+389
-82
lines changed

13 files changed

+389
-82
lines changed

pom.xml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,12 +179,31 @@
179179
<type>jar</type>
180180
</dependency>
181181

182+
<!-- javax bean validation reference spec -->
183+
<dependency>
184+
<groupId>javax.validation</groupId>
185+
<artifactId>validation-api</artifactId>
186+
<version>2.0.0.Final</version>
187+
</dependency>
188+
189+
<!-- Java Bean validation libraries from Hibernate -->
190+
<dependency>
191+
<groupId>org.hibernate.validator</groupId>
192+
<artifactId>hibernate-validator</artifactId>
193+
<version>6.0.2.Final</version>
194+
</dependency>
195+
<dependency>
196+
<groupId>org.hibernate.validator</groupId>
197+
<artifactId>hibernate-validator-annotation-processor</artifactId>
198+
<version>6.0.2.Final</version>
199+
</dependency>
182200

183-
<dependency>
201+
<!-- apache shiro authentication layer -->
202+
<dependency>
184203
<groupId>org.apache.shiro</groupId>
185204
<artifactId>shiro-core</artifactId>
186205
<version>1.3.2</version>
187-
</dependency>
206+
</dependency>
188207

189208
<dependency>
190209
<groupId>org.apache.shiro</groupId>

schema.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,7 @@
493493
<field name="sponsoringOrganizations.primaryAward" type="text_en"
494494
multiValued="true" indexed="true" stored="true"/>
495495
<field name="workflowStatus" type="string" indexed="true" stored="true"/>
496+
<field name="softwareType" type="string" indexed="true" stored="true"/>
496497

497498
<!-- any incoming JSON field not defined above is dropped -->
498499
<dynamicField name="*" type="ignored"/>

src/main/java/gov/osti/entity/Agent.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import javax.persistence.GenerationType;
99
import javax.persistence.Id;
1010
import javax.persistence.MappedSuperclass;
11+
import javax.validation.constraints.Size;
1112
import org.apache.commons.lang3.StringUtils;
1213
import org.slf4j.Logger;
1314
import org.slf4j.LoggerFactory;
@@ -45,20 +46,23 @@ public void setAgentId(Long id) {
4546
this.agentId = id;
4647
}
4748

49+
@Size (max = 255, message = "First name is limited to 255 characters.")
4850
@Column (name = "FIRST_NAME")
4951
public String getFirstName() {
5052
return firstName;
5153
}
5254
public void setFirstName(String firstName) {
5355
this.firstName = firstName;
5456
}
57+
@Size (max = 255, message = "Last name is limited to 255 characters.")
5558
@Column (name = "LAST_NAME")
5659
public String getLastName() {
5760
return lastName;
5861
}
5962
public void setLastName(String lastName) {
6063
this.lastName = lastName;
6164
}
65+
@Size (max = 255, message = "Middle name is limited to 255 characters.")
6266
@Column (name = "MIDDLE_NAME")
6367
public String getMiddleName() {
6468
return middleName;
@@ -67,6 +71,7 @@ public void setMiddleName(String middleName) {
6771
this.middleName = middleName;
6872
}
6973

74+
@Size (max = 640, message = "Email is limited to 640 characters.")
7075
@Column (length = 640)
7176
public String getEmail() {
7277
return email;

src/main/java/gov/osti/entity/ApprovedMetadata.java

Lines changed: 0 additions & 65 deletions
This file was deleted.

src/main/java/gov/osti/entity/DOECodeMetadata.java

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838
import javax.persistence.PreUpdate;
3939
import javax.persistence.Temporal;
4040
import javax.persistence.TemporalType;
41+
import javax.validation.Valid;
42+
import javax.validation.constraints.Size;
4143
import javax.xml.bind.annotation.XmlRootElement;
4244
import org.slf4j.Logger;
4345
import org.slf4j.LoggerFactory;
@@ -63,10 +65,12 @@ public class DOECodeMetadata implements Serializable {
6365
* Saved - stored to the database without validation
6466
* Submitted - validated to business logic rules, and/or sent to OSTI
6567
* Approved - ready to be sent to SOLR/search services
68+
* Announced - sent to OSTI
6669
*/
6770
public enum Status {
6871
Saved,
6972
Submitted,
73+
Announced,
7074
Approved
7175
}
7276

@@ -251,6 +255,7 @@ public Boolean getOpenSource() {
251255
public void setOpenSource(Boolean openSource) {
252256
this.openSource = openSource;
253257
}
258+
@Size (max = 255, message = "Repository link is limited to 255 characters.")
254259
@Column (name="REPOSITORY_LINK")
255260
public String getRepositoryLink() {
256261
return repositoryLink;
@@ -287,6 +292,7 @@ public void setAccessLimitations(List<String> limitations) {
287292
*/
288293
@OneToMany (cascade = CascadeType.ALL, orphanRemoval = true)
289294
@JoinColumn (name="OWNER_ID", referencedColumnName = "CODE_ID")
295+
@Valid
290296
public List<Contributor> getContributors() {
291297
return this.contributors;
292298
}
@@ -297,6 +303,7 @@ public List<Contributor> getContributors() {
297303
*/
298304
@OneToMany(cascade = CascadeType.ALL, orphanRemoval = true)
299305
@JoinColumn (name ="OWNER_ID", referencedColumnName = "CODE_ID")
306+
@Valid
300307
public List<SponsoringOrganization> getSponsoringOrganizations() {
301308
return this.sponsoringOrganizations;
302309
}
@@ -307,6 +314,7 @@ public List<SponsoringOrganization> getSponsoringOrganizations() {
307314
*/
308315
@OneToMany(cascade = CascadeType.ALL, orphanRemoval = true)
309316
@JoinColumn (name = "OWNER_ID", referencedColumnName = "CODE_ID")
317+
@Valid
310318
public List<ContributingOrganization> getContributingOrganizations() {
311319
return this.contributingOrganizations;
312320
}
@@ -317,29 +325,34 @@ public List<ContributingOrganization> getContributingOrganizations() {
317325
*/
318326
@OneToMany(cascade = CascadeType.ALL, orphanRemoval = true)
319327
@JoinColumn (name="OWNER_ID", referencedColumnName = "CODE_ID")
328+
@Valid
320329
public List<ResearchOrganization> getResearchOrganizations() {
321330
return this.researchOrganizations;
322331
}
323332

333+
@Size (max = 1000, message = "Software title is limited to 1000 characters.")
324334
@Column (name = "SOFTWARE_TITLE", length = 1000)
325335
public String getSoftwareTitle() {
326336
return softwareTitle;
327337
}
328338
public void setSoftwareTitle(String softwareTitle) {
329339
this.softwareTitle = softwareTitle;
330340
}
341+
@Size (max = 255, message = "Acronym is limited to 255 characters.")
331342
public String getAcronym() {
332343
return acronym;
333344
}
334345
public void setAcronym(String acronym) {
335346
this.acronym = acronym;
336347
}
348+
@Size (max = 255, message = "DOI is limited to 255 characters.")
337349
public String getDoi() {
338350
return doi;
339351
}
340352
public void setDoi(String doi) {
341353
this.doi = doi;
342354
}
355+
@Size (max = 4000, message = "Description is limited to 4000 characters.")
343356
@Column (length = 4000, name = "description")
344357
public String getDescription() {
345358
return description;
@@ -361,20 +374,23 @@ public List<RelatedIdentifier> getRelatedIdentifiers() {
361374
return this.relatedIdentifiers;
362375
}
363376

377+
@Size (max = 255, message = "Country is limited to 255 characters.")
364378
@Column (name = "COUNTRY_OF_ORIGIN")
365379
public String getCountryOfOrigin() {
366380
return countryOfOrigin;
367381
}
368382
public void setCountryOfOrigin(String countryOfOrigin) {
369383
this.countryOfOrigin = countryOfOrigin;
370384
}
385+
@Size (max = 500, message = "Keywords are limited to 500 characters.")
371386
@Column (length = 500)
372387
public String getKeywords() {
373388
return keywords;
374389
}
375390
public void setKeywords(String keywords) {
376391
this.keywords = keywords;
377392
}
393+
@Size (max = 3000, message = "Disclaimers are limited to 3000 characters.")
378394
@Column (length = 3000)
379395
public String getDisclaimers() {
380396
return disclaimers;
@@ -396,6 +412,7 @@ public void setLicenses(List<String> licenses) {
396412
}
397413

398414

415+
@Size (max = 255, message = "Proprietary URL is limited to 255 characters.")
399416
@Column (name="PROPRIETARY_URL")
400417
public String getProprietaryUrl() {
401418
return proprietaryUrl;
@@ -411,6 +428,7 @@ public void setProprietaryUrl(String proprietaryUrl) {
411428
*/
412429
@OneToMany(cascade = CascadeType.ALL, orphanRemoval = true)
413430
@JoinColumn (name="OWNER_ID", referencedColumnName = "CODE_ID")
431+
@Valid
414432
public List<Developer> getDevelopers() {
415433
return developers;
416434
}
@@ -457,27 +475,31 @@ public void setDevelopers(List<Developer> devlist) {
457475
this.developers = devlist;
458476
}
459477

478+
@Size (max = 255, message = "Recipient name is limited to 255 characters.")
460479
@Column (name = "RECIPIENT_NAME")
461480
public String getRecipientName() {
462481
return recipientName;
463482
}
464483
public void setRecipientName(String recipientName) {
465484
this.recipientName = recipientName;
466485
}
486+
@Size (max = 255, message = "Recipient email is limited to 255 characters.")
467487
@Column (name="RECIPIENT_EMAIL")
468488
public String getRecipientEmail() {
469489
return recipientEmail;
470490
}
471491
public void setRecipientEmail(String recipientEmail) {
472492
this.recipientEmail = recipientEmail;
473493
}
494+
@Size (max = 255, message = "Recipient phone is limited to 255 characters.")
474495
@Column (name="RECIPIENT_PHONE")
475496
public String getRecipientPhone() {
476497
return recipientPhone;
477498
}
478499
public void setRecipientPhone(String recipientPhone) {
479500
this.recipientPhone = recipientPhone;
480501
}
502+
@Size (max = 255, message = "Recipient organization is limited to 255 characters.")
481503
@Column (name = "RECIPIENT_ORGANIZATION")
482504
public String getRecipientOrg() {
483505
return recipientOrg;
@@ -486,6 +508,7 @@ public void setRecipientOrg(String recipientOrg) {
486508
this.recipientOrg = recipientOrg;
487509
}
488510

511+
@Size (max = 255, message = "Accession number is limited to 255 characters.")
489512
@Column (name="SITE_ACCESSION_NUMBER")
490513
public String getSiteAccessionNumber() {
491514
return siteAccessionNumber;
@@ -494,6 +517,7 @@ public void setSiteAccessionNumber(String siteAccessionNumber) {
494517
this.siteAccessionNumber = siteAccessionNumber;
495518
}
496519

520+
@Size (max = 1500, message = "Other special requirements field is limited to 255 characters.")
497521
@Column (name="OTHER_SPECIAL_REQUIREMENTS", length = 1500)
498522
public String getOtherSpecialRequirements() {
499523
return otherSpecialRequirements;
@@ -540,6 +564,7 @@ public Date getReleaseDate() {
540564
return this.releaseDate;
541565
}
542566

567+
@Size (max = 255, message = "Landing page URL is limited to 255 characters.")
543568
@Column (name="LANDING_PAGE")
544569
public String getLandingPage() {
545570
return landingPage;

0 commit comments

Comments
 (0)