Search in sources :

Example 26 with WorkTitle

use of org.orcid.jaxb.model.record_rc3.WorkTitle in project ORCID-Source by ORCID.

the class ActivityValidatorTest method getWorkTitle.

public WorkTitle getWorkTitle() {
    WorkTitle title = new WorkTitle();
    title.setTitle(new Title("title"));
    title.setSubtitle(new Subtitle("subtitle"));
    title.setTranslatedTitle(new TranslatedTitle("translated title", "en"));
    return title;
}
Also used : Subtitle(org.orcid.jaxb.model.common_v2.Subtitle) TranslatedTitle(org.orcid.jaxb.model.common_v2.TranslatedTitle) WorkTitle(org.orcid.jaxb.model.record_v2.WorkTitle) WorkTitle(org.orcid.jaxb.model.record_v2.WorkTitle) TranslatedTitle(org.orcid.jaxb.model.common_v2.TranslatedTitle) FundingTitle(org.orcid.jaxb.model.record_v2.FundingTitle) Title(org.orcid.jaxb.model.common_v2.Title)

Example 27 with WorkTitle

use of org.orcid.jaxb.model.record_rc3.WorkTitle in project ORCID-Source by ORCID.

the class WorksTest method getWork.

private Work getWork(String title, boolean randomExtId, String extIdValue) {
    Long time = System.currentTimeMillis();
    Work work = new Work();
    WorkTitle workTitle = new WorkTitle();
    Title wTitle = new Title(title);
    workTitle.setTranslatedTitle(new TranslatedTitle(title, "en"));
    workTitle.setTitle(wTitle);
    work.setWorkTitle(workTitle);
    work.setWorkType(WorkType.BOOK);
    ExternalID extId = new ExternalID();
    extId.setRelationship(Relationship.SELF);
    if (randomExtId) {
        extId.setValue("work-ext-id-" + (Math.random() * 1000) + "-" + time);
    } else {
        extId.setValue("work-ext-id-" + extIdValue);
    }
    extId.setType("doi");
    ExternalIDs extIds = new ExternalIDs();
    extIds.getExternalIdentifier().add(extId);
    work.setWorkExternalIdentifiers(extIds);
    return work;
}
Also used : ExternalIDs(org.orcid.jaxb.model.record_v2.ExternalIDs) TranslatedTitle(org.orcid.jaxb.model.common_v2.TranslatedTitle) WorkTitle(org.orcid.jaxb.model.record_v2.WorkTitle) ExternalID(org.orcid.jaxb.model.record_v2.ExternalID) Work(org.orcid.jaxb.model.record_v2.Work) WorkTitle(org.orcid.jaxb.model.record_v2.WorkTitle) Title(org.orcid.jaxb.model.common_v2.Title) TranslatedTitle(org.orcid.jaxb.model.common_v2.TranslatedTitle)

Example 28 with WorkTitle

use of org.orcid.jaxb.model.record_rc3.WorkTitle in project ORCID-Source by ORCID.

the class ContributorUtilsTest method getWorkWithContributorWithoutOrcid.

private Work getWorkWithContributorWithoutOrcid() {
    Work work = new Work();
    WorkTitle workTitle = new WorkTitle();
    workTitle.setTitle(new Title("work with contributor without ORCID record"));
    work.setWorkTitle(workTitle);
    work.setWorkContributors(getWorkContributorWithoutOrcid());
    return work;
}
Also used : WorkTitle(org.orcid.jaxb.model.record_v2.WorkTitle) Work(org.orcid.jaxb.model.record_v2.Work) FundingTitle(org.orcid.jaxb.model.record_v2.FundingTitle) WorkTitle(org.orcid.jaxb.model.record_v2.WorkTitle) Title(org.orcid.jaxb.model.common_v2.Title)

Example 29 with WorkTitle

use of org.orcid.jaxb.model.record_rc3.WorkTitle in project ORCID-Source by ORCID.

the class SourceInActivitiesTest method getWorkWithoutExternalIdentifier.

private Work getWorkWithoutExternalIdentifier(String userOrcid, boolean validate) {
    Work work = new Work();
    WorkTitle title = new WorkTitle();
    title.setTitle(new Title("Work " + System.currentTimeMillis()));
    work.setWorkTitle(title);
    work.setWorkType(org.orcid.jaxb.model.record_v2.WorkType.BOOK);
    work = workManager.createWork(userOrcid, work, validate);
    return workManager.getWork(userOrcid, work.getPutCode());
}
Also used : WorkTitle(org.orcid.jaxb.model.record_v2.WorkTitle) Work(org.orcid.jaxb.model.record_v2.Work) WorkTitle(org.orcid.jaxb.model.record_v2.WorkTitle) FundingTitle(org.orcid.jaxb.model.record_v2.FundingTitle) Title(org.orcid.jaxb.model.common_v2.Title)

Example 30 with WorkTitle

use of org.orcid.jaxb.model.record_rc3.WorkTitle in project ORCID-Source by ORCID.

the class SourceInActivitiesTest method getWorkWithPutCode.

private Work getWorkWithPutCode(String userOrcid, boolean validate) {
    Work work = new Work();
    WorkTitle title = new WorkTitle();
    title.setTitle(new Title("Work " + System.currentTimeMillis()));
    work.setWorkTitle(title);
    ExternalID extId = new ExternalID();
    extId.setValue("111");
    extId.setType(WorkExternalIdentifierType.DOI.value());
    ExternalIDs extIdentifiers = new ExternalIDs();
    extIdentifiers.getExternalIdentifier().add(extId);
    work.setWorkExternalIdentifiers(extIdentifiers);
    work.setWorkType(org.orcid.jaxb.model.record_v2.WorkType.BOOK);
    work.setPutCode(Long.valueOf(111));
    work = workManager.createWork(userOrcid, work, validate);
    return workManager.getWork(userOrcid, work.getPutCode());
}
Also used : ExternalIDs(org.orcid.jaxb.model.record_v2.ExternalIDs) WorkTitle(org.orcid.jaxb.model.record_v2.WorkTitle) ExternalID(org.orcid.jaxb.model.record_v2.ExternalID) Work(org.orcid.jaxb.model.record_v2.Work) WorkTitle(org.orcid.jaxb.model.record_v2.WorkTitle) FundingTitle(org.orcid.jaxb.model.record_v2.FundingTitle) Title(org.orcid.jaxb.model.common_v2.Title)

Aggregations

WorkTitle (org.orcid.jaxb.model.record_v2.WorkTitle)32 Title (org.orcid.jaxb.model.common_v2.Title)31 Work (org.orcid.jaxb.model.record_v2.Work)22 ExternalID (org.orcid.jaxb.model.record_v2.ExternalID)20 ExternalIDs (org.orcid.jaxb.model.record_v2.ExternalIDs)18 Test (org.junit.Test)16 Url (org.orcid.jaxb.model.common_v2.Url)12 TranslatedTitle (org.orcid.jaxb.model.common_v2.TranslatedTitle)11 FundingTitle (org.orcid.jaxb.model.record_v2.FundingTitle)11 WorkSummary (org.orcid.jaxb.model.record.summary_v2.WorkSummary)8 WorkBulk (org.orcid.jaxb.model.record_v2.WorkBulk)6 ClientResponse (com.sun.jersey.api.client.ClientResponse)5 BaseTest (org.orcid.core.BaseTest)5 ActivitiesSummary (org.orcid.jaxb.model.record.summary_v2.ActivitiesSummary)5 WorkGroup (org.orcid.jaxb.model.record.summary_v2.WorkGroup)5 SourceEntity (org.orcid.persistence.jpa.entities.SourceEntity)5 DBUnitTest (org.orcid.test.DBUnitTest)5 ClientDetailsEntity (org.orcid.persistence.jpa.entities.ClientDetailsEntity)4 List (java.util.List)3 Response (javax.ws.rs.core.Response)3