Search in sources :

Example 16 with FamilyName

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

the class OrcidProfileManagerBaseTest method createFullOrcidProfile.

protected OrcidProfile createFullOrcidProfile() {
    OrcidProfile profile2 = new OrcidProfile();
    profile2.setPassword("password");
    profile2.setVerificationCode("1234");
    profile2.setOrcidIdentifier(TEST_ORCID);
    OrcidBio bio = new OrcidBio();
    ContactDetails contactDetails = new ContactDetails();
    contactDetails.addOrReplacePrimaryEmail(new Email("will@orcid.org"));
    bio.setContactDetails(contactDetails);
    profile2.setOrcidBio(bio);
    PersonalDetails personalDetails = new PersonalDetails();
    personalDetails.setGivenNames(new GivenNames("William"));
    personalDetails.setFamilyName(new FamilyName("Simpson"));
    personalDetails.setCreditName(new CreditName("W. J. R. Simpson"));
    bio.setPersonalDetails(personalDetails);
    ResearcherUrls researcherUrls = new ResearcherUrls();
    researcherUrls.getResearcherUrl().add(new ResearcherUrl(new Url("http://www.wjrs.co.uk"), null));
    bio.setResearcherUrls(researcherUrls);
    Keywords keywords = new Keywords();
    bio.setKeywords(keywords);
    keywords.getKeyword().add(new Keyword("Java", null));
    bio.setBiography(new Biography("Will is a software developer at Semantico"));
    return profile2;
}
Also used : Email(org.orcid.jaxb.model.message.Email) Keywords(org.orcid.jaxb.model.message.Keywords) OrcidBio(org.orcid.jaxb.model.message.OrcidBio) Keyword(org.orcid.jaxb.model.message.Keyword) FamilyName(org.orcid.jaxb.model.message.FamilyName) CreditName(org.orcid.jaxb.model.message.CreditName) PersonalDetails(org.orcid.jaxb.model.message.PersonalDetails) Url(org.orcid.jaxb.model.message.Url) ResearcherUrl(org.orcid.jaxb.model.message.ResearcherUrl) OrcidProfile(org.orcid.jaxb.model.message.OrcidProfile) ContactDetails(org.orcid.jaxb.model.message.ContactDetails) GivenNames(org.orcid.jaxb.model.message.GivenNames) Biography(org.orcid.jaxb.model.message.Biography) ResearcherUrls(org.orcid.jaxb.model.message.ResearcherUrls) ResearcherUrl(org.orcid.jaxb.model.message.ResearcherUrl)

Example 17 with FamilyName

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

the class RDFWriterTest method fakeBio.

private OrcidMessage fakeBio() throws DatatypeConfigurationException {
    OrcidMessage orcidMessage = new OrcidMessage();
    OrcidProfile orcidProfile1 = new OrcidProfile();
    OrcidIdentifier orcidIdentifier = new OrcidIdentifier();
    orcidProfile1.setOrcidIdentifier(orcidIdentifier);
    orcidIdentifier.setUri("http://orcid.example.com/000-1337");
    orcidIdentifier.setPath("000-1337");
    OrcidBio bio = new OrcidBio();
    orcidProfile1.setOrcidBio(bio);
    OrcidHistory history = new OrcidHistory();
    XMLGregorianCalendar value = dataTypeFactory.newXMLGregorianCalendar(1980, 12, 31, 23, 29, 29, 999, 0);
    history.setCreationMethod(CreationMethod.WEBSITE);
    history.setLastModifiedDate(new LastModifiedDate(value));
    orcidProfile1.setOrcidHistory(history);
    PersonalDetails personal = new PersonalDetails();
    bio.setPersonalDetails(personal);
    personal.setFamilyName(new FamilyName("Doe"));
    personal.setCreditName(new CreditName("John F Doe"));
    personal.setGivenNames(new GivenNames("John"));
    personal.setOtherNames(new OtherNames());
    personal.getOtherNames().addOtherName("Johnny", Visibility.PUBLIC);
    personal.getOtherNames().addOtherName("Mr Doe", Visibility.PUBLIC);
    ResearcherUrls urls = new ResearcherUrls();
    bio.setResearcherUrls(urls);
    ResearcherUrl anonymous = new ResearcherUrl(new Url("http://example.com/anon"), Visibility.PUBLIC);
    urls.getResearcherUrl().add(anonymous);
    // "home page" - with strange casing
    ResearcherUrl homePage = new ResearcherUrl(new Url("http://example.com/myPage"), new UrlName("homePage"), Visibility.PUBLIC);
    urls.getResearcherUrl().add(homePage);
    ResearcherUrl foaf = new ResearcherUrl(new Url("http://example.com/foaf#me"), new UrlName("FOAF"), Visibility.PUBLIC);
    urls.getResearcherUrl().add(foaf);
    ResearcherUrl webId = new ResearcherUrl(new Url("http://example.com/webId"), new UrlName("webID"), Visibility.PUBLIC);
    urls.getResearcherUrl().add(webId);
    ResearcherUrl other = new ResearcherUrl(new Url("http://example.com/other"), new UrlName("other"), Visibility.PUBLIC);
    urls.getResearcherUrl().add(other);
    bio.setContactDetails(new ContactDetails());
    bio.getContactDetails().setEmail(Arrays.asList(new Email("john@example.org"), new Email("doe@example.com")));
    bio.getContactDetails().setAddress(new Address());
    bio.getContactDetails().getAddress().setCountry(new Country(Iso3166Country.GB));
    orcidMessage.setOrcidProfile(orcidProfile1);
    return orcidMessage;
}
Also used : LastModifiedDate(org.orcid.jaxb.model.message.LastModifiedDate) Email(org.orcid.jaxb.model.message.Email) OrcidBio(org.orcid.jaxb.model.message.OrcidBio) Address(org.orcid.jaxb.model.message.Address) FamilyName(org.orcid.jaxb.model.message.FamilyName) OtherNames(org.orcid.jaxb.model.message.OtherNames) CreditName(org.orcid.jaxb.model.message.CreditName) UrlName(org.orcid.jaxb.model.message.UrlName) PersonalDetails(org.orcid.jaxb.model.message.PersonalDetails) Url(org.orcid.jaxb.model.message.Url) ResearcherUrl(org.orcid.jaxb.model.message.ResearcherUrl) OrcidProfile(org.orcid.jaxb.model.message.OrcidProfile) XMLGregorianCalendar(javax.xml.datatype.XMLGregorianCalendar) ContactDetails(org.orcid.jaxb.model.message.ContactDetails) OrcidIdentifier(org.orcid.jaxb.model.message.OrcidIdentifier) OrcidHistory(org.orcid.jaxb.model.message.OrcidHistory) GivenNames(org.orcid.jaxb.model.message.GivenNames) OrcidMessage(org.orcid.jaxb.model.message.OrcidMessage) ResearcherUrls(org.orcid.jaxb.model.message.ResearcherUrls) Iso3166Country(org.orcid.jaxb.model.message.Iso3166Country) Country(org.orcid.jaxb.model.message.Country) ResearcherUrl(org.orcid.jaxb.model.message.ResearcherUrl)

Example 18 with FamilyName

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

the class OrcidProfileManagerImpl method deactivateOrcidProfile.

@Override
@Transactional
@Deprecated
public OrcidProfile deactivateOrcidProfile(OrcidProfile existingOrcidProfile) {
    OrcidProfile blankedOrcidProfile = new OrcidProfile();
    OrcidBio existingBio = existingOrcidProfile.getOrcidBio();
    OrcidBio minimalBio = new OrcidBio();
    ContactDetails minimalContactDetails = new ContactDetails();
    minimalContactDetails.getEmail().addAll(existingBio.getContactDetails().getEmail());
    OrcidInternal minimalOrcidInternal = new OrcidInternal();
    minimalOrcidInternal.setSecurityDetails(existingOrcidProfile.getOrcidInternal().getSecurityDetails());
    OrcidHistory deactivatedOrcidHistory = existingOrcidProfile.getOrcidHistory();
    deactivatedOrcidHistory.setDeactivationDate(new DeactivationDate(DateUtils.convertToXMLGregorianCalendar(new Date())));
    blankedOrcidProfile.setOrcidHistory(deactivatedOrcidHistory);
    // only names names from bio with a visibility setting
    PersonalDetails minimalPersonalDetails = new PersonalDetails();
    minimalPersonalDetails.setOtherNames(null);
    CreditName creditName = new CreditName();
    creditName.setVisibility(Visibility.PUBLIC);
    minimalPersonalDetails.setCreditName(creditName);
    minimalPersonalDetails.setGivenNames(new GivenNames("Given Names Deactivated"));
    minimalPersonalDetails.setFamilyName(new FamilyName("Family Name Deactivated"));
    for (Email email : minimalContactDetails.getEmail()) {
        setVisibilityToPrivate(email);
    }
    setVisibilityToPrivate(minimalPersonalDetails.getOtherNames());
    if (minimalPersonalDetails.getOtherNames() != null && minimalPersonalDetails.getOtherNames().getOtherName() != null) {
        for (OtherName name : minimalPersonalDetails.getOtherNames().getOtherName()) setVisibilityToPrivate(name);
    }
    minimalBio.setPersonalDetails(minimalPersonalDetails);
    minimalBio.setContactDetails(minimalContactDetails);
    minimalBio.setBiography(new Biography());
    minimalBio.setExternalIdentifiers(new ExternalIdentifiers());
    blankedOrcidProfile.setOrcidBio(minimalBio);
    blankedOrcidProfile.setOrcidIdentifier(existingOrcidProfile.getOrcidIdentifier().getPath());
    OrcidProfile profileToReturn = updateOrcidProfile(blankedOrcidProfile);
    userConnectionDao.deleteByOrcid(existingOrcidProfile.getOrcidIdentifier().getPath());
    notificationManager.sendAmendEmail(profileToReturn, AmendedSection.UNKNOWN);
    return profileToReturn;
}
Also used : Email(org.orcid.jaxb.model.message.Email) OrcidBio(org.orcid.jaxb.model.message.OrcidBio) FamilyName(org.orcid.jaxb.model.message.FamilyName) OrcidInternal(org.orcid.jaxb.model.message.OrcidInternal) CreditName(org.orcid.jaxb.model.message.CreditName) OtherName(org.orcid.jaxb.model.message.OtherName) PersonalDetails(org.orcid.jaxb.model.message.PersonalDetails) DeactivationDate(org.orcid.jaxb.model.message.DeactivationDate) Date(java.util.Date) DeactivationDate(org.orcid.jaxb.model.message.DeactivationDate) OrcidProfile(org.orcid.jaxb.model.message.OrcidProfile) ContactDetails(org.orcid.jaxb.model.message.ContactDetails) OrcidHistory(org.orcid.jaxb.model.message.OrcidHistory) GivenNames(org.orcid.jaxb.model.message.GivenNames) Biography(org.orcid.jaxb.model.message.Biography) ExternalIdentifiers(org.orcid.jaxb.model.message.ExternalIdentifiers) Transactional(org.springframework.transaction.annotation.Transactional)

Aggregations

FamilyName (org.orcid.jaxb.model.message.FamilyName)18 GivenNames (org.orcid.jaxb.model.message.GivenNames)16 OrcidBio (org.orcid.jaxb.model.message.OrcidBio)16 PersonalDetails (org.orcid.jaxb.model.message.PersonalDetails)16 OrcidProfile (org.orcid.jaxb.model.message.OrcidProfile)15 ContactDetails (org.orcid.jaxb.model.message.ContactDetails)12 Email (org.orcid.jaxb.model.message.Email)11 CreditName (org.orcid.jaxb.model.message.CreditName)9 Biography (org.orcid.jaxb.model.message.Biography)6 OtherNames (org.orcid.jaxb.model.message.OtherNames)6 ResearcherUrl (org.orcid.jaxb.model.message.ResearcherUrl)6 ResearcherUrls (org.orcid.jaxb.model.message.ResearcherUrls)6 Url (org.orcid.jaxb.model.message.Url)6 ArrayList (java.util.ArrayList)4 Affiliations (org.orcid.jaxb.model.message.Affiliations)4 ExternalIdentifiers (org.orcid.jaxb.model.message.ExternalIdentifiers)4 Keyword (org.orcid.jaxb.model.message.Keyword)4 Keywords (org.orcid.jaxb.model.message.Keywords)4 OrcidActivities (org.orcid.jaxb.model.message.OrcidActivities)4 OrcidHistory (org.orcid.jaxb.model.message.OrcidHistory)4