Refine search
if (maxLevel == -1 || currentLevel < maxLevel) { currentLevel++; PropertyIterator propIter = node.getProperties(); while (propIter.hasNext()) { propIter.nextProperty().accept(this); PropertyIterator propIter = node.getProperties(); while (propIter.hasNext()) { nextQueue.addLast(propIter.nextProperty());
private boolean hasI18NKeys(Node node, String[] properties) { try { return node.getProperties(properties).hasNext(); } catch (RepositoryException re) { log.warn("Got exception by checking if '{}' has i18n properties", NodeUtil.getName(node), re); return false; } }
@Override public void visit(Node node) throws RepositoryException { PropertyIterator properties = new JCRMgnlPropertiesFilteringNodeWrapper(node).getProperties(); while(properties.hasNext()) { Property property = properties.nextProperty(); protoPropertiesMap.put(getRelativePath(property,"prototype"), getStringFromProperty(property)); } } };
@Override public Set<String> keySet() { Set<String> keys = new HashSet<String>(); try { PropertyIterator props = content.getProperties(); while (props.hasNext()) { keys.add(props.nextProperty().getName()); } } catch (RepositoryException e) { // ignore - has no access } for (String name : specialProperties.keySet()) { keys.add(name); } return keys; }
/** * @see Authorizable#getPropertyNames() */ public Iterator<String> getPropertyNames() throws RepositoryException { List<String> l = new ArrayList<String>(); for (PropertyIterator it = node.getProperties(); it.hasNext();) { Property prop = it.nextProperty(); if (isAuthorizableProperty(prop, false)) { l.add(prop.getName()); } } return l.iterator(); }
/** * @see AbstractCollectionConverterImpl#doIsNull(Session, Node, CollectionDescriptor, Class) */ protected boolean doIsNull(Session session, Node parentNode, CollectionDescriptor collectionDescriptor, Class collectionFieldClass) throws RepositoryException { String jcrName = getCollectionJcrName(collectionDescriptor); return (parentNode == null || !parentNode.getProperties(jcrName).hasNext()); }
/** * Returns a sorted map of the properties of the given node. * * @param node JCR node * @return sorted map (keyed by name) of properties * @throws RepositoryException if a repository error occurs */ private SortedMap getProperties(Node node) throws RepositoryException { SortedMap properties = new TreeMap(); PropertyIterator iterator = node.getProperties(); while (iterator.hasNext()) { Property property = iterator.nextProperty(); properties.put(property.getName(), property); } return properties; }
/** * @see Authorizable#getPropertyNames() */ public Iterator<String> getPropertyNames() throws RepositoryException { List<String> l = new ArrayList<String>(); for (PropertyIterator it = node.getProperties(); it.hasNext();) { Property prop = it.nextProperty(); if (isAuthorizableProperty(prop, false)) { l.add(prop.getName()); } } return l.iterator(); }
/** * @see AbstractCollectionConverterImpl#doIsNull(Session, Node, CollectionDescriptor, Class) */ protected boolean doIsNull(Session session, Node parentNode, CollectionDescriptor collectionDescriptor, Class collectionFieldClass) throws RepositoryException { String jcrName = getCollectionJcrName(collectionDescriptor); return (parentNode == null || !parentNode.getProperties(jcrName).hasNext()); }
/** * Returns a sorted map of the properties of the given node. * * @param node JCR node * @return sorted map (keyed by name) of properties * @throws RepositoryException if a repository error occurs */ private SortedMap getProperties(Node node) throws RepositoryException { SortedMap properties = new TreeMap(); PropertyIterator iterator = node.getProperties(); while (iterator.hasNext()) { Property property = iterator.nextProperty(); properties.put(property.getName(), property); } return properties; }
@Override public String[] getVersionLabels() throws RepositoryException { List<String> labels = new ArrayList<String>(); PropertyIterator iter = versionLabels().getProperties(); while (iter.hasNext()) { javax.jcr.Property property = iter.nextProperty(); if (property.getType() == PropertyType.REFERENCE) { labels.add(property.getName()); } } return labels.toArray(new String[labels.size()]); }
/** * Gets all properties from node and returns them as {@link java.util.List}. * Also filters out "extends" property. */ private static List<Property> getPropertiesAsList(Node node, String namePattern) throws RepositoryException { List<Property> properties = new ArrayList<Property>(); PropertyIterator it = node.getProperties(namePattern); while (it.hasNext()) { Property prop = (Property) it.next(); if (!prop.getName().equals(EXTENDING_NODE_PROPERTY)) { properties.add(prop); } } return properties; }
/** * Returns a sorted map of the properties of the given node. * * @param node JCR node * @return sorted map (keyed by name) of properties * @throws RepositoryException if a repository error occurs */ private SortedMap getProperties(Node node) throws RepositoryException { SortedMap properties = new TreeMap(); PropertyIterator iterator = node.getProperties(); while (iterator.hasNext()) { Property property = iterator.nextProperty(); properties.put(property.getName(), property); } return properties; }
@Override public String[] getVersionLabels() throws RepositoryException { List<String> labels = new ArrayList<String>(); PropertyIterator iter = versionLabels().getProperties(); while (iter.hasNext()) { javax.jcr.Property property = iter.nextProperty(); if (property.getType() == PropertyType.REFERENCE) { labels.add(property.getName()); } } return labels.toArray(new String[labels.size()]); }
private List<String> listOfPermTypes(Node userNode) throws RepositoryException { List<String> permTypes = new ArrayList<String>(); Node permsNode = getNode(userNode, "permissions", "nt:file"); Node content = getNode(permsNode, "jcr:content", "nt:unstructured"); PropertyIterator perms = content.getProperties(); while (perms.hasNext()) { Property p = (Property) perms.next(); String name = p.getName(); if (!name.startsWith("jcr")) { permTypes.add(name); } } return permTypes; }
/** * Read all properties. * @throws IllegalArgumentException if a repository exception occurs */ void readFully() { if (!fullyRead) { try { final PropertyIterator pi = node.getProperties(); while (pi.hasNext()) { final Property prop = pi.nextProperty(); this.cacheProperty(prop); } fullyRead = true; } catch (final RepositoryException re) { throw new IllegalArgumentException(re); } } }
public PropertyIterator getProperties(String namePattern) throws RepositoryException { PropertyIterator iterator = getProperties(); List<Property> properties = new ArrayList<Property>(); while (iterator.hasNext()) { Property p = iterator.nextProperty(); String name = p.getName(); if (ChildrenCollectorFilter.matches(name, namePattern)) { properties.add(p); } } return new MockPropertyIterator(properties.iterator()); }
private List<String> listOfPermTypes(Node userNode) throws RepositoryException { List<String> permTypes = new ArrayList<String>(); Node permsNode = getNode(userNode, "permissions", "nt:file"); Node content = getNode(permsNode, "jcr:content", "nt:unstructured"); PropertyIterator perms = content.getProperties(); while (perms.hasNext()) { Property p = (Property) perms.next(); String name = p.getName(); if (!name.startsWith("jcr")) { permTypes.add(name); } } return permTypes; }
/** * Read all properties. * @throws IllegalArgumentException if a repository exception occurs */ void readFully() { if (!fullyRead) { try { final PropertyIterator pi = node.getProperties(); while (pi.hasNext()) { final Property prop = pi.nextProperty(); this.cacheProperty(prop); } fullyRead = true; } catch (final RepositoryException re) { throw new IllegalArgumentException(re); } } }
private Map<String, Object> convertPropertiesToMap(PropertyIterator iterator) throws RepositoryException { Map<String, Object> propertyMap = Maps.newHashMap(); while (iterator.hasNext()) { Property property = iterator.nextProperty(); final Object propertyValue; if (property.isMultiple()) { propertyValue = Arrays.stream(property.getValues()).map(PropertyUtil::getValueObject).collect(Collectors.toList()); } else { propertyValue = PropertyUtil.getValueObject(property.getValue()); } propertyMap.put(property.getName(), propertyValue); } return propertyMap; }