public boolean hasProperty(String name) { if (properties.containsKey(name)) { return true; } try { return node().hasProperty(name); } catch (RepositoryException e) { return false; } }
public boolean hasProperty(String name) { if (properties.containsKey(name)) { return true; } try { return node().hasProperty(name); } catch (RepositoryException e) { return false; } }
private void loadProps() throws RepositoryException { Node n = node(); /*Set attrs*/ for (int i = 1; i <= ArtefactProperties.PROPS_COUNT; i++) { String propName = ArtefactProperties.PROP_ATTRIBUTE + i; if (n.hasProperty(propName)) { props.put(propName, getPropValueByType(propName)); } } }
private void loadProps() throws RepositoryException { Node n = node(); /*Set attrs*/ for (int i = 1; i <= ArtefactProperties.PROPS_COUNT; i++) { String propName = ArtefactProperties.PROP_ATTRIBUTE + i; if (n.hasProperty(propName)) { props.put(propName, getPropValueByType(propName)); } } }
private Map<String, Object> getVersionProps(CommonVersion version) throws PropertyException, RepositoryException { Node frozenNode = NodeUtil.getNode4Version(node(), version); Map<String, Object> versProps = new HashMap<String, Object>(); return versProps; }
private Map<String, Object> getVersionProps(CommonVersion version) throws PropertyException, RepositoryException { Node frozenNode = NodeUtil.getNode4Version(node(), version); Map<String, Object> versProps = new HashMap<String, Object>(); return versProps; }
private Object getPropValueByType(String propName) throws RepositoryException { Node n = node(); return getPropValueByType(propName, n); }
private Object getPropValueByType(String propName) throws RepositoryException { Node n = node(); return getPropValueByType(propName, n); }
public org.openl.rules.common.Property getProperty(String name) throws PropertyException { org.openl.rules.common.Property rp = properties.get(name); try { if (node().hasProperty(name)) { rp = new JcrProperty(node(), node().getProperty(name)); properties.put(name, rp); } } catch (Exception e) { if (log.isErrorEnabled()) { log.error(e.getMessage(), e); } } if (rp == null) { throw new PropertyException("No such property ''{0}''.", null, name); } return rp; }
@Override public Map<String, InheritedProperty> getInheritedProps() { Map<String, InheritedProperty> inhProps = new HashMap<String, InheritedProperty>(); try { if (node().getDepth() > 3 && node().getParent() != null) { inhProps = getParentProps(node().getParent()); } } catch (Exception e) { if (log.isErrorEnabled()) { log.error(e.getMessage(), e); } } return inhProps; }
@Override public Map<String, InheritedProperty> getInheritedProps() { Map<String, InheritedProperty> inhProps = new HashMap<String, InheritedProperty>(); try { if (node().getDepth() > 3 && node().getParent() != null) { inhProps = getParentProps(node().getParent()); } } catch (Exception e) { if (log.isErrorEnabled()) { log.error(e.getMessage(), e); } } return inhProps; }
public String getPath() throws RRepositoryException { StringBuilder sb = new StringBuilder(128); try { buildRelPath(sb, node()); } catch (RepositoryException e) { throw new RRepositoryException("Failed to get relative path.", e); } return sb.toString(); }
public String getPath() throws RRepositoryException { StringBuilder sb = new StringBuilder(128); try { buildRelPath(sb, node()); } catch (RepositoryException e) { throw new RRepositoryException("Failed to get relative path.", e); } return sb.toString(); }
private void setProperty(String propName, Object propValue) throws RRepositoryException { Node n = node(); try { NodeUtil.smartCheckout(n, false); if (propValue instanceof Date) { n.setProperty(propName, ((Date) propValue).getTime()); } else if (propValue instanceof Double) { n.setProperty(propName, (Double) propValue); } else { n.setProperty(propName, propValue.toString()); } n.save(); } catch (RepositoryException e) { throw new RRepositoryException("Cannot set property " + propName + ".", e); } }
public RLock getLock() throws RRepositoryException { if (isOldVersion()) { return RLock.NO_LOCK; } else { try { return new JcrLock(node()); } catch (RepositoryException e) { throw new RRepositoryException("Failed to get lock.", e); } } }
public RLock getLock() throws RRepositoryException { if (isOldVersion()) { return RLock.NO_LOCK; } else { try { return new JcrLock(node()); } catch (RepositoryException e) { throw new RRepositoryException("Failed to get lock.", e); } } }
public org.openl.rules.common.Property removeProperty(String name) throws PropertyException { org.openl.rules.common.Property rp = getProperty(name); if (rp == null) { throw new PropertyException("No such property ''{0}''.", null, name); } Node n = node(); try { NodeUtil.smartCheckout(n, false); n.getProperty(name).remove(); n.save(); } catch (RepositoryException e) { throw new PropertyException("Cannot remove property ''{0}''.", e, name); } return properties.remove(name); }
public JcrEntityAPI getVersion(CommonVersion version) throws RRepositoryException { try { Node frozenNode = NodeUtil.getNode4Version(node(), version); return new JcrEntityAPI(frozenNode, getArtefactPath(), true); } catch (RepositoryException e) { throw new RRepositoryException("Failed to get version for node.", e); } }
public JcrEntityAPI getVersion(CommonVersion version) throws RRepositoryException { try { Node frozenNode = NodeUtil.getNode4Version(node(), version); return new JcrEntityAPI(frozenNode, getArtefactPath(), true); } catch (RepositoryException e) { throw new RRepositoryException("Failed to get version for node.", e); } }
public org.openl.rules.common.Property removeProperty(String name) throws PropertyException { org.openl.rules.common.Property rp = getProperty(name); if (rp == null) { throw new PropertyException("No such property ''{0}''.", null, name); } Node n = node(); try { NodeUtil.smartCheckout(n, false); n.getProperty(name).remove(); n.save(); } catch (RepositoryException e) { throw new PropertyException("Cannot remove property ''{0}''.", e, name); } return properties.remove(name); }