Search in sources :

Example 11 with Citation

use of org.orcid.jaxb.model.v3.dev1.record.Citation in project ORCID-Source by ORCID.

the class MemberV3ApiServiceDelegator_WorksTest method testCleanEmptyFieldsOnWorks.

@Test
public void testCleanEmptyFieldsOnWorks() {
    LastModifiedDate lmd = new LastModifiedDate(DateUtils.convertToXMLGregorianCalendar(System.currentTimeMillis()));
    Work work = new Work();
    work.setLastModifiedDate(lmd);
    work.setWorkCitation(new Citation("", CitationType.FORMATTED_UNSPECIFIED));
    WorkTitle title = new WorkTitle();
    title.setTitle(new Title("My Work"));
    title.setSubtitle(new Subtitle("My subtitle"));
    title.setTranslatedTitle(new TranslatedTitle("", ""));
    work.setWorkTitle(title);
    ActivityUtils.cleanEmptyFields(work);
    assertNotNull(work);
    Utils.verifyLastModified(work.getLastModifiedDate());
    assertNotNull(work.getWorkTitle());
    assertNotNull(work.getWorkTitle().getTitle());
    assertNotNull(work.getWorkTitle().getSubtitle());
    assertEquals("My Work", work.getWorkTitle().getTitle().getContent());
    assertEquals("My subtitle", work.getWorkTitle().getSubtitle().getContent());
    assertNull(work.getWorkCitation());
    assertNull(work.getWorkTitle().getTranslatedTitle());
}
Also used : LastModifiedDate(org.orcid.jaxb.model.v3.dev1.common.LastModifiedDate) Subtitle(org.orcid.jaxb.model.v3.dev1.common.Subtitle) TranslatedTitle(org.orcid.jaxb.model.v3.dev1.common.TranslatedTitle) WorkTitle(org.orcid.jaxb.model.v3.dev1.record.WorkTitle) Work(org.orcid.jaxb.model.v3.dev1.record.Work) Title(org.orcid.jaxb.model.v3.dev1.common.Title) TranslatedTitle(org.orcid.jaxb.model.v3.dev1.common.TranslatedTitle) WorkTitle(org.orcid.jaxb.model.v3.dev1.record.WorkTitle) Citation(org.orcid.jaxb.model.v3.dev1.record.Citation) DBUnitTest(org.orcid.test.DBUnitTest) Test(org.junit.Test)

Example 12 with Citation

use of org.orcid.jaxb.model.v3.dev1.record.Citation in project ORCID-Source by ORCID.

the class ActivityValidator method validateWork.

public void validateWork(Work work, SourceEntity sourceEntity, boolean createFlag, boolean isApiRequest, Visibility originalVisibility) {
    WorkTitle title = work.getWorkTitle();
    if (title == null || title.getTitle() == null || PojoUtil.isEmpty(title.getTitle().getContent())) {
        throw new ActivityTitleValidationException();
    }
    if (work.getCountry() != null) {
        if (work.getCountry().getValue() == null) {
            Map<String, String> params = new HashMap<String, String>();
            String values = Arrays.stream(Iso3166Country.values()).map(element -> element.value()).collect(Collectors.joining(", "));
            params.put("type", "country");
            params.put("values", values);
            throw new ActivityTypeValidationException(params);
        }
    }
    // translated title language code
    if (title != null && title.getTranslatedTitle() != null) {
        String translatedTitle = title.getTranslatedTitle().getContent();
        String languageCode = title.getTranslatedTitle().getLanguageCode();
        if (PojoUtil.isEmpty(translatedTitle) && !PojoUtil.isEmpty(languageCode)) {
            throw new OrcidValidationException("Please specify a translated title or remove the language code");
        }
        // If translated title language code is null or invalid
        if (!PojoUtil.isEmpty(translatedTitle) && (PojoUtil.isEmpty(title.getTranslatedTitle().getLanguageCode()) || !Arrays.stream(SiteConstants.AVAILABLE_ISO_LANGUAGES).anyMatch(title.getTranslatedTitle().getLanguageCode()::equals))) {
            Map<String, String> params = new HashMap<String, String>();
            String values = Arrays.stream(SiteConstants.AVAILABLE_ISO_LANGUAGES).collect(Collectors.joining(", "));
            params.put("type", "translated title -> language code");
            params.put("values", values);
            throw new ActivityTypeValidationException(params);
        }
    }
    if (work.getWorkType() == null) {
        Map<String, String> params = new HashMap<String, String>();
        String values = Arrays.stream(WorkType.values()).map(element -> element.value()).collect(Collectors.joining(", "));
        params.put("type", "work type");
        params.put("values", values);
        throw new ActivityTypeValidationException(params);
    }
    if (!PojoUtil.isEmpty(work.getLanguageCode())) {
        if (!Arrays.stream(SiteConstants.AVAILABLE_ISO_LANGUAGES).anyMatch(work.getLanguageCode()::equals)) {
            Map<String, String> params = new HashMap<String, String>();
            String values = Arrays.stream(SiteConstants.AVAILABLE_ISO_LANGUAGES).collect(Collectors.joining(", "));
            params.put("type", "language code");
            params.put("values", values);
            throw new ActivityTypeValidationException(params);
        }
    }
    // publication date
    if (work.getPublicationDate() != null) {
        PublicationDate pd = work.getPublicationDate();
        Year year = pd.getYear();
        Month month = pd.getMonth();
        Day day = pd.getDay();
        if (year != null) {
            try {
                Integer.valueOf(year.getValue());
            } catch (NumberFormatException n) {
                Map<String, String> params = new HashMap<String, String>();
                params.put("type", "publication date -> year");
                params.put("values", "integers");
                throw new ActivityTypeValidationException(params);
            }
            if (year.getValue().length() != 4) {
                throw new OrcidValidationException("Invalid year " + year.getValue() + " please specify a four digits value");
            }
        }
        if (month != null) {
            try {
                Integer.valueOf(month.getValue());
            } catch (NumberFormatException n) {
                Map<String, String> params = new HashMap<String, String>();
                params.put("type", "publication date -> month");
                params.put("values", "integers");
                throw new ActivityTypeValidationException(params);
            }
            if (month.getValue().length() != 2) {
                throw new OrcidValidationException("Invalid month " + month.getValue() + " please specify a two digits value");
            }
        }
        if (day != null) {
            try {
                Integer.valueOf(day.getValue());
            } catch (NumberFormatException n) {
                Map<String, String> params = new HashMap<String, String>();
                params.put("type", "publication date -> day");
                params.put("values", "integers");
                throw new ActivityTypeValidationException(params);
            }
            if (day.getValue().length() != 2) {
                throw new OrcidValidationException("Invalid day " + day.getValue() + " please specify a two digits value");
            }
        }
        // Check the date is valid
        boolean isYearEmpty = (year == null || year.getValue() == null) ? true : false;
        boolean isMonthEmpty = (month == null || month.getValue() == null) ? true : false;
        boolean isDayEmpty = (day == null || day.getValue() == null) ? true : false;
        if (isYearEmpty && (!isMonthEmpty || !isDayEmpty)) {
            throw new OrcidValidationException("Invalid date, please specify a year element");
        } else if (!isYearEmpty && isMonthEmpty && !isDayEmpty) {
            throw new OrcidValidationException("Invalid date, please specify a month element");
        } else if (isYearEmpty && isMonthEmpty && !isDayEmpty) {
            throw new OrcidValidationException("Invalid date, please specify a year and month elements");
        }
    }
    // citation
    if (work.getWorkCitation() != null) {
        String citation = work.getWorkCitation().getCitation();
        CitationType type = work.getWorkCitation().getWorkCitationType();
        if (type == null) {
            Map<String, String> params = new HashMap<String, String>();
            String values = Arrays.stream(CitationType.values()).map(element -> element.value()).collect(Collectors.joining(", "));
            params.put("type", "citation type");
            params.put("values", values);
            throw new ActivityTypeValidationException(params);
        }
        if (PojoUtil.isEmpty(citation)) {
            throw new OrcidValidationException("Please specify a citation or remove the parent tag");
        }
    }
    if (work.getWorkExternalIdentifiers() == null || work.getWorkExternalIdentifiers().getExternalIdentifier() == null || work.getExternalIdentifiers().getExternalIdentifier().isEmpty()) {
        throw new ActivityIdentifierValidationException();
    }
    if (work.getWorkContributors() != null) {
        WorkContributors contributors = work.getWorkContributors();
        if (!contributors.getContributor().isEmpty()) {
            for (Contributor contributor : contributors.getContributor()) {
                if (contributor.getContributorOrcid() != null) {
                    ContributorOrcid contributorOrcid = contributor.getContributorOrcid();
                    if (!PojoUtil.isEmpty(contributorOrcid.getUri())) {
                        if (!OrcidStringUtils.isValidOrcid2_1Uri(contributorOrcid.getUri())) {
                            throw new OrcidValidationException("Invalid contributor URI");
                        }
                    }
                    if (!PojoUtil.isEmpty(contributorOrcid.getPath())) {
                        if (!OrcidStringUtils.isValidOrcid(contributorOrcid.getPath())) {
                            throw new OrcidValidationException("Invalid contributor ORCID");
                        }
                    }
                }
                if (contributor.getCreditName() != null) {
                    if (PojoUtil.isEmpty(contributor.getCreditName().getContent())) {
                        throw new OrcidValidationException("Please specify a contributor credit name or remove the empty tag");
                    }
                }
                if (contributor.getContributorEmail() != null) {
                    if (PojoUtil.isEmpty(contributor.getContributorEmail().getValue())) {
                        throw new OrcidValidationException("Please specify a contributor email or remove the empty tag");
                    }
                }
            }
        }
    }
    if (work.getPutCode() != null && createFlag) {
        Map<String, String> params = new HashMap<String, String>();
        if (sourceEntity != null) {
            params.put("clientName", sourceEntity.getSourceName());
        }
        throw new InvalidPutCodeException(params);
    }
    // Check that we are not changing the visibility
    if (isApiRequest && !createFlag) {
        Visibility updatedVisibility = work.getVisibility();
        validateVisibilityDoesntChange(updatedVisibility, originalVisibility);
    }
    externalIDValidator.validateWorkOrPeerReview(work.getExternalIdentifiers());
}
Also used : Arrays(java.util.Arrays) InvalidPutCodeException(org.orcid.core.exception.InvalidPutCodeException) WorkContributors(org.orcid.jaxb.model.v3.dev1.record.WorkContributors) StringUtils(org.apache.commons.lang3.StringUtils) InvalidOrgException(org.orcid.core.exception.InvalidOrgException) TransientNonEmptyString(org.orcid.jaxb.model.v3.dev1.common.TransientNonEmptyString) Matcher(java.util.regex.Matcher) ActivityTypeValidationException(org.orcid.core.exception.ActivityTypeValidationException) Map(java.util.Map) VisibilityMismatchException(org.orcid.core.exception.VisibilityMismatchException) Month(org.orcid.jaxb.model.v3.dev1.common.Month) CitationType(org.orcid.jaxb.model.v3.dev1.record.CitationType) PeerReviewType(org.orcid.jaxb.model.v3.dev1.record.PeerReviewType) Affiliation(org.orcid.jaxb.model.v3.dev1.record.Affiliation) Resource(javax.annotation.Resource) NormalizationService(org.orcid.core.utils.v3.identifiers.NormalizationService) ExternalIDs(org.orcid.jaxb.model.v3.dev1.record.ExternalIDs) Amount(org.orcid.jaxb.model.v3.dev1.common.Amount) ContributorOrcid(org.orcid.jaxb.model.v3.dev1.common.ContributorOrcid) Collectors(java.util.stream.Collectors) ActivityIdentifierValidationException(org.orcid.core.exception.ActivityIdentifierValidationException) OrganizationHolder(org.orcid.jaxb.model.v3.dev1.common.OrganizationHolder) PeerReview(org.orcid.jaxb.model.v3.dev1.record.PeerReview) Day(org.orcid.jaxb.model.v3.dev1.common.Day) Source(org.orcid.jaxb.model.v3.dev1.common.Source) PublicationDate(org.orcid.jaxb.model.v3.dev1.common.PublicationDate) Pattern(java.util.regex.Pattern) SiteConstants(org.orcid.persistence.constants.SiteConstants) Relationship(org.orcid.jaxb.model.v3.dev1.record.Relationship) Year(org.orcid.jaxb.model.v3.dev1.common.Year) OrcidStringUtils(org.orcid.utils.OrcidStringUtils) ActivityTitleValidationException(org.orcid.core.exception.ActivityTitleValidationException) OrcidDuplicatedActivityException(org.orcid.core.exception.OrcidDuplicatedActivityException) PojoUtil(org.orcid.pojo.ajaxForm.PojoUtil) HashMap(java.util.HashMap) OrcidValidationException(org.orcid.core.exception.OrcidValidationException) Organization(org.orcid.jaxb.model.v3.dev1.common.Organization) Iso3166Country(org.orcid.jaxb.model.v3.dev1.common.Iso3166Country) WorkType(org.orcid.jaxb.model.v3.dev1.record.WorkType) Funding(org.orcid.jaxb.model.v3.dev1.record.Funding) InvalidDisambiguatedOrgException(org.orcid.core.exception.InvalidDisambiguatedOrgException) SourceEntity(org.orcid.persistence.jpa.entities.SourceEntity) GroupIdRecord(org.orcid.jaxb.model.v3.dev1.groupid.GroupIdRecord) Contributor(org.orcid.jaxb.model.v3.dev1.common.Contributor) Visibility(org.orcid.jaxb.model.v3.dev1.common.Visibility) FundingTitle(org.orcid.jaxb.model.v3.dev1.record.FundingTitle) Work(org.orcid.jaxb.model.v3.dev1.record.Work) WorkTitle(org.orcid.jaxb.model.v3.dev1.record.WorkTitle) ExternalID(org.orcid.jaxb.model.v3.dev1.record.ExternalID) PublicationDate(org.orcid.jaxb.model.v3.dev1.common.PublicationDate) HashMap(java.util.HashMap) WorkContributors(org.orcid.jaxb.model.v3.dev1.record.WorkContributors) OrcidValidationException(org.orcid.core.exception.OrcidValidationException) Contributor(org.orcid.jaxb.model.v3.dev1.common.Contributor) ActivityTypeValidationException(org.orcid.core.exception.ActivityTypeValidationException) TransientNonEmptyString(org.orcid.jaxb.model.v3.dev1.common.TransientNonEmptyString) ActivityIdentifierValidationException(org.orcid.core.exception.ActivityIdentifierValidationException) Month(org.orcid.jaxb.model.v3.dev1.common.Month) ActivityTitleValidationException(org.orcid.core.exception.ActivityTitleValidationException) Year(org.orcid.jaxb.model.v3.dev1.common.Year) WorkTitle(org.orcid.jaxb.model.v3.dev1.record.WorkTitle) InvalidPutCodeException(org.orcid.core.exception.InvalidPutCodeException) CitationType(org.orcid.jaxb.model.v3.dev1.record.CitationType) Visibility(org.orcid.jaxb.model.v3.dev1.common.Visibility) ContributorOrcid(org.orcid.jaxb.model.v3.dev1.common.ContributorOrcid) Day(org.orcid.jaxb.model.v3.dev1.common.Day) Map(java.util.Map) HashMap(java.util.HashMap)

Example 13 with Citation

use of org.orcid.jaxb.model.v3.dev1.record.Citation in project ORCID-Source by ORCID.

the class ActivityUtilsTest method cleanBulkWorkTest.

@Test
public void cleanBulkWorkTest() {
    // Test it cleans empty fields
    WorkBulk bulk = new WorkBulk();
    Work w = getEmptyWork();
    bulk.getBulk().add(w);
    assertNotNull(((Work) bulk.getBulk().get(0)).getWorkTitle().getTranslatedTitle());
    assertNotNull(((Work) bulk.getBulk().get(0)).getWorkCitation());
    assertNotNull(((Work) bulk.getBulk().get(0)).getWorkContributors().getContributor().get(0).getCreditName());
    ActivityUtils.cleanEmptyFields(bulk);
    assertNull(((Work) bulk.getBulk().get(0)).getWorkTitle().getTranslatedTitle());
    assertNull(((Work) bulk.getBulk().get(0)).getWorkCitation());
    assertNull(((Work) bulk.getBulk().get(0)).getWorkContributors().getContributor().get(0).getCreditName());
    // Test it doesn't remove non empty fields
    bulk = new WorkBulk();
    w = getEmptyWork();
    w.getWorkTitle().getTranslatedTitle().setContent("translated_title");
    w.getWorkTitle().getTranslatedTitle().setLanguageCode("en_us");
    w.getWorkCitation().setCitation("citation");
    w.getWorkCitation().setWorkCitationType(CitationType.BIBTEX);
    w.getWorkContributors().getContributor().get(0).getCreditName().setContent("credit_name");
    bulk.getBulk().add(w);
    assertEquals("translated_title", ((Work) bulk.getBulk().get(0)).getWorkTitle().getTranslatedTitle().getContent());
    assertEquals("en_us", ((Work) bulk.getBulk().get(0)).getWorkTitle().getTranslatedTitle().getLanguageCode());
    assertEquals("citation", ((Work) bulk.getBulk().get(0)).getWorkCitation().getCitation());
    assertEquals(CitationType.BIBTEX, ((Work) bulk.getBulk().get(0)).getWorkCitation().getWorkCitationType());
    assertEquals("credit_name", ((Work) bulk.getBulk().get(0)).getWorkContributors().getContributor().get(0).getCreditName().getContent());
    ActivityUtils.cleanEmptyFields(bulk);
    assertEquals("translated_title", ((Work) bulk.getBulk().get(0)).getWorkTitle().getTranslatedTitle().getContent());
    assertEquals("en_us", ((Work) bulk.getBulk().get(0)).getWorkTitle().getTranslatedTitle().getLanguageCode());
    assertEquals("citation", ((Work) bulk.getBulk().get(0)).getWorkCitation().getCitation());
    assertEquals(CitationType.BIBTEX, ((Work) bulk.getBulk().get(0)).getWorkCitation().getWorkCitationType());
    assertEquals("credit_name", ((Work) bulk.getBulk().get(0)).getWorkContributors().getContributor().get(0).getCreditName().getContent());
}
Also used : WorkBulk(org.orcid.jaxb.model.v3.dev1.record.WorkBulk) Work(org.orcid.jaxb.model.v3.dev1.record.Work) Test(org.junit.Test)

Example 14 with Citation

use of org.orcid.jaxb.model.v3.dev1.record.Citation in project ORCID-Source by ORCID.

the class ActivityUtilsTest method cleanWorkTest.

@Test
public void cleanWorkTest() {
    // Test it cleans empty fields
    Work w = getEmptyWork();
    assertNotNull(w.getWorkTitle().getTranslatedTitle());
    assertNotNull(w.getWorkCitation());
    assertNotNull(w.getWorkContributors().getContributor().get(0).getCreditName());
    ActivityUtils.cleanEmptyFields(w);
    assertNull(w.getWorkTitle().getTranslatedTitle());
    assertNull(w.getWorkCitation());
    assertNull(w.getWorkContributors().getContributor().get(0).getCreditName());
    // Test it doesn't remove non empty fields
    w = getEmptyWork();
    w.getWorkTitle().getTranslatedTitle().setContent("translated_title");
    w.getWorkTitle().getTranslatedTitle().setLanguageCode("en_us");
    w.getWorkCitation().setCitation("citation");
    w.getWorkCitation().setWorkCitationType(CitationType.BIBTEX);
    w.getWorkContributors().getContributor().get(0).getCreditName().setContent("credit_name");
    assertEquals("translated_title", w.getWorkTitle().getTranslatedTitle().getContent());
    assertEquals("en_us", w.getWorkTitle().getTranslatedTitle().getLanguageCode());
    assertEquals("citation", w.getWorkCitation().getCitation());
    assertEquals(CitationType.BIBTEX, w.getWorkCitation().getWorkCitationType());
    assertEquals("credit_name", w.getWorkContributors().getContributor().get(0).getCreditName().getContent());
    ActivityUtils.cleanEmptyFields(w);
    assertEquals("translated_title", w.getWorkTitle().getTranslatedTitle().getContent());
    assertEquals("en_us", w.getWorkTitle().getTranslatedTitle().getLanguageCode());
    assertEquals("citation", w.getWorkCitation().getCitation());
    assertEquals(CitationType.BIBTEX, w.getWorkCitation().getWorkCitationType());
    assertEquals("credit_name", w.getWorkContributors().getContributor().get(0).getCreditName().getContent());
}
Also used : Work(org.orcid.jaxb.model.v3.dev1.record.Work) Test(org.junit.Test)

Example 15 with Citation

use of org.orcid.jaxb.model.v3.dev1.record.Citation in project ORCID-Source by ORCID.

the class V3WorkToCiteprocTranslator method translateFromWorkMetadata.

/**
 * Use the ORCID work metadata to generate a *limited* citation. You'll most
 * likely get a title, doi, url, date and author.
 *
 * Translates type according to https://docs.google.com/spreadsheets/d/
 * 1h4nTF6DKNEpWcGNQVMDwt0ea09qmkBnkWisxkJE-li4/edit#gid=754644608
 *
 * Informed by mendley tranforms at
 * http://support.mendeley.com/customer/portal/articles/364144-csl-type-
 * mapping
 *
 * See also:
 * http://docs.citationstyles.org/en/stable/specification.html#appendix-iii-
 * types http://members.orcid.org/api/supported-work-types datacite and
 * crossref mappings here:
 * https://github.com/lagotto/lagotto/blob/master/config/initializers/
 * constants.rb
 * @param creditName
 *
 * @param worktype
 * @return a CSLItemData, default CSLType.ARTICLE if cannot map type
 */
private CSLItemData translateFromWorkMetadata(Work work, String creditName) {
    CSLItemDataBuilder builder = new CSLItemDataBuilder();
    builder.title((work.getWorkTitle() != null) ? StringUtils.stripAccents(work.getWorkTitle().getTitle().getContent()) : "No Title");
    String doi = extractID(work, WorkExternalIdentifierType.DOI);
    String url = extractID(work, WorkExternalIdentifierType.URI);
    if (doi != null) {
        builder.DOI(doi);
    }
    if (url != null) {
        builder.URL(url);
    } else if (doi != null) {
        builder.URL("http://doi.org/" + doi);
    } else {
        url = extractID(work, WorkExternalIdentifierType.HANDLE);
        if (url != null) {
            builder.URL(url);
        }
    }
    if (work.getJournalTitle() != null) {
        builder.containerTitle(StringUtils.stripAccents(work.getJournalTitle().getContent()));
    }
    List<String> names = new ArrayList<String>();
    // TODO: Pass in credit name
    names.add(creditName);
    if (work.getWorkContributors() != null && work.getWorkContributors().getContributor() != null) {
        for (Contributor c : work.getWorkContributors().getContributor()) {
            if (c.getCreditName() != null && c.getCreditName().getContent() != null) {
                names.add(StringUtils.stripAccents(c.getCreditName().getContent()));
            }
        }
    }
    CSLNameBuilder name = new CSLNameBuilder();
    name.literal(Joiner.on(" and ").skipNulls().join(names));
    builder.author(name.build());
    // TODO: make it work with "Spring", "August", whatever...
    if (work.getPublicationDate() != null) {
        int year = 0;
        int month = 0;
        int day = 0;
        try {
            year = Integer.parseInt(work.getPublicationDate().getYear().getValue());
            month = Integer.parseInt(work.getPublicationDate().getMonth().getValue());
            day = Integer.parseInt(work.getPublicationDate().getDay().getValue());
        } catch (Exception e) {
        }
        if (year > 0 && month > 0 && day > 0) {
            builder.issued(year, month, day);
        } else if (year > 0 && month > 0) {
            builder.issued(year, month);
        } else if (year > 0) {
            builder.issued(year);
        }
    }
    switch(work.getWorkType()) {
        case ARTISTIC_PERFORMANCE:
            break;
        case BOOK:
            builder.type(CSLType.BOOK);
            break;
        case BOOK_CHAPTER:
            builder.type(CSLType.CHAPTER);
            break;
        case BOOK_REVIEW:
            builder.type(CSLType.REVIEW_BOOK);
            break;
        case CONFERENCE_ABSTRACT:
            builder.type(CSLType.PAPER_CONFERENCE);
            break;
        case CONFERENCE_PAPER:
            builder.type(CSLType.PAPER_CONFERENCE);
            break;
        case CONFERENCE_POSTER:
            builder.type(CSLType.PAPER_CONFERENCE);
            break;
        case DATA_SET:
            builder.type(CSLType.DATASET);
            break;
        case DICTIONARY_ENTRY:
            builder.type(CSLType.ENTRY_DICTIONARY);
            break;
        case DISSERTATION:
            builder.type(CSLType.THESIS);
            break;
        case ENCYCLOPEDIA_ENTRY:
            builder.type(CSLType.ENTRY_ENCYCLOPEDIA);
            break;
        case JOURNAL_ARTICLE:
            builder.type(CSLType.ARTICLE_JOURNAL);
            break;
        case MAGAZINE_ARTICLE:
            builder.type(CSLType.ARTICLE_MAGAZINE);
            break;
        case NEWSLETTER_ARTICLE:
            builder.type(CSLType.ARTICLE_NEWSPAPER);
            break;
        case NEWSPAPER_ARTICLE:
            builder.type(CSLType.ARTICLE_NEWSPAPER);
            break;
        case ONLINE_RESOURCE:
            builder.type(CSLType.WEBPAGE);
            break;
        case REPORT:
            builder.type(CSLType.REPORT);
            break;
        case WEBSITE:
            builder.type(CSLType.WEBPAGE);
            break;
        case WORKING_PAPER:
            builder.type(CSLType.ARTICLE);
            break;
        case DISCLOSURE:
        case EDITED_BOOK:
        case INVENTION:
        case JOURNAL_ISSUE:
        case LECTURE_SPEECH:
        case LICENSE:
        case MANUAL:
        case OTHER:
        case PATENT:
        case REGISTERED_COPYRIGHT:
        case RESEARCH_TECHNIQUE:
        case RESEARCH_TOOL:
        case SPIN_OFF_COMPANY:
        case STANDARDS_AND_POLICY:
        case SUPERVISED_STUDENT_PUBLICATION:
        case TECHNICAL_STANDARD:
        case TEST:
        case TRADEMARK:
        case TRANSLATION:
        case UNDEFINED:
        default:
            // builder.type(CSLType.ARTICLE);
            break;
    }
    return builder.build();
}
Also used : ArrayList(java.util.ArrayList) CSLNameBuilder(de.undercouch.citeproc.csl.CSLNameBuilder) Contributor(org.orcid.jaxb.model.v3.dev1.common.Contributor) CSLItemDataBuilder(de.undercouch.citeproc.csl.CSLItemDataBuilder) IOException(java.io.IOException) ParseException(org.jbibtex.ParseException)

Aggregations

Work (org.orcid.jaxb.model.v3.dev1.record.Work)12 WorkTitle (org.orcid.jaxb.model.v3.dev1.record.WorkTitle)6 Test (org.junit.Test)5 PublicationDate (org.orcid.jaxb.model.v3.dev1.common.PublicationDate)5 Title (org.orcid.jaxb.model.v3.dev1.common.Title)5 Contributor (org.orcid.jaxb.model.v3.dev1.common.Contributor)4 ContributorOrcid (org.orcid.jaxb.model.v3.dev1.common.ContributorOrcid)4 CreatedDate (org.orcid.jaxb.model.v3.dev1.common.CreatedDate)4 CreditName (org.orcid.jaxb.model.v3.dev1.common.CreditName)4 Iso3166Country (org.orcid.jaxb.model.v3.dev1.common.Iso3166Country)4 Subtitle (org.orcid.jaxb.model.v3.dev1.common.Subtitle)4 Url (org.orcid.jaxb.model.v3.dev1.common.Url)4 WorkContributors (org.orcid.jaxb.model.v3.dev1.record.WorkContributors)4 Country (org.orcid.jaxb.model.v3.dev1.common.Country)3 Day (org.orcid.jaxb.model.v3.dev1.common.Day)3 FuzzyDate (org.orcid.jaxb.model.v3.dev1.common.FuzzyDate)3 LastModifiedDate (org.orcid.jaxb.model.v3.dev1.common.LastModifiedDate)3 Month (org.orcid.jaxb.model.v3.dev1.common.Month)3 TranslatedTitle (org.orcid.jaxb.model.v3.dev1.common.TranslatedTitle)3 Citation (org.orcid.jaxb.model.v3.dev1.record.Citation)3