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());
@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)); } } };
/** * Sets up the fixture for this test. */ protected void setUp() throws Exception { isReadOnly = true; super.setUp(); session = getHelper().getReadOnlySession(); testRootNode = session.getRootNode().getNode(testPath); PropertyIterator properties = testRootNode.getProperties(); try { property = properties.nextProperty(); } catch (NoSuchElementException e) { fail("Any node must have at least one property set: jcr:primaryType"); } }
@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; }
@Override public String toString() { try { PropertyIterator iter = this.getProperties(); StringBuilder propertyBuff = new StringBuilder(); while (iter.hasNext()) { AbstractJcrProperty prop = (AbstractJcrProperty)iter.nextProperty(); propertyBuff.append(prop); if (iter.hasNext()) { propertyBuff.append(", "); } } return this.getPath() + " {" + propertyBuff.toString() + "}"; } catch (Exception e) { return e.getMessage(); } }
/** * 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(); }
/** * 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(); }
/** * 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()]); }
/** * 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); } } }
@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()]); }
/** * 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; }
/** * Gets all of the custom s-ramp property names currently stored on the given * JCR node. * @param jcrNode * @throws RepositoryException */ private static Set<String> getNodePropertyNames(Node jcrNode) throws RepositoryException { String srampPropsPrefix = JCRConstants.SRAMP_PROPERTIES + ":"; //$NON-NLS-1$ int srampPropsPrefixLen = srampPropsPrefix.length(); Set<String> rval = new HashSet<String>(); PropertyIterator properties = jcrNode.getProperties(); while (properties.hasNext()) { Property prop = properties.nextProperty(); String propName = prop.getName(); if (propName.startsWith(srampPropsPrefix)) { propName = propName.substring(srampPropsPrefixLen); rval.add(propName); } } return rval; }
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 static Map<String, String> getLocalizedStringMap( final Session session, final PentahoJcrConstants pentahoJcrConstants, final Node localizedStringNode ) throws RepositoryException { Assert.isTrue( isLocalizedString( session, pentahoJcrConstants, localizedStringNode ) ); String prefix = session.getNamespacePrefix( PentahoJcrConstants.PHO_NS ); Assert.hasText( prefix ); Map<String, String> localizedStringMap = new HashMap<String, String>(); PropertyIterator propertyIter = localizedStringNode.getProperties(); // Loop through properties and append the appropriate values in the map while ( propertyIter.hasNext() ) { Property property = propertyIter.nextProperty(); String propertyKey = property.getName().substring( prefix.length() + 1 ); localizedStringMap.put( propertyKey, property.getString() ); } return localizedStringMap; }
@Override protected Iterator<IModel<Property>> getItemModels() { List<IModel<Property>> refModels = new LinkedList<IModel<Property>>(); Node node = ReferencesDialog.this.getModelObject(); try { PropertyIterator refs = node.getReferences(); while (refs.hasNext()) { refModels.add(new JcrPropertyModel(refs.nextProperty())); } } catch (RepositoryException ex) { log.error(ex.getMessage()); } return refModels.iterator(); }
private void handleNode(Node node, String[] properties) throws RepositoryException { PropertyIterator propertyIterator = node.getProperties(properties); while (propertyIterator.hasNext()) { Property property = propertyIterator.nextProperty(); if (DEPRECATED_I18N_PROPERTIES.contains(property.getName())) { log.info("SiteMap i18n property removed: '{}' ", property.getPath()); property.remove(); } } }