/** * @see javax.jcr.observation.Event#getIdentifier() */ public String getIdentifier() throws RepositoryException { ItemId itemId = event.getItemId(); if (itemId == null) { return null; } else { NodeId nodeId = (itemId.denotesNode()) ? (NodeId) itemId : ((PropertyId) itemId).getParentId(); return idFactory.toJcrIdentifier(nodeId); } }
/** * @see javax.jcr.observation.Event#getIdentifier() */ public String getIdentifier() throws RepositoryException { ItemId itemId = event.getItemId(); if (itemId == null) { return null; } else { NodeId nodeId = (itemId.denotesNode()) ? (NodeId) itemId : ((PropertyId) itemId).getParentId(); return idFactory.toJcrIdentifier(nodeId); } }
public PropertyId next() { PropertyId propId = propIds.next(); NodeId parentId = propId.getParentId(); idFactory.createNodeId( parentId.getUniqueID(), parentId.getPath()); return idFactory.createPropertyId( parentId, propId.getName()); } public void remove() {
public PropertyId next() { PropertyId propId = propIds.next(); NodeId parentId = propId.getParentId(); idFactory.createNodeId( parentId.getUniqueID(), parentId.getPath()); return idFactory.createPropertyId( parentId, propId.getName()); } public void remove() {
public Object next() { PropertyId propId = (PropertyId) propIds.next(); NodeId parentId = propId.getParentId(); idFactory.createNodeId( parentId.getUniqueID(), parentId.getPath()); return idFactory.createPropertyId( parentId, propId.getName()); } public void remove() {
private Path getPath(ItemId itemId, SessionInfo sessionInfo, String workspaceName) throws RepositoryException { if (itemId.denotesNode()) { Path p = itemId.getPath(); String uid = itemId.getUniqueID(); if (uid == null) { return p; } else { NamePathResolver resolver = getNamePathResolver(sessionInfo); String uri = super.getItemUri(itemId, sessionInfo, workspaceName); String rootUri = getRootURI(sessionInfo); String jcrPath; if (uri.startsWith(rootUri)) { jcrPath = uri.substring(rootUri.length()); } else { log.warn("ItemURI " + uri + " doesn't start with rootURI (" + rootUri + ")."); // fallback: // calculated uri does not start with the rootURI // -> search /jcr:root and start sub-string behind. String rootSegment = Text.escapePath(JcrRemotingConstants.ROOT_ITEM_RESOURCEPATH); jcrPath = uri.substring(uri.indexOf(rootSegment) + rootSegment.length()); } jcrPath = Text.unescape(jcrPath); return resolver.getQPath(jcrPath); } } else { PropertyId pId = (PropertyId) itemId; Path parentPath = getPath(pId.getParentId(), sessionInfo, workspaceName); return getPathFactory().create(parentPath, pId.getName(), true); } }
private Path getPath(ItemId itemId, SessionInfo sessionInfo, String workspaceName) throws RepositoryException { if (itemId.denotesNode()) { Path p = itemId.getPath(); String uid = itemId.getUniqueID(); if (uid == null) { return p; } else { NamePathResolver resolver = getNamePathResolver(sessionInfo); String uri = super.getItemUri(itemId, sessionInfo, workspaceName); String rootUri = getRootURI(sessionInfo); String jcrPath; if (uri.startsWith(rootUri)) { jcrPath = uri.substring(rootUri.length()); } else { log.warn("ItemURI " + uri + " doesn't start with rootURI (" + rootUri + ")."); // fallback: // calculated uri does not start with the rootURI // -> search /jcr:root and start sub-string behind. String rootSegment = Text.escapePath(JcrRemotingConstants.ROOT_ITEM_RESOURCEPATH); jcrPath = uri.substring(uri.indexOf(rootSegment) + rootSegment.length()); } jcrPath = Text.unescape(jcrPath); return resolver.getQPath(jcrPath); } } else { PropertyId pId = (PropertyId) itemId; Path parentPath = getPath(pId.getParentId(), sessionInfo, workspaceName); return getPathFactory().create(parentPath, pId.getName(), true); } }
List<PropertyId> serRefs = new ArrayList<PropertyId>(); for (PropertyId ref : nodeInfo.getReferences()) { NodeId parentId = ref.getParentId(); parentId = idFactory.createNodeId( parentId.getUniqueID(), parentId.getPath());
List<PropertyId> serRefs = new ArrayList<PropertyId>(); for (PropertyId ref : nodeInfo.getReferences()) { NodeId parentId = ref.getParentId(); parentId = idFactory.createNodeId( parentId.getUniqueID(), parentId.getPath());
/** * Creates a new serializable property info for the given * <code>PropertyInfo</code>. * * @param propertyInfo */ public static PropertyInfo createSerializablePropertyInfo( PropertyInfo propertyInfo, IdFactory idFactory) { if (propertyInfo instanceof Serializable) { return propertyInfo; } else { NodeId parentId = propertyInfo.getId().getParentId(); parentId = idFactory.createNodeId( parentId.getUniqueID(), parentId.getPath()); PropertyId propId = idFactory.createPropertyId( parentId, propertyInfo.getId().getName()); return new PropertyInfoImpl(propertyInfo.getPath(), propId, propertyInfo.getType(), propertyInfo.isMultiValued(), propertyInfo.getValues()); } }
/** * Creates a new serializable property info for the given * <code>PropertyInfo</code>. * * @param propertyInfo */ public static PropertyInfo createSerializablePropertyInfo( PropertyInfo propertyInfo, IdFactory idFactory) { if (propertyInfo instanceof Serializable) { return propertyInfo; } else { NodeId parentId = propertyInfo.getId().getParentId(); parentId = idFactory.createNodeId( parentId.getUniqueID(), parentId.getPath()); PropertyId propId = idFactory.createPropertyId( parentId, propertyInfo.getId().getName()); return new PropertyInfoImpl(propertyInfo.getPath(), propId, propertyInfo.getType(), propertyInfo.isMultiValued(), propertyInfo.getValues()); } }
List serRefs = new ArrayList(); for (int i = 0; i < refs.length; i++) { NodeId parentId = refs[i].getParentId(); parentId = idFactory.createNodeId( parentId.getUniqueID(), parentId.getPath());