use of org.orcid.jaxb.model.common_v2.Source in project ORCID-Source by ORCID.
the class SourceNameConverter method convert.
@Override
public SourceName convert(String source, Type<? extends SourceName> destinationType) {
if (PojoUtil.isEmpty(source)) {
return null;
}
String sourceName = sourceNameCacheManager.retrieve(source);
if (PojoUtil.isEmpty(sourceName)) {
return null;
}
SourceName result = new SourceName();
result.setContent(sourceName);
return result;
}
use of org.orcid.jaxb.model.common_v2.Source in project ORCID-Source by ORCID.
the class SourceOrcidConverter method convertFrom.
@Override
public SourceOrcid convertFrom(String source, Type<SourceOrcid> destinationType) {
if (PojoUtil.isEmpty(source)) {
return null;
}
SourceOrcid sourceOrcid = new SourceOrcid();
sourceOrcid.setHost(orcidUrlManager.getBaseHost());
sourceOrcid.setUri(orcidUrlManager.getBaseUriHttp() + "/" + source);
sourceOrcid.setPath(source);
return sourceOrcid;
}
use of org.orcid.jaxb.model.common_v2.Source in project ORCID-Source by ORCID.
the class SourceClientIdConverter method convertFrom.
@Override
public SourceClientId convertFrom(String source, Type<SourceClientId> destinationType) {
if (PojoUtil.isEmpty(source)) {
return null;
}
SourceClientId sourceClientId = new SourceClientId();
sourceClientId.setHost(orcidUrlManager.getBaseHost());
sourceClientId.setUri(orcidUrlManager.getBaseUriHttp() + "/client/" + source);
sourceClientId.setPath(source);
return sourceClientId;
}
use of org.orcid.jaxb.model.common_v2.Source in project ORCID-Source by ORCID.
the class RecordManagerReadOnlyImpl method getHistory.
private History getHistory(String orcid) {
History history = new History();
ProfileEntity profile = profileEntityCacheManager.retrieve(orcid);
history.setClaimed(profile.getClaimed());
if (profile.getCompletedDate() != null) {
history.setCompletionDate(new CompletionDate(DateUtils.convertToXMLGregorianCalendar(profile.getCompletedDate())));
}
if (!PojoUtil.isEmpty(profile.getCreationMethod())) {
history.setCreationMethod(CreationMethod.fromValue(profile.getCreationMethod()));
}
if (profile.getDeactivationDate() != null) {
history.setDeactivationDate(new DeactivationDate(DateUtils.convertToXMLGregorianCalendar(profile.getDeactivationDate())));
}
if (profile.getLastModified() != null) {
history.setLastModifiedDate(new LastModifiedDate(DateUtils.convertToXMLGregorianCalendar(profile.getLastModified())));
}
if (profile.getSubmissionDate() != null) {
history.setSubmissionDate(new SubmissionDate(DateUtils.convertToXMLGregorianCalendar(profile.getSubmissionDate())));
}
if (profile.getSource() != null) {
history.setSource(new Source(profile.getSource().getSourceId()));
}
boolean verfiedEmail = false;
boolean verfiedPrimaryEmail = false;
Emails emails = emailManager.getEmails(orcid, profile.getLastModified().getTime());
if (emails != null) {
for (Email email : emails.getEmails()) {
if (email.isVerified()) {
verfiedEmail = true;
if (email.isPrimary()) {
verfiedPrimaryEmail = true;
break;
}
}
}
}
history.setVerifiedEmail(verfiedEmail);
history.setVerifiedPrimaryEmail(verfiedPrimaryEmail);
return history;
}
use of org.orcid.jaxb.model.common_v2.Source in project ORCID-Source by ORCID.
the class OrcidSecurityManagerTestBase method setSource.
protected void setSource(SourceAware element, String sourceId) {
Source source = new Source();
source.setSourceClientId(new SourceClientId(sourceId));
element.setSource(source);
}
Aggregations