Adds "source" property to Funders and Projects fetched from external sources.
This commit is contained in:
parent
a9a39db622
commit
eb48edfb2d
|
@ -16,6 +16,7 @@ public class FunderBuilder extends Builder<Funder> {
|
||||||
private Date created;
|
private Date created;
|
||||||
private Date modified;
|
private Date modified;
|
||||||
private Integer type;
|
private Integer type;
|
||||||
|
private String source;
|
||||||
|
|
||||||
public FunderBuilder id(UUID id) {
|
public FunderBuilder id(UUID id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
|
@ -57,6 +58,11 @@ public class FunderBuilder extends Builder<Funder> {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public FunderBuilder source(String source) {
|
||||||
|
this.source = source;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Funder build() {
|
public Funder build() {
|
||||||
Funder funder = new Funder();
|
Funder funder = new Funder();
|
||||||
|
@ -68,6 +74,7 @@ public class FunderBuilder extends Builder<Funder> {
|
||||||
funder.setCreated(created);
|
funder.setCreated(created);
|
||||||
funder.setModified(modified);
|
funder.setModified(modified);
|
||||||
funder.setType(type);
|
funder.setType(type);
|
||||||
|
funder.setSource(source);
|
||||||
return funder;
|
return funder;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,6 +27,7 @@ public class ProjectBuilder extends Builder<Project> {
|
||||||
private Date created;
|
private Date created;
|
||||||
private Date modified;
|
private Date modified;
|
||||||
private String description;
|
private String description;
|
||||||
|
private String source;
|
||||||
|
|
||||||
public ProjectBuilder id(UUID id) {
|
public ProjectBuilder id(UUID id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
|
@ -103,6 +104,11 @@ public class ProjectBuilder extends Builder<Project> {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ProjectBuilder source(String source) {
|
||||||
|
this.source = source;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Project build() {
|
public Project build() {
|
||||||
Project project = new Project();
|
Project project = new Project();
|
||||||
|
@ -120,6 +126,7 @@ public class ProjectBuilder extends Builder<Project> {
|
||||||
project.setReference(reference);
|
project.setReference(reference);
|
||||||
project.setCreationUser(creationUser);
|
project.setCreationUser(creationUser);
|
||||||
project.setStartDate(startDate);
|
project.setStartDate(startDate);
|
||||||
|
project.setSource(source);
|
||||||
return project;
|
return project;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,6 +41,7 @@ public class FunderManager {
|
||||||
eu.eudat.models.data.funder.Funder funder = apiContext.getOperationsContext().getBuilderFactory().getBuilder(FunderBuilder.class)
|
eu.eudat.models.data.funder.Funder funder = apiContext.getOperationsContext().getBuilderFactory().getBuilder(FunderBuilder.class)
|
||||||
.reference(externalListingItem.getRemoteId()).label(externalListingItem.getName())
|
.reference(externalListingItem.getRemoteId()).label(externalListingItem.getName())
|
||||||
.status(eu.eudat.data.entities.Funder.Status.fromInteger(0))
|
.status(eu.eudat.data.entities.Funder.Status.fromInteger(0))
|
||||||
|
.source(externalListingItem.getSource())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
funders.add(funder);
|
funders.add(funder);
|
||||||
|
|
|
@ -42,6 +42,7 @@ public class ProjectManager {
|
||||||
.reference(externalListingItem.getRemoteId()).label(externalListingItem.getName())
|
.reference(externalListingItem.getRemoteId()).label(externalListingItem.getName())
|
||||||
.description(externalListingItem.getDescription()).uri(externalListingItem.getUri())
|
.description(externalListingItem.getDescription()).uri(externalListingItem.getUri())
|
||||||
.abbreviation(externalListingItem.getAbbreviation()).status(eu.eudat.data.entities.Project.Status.fromInteger(0))
|
.abbreviation(externalListingItem.getAbbreviation()).status(eu.eudat.data.entities.Project.Status.fromInteger(0))
|
||||||
|
.source(externalListingItem.getSource())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
projects.add(project);
|
projects.add(project);
|
||||||
|
|
|
@ -13,6 +13,7 @@ public class FundersExternalSourcesModel extends ExternalListingItem<FundersExte
|
||||||
model.setUri(item.get("uri"));
|
model.setUri(item.get("uri"));
|
||||||
model.setName(item.get("name"));
|
model.setName(item.get("name"));
|
||||||
model.setDescription(item.get("description"));
|
model.setDescription(item.get("description"));
|
||||||
|
model.setSource(item.get("source"));
|
||||||
this.add(model);
|
this.add(model);
|
||||||
}
|
}
|
||||||
return this;
|
return this;
|
||||||
|
|
|
@ -12,6 +12,7 @@ public class ProjectsExternalSourcesModel extends ExternalListingItem<ProjectsEx
|
||||||
model.setUri(item.get("uri"));
|
model.setUri(item.get("uri"));
|
||||||
model.setName(item.get("name"));
|
model.setName(item.get("name"));
|
||||||
model.setDescription(item.get("description"));
|
model.setDescription(item.get("description"));
|
||||||
|
model.setSource(item.get("source"));
|
||||||
this.add(model);
|
this.add(model);
|
||||||
}
|
}
|
||||||
return this;
|
return this;
|
||||||
|
|
|
@ -15,6 +15,7 @@ public class Funder implements DataModel<eu.eudat.data.entities.Funder, Funder>
|
||||||
private Date created;
|
private Date created;
|
||||||
private Date modified;
|
private Date modified;
|
||||||
private Integer type;
|
private Integer type;
|
||||||
|
private String source;
|
||||||
|
|
||||||
public UUID getId() {
|
public UUID getId() {
|
||||||
return id;
|
return id;
|
||||||
|
@ -72,6 +73,13 @@ public class Funder implements DataModel<eu.eudat.data.entities.Funder, Funder>
|
||||||
this.type = type;
|
this.type = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getSource() {
|
||||||
|
return source;
|
||||||
|
}
|
||||||
|
public void setSource(String source) {
|
||||||
|
this.source = source;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Funder fromDataModel(eu.eudat.data.entities.Funder entity) {
|
public Funder fromDataModel(eu.eudat.data.entities.Funder entity) {
|
||||||
this.id = entity.getId();
|
this.id = entity.getId();
|
||||||
|
@ -82,6 +90,7 @@ public class Funder implements DataModel<eu.eudat.data.entities.Funder, Funder>
|
||||||
this.status = entity.getStatus();
|
this.status = entity.getStatus();
|
||||||
this.created = entity.getCreated();
|
this.created = entity.getCreated();
|
||||||
this.modified = entity.getModified();
|
this.modified = entity.getModified();
|
||||||
|
this.source = "Internal";
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,7 @@ public class Project implements DataModel<eu.eudat.data.entities.Project, Projec
|
||||||
private Date modified;
|
private Date modified;
|
||||||
private String description;
|
private String description;
|
||||||
private List<ContentFile> files;
|
private List<ContentFile> files;
|
||||||
|
private String source;
|
||||||
|
|
||||||
public UUID getId() {
|
public UUID getId() {
|
||||||
return id;
|
return id;
|
||||||
|
@ -141,6 +142,13 @@ public class Project implements DataModel<eu.eudat.data.entities.Project, Projec
|
||||||
this.files = files;
|
this.files = files;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getSource() {
|
||||||
|
return source;
|
||||||
|
}
|
||||||
|
public void setSource(String source) {
|
||||||
|
this.source = source;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Project fromDataModel(eu.eudat.data.entities.Project entity) {
|
public Project fromDataModel(eu.eudat.data.entities.Project entity) {
|
||||||
this.id = entity.getId();
|
this.id = entity.getId();
|
||||||
|
@ -157,6 +165,7 @@ public class Project implements DataModel<eu.eudat.data.entities.Project, Projec
|
||||||
this.modified = entity.getModified();
|
this.modified = entity.getModified();
|
||||||
this.description = entity.getDescription();
|
this.description = entity.getDescription();
|
||||||
this.files = entity.getContent() != null ? Arrays.asList(new ContentFile(entity.getContent().getLabel(), UUID.fromString(entity.getContent().getUri().split(":")[1]), "final", entity.getContent().getExtension())) : Arrays.asList(new ContentFile("default.png", null, null, null));
|
this.files = entity.getContent() != null ? Arrays.asList(new ContentFile(entity.getContent().getLabel(), UUID.fromString(entity.getContent().getUri().split(":")[1]), "final", entity.getContent().getExtension())) : Arrays.asList(new ContentFile("default.png", null, null, null));
|
||||||
|
this.source = "Internal";
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -51,6 +51,7 @@
|
||||||
<name>'name'</name>
|
<name>'name'</name>
|
||||||
<uri>'uri'</uri>
|
<uri>'uri'</uri>
|
||||||
<description>'description'</description>
|
<description>'description'</description>
|
||||||
|
<source>'source'</source>
|
||||||
</fields>
|
</fields>
|
||||||
</data>
|
</data>
|
||||||
<paginationpath>$['meta']['pagination']['page','pages','count']</paginationpath>
|
<paginationpath>$['meta']['pagination']['page','pages','count']</paginationpath>
|
||||||
|
|
|
@ -51,6 +51,7 @@
|
||||||
<name>'name'</name>
|
<name>'name'</name>
|
||||||
<uri>'uri'</uri>
|
<uri>'uri'</uri>
|
||||||
<description>'description'</description>
|
<description>'description'</description>
|
||||||
|
<source>'source'</source>
|
||||||
</fields>
|
</fields>
|
||||||
</data>
|
</data>
|
||||||
<paginationpath>$['meta']['pagination']['page','pages','count']</paginationpath>
|
<paginationpath>$['meta']['pagination']['page','pages','count']</paginationpath>
|
||||||
|
|
Loading…
Reference in New Issue