public String getLockOwner() { PropertyState property = tree.getProperty(JCR_LOCKOWNER); if (property != null && property.getType() == Type.STRING) { return property.getValue(Type.STRING); } else { return null; } }
private String getOakName(Tree tree) { PropertyState property = tree.getProperty(JCR_NODETYPENAME); if (property != null) { return property.getValue(Type.NAME); } else { return tree.getName(); } }
private static long counterValue(ContentSession s, String path) { Tree counter = s.getLatestRoot().getTree(path); if (counter.hasProperty("oak:counter")) { return counter.getProperty("oak:counter").getValue(LONG); } return 0; } }
private static void setup(Root root) throws Exception { Tree tree = root.getTree("/"); tree.addChild("c").setProperty("p", "base"); root.commit(); }
@Override public void testRemoveRepExternalIdWithoutPrincipalNames() throws Exception { root.getTree(testUserPath).setProperty(ExternalIdentityConstants.REP_EXTERNAL_ID, "id"); root.commit(); root.getTree(testUserPath).removeProperty(ExternalIdentityConstants.REP_EXTERNAL_ID); root.commit(); } }
public long getLong(String name, long defaultValue) { PropertyState property = tree.getProperty(name); if (property != null && !property.isArray()) { return property.getValue(LONG); } else { return defaultValue; } }
private static Tree getOrCreateNodeTypes(Root root) { Tree types = root.getTree(NODE_TYPES_PATH); if (!types.exists()) { Tree system = root.getTree('/' + JCR_SYSTEM); if (!system.exists()) { system = root.getTree("/").addChild(JCR_SYSTEM); } types = system.addChild(JCR_NODE_TYPES); } return types; }
@Override public void testAddRepExternalId() throws Exception { root.getTree(testUserPath).setProperty(ExternalIdentityConstants.REP_EXTERNAL_ID, "id"); root.commit(); }
void autosave() throws RepositoryException { if (autosave) { try { root.commit(); } catch (CommitFailedException e) { throw e.asRepositoryException(); } finally { root.refresh(); } } }
public String getLockOwner() { PropertyState property = tree.getProperty(JCR_LOCKOWNER); if (property != null && property.getType() == Type.STRING) { return property.getValue(Type.STRING); } else { return null; } }
private String getOakName(Tree tree) { PropertyState property = tree.getProperty(JCR_NODETYPENAME); if (property != null) { return property.getValue(Type.NAME); } else { return tree.getName(); } }
private static Tree getOrCreateNodeTypes(Root root) { Tree types = root.getTree(NODE_TYPES_PATH); if (!types.exists()) { Tree system = root.getTree('/' + JCR_SYSTEM); if (!system.exists()) { system = root.getTree("/").addChild(JCR_SYSTEM); } types = system.addChild(JCR_NODE_TYPES); } return types; }
public String getLockOwner() { PropertyState property = tree.getProperty(JCR_LOCKOWNER); if (property != null && property.getType() == Type.STRING) { return property.getValue(Type.STRING); } else { return null; } }
private String getOakName(Tree tree) { PropertyState property = tree.getProperty(JCR_NODETYPENAME); if (property != null) { return property.getValue(Type.NAME); } else { return tree.getName(); } }