/** * Create an instance of {@link Biography } * */ public Biography createBiography() { return new Biography(); }
@Override public boolean updateBiography(String orcid, Biography bio) { if (bio == null || bio.getVisibility() == null) { return false; } return biographyDao.updateBiography(orcid, bio.getContent(), bio.getVisibility().name()); }
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-04-24T11:17:38-05:00", comments = "JAXB RI v2.2.11") public String toString() { final ToStringStrategy strategy = JAXBToStringStrategy.INSTANCE; final StringBuilder buffer = new StringBuilder(); append(null, buffer, strategy); return buffer.toString(); }
@Override public Biography getBiography(String orcid) { BiographyEntity biographyEntity = null; try { biographyEntity = biographyDao.getBiography(orcid, getLastModified(orcid)); } catch(Exception e) { LOGGER.debug("Couldn't find biography for " + orcid); } if(biographyEntity != null) { Biography bio = new Biography(); bio.setContent(biographyEntity.getBiography()); bio.setVisibility(Visibility.valueOf(biographyEntity.getVisibility())); bio.setLastModifiedDate(new LastModifiedDate(DateUtils.convertToXMLGregorianCalendar(biographyEntity.getLastModified()))); bio.setCreatedDate(new CreatedDate(DateUtils.convertToXMLGregorianCalendar(biographyEntity.getDateCreated()))); return bio; } return null; }
Biography deprecatedBio = new Biography(); deprecatedBio.setContent(null); deprecatedBio.setVisibility(Visibility.PRIVATE); biographyManager.updateBiography(orcid, deprecatedBio);
private void describeBiography(org.orcid.jaxb.model.record_v2.Biography biography, Individual person, OntModel m) { if (biography != null && biography.getContent()!=null) { // FIXME: Which language is the biography written in? Can't assume // EN person.addProperty(FOAF.plan, biography.getContent()); } }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((biography == null) ? 0 : biography.hashCode()); result = prime * result + ((name == null) ? 0 : name.hashCode()); result = prime * result + ((otherNames == null) ? 0 : otherNames.hashCode()); return result; }
return false; } else if (!biography.equals(other.biography)) { return false;
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-04-24T11:17:38-05:00", comments = "JAXB RI v2.2.11") public StringBuilder append(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) { strategy.appendStart(locator, this, buffer); appendFields(locator, buffer, strategy); strategy.appendEnd(locator, this, buffer); return buffer; }
@Override public Biography getPublicBiography(String orcid) { Biography bio = getBiography(orcid); if(bio != null && org.orcid.jaxb.model.common_v2.Visibility.PUBLIC.equals(bio.getVisibility())) { return bio; } return null; }
public static void calculateLastModified(PersonalDetails personalDetails) { if (personalDetails != null) { calculateLastModified(personalDetails.getOtherNames()); LastModifiedDate l1 = personalDetails.getBiography() == null ? null : personalDetails.getBiography().getLastModifiedDate(); LastModifiedDate l2 = personalDetails.getName() == null ? null : personalDetails.getName().getLastModifiedDate(); LastModifiedDate l3 = personalDetails.getOtherNames() == null ? null : personalDetails.getOtherNames().getLastModifiedDate(); LastModifiedDate globalLatest = calculateLatest(l1, l2, l3); personalDetails.setLastModifiedDate(globalLatest); } }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((addresses == null) ? 0 : addresses.hashCode()); result = prime * result + ((biography == null) ? 0 : biography.hashCode()); result = prime * result + ((emails == null) ? 0 : emails.hashCode()); result = prime * result + ((externalIdentifiers == null) ? 0 : externalIdentifiers.hashCode()); result = prime * result + ((keywords == null) ? 0 : keywords.hashCode()); result = prime * result + ((name == null) ? 0 : name.hashCode()); result = prime * result + ((otherNames == null) ? 0 : otherNames.hashCode()); result = prime * result + ((path == null) ? 0 : path.hashCode()); result = prime * result + ((researcherUrls == null) ? 0 : researcherUrls.hashCode()); return result; }
if (other.biography != null) return false; } else if (!biography.equals(other.biography)) return false; if (emails == null) {
@Override public void createBiography(String orcid, Biography bio) { if (bio == null || PojoUtil.isEmpty(bio.getContent()) || bio.getVisibility() == null) { return; } if(biographyDao.exists(orcid)) { throw new IllegalArgumentException("The biography for " + orcid + " already exists"); } biographyDao.persistBiography(orcid, bio.getContent(), bio.getVisibility().name()); } }