public CreatedDate toCreatedDate() { GregorianCalendar cal = toCalendar(); return new CreatedDate(DateUtils.convertToXMLGregorianCalendar(cal)); }
@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.fromValue(biographyEntity.getVisibility())); bio.setLastModifiedDate(new LastModifiedDate(DateUtils.convertToXMLGregorianCalendar(biographyEntity.getLastModified()))); bio.setCreatedDate(new CreatedDate(DateUtils.convertToXMLGregorianCalendar(biographyEntity.getDateCreated()))); return bio; } return null; }
public Keyword toKeyword() { Keyword keyword = new Keyword(); if (!PojoUtil.isEmpty(putCode)) { keyword.setPutCode(Long.valueOf(putCode)); } if (!PojoUtil.isEmpty(content)) { keyword.setContent(content); } if (visibility != null && visibility.getVisibility() != null) { keyword.setVisibility(org.orcid.jaxb.model.v3.rc2.common.Visibility.fromValue(visibility.getVisibility().value())); } else { keyword.setVisibility(org.orcid.jaxb.model.v3.rc2.common.Visibility.fromValue(OrcidVisibilityDefaults.KEYWORD_DEFAULT.getVisibility().value())); } if (createdDate != null) { keyword.setCreatedDate(new CreatedDate(DateUtils.convertToXMLGregorianCalendar(createdDate.toCalendar()))); } if (lastModified != null) { keyword.setLastModifiedDate(new LastModifiedDate(DateUtils.convertToXMLGregorianCalendar(lastModified.toCalendar()))); } if (displayIndex != null) { keyword.setDisplayIndex(displayIndex); } else { keyword.setDisplayIndex(0L); } keyword.setSource(new Source(source)); return keyword; }
CreatedDate createdDate = new CreatedDate(); createdDate.setValue(DateUtils.convertToXMLGregorianCalendar(this.getCreatedDate().toJavaDate())); work.setCreatedDate(createdDate);