Search in sources :

Example 1 with CreationMethod

use of org.orcid.jaxb.model.message.CreationMethod in project ORCID-Source by ORCID.

the class Jaxb2JpaAdapterImpl method setHistoryDetails.

private void setHistoryDetails(ProfileEntity profileEntity, OrcidHistory orcidHistory) {
    if (orcidHistory != null) {
        CompletionDate completionDate = orcidHistory.getCompletionDate();
        profileEntity.setCompletedDate(completionDate == null ? null : toDate(completionDate.getValue()));
        SubmissionDate submissionDate = orcidHistory.getSubmissionDate();
        profileEntity.setSubmissionDate(submissionDate == null ? null : toDate(submissionDate.getValue()));
        DeactivationDate deactivationDate = orcidHistory.getDeactivationDate();
        profileEntity.setDeactivationDate(deactivationDate == null ? null : toDate(deactivationDate.getValue()));
        profileEntity.setClaimed(orcidHistory.isClaimed());
        CreationMethod creationMethod = orcidHistory.getCreationMethod();
        profileEntity.setCreationMethod(creationMethod != null ? creationMethod.value() : null);
        Source source = orcidHistory.getSource();
        if (source != null) {
            SourceEntity sourceEntity = new SourceEntity();
            ClientDetailsEntity clientDetailsEntity = new ClientDetailsEntity();
            clientDetailsEntity.setId(source.retrieveSourcePath());
            sourceEntity.setSourceClient(clientDetailsEntity);
            profileEntity.setSource(sourceEntity);
        }
    }
}
Also used : ClientDetailsEntity(org.orcid.persistence.jpa.entities.ClientDetailsEntity) CreationMethod(org.orcid.jaxb.model.message.CreationMethod) SourceEntity(org.orcid.persistence.jpa.entities.SourceEntity) SubmissionDate(org.orcid.jaxb.model.message.SubmissionDate) CompletionDate(org.orcid.jaxb.model.message.CompletionDate) DeactivationDate(org.orcid.jaxb.model.message.DeactivationDate) Source(org.orcid.jaxb.model.message.Source)

Aggregations

CompletionDate (org.orcid.jaxb.model.message.CompletionDate)1 CreationMethod (org.orcid.jaxb.model.message.CreationMethod)1 DeactivationDate (org.orcid.jaxb.model.message.DeactivationDate)1 Source (org.orcid.jaxb.model.message.Source)1 SubmissionDate (org.orcid.jaxb.model.message.SubmissionDate)1 ClientDetailsEntity (org.orcid.persistence.jpa.entities.ClientDetailsEntity)1 SourceEntity (org.orcid.persistence.jpa.entities.SourceEntity)1