Skip to content

Commit

Permalink
[Issue 368] Refactor relationship date time interval properties (#369)
Browse files Browse the repository at this point in the history
* Refactor relationship date time interval properties

The field types conflicted with property of the same name on Process.

* Add eof newline to template file
  • Loading branch information
wwelling authored Aug 11, 2023
1 parent 1339e65 commit f6578dc
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 61 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -191,13 +191,13 @@ public class Relationship extends Common {

@Field
@FieldType(type = "pdate")
@FieldSource(template = "relationship/dateTimeIntervalStart", predicate = "http://vivoweb.org/ontology/core#dateTime")
private String dateTimeIntervalStart;
@FieldSource(template = "relationship/startDateTime", predicate = "http://vivoweb.org/ontology/core#dateTime")
private String startDateTime;

@Field
@FieldType(type = "pdate")
@FieldSource(template = "relationship/dateTimeIntervalEnd", predicate = "http://vivoweb.org/ontology/core#dateTime")
private String dateTimeIntervalEnd;
@FieldSource(template = "relationship/endDateTime", predicate = "http://vivoweb.org/ontology/core#dateTime")
private String endDateTime;

@Field
@NestedObject
Expand Down Expand Up @@ -486,20 +486,20 @@ public void setSupportedPublicationOrOtherWork(List<String> supportedPublication
this.supportedPublicationOrOtherWork = supportedPublicationOrOtherWork;
}

public String getDateTimeIntervalStart() {
return dateTimeIntervalStart;
public String getStartDateTime() {
return startDateTime;
}

public void setDateTimeIntervalStart(String dateTimeIntervalStart) {
this.dateTimeIntervalStart = dateTimeIntervalStart;
public void setStartDateTime(String startDateTime) {
this.startDateTime = startDateTime;
}

public String getDateTimeIntervalEnd() {
return dateTimeIntervalEnd;
public String getEndDateTime() {
return endDateTime;
}

public void setDateTimeIntervalEnd(String dateTimeIntervalEnd) {
this.dateTimeIntervalEnd = dateTimeIntervalEnd;
public void setEndDateTime(String endDateTime) {
this.endDateTime = endDateTime;
}

public List<String> getSubjectAreas() {
Expand Down
12 changes: 6 additions & 6 deletions src/main/resources/defaults/discoveryViews.yml
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,8 @@
fields:
- type
- title
- dateTimeIntervalStart
- dateTimeIntervalEnd
- startDateTime
- endDateTime
- awardedBy
- contributors
- contributors.role
Expand Down Expand Up @@ -409,7 +409,7 @@
collapsed: true
hidden: false
- name: Year Start
field: dateTimeIntervalStart
field: startDateTime
opKey: BETWEEN
type: DATE_YEAR
sort: COUNT
Expand All @@ -418,7 +418,7 @@
collapsed: true
hidden: false
- name: Year End
field: dateTimeIntervalEnd
field: endDateTime
opKey: BETWEEN
type: DATE_YEAR
sort: COUNT
Expand Down Expand Up @@ -448,9 +448,9 @@
- columnHeader: Grant title
valuePath: title
- columnHeader: Grant date start
valuePath: dateTimeIntervalStart
valuePath: startDateTime
- columnHeader: Grant date end
valuePath: dateTimeIntervalEnd
valuePath: endDateTime
- columnHeader: Awarded by
valuePath: awardedBy
- columnHeader: Principal investigators
Expand Down
14 changes: 7 additions & 7 deletions src/main/resources/defaults/discoveryViews/grants/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@
</div>
<div>
<div>
{{#if dateTimeIntervalStart}}
{{#if dateTimeIntervalEnd}}
{{#if startDateTime}}
{{#if endDateTime}}
<span class="label">Date:</span>
<span>{{toYear dateTimeIntervalStart}}</span>
<span>{{toYear startDateTime}}</span>
<span>-</span>
<span>{{toYear dateTimeIntervalEnd}}</span>
<span>{{toYear endDateTime}}</span>
{{else}}
<span class="label">Date:</span>
<span>{{toYear dateTimeIntervalStart}}</span>
<span>{{toYear startDateTime}}</span>
{{/if}}
{{else}}
{{#if dateTimeIntervalEnd}}
{{#if endDateTime}}
<span class="label">Date:</span>
<span>{{toYear dateTimeIntervalEnd}}</span>
<span>{{toYear endDateTime}}</span>
{{/if}}
{{/if}}
</div>
Expand Down
18 changes: 7 additions & 11 deletions src/main/resources/defaults/displayViews.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1103,22 +1103,18 @@
template: "defaults/displayViews/organizations/overview/abbreviation.html"
field: abbreviation
order: 2
- name: date/time interval
template: "defaults/displayViews/organizations/overview/dateTimeInterval.html"
field: dateTimeInterval
order: 3
- name: sponsors award or honor
paginated: true
template: "defaults/displayViews/organizations/overview/sponsorsAwardOrHonor.html"
field: sponsorsAwardOrHonor
order: 4
order: 3
lazyReferences:
- sponsorsAwardOrHonor
- name: award or honor given
paginated: true
template: "defaults/displayViews/organizations/overview/awardOrHonorGiven.html"
field: awardOrHonorGiven
order: 5
order: 4
sort:
- field: yearAwarded
direction: DESC
Expand All @@ -1128,17 +1124,17 @@
- name: awards and honors received
template: "defaults/displayViews/organizations/overview/awardsAndHonorsReceived.html"
field: awardsAndHonorsReceived
order: 6
order: 5
lazyReferences:
- awardsAndHonorsReceived
- name: keywords
template: "defaults/displayViews/organizations/overview/keywords.html"
field: keywords
order: 7
order: 6
- name: geographic focus
template: "defaults/displayViews/organizations/overview/geographicFocus.html"
field: geographicFocus
order: 8
order: 7
- name: Affiliation
sections:
- name: organization for training
Expand Down Expand Up @@ -1778,10 +1774,10 @@
order: 3
- name: date/time interval
template: "defaults/displayViews/relationships/overview/dateTimeInterval.html"
field: dateTimeIntervalStart
field: startDateTime
order: 4
requiredFields:
- dateTimeIntervalEnd
- endDateTime
- name: year awarded
template: "defaults/displayViews/relationships/overview/yearAwarded.html"
field: yearAwarded
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<div>
{{#if dateTimeIntervalStart}}
{{#if dateTimeIntervalEnd}}
<span>{{toYear dateTimeIntervalStart}}</span>
{{#if startDateTime}}
{{#if endDateTime}}
<span>{{toYear startDateTime}}</span>
<span>-</span>
<span>{{toYear dateTimeIntervalEnd}}</span>
<span>{{toYear endDateTime}}</span>
{{else}}
<span>{{toYear dateTimeIntervalStart}}</span>
<span>{{toYear startDateTime}}</span>
{{/if}}
{{else}}
{{#if dateTimeIntervalEnd}}
<span>{{toYear dateTimeIntervalEnd}}</span>
{{#if endDateTime}}
<span>{{toYear endDateTime}}</span>
{{/if}}
{{/if}}
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"coPrincipalInvestigators": [
"Hagan-Burke, Shanna::nb2c12cd3"
],
"dateTimeIntervalStart": "2006-01-01T00:00:00",
"dateTimeIntervalEnd": "2011-01-01T00:00:00",
"startDateTime": "2006-01-01T00:00:00",
"endDateTime": "2011-01-01T00:00:00",
"modTime": "2019-02-01T00:00:00"
}

0 comments on commit f6578dc

Please sign in to comment.