/** * Returns <code>true</code> if the item is a node and the polarity is * positive (true). * @see org.apache.jackrabbit.commons.predicate.DepthPredicate#matches(javax.jcr.Item) */ @Override protected boolean matches(Item item) throws RepositoryException { return item.isNode() == isNode; } }
/** * {@inheritDoc} * * Returns {@code true} if the item is a node and the polarity is * positive (true). */ public boolean matches(Item item) throws RepositoryException { return item.isNode() == isNode; }
private <T extends Item> void move(T item, Node parent) throws RepositoryException { if (item.isNode()) { move((Node) item, parent); } else { move((Property) item, parent); } }
@Override public boolean recomputeDerivedData() throws RepositoryException { if(item.isNode()) { return ((SessionDecorator)getSession()).computeDerivedData((Node) item); } return false; }
@Override public MockNode getNode(final String absPath) throws RepositoryException { Item item = getItem(absPath); if (!item.isNode()) { throw new PathNotFoundException("No such node: " + absPath); } return (MockNode) item; }
@Override public Item getAncestor(int depth) throws ItemNotFoundException, AccessDeniedException, RepositoryException { Item item = super.getAncestor(depth); if (item.isNode()) { return wrapNode((Node) item); } else { return wrapProperty((Property) item); } }
private void export(String path, Exporter exporter) throws PathNotFoundException, SAXException, RepositoryException { Item item = getItem(path); if (item.isNode()) { exporter.export((Node) item); } else { throw new PathNotFoundException("XML export is not defined for properties: " + path); } }
public Object doInJcr( final Session session ) throws RepositoryException { Item item = session.getItem( absPath ); Assert.isTrue( !item.isNode() ); return ( (Property) item ).getString(); } } );
@Override public Item getAncestor(int depth) throws ItemNotFoundException, AccessDeniedException, RepositoryException { Item item = super.getAncestor(depth); if (item.isNode()) { return wrapNode((Node) item); } else { return wrapProperty((Property) item); } }
/** {@inheritDoc} */ @Override public void save() throws AccessDeniedException, ConstraintViolationException, InvalidItemStateException, ReferentialIntegrityException, VersionException, LockException, RepositoryException { if(item.isNode()) { ((SessionDecorator)getSession()).postSave((Node)item); } super.save(); }
public JcrItemModel(T item) { super(item); setUserId(); relPath = null; uuid = null; if (item != null) { TraceMonitor.track(item); property = !item.isNode(); doSave(); } }
public Object doInJcr( final Session session ) throws RepositoryException { Item item = session.getItem( absPath ); Assert.isTrue( !item.isNode() ); return ( (Property) item ).getDate().getTime(); } } );
/** * @see org.apache.jackrabbit.commons.predicate.DepthPredicate#matches(javax.jcr.Item) */ @Override protected boolean matches(Item item) throws RepositoryException { if (item.isNode()) { return ((Node) item).getDefinition().isMandatory() == isMandatory; } return ((Property) item).getDefinition().isMandatory() == isMandatory; } }
public boolean matches(Item item) throws RepositoryException { if (item.isNode()) { return ((Node) item).getDefinition().isMandatory() == isMandatory; } else { return ((Property) item).getDefinition().isMandatory() == isMandatory; } }
/** * @see org.apache.jackrabbit.commons.predicate.DepthPredicate#matches(javax.jcr.Item) */ @Override protected boolean matches(Item item) throws RepositoryException { if (item.isNode()) { return ((Node) item).getDefinition().isMandatory() == isMandatory; } return ((Property) item).getDefinition().isMandatory() == isMandatory; } }
/** * Test if all returned items are of type node. */ public void testGetProperties() throws RepositoryException { PropertyIterator properties = testRootNode.getProperties(); while (properties.hasNext()) { Item item = (Item) properties.next(); assertFalse("Item is not a property", item.isNode()); } }
public Object doInJcr( final Session session ) throws RepositoryException { Item item; try { item = session.getItem( absPath ); } catch ( PathNotFoundException e ) { return null; } Assert.isTrue( item.isNode() ); return ( (Node) item ).getUUID(); } } );
public Object doInJcr( final Session session ) throws RepositoryException { Item item = session.getItem( absPath ); Assert.isTrue( item.isNode() ); return ( (Node) item ).isLocked(); } } );
public Object doInJcr( final Session session ) throws RepositoryException { Item item = session.getItem( absPath ); Assert.isTrue( item.isNode() ); Node node = ( (Node) item ); return node.getVersionHistory().getPath(); } } );
public void removeItem(String path) throws RepositoryException { Item item = getSession().getItem(path); if (item.isNode()) { new NodeProxy((Node) item).remove(); } else { item.remove(); processChanges(Text.getRelativeParent(path, 1), path); } }