public void onDoiUpdate(Publication publication, String oldId) { if (oldId == null){ publicationChangeLogger.log(Level.INFO, "The DOI has been initialised for the publication " + publication.toString()); } else if (publication.getDoi() == null){ publicationChangeLogger.log(Level.INFO, "The DOI has been reset for the publication " + publication.toString()); } else { publicationChangeLogger.log(Level.INFO, "The DOI " + oldId + " has been updated with " + publication.getDoi() + " in the publication " + publication.toString()); } }
public static String getDoiId(Experiment exp){ if (exp == null){ return null; } else if (exp.getPublication() == null){ return null; } else{ return exp.getPublication().getDoi(); } }
@Override public void onImexIdAssigned(Publication intactPublication, String imex) { String pubId = intactPublication.getPubmedId() != null ? intactPublication.getPubmedId() : intactPublication.getDoi(); if (pubId == null && !intactPublication.getIdentifiers().isEmpty()){ Xref id = intactPublication.getXrefs().iterator().next(); pubId = id.getId(); } NewAssignedImexEvent evt = new NewAssignedImexEvent(this, pubId, imex, null, null); getImexCentralManager().fireOnNewImexAssigned(evt); }
@Override public void onPublicationWhichCannotBeRegistered(Publication intactPublication) { String pubId = intactPublication.getPubmedId() != null ? intactPublication.getPubmedId() : intactPublication.getDoi(); if (pubId == null && !intactPublication.getIdentifiers().isEmpty()){ Xref id = intactPublication.getXrefs().iterator().next(); pubId = id.getId(); } // unassigned publication, cannot use the webservice to automatically assign IMEx id for now, ask the curator to manually register and assign IMEx id to this publication if (!Pattern.matches(ImexCentralManager.PUBMED_REGEXP.toString(), pubId)){ log.warn("It is not possible to register an unassigned publication. " + "The publication needs to be registered manually by a curator in IMEx central."); } // the publication is already registered, we just update status and users else { ImexErrorEvent evt = new ImexErrorEvent(this, ImexErrorType.no_record_created, pubId, null, null, null, "It is not possible to register the publication " + pubId + " in IMEx central."); getImexCentralManager().fireOnImexError(evt); } // do not update experiments and interactions getImexCentralManager().setEnableExperimentsAndInteractionsUpdate(false); }
@Override public void onMissingImexId(Publication intactPublication) { String pubId = intactPublication.getPubmedId() != null ? intactPublication.getPubmedId() : intactPublication.getDoi(); if (pubId == null && !intactPublication.getIdentifiers().isEmpty()){ Xref id = intactPublication.getXrefs().iterator().next(); pubId = id.getId(); } ImexErrorEvent errorEvt = new ImexErrorEvent(this, ImexErrorType.no_IMEX_id, pubId, null, null, null, "Publication " + ((IntactPublication)intactPublication).getAc() + " does not have a valid IMEx id and is ignored."); imexCentralManager.fireOnImexError(errorEvt); // do not update experiments and interactions getImexCentralManager().setEnableExperimentsAndInteractionsUpdate(false); }
@Override public void onPublicationAlreadyRegisteredInImexCentral(Publication intactPublication, String imex) { String pubId = intactPublication.getPubmedId() != null ? intactPublication.getPubmedId() : intactPublication.getDoi(); if (pubId == null && !intactPublication.getIdentifiers().isEmpty()){ Xref id = intactPublication.getXrefs().iterator().next(); pubId = id.getId(); } // we already have an IMEx id in IMEx central, it is not possible to update the intact publication because we have a conflict ImexErrorEvent evt = new ImexErrorEvent(this, ImexErrorType.publication_already_in_imex, pubId, imex, null, null, "It is not possible to assign a valid IMEx id to the publication " + pubId + " because it already registered in IMEx central with another institution"); getImexCentralManager().fireOnImexError(evt); // do not update experiments and interactions getImexCentralManager().setEnableExperimentsAndInteractionsUpdate(false); }
@Override public void onImexIdConflicts(Publication intactPublication, Collection<Xref> conflictingXrefs) { String pubId = intactPublication.getPubmedId() != null ? intactPublication.getPubmedId() : intactPublication.getDoi(); if (pubId == null && !intactPublication.getIdentifiers().isEmpty()){ Xref id = intactPublication.getXrefs().iterator().next(); pubId = id.getId(); } ImexErrorEvent errorEvt = new ImexErrorEvent(this, ImexErrorType.publication_imex_conflict, pubId, null, null, null, "Publication " + pubId + " cannot be updated because of IMEx identifier conflicts."); getImexCentralManager().fireOnImexError(errorEvt); // do not update experiments and interactions getImexCentralManager().setEnableExperimentsAndInteractionsUpdate(false); }
@Override public void onImexIdNotRecognized(Publication intactPublication, String imex) { String pubId = intactPublication.getPubmedId() != null ? intactPublication.getPubmedId() : intactPublication.getDoi(); if (pubId == null && !intactPublication.getIdentifiers().isEmpty()){ Xref id = intactPublication.getXrefs().iterator().next(); pubId = id.getId(); } ImexErrorEvent errorEvt = new ImexErrorEvent(this, ImexErrorType.imex_not_recognized, pubId, imex, null, null, "Publication " + ((IntactPublication)intactPublication).getAc() + " is not matching any record in IMEx central with id " + imex); getImexCentralManager().fireOnImexError(errorEvt); // do not update experiments and interactions getImexCentralManager().setEnableExperimentsAndInteractionsUpdate(false); }
String pubId = publication.getPubmedId() != null ? publication.getPubmedId() : publication.getDoi(); String source = publication.getPubmedId() != null ? Xref.PUBMED : Xref.DOI; if (pubId == null && !publication.getIdentifiers().isEmpty()){