use of org.orcid.jaxb.model.v3.dev1.common.LastModifiedDate in project ORCID-Source by ORCID.
the class BiographyManagerReadOnlyImpl method getBiography.
@Override
public Biography getBiography(String orcid) {
BiographyEntity biographyEntity = null;
try {
biographyEntity = biographyDao.getBiography(orcid, getLastModified(orcid));
} catch (Exception e) {
LOGGER.debug("Couldn't find biography for " + orcid);
}
if (biographyEntity != null) {
Biography bio = new Biography();
bio.setContent(biographyEntity.getBiography());
bio.setVisibility(Visibility.fromValue(biographyEntity.getVisibility().value()));
bio.setLastModifiedDate(new LastModifiedDate(DateUtils.convertToXMLGregorianCalendar(biographyEntity.getLastModified())));
bio.setCreatedDate(new CreatedDate(DateUtils.convertToXMLGregorianCalendar(biographyEntity.getDateCreated())));
return bio;
}
return null;
}
use of org.orcid.jaxb.model.v3.dev1.common.LastModifiedDate in project ORCID-Source by ORCID.
the class WorksPaginatorTest method getLimitedWorkGroup.
private WorkGroup getLimitedWorkGroup(int i) {
WorkGroup workGroup = new WorkGroup();
workGroup.setLastModifiedDate(new LastModifiedDate(DateUtils.convertToXMLGregorianCalendar(System.currentTimeMillis())));
for (int x = 0; x < 10; x++) {
WorkSummary workSummary = new WorkSummary();
workSummary.setCreatedDate(new CreatedDate(DateUtils.convertToXMLGregorianCalendar(System.currentTimeMillis())));
workSummary.setTitle(getTitle(i));
workSummary.setVisibility(Visibility.LIMITED);
workSummary.setDisplayIndex(Integer.toString(x));
workSummary.setPutCode(Long.valueOf(new StringBuilder(i).append(x).toString()));
workSummary.setSource(getSource());
workSummary.setType(WorkType.EDITED_BOOK);
workGroup.getWorkSummary().add(workSummary);
}
return workGroup;
}
use of org.orcid.jaxb.model.v3.dev1.common.LastModifiedDate in project ORCID-Source by ORCID.
the class WorksPaginatorTest method getPageSizeOfMixedWorkGroups.
private Works getPageSizeOfMixedWorkGroups() {
Works works = new Works();
works.setLastModifiedDate(new LastModifiedDate(DateUtils.convertToXMLGregorianCalendar(System.currentTimeMillis())));
works.setPath("some path");
for (int i = 0; i < WorksPaginator.PAGE_SIZE; i++) {
works.getWorkGroup().add(getMixedWorkGroup(i));
}
return works;
}
use of org.orcid.jaxb.model.v3.dev1.common.LastModifiedDate in project ORCID-Source by ORCID.
the class WorksPaginatorTest method getFiveLimitedWorkGroups.
private Works getFiveLimitedWorkGroups() {
Works works = new Works();
works.setLastModifiedDate(new LastModifiedDate(DateUtils.convertToXMLGregorianCalendar(System.currentTimeMillis())));
works.setPath("some path");
for (int i = 0; i < 5; i++) {
works.getWorkGroup().add(getLimitedWorkGroup(i));
}
return works;
}
use of org.orcid.jaxb.model.v3.dev1.common.LastModifiedDate in project ORCID-Source by ORCID.
the class WorksPaginatorTest method getPublicWorkGroup.
private WorkGroup getPublicWorkGroup(int i) {
WorkGroup workGroup = new WorkGroup();
workGroup.setLastModifiedDate(new LastModifiedDate(DateUtils.convertToXMLGregorianCalendar(System.currentTimeMillis())));
for (int x = 0; x < 10; x++) {
WorkSummary workSummary = new WorkSummary();
workSummary.setCreatedDate(new CreatedDate(DateUtils.convertToXMLGregorianCalendar(System.currentTimeMillis())));
workSummary.setPublicationDate(new PublicationDate(new FuzzyDate(new Year(2017), new Month(x), new Day(x))));
workSummary.setTitle(getTitle(i));
workSummary.setVisibility(Visibility.PUBLIC);
workSummary.setDisplayIndex(Integer.toString(x));
workSummary.setPutCode(Long.valueOf(new StringBuilder(i).append(x).toString()));
workSummary.setSource(getSource());
workSummary.setType(WorkType.EDITED_BOOK);
workGroup.getWorkSummary().add(workSummary);
}
return workGroup;
}
Aggregations