private void downGradeActivity(OrcidWork work) { work.setSource(null); }
private void addSourceToActivity(Activity updatedActivity, Source targetSource) { if(updatedActivity instanceof OrcidWork) { ((OrcidWork) updatedActivity).setSource(targetSource); } else if(updatedActivity instanceof Funding) { ((Funding) updatedActivity).setSource(targetSource); } else if(updatedActivity instanceof Affiliation) { ((Affiliation) updatedActivity).setSource(targetSource); } }
/** * Add source to the works * * @param orcidWorks * The list of works * @param source * The source element */ private void addSourceToWorks(OrcidWorks orcidWorks, Source source) { for(OrcidWork work : orcidWorks.getOrcidWork()) { if(PojoUtil.isEmpty(work.getPutCode())) { work.setSource(source); } } }
private void downGradeActivity(OrcidWork orcidWork) { Source source = orcidWork.getSource(); if (source != null) { SourceOrcid sourceOrcid = source.getSourceOrcid(); if (sourceOrcid != null) { orcidWork.setSource(null); orcidWork.setWorkSource(new WorkSource(sourceOrcid)); } } WorkExternalIdentifiers externalIdentifiers = orcidWork.getWorkExternalIdentifiers(); if (externalIdentifiers != null) { for (WorkExternalIdentifier wei : externalIdentifiers.getWorkExternalIdentifier()) { WorkExternalIdentifierType type = wei.getWorkExternalIdentifierType(); if (type != null) { if (Arrays.binarySearch(NEW_WORK_EXT_ID_TYPES, type) >= 0) { wei.setWorkExternalIdentifierType(OTHER_ID); } } } } }
orcidWork.setWorkExternalIdentifiers(converter.convertFrom(work.getExternalIdentifiersJson())); orcidWork.setSource(getSource(work)); orcidWork.setWorkTitle(getWorkTitle(work)); orcidWork.setJournalTitle(StringUtils.isNotBlank(work.getJournalTitle()) ? new Title(work.getJournalTitle()) : null);