private RepositoryProjectVersionImpl createRepositoryProjectVersion(RVersion rv, Date modifiedAt, String modifiedBy) { RepositoryVersionInfoImpl rvii = new RepositoryVersionInfoImpl(rv.getCreated(), rv.getCreatedBy() .getUserName(), modifiedAt, modifiedBy); String versionComment = ""; Map<String, Object> versionProperties = new HashMap<String, Object>(); try { JcrEntityAPI entity = getVersion(rv); versionProperties = getVersionProps(rv); if (entity.hasProperty(ArtefactProperties.VERSION_COMMENT)) { versionComment = entity.getProperty(ArtefactProperties.VERSION_COMMENT).getString(); } } catch (Exception e) { log.error("Failed to get version properties!", e); // TODO exception should be rethrown } return new RepositoryProjectVersionImpl(rv, rvii, versionComment, versionProperties); }
private RepositoryProjectVersionImpl createRepositoryProjectVersion(RVersion rv, Date modifiedAt, String modifiedBy) { RepositoryVersionInfoImpl rvii = new RepositoryVersionInfoImpl(rv.getCreated(), rv.getCreatedBy() .getUserName(), modifiedAt, modifiedBy); String versionComment = ""; Map<String, Object> versionProperties = new HashMap<String, Object>(); try { JcrEntityAPI entity = getVersion(rv); versionProperties = getVersionProps(rv); if (entity.hasProperty(ArtefactProperties.VERSION_COMMENT)) { versionComment = entity.getProperty(ArtefactProperties.VERSION_COMMENT).getString(); } } catch (Exception e) { log.error("Failed to get version properties!", e); // TODO exception should be rethrown } return new RepositoryProjectVersionImpl(rv, rvii, versionComment, versionProperties); }
public void addProperty(String name, ValueType type, Object value) throws PropertyException { if (hasProperty(name)) { removeProperty(name); } if (value != null) { try { NodeUtil.smartCheckout(node(), false); JcrProperty jp; try { jp = new JcrProperty(node(), name, type, value); } catch (RRepositoryException e) { throw new PropertyException("Internal error.", e); } properties.put(name, jp); node().save(); } catch (RepositoryException e) { throw new PropertyException("Internal error.", e); } } }
public void addProperty(String name, ValueType type, Object value) throws PropertyException { if (hasProperty(name)) { removeProperty(name); } if (value != null) { try { NodeUtil.smartCheckout(node(), false); JcrProperty jp; try { jp = new JcrProperty(node(), name, type, value); } catch (RRepositoryException e) { throw new PropertyException("Internal error.", e); } properties.put(name, jp); node().save(); } catch (RepositoryException e) { throw new PropertyException("Internal error.", e); } } }