/** * {@inheritDoc} */ public PropertyState createNew(Name propName, NodeId parentId) throws IllegalStateException { if (!editMode) { throw new IllegalStateException("Not in edit mode"); } PropertyState state = new PropertyState( new PropertyId(parentId, propName), ItemState.STATUS_NEW, false); changeLog.added(state); state.setContainer(this); return state; }
/** * {@inheritDoc} */ public PropertyState createNew(Name propName, NodeId parentId) throws IllegalStateException { if (!editMode) { throw new IllegalStateException("Not in edit mode"); } PropertyState state = new PropertyState( new PropertyId(parentId, propName), ItemState.STATUS_NEW, false); changeLog.added(state); state.setContainer(this); return state; }
/** * {@inheritDoc} */ public PropertyId readPropertyId() throws JournalException { return new PropertyId(readNodeId(), readQName()); }
/** * Checks if the given property exists * * @param name name of the property * @return <code>true</code> if the given property exists. */ public boolean hasProperty(Name name) { PropertyId propId = new PropertyId(nodeState.getNodeId(), name); return stateMgr.hasItemState(propId); }
/** * Checks if the given property exists * * @param name name of the property * @return <code>true</code> if the given property exists. */ public boolean hasProperty(Name name) { PropertyId propId = new PropertyId(nodeState.getNodeId(), name); return stateMgr.hasItemState(propId); }
/** * {@inheritDoc} */ public PropertyId readPropertyId() throws JournalException { return new PropertyId(readNodeId(), readQName()); }
/** * Create a new property state instance * * @param propName property name * @param parentId parent Id * @return new property state instance */ private PropertyState createInstance(Name propName, NodeId parentId) { PropertyState state = persistMgr.createNew(new PropertyId(parentId, propName)); state.setStatus(ItemState.STATUS_NEW); state.setContainer(this); return state; }
/** * Create a property state. * * @param parentId parent node id * @param name property name * @return property state. */ protected PropertyState createPropertyState(NodeId parentId, String name) { Name propName = nameFactory.create(name); return new PropertyState( new PropertyId(parentId, propName), NodeState.STATUS_EXISTING, false); }
/** * Create a new property state instance * * @param propName property name * @param parentId parent Id * @return new property state instance */ private PropertyState createInstance(Name propName, NodeId parentId) { PropertyState state = persistMgr.createNew(new PropertyId(parentId, propName)); state.setStatus(ItemState.STATUS_NEW); state.setContainer(this); return state; }
/** * Returns the value of the given property or <code>null</code> * * @param name name of the property * @return the value of the given property. */ public InternalValue getPropertyValue(Name name) { PropertyId propId = new PropertyId(nodeState.getNodeId(), name); try { PropertyState ps = (PropertyState) stateMgr.getItemState(propId); return ps.getValues()[0]; } catch (ItemStateException e) { return null; } }
/** * {@inheritDoc} */ public VirtualPropertyState createPropertyState(VirtualNodeState parent, Name name, int type, boolean multiValued) throws RepositoryException { PropertyId id = new PropertyId(parent.getNodeId(), name); VirtualPropertyState prop = new VirtualPropertyState(id); prop.setType(type); prop.setMultiValued(multiValued); return prop; }
/** * {@inheritDoc} */ public VirtualPropertyState createPropertyState(VirtualNodeState parent, Name name, int type, boolean multiValued) throws RepositoryException { PropertyId id = new PropertyId(parent.getNodeId(), name); VirtualPropertyState prop = new VirtualPropertyState(id); prop.setType(type); prop.setMultiValued(multiValued); return prop; }
protected void removeChildProperty(Name propName) throws RepositoryException { // modify the state of 'this', i.e. the parent node NodeState thisState = (NodeState) getOrCreateTransientItemState(); // remove the property entry if (!thisState.removePropertyName(propName)) { String msg = "failed to remove property " + propName + " of " + this; log.debug(msg); throw new RepositoryException(msg); } // remove property PropertyId propId = new PropertyId(thisState.getNodeId(), propName); itemMgr.getItem(propId).setRemoved(); }
protected void removeChildProperty(Name propName) throws RepositoryException { // modify the state of 'this', i.e. the parent node NodeState thisState = (NodeState) getOrCreateTransientItemState(); // remove the property entry if (!thisState.removePropertyName(propName)) { String msg = "failed to remove property " + propName + " of " + this; log.debug(msg); throw new RepositoryException(msg); } // remove property PropertyId propId = new PropertyId(thisState.getNodeId(), propName); itemMgr.getItem(propId).setRemoved(); }
public PropertyImpl perform(SessionContext context) throws RepositoryException { try { return (PropertyImpl) context.getItemManager().getItem( new PropertyId(getNodeId(), name)); } catch (AccessDeniedException ade) { String n = context.getJCRName(name); throw new ItemNotFoundException( "Property " + n + " not found"); } } public String toString() {
private void removeProperty(NodeState node, Name name) { if (node.hasPropertyName(name)) { node.removePropertyName(name); try { workspaceChanges.deleted(workspace.load( new PropertyId(node.getNodeId(), name))); } catch (ItemStateException ignoe) { } } }
public Boolean perform(SessionContext context) throws RepositoryException { return data.getNodeState().hasPropertyName(name) && context.getItemManager().itemExists( new PropertyId(getNodeId(), name)); } public String toString() {
private void removeProperty(NodeState node, Name name) { if (node.hasPropertyName(name)) { node.removePropertyName(name); try { workspaceChanges.deleted(workspace.load( new PropertyId(node.getNodeId(), name))); } catch (ItemStateException ignoe) { } } }
public PropertyImpl perform(SessionContext context) throws RepositoryException { try { return (PropertyImpl) context.getItemManager().getItem( new PropertyId(getNodeId(), name)); } catch (AccessDeniedException ade) { String n = context.getJCRName(name); throw new ItemNotFoundException( "Property " + n + " not found"); } } public String toString() {
public Boolean perform(SessionContext context) throws RepositoryException { return data.getNodeState().hasPropertyName(name) && context.getItemManager().itemExists( new PropertyId(getNodeId(), name)); } public String toString() {