public Object call() { return idFactory.createPropertyId(parentId, propertyName); }}, "createPropertyId(NodeId, Name)", new Object[]{parentId, propertyName}); }
public Object call() { return idFactory.createPropertyId(parentId, propertyName); }}, "createPropertyId(NodeId, Name)", new Object[]{parentId, propertyName}); }
/** * @see PropertyEntry#getId() */ public PropertyId getId() throws InvalidItemStateException, RepositoryException { return getIdFactory().createPropertyId(parent.getId(), getName()); }
/** * @see PropertyEntry#getWorkspaceId() */ public PropertyId getWorkspaceId() throws InvalidItemStateException, RepositoryException { return getIdFactory().createPropertyId(parent.getWorkspaceId(), getName()); }
/** * @see PropertyEntry#getWorkspaceId() */ public PropertyId getWorkspaceId() throws InvalidItemStateException, RepositoryException { return getIdFactory().createPropertyId(parent.getWorkspaceId(), getName()); }
/** * @see PropertyEntry#getId() */ public PropertyId getId() throws InvalidItemStateException, RepositoryException { return getIdFactory().createPropertyId(parent.getId(), getName()); }
private PropertyId getPropertyId(NodeId nId, Name propName) throws RepositoryException { return rs.getIdFactory().createPropertyId(nId, propName); } }
private PropertyId getPropertyId(NodeId nodeID, Name propName) throws RepositoryException { return rs.getIdFactory().createPropertyId(nodeID, propName); }
private PropertyId getPropertyId(NodeId nId, Name propName) throws RepositoryException { return rs.getIdFactory().createPropertyId(nId, propName); }
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() {
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() {
void setPropertyInfos(PropertyInfoImpl[] propInfos, IdFactory idFactory) throws RepositoryException { boolean resolveUUID = false; for (PropertyInfoImpl propInfo : propInfos) { Name pn = propInfo.getId().getName(); if (NameConstants.JCR_UUID.equals(pn)) { id = idFactory.createNodeId(propInfo.getValues()[0].getString()); resolveUUID = true; } else if (NameConstants.JCR_PRIMARYTYPE.equals(pn)) { primaryNodeTypeName = propInfo.getValues()[0].getName(); } else if (NameConstants.JCR_MIXINTYPES.equals(pn)) { QValue[] vs = propInfo.getValues(); Name[] mixins = new Name[vs.length]; for (int i = 0; i < vs.length; i++) { mixins[i] = vs[i].getName(); } mixinNodeTypeNames = mixins; } } propertyIds.clear(); for (PropertyInfoImpl propInfo : propInfos) { if (resolveUUID) { propInfo.setId(idFactory.createPropertyId(id, propInfo.getName())); } propertyIds.add(propInfo.getId()); } }
public void testPropertiesWithNonLatinCharacters() throws RepositoryException, IOException { Name fileName = resolver.getQName("\u0633\u0634.txt"); createFile(fileName); NodeId nid = getNodeId(testPath + "/\u0633\u0634.txt/jcr:content"); PropertyInfo pi = rs.getPropertyInfo(si, rs.getIdFactory().createPropertyId(nid, NameConstants.JCR_LASTMODIFIED)); assertEquals(lastModified, pi.getValues()[0]); pi = rs.getPropertyInfo(si, rs.getIdFactory().createPropertyId(nid, NameConstants.JCR_MIMETYPE)); assertEquals(mimeType, pi.getValues()[0]); pi = rs.getPropertyInfo(si, rs.getIdFactory().createPropertyId(nid, NameConstants.JCR_ENCODING)); assertEquals(enc, pi.getValues()[0]); pi = rs.getPropertyInfo(si, rs.getIdFactory().createPropertyId(nid, NameConstants.JCR_DATA)); assertEquals("\u0633\u0634", pi.getValues()[0].getString()); }
PropertyId buildPropertyId(NodeId parentId, MultiStatusResponse response, String workspaceName, NamePathResolver resolver) throws RepositoryException { IdURICache cache = getCache(workspaceName); if (cache.containsUri(response.getHref())) { ItemId id = cache.getItemId(response.getHref()); if (!id.denotesNode()) { return (PropertyId) id; } } try { DavPropertySet propSet = response.getProperties(DavServletResponse.SC_OK); Name name = resolver.getQName(propSet.get(JcrRemotingConstants.JCR_NAME_LN, ItemResourceConstants.NAMESPACE).getValue().toString()); PropertyId propertyId = service.getIdFactory().createPropertyId(parentId, name); cache.add(response.getHref(), propertyId); return propertyId; } catch (NameException e) { throw new RepositoryException(e); } }
PropertyId buildPropertyId(NodeId parentId, MultiStatusResponse response, String workspaceName, NamePathResolver resolver) throws RepositoryException { IdURICache cache = getCache(workspaceName); if (cache.containsUri(response.getHref())) { ItemId id = cache.getItemId(response.getHref()); if (!id.denotesNode()) { return (PropertyId) id; } } try { DavPropertySet propSet = response.getProperties(DavServletResponse.SC_OK); Name name = resolver.getQName(propSet.get(JcrRemotingConstants.JCR_NAME_LN, ItemResourceConstants.NAMESPACE).getValue().toString()); PropertyId propertyId = service.getIdFactory().createPropertyId(parentId, name); cache.add(response.getHref(), propertyId); return propertyId; } catch (NameException e) { throw new RepositoryException(e); } }
/** * 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()); } }
/** * 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.getParentId(); parentId = idFactory.createNodeId( parentId.getUniqueID(), parentId.getPath()); PropertyId propId = idFactory.createPropertyId( parentId, propertyInfo.getId().getName()); return new PropertyInfoImpl(parentId, propertyInfo.getName(), propertyInfo.getPath(), propId, propertyInfo.getType(), propertyInfo.isMultiValued(), propertyInfo.getValues()); } }
/** * @inheritDoc */ public PropertyId getPropertyId(String uri, SessionInfo sessionInfo) throws RepositoryException { IdURICache cache = getCache(sessionInfo.getWorkspaceName()); ItemId id = cache.getItemId(uri); if (id != null) { if (!id.denotesNode()) { return (PropertyId) id; } } // separate parent uri and property JCRName String parentUri = Text.getRelativeParent(uri, 1, true); // make sure propName is unescaped String propName = Text.unescape(Text.getName(uri, true)); // retrieve parent node id NodeId parentId = getNodeId(parentUri, sessionInfo, false); // build property id try { Name name = service.getNamePathResolver(sessionInfo).getQName(propName); PropertyId propertyId = service.getIdFactory().createPropertyId(parentId, name); cache.add(uri, propertyId); return propertyId; } catch (NameException e) { throw new RepositoryException(e); } } }