protected void performCheck(String statement, String expected) throws RepositoryException { QueryManager qm = superuser.getWorkspace().getQueryManager(); Query query = qm.createQuery( "/jcr:root[rep:spellcheck('" + statement + "')]/(rep:spellcheck())", Query.XPATH); RowIterator rows = query.execute().getRows(); assertEquals("no results returned", 1, rows.getSize()); Row r = rows.nextRow(); Value v = r.getValue("rep:spellcheck()"); if (statement.equals(expected)) { assertNull("must not return a suggestion", v); } else { assertNotNull("no suggestion returned", v); assertEquals("wrong suggestion returned", expected, v.getString()); } query = qm.createQuery( "select rep:spellcheck() from nt:base where " + "jcr:path = '/' and spellcheck('" + statement + "')", Query.SQL); rows = query.execute().getRows(); assertEquals("no results returned", 1, rows.getSize()); r = rows.nextRow(); v = r.getValue("rep:spellcheck()"); if (statement.equals(expected)) { assertNull("must not return a suggestion", v); } else { assertNotNull("no suggestion returned", v); assertEquals("wrong suggestion returned", expected, v.getString()); } }
private Row prepareAnActivityRow(String path) throws RepositoryException { Row activityRow = mock(Row.class); Value pathValue = mock(Value.class); when(pathValue.getString()).thenReturn(path); when(activityRow.getValue("jcr:path")).thenReturn(pathValue); return activityRow; }
@Override public ResultSet query(String text, String lang) { Session session = (Session) this.getThreadLocalRequest().getSession().getAttribute("session"); ResultSet rs = new ResultSet(); try { QueryManager qm = session.getWorkspace().getQueryManager(); Query q = qm.createQuery(text, lang); QueryResult qr = q.execute(); rs.setColumnNames(qr.getColumnNames()); ArrayList<String[]> rows = new ArrayList(); RowIterator it = qr.getRows(); while (it.hasNext()) { Row row = it.nextRow(); String[] list = new String[qr.getColumnNames().length]; for (int i = 0; i < qr.getColumnNames().length; i++) { Value v = row.getValue(qr.getColumnNames()[i]); list[i] = v != null ? v.getString() : "null"; } rows.add(list); } rs.setRows(rows); } catch (RepositoryException e) { log.log(Level.SEVERE, "Error executing query: " + text, e); } return rs; }
/** * Writes the given value to the JSON writer. currently the following conversions are done: * * <table> * <tr> * <th>JSR Property Type</th> * <th>JSON Value Type</th> * </tr> * <tr> * <td>BINARY</td> * <td>always 0 as long</td> * </tr> * <tr> * <td>DATE</td> * <td>converted date string as defined by ECMA</td> * </tr> * <tr> * <td>BOOLEAN</td> * <td>boolean</td> * </tr> * <tr> * <td>LONG</td> * <td>long</td> * </tr> * <tr> * <td>DOUBLE</td> * <td>double</td> * </tr> * <tr> * <td><i>all other</li> * </td> * <td>string</td> * </tr> * </table> * * <sup>1</sup> Currently not implemented and uses 0 as default. * * @param w json writer * @param v value to dump */ protected void dumpValue(JSONWriter w, Value v) throws ValueFormatException, IllegalStateException, RepositoryException, JSONException { switch (v.getType()) { case PropertyType.BINARY: w.value(0); break; case PropertyType.DATE: w.value(format(v.getDate())); break; case PropertyType.BOOLEAN: w.value(v.getBoolean()); break; case PropertyType.LONG: w.value(v.getLong()); break; case PropertyType.DOUBLE: w.value(v.getDouble()); break; default: w.value(v.getString()); } }
@Test public void testNonSiteNode() throws RepositoryException, JSONException { SiteSearchResultProcessor siteSearchResultProcessor = new SiteSearchResultProcessor(); SiteService siteService = createMock(SiteService.class); siteSearchResultProcessor.bindSiteService(siteService); Row row = createMock(Row.class); Value val = createMock(Value.class); expect(val.getString()).andReturn(""); expect(row.getValue("jcr:path")).andReturn(val); expect(siteService.isSite(isA(Item.class))).andReturn(false); Node resultNode = createMock(Node.class); expect(resultNode.getPath()).andReturn(""); SlingHttpServletRequest request = createMock(SlingHttpServletRequest.class); ResourceResolver resourceResolver = createMock(ResourceResolver.class); Session session = createMock(Session.class); expect(request.getResourceResolver()).andReturn(resourceResolver); expect(resourceResolver.adaptTo(Session.class)).andReturn(session); expect(session.getItem("")).andReturn(resultNode); replay(); try { siteSearchResultProcessor.writeNode(request, null, null, row); fail(); } catch (JSONException e) { assertEquals("Unable to write non-site node result", e.getMessage()); } }
/** * Gets the spell suggestion. * * @param checkingWord the checking word * @param manageableRepository the manageable repository * @return the spell suggestion * @throws Exception the exception */ private String getSpellSuggestion(String checkingWord, ManageableRepository manageableRepository) throws Exception { // Retrieve spell suggestion in special way to avoid access denied exception String suggestion = null; Session session = null; try { session = manageableRepository.getSystemSession( manageableRepository.getConfiguration().getDefaultWorkspaceName()); QueryManager queryManager = session.getWorkspace().getQueryManager(); Query query = queryManager.createQuery( "SELECT rep:spellcheck() FROM nt:base WHERE jcr:path like '/' AND SPELLCHECK('" + checkingWord + "')", Query.SQL); RowIterator rows = query.execute().getRows(); Value value = rows.nextRow().getValue("rep:spellcheck()"); if (value != null) { suggestion = value.getString(); } } catch (Exception e) { if (LOG.isWarnEnabled()) { LOG.warn(e.getMessage()); } } finally { if (session != null) session.logout(); } return suggestion; }
private Row getRow(String key, String val) throws RepositoryException { Row row = createMock(Row.class); Value value = createMock(Value.class); expect(value.getString()).andReturn(val); expect(row.getValue(key)).andReturn(value); return row; }
@Test public void testNextWithURI() throws Exception { when(mockValue.getType()).thenReturn(PropertyType.URI); when(mockValue.getString()).thenReturn("info:xyz"); final QuerySolution solution = testObj.next(); assertEquals("info:xyz", solution.get("a").asResource().getURI()); }
@Test public void testNextWithLiteralBoolean() throws Exception { when(mockValue.getType()).thenReturn(PropertyType.BOOLEAN); when(mockValue.getString()).thenReturn("true"); final QuerySolution solution = testObj.next(); assertEquals("true", solution.get("a").asLiteral().getLexicalForm()); }
protected void assertCanObtainValue(Value value, int expectedType) throws Exception { switch (expectedType) { case PropertyType.BINARY: Binary binary = value.getBinary(); try { InputStream stream = binary.getStream(); assertThat(stream, is(notNullValue())); try { stream.read(); } finally { stream.close(); } } finally { binary.dispose(); } break; case PropertyType.BOOLEAN: assertThat(value.getBoolean() || !value.getBoolean(), is(true)); break; case PropertyType.DATE: Calendar cal = value.getDate(); assertThat(cal, is(notNullValue())); break; case PropertyType.DOUBLE: double doubleValue = value.getDouble(); assertThat(doubleValue < 0.0d || doubleValue >= -1.0d, is(true)); break; case PropertyType.LONG: long longValue = value.getLong(); assertThat(longValue < 0L || longValue >= 0L, is(true)); break; case PropertyType.NAME: context.getValueFactories().getNameFactory().create(value.getString()); break; case PropertyType.PATH: context.getValueFactories().getPathFactory().create(value.getString()); break; case PropertyType.REFERENCE: UUID uuid = context.getValueFactories().getUuidFactory().create(value.getString()); assertThat(uuid, is(notNullValue())); break; case PropertyType.STRING: value.getString(); break; } }
@Test public void testNextBinding() throws Exception { when(mockValue.getString()).thenReturn("x"); final Binding binding = testObj.nextBinding(); assertTrue(binding.contains(Var.alloc("a"))); final Node a = binding.get(Var.alloc("a")); assertEquals("x", a.getLiteralLexicalForm()); }
@Test public void testNextWithLiteral() throws Exception { when(mockValue.getString()).thenReturn("x"); final QuerySolution solution = testObj.next(); assertTrue(solution.contains("a")); assertEquals("x", solution.get("a").asLiteral().getLexicalForm()); assertEquals(solution.get("a"), solution.getLiteral("a")); }
/** * This method will check notify type of watcher, userName is equal value of property with * notification type * * @param documentNode specify a node to watch * @param userName userName to watch a document * @param notification Notification Type * @return boolean * @throws Exception */ private boolean checkNotifyTypeOfWatcher( Node documentNode, String userName, String notificationType) throws Exception { if (documentNode.hasProperty(notificationType)) { Value[] watchers = documentNode.getProperty(notificationType).getValues(); for (Value value : watchers) { if (userName.equalsIgnoreCase(value.getString())) return true; } } return false; }
/** Tests if a calendar is returned and if the conversion to a string has correct format. */ public void testGetString() throws RepositoryException { Value val = PropertyUtil.getValue(prop); // correct format: YYYY-MM-DDThh:mm:ss.sssTZD // month(01-12), day(01-31), hours(00-23), minutes(00-59), seconds(00-59), // TZD(Z or +hh:mm or -hh:mm) // String aDay="2005-01-19T15:34:15.917+01:00"; String date = val.getString(); log.println("date str = " + date); boolean match = PropertyUtil.isDateFormat(prop.getString()); assertTrue("Date not in correct String format.", match); }
@Test public void testNextWithReference() throws Exception { when(mockValue.getType()).thenReturn(PropertyType.REFERENCE); when(mockValue.getString()).thenReturn("uuid"); when(mockSession.getNodeByIdentifier("uuid")).thenReturn(mockNode); when(mockGraphSubjects.getSubject(mockNode.getPath())) .thenReturn(ResourceFactory.createResource("http://localhost:8080/xyz")); final QuerySolution solution = testObj.next(); assertEquals("http://localhost:8080/xyz", solution.get("a").asResource().getURI()); }
@Test public void testNextWithResource() throws Exception { when(mockValue.getType()).thenReturn(PropertyType.PATH); when(mockValue.getString()).thenReturn("/x"); when(mockGraphSubjects.getSubject("/x")).thenReturn(ResourceFactory.createResource("info:x")); final QuerySolution solution = testObj.next(); assertTrue(solution.contains("a")); assertEquals("info:x", solution.get("a").asResource().getURI()); assertEquals(solution.get("a"), solution.getResource("a")); }
@Test public void testDefaultExcerptProp() throws RepositoryException { Row row = createMock(Row.class); Value value = createMock(Value.class); expect(value.getString()).andReturn("foo"); expect(row.getValue("rep:excerpt(jcr:content)")).andReturn(null).once(); expect(row.getValue("rep:excerpt(.)")).andReturn(value).once(); replay(); String result = RowUtils.getDefaultExcerpt(row); assertEquals("Excerpt is not the same", "foo", result); }
/** * Gets the values as string. * * @param node the node * @param propName the prop name * @return the values as string * @throws Exception the exception */ public static List<String> getValuesAsString(Node node, String propName) throws Exception { if (!node.hasProperty(propName)) return new ArrayList<String>(); List<String> results = new ArrayList<String>(); try { for (Value value : node.getProperty(propName).getValues()) { results.add(value.getString()); } } catch (ValueFormatException ex) { results.add(node.getProperty(propName).getValue().getString()); } return results; }
/* (non-Javadoc) * @see org.exoplatform.services.wcm.link.LiveLinkManagerService#updateLinks(javax.jcr.Node, java.util.List) */ public void updateLinkDataForNode(Node webContent, List<String> newLinks) throws Exception { ValueFactory valueFactory = webContent.getSession().getValueFactory(); if (webContent.canAddMixin("exo:linkable")) { webContent.addMixin("exo:linkable"); } // get old link from exo:links property List<String> listExtractedLink = new ArrayList<String>(); if (webContent.hasProperty("exo:links")) { Property property = webContent.getProperty("exo:links"); for (Value value : property.getValues()) { listExtractedLink.add(value.getString()); } } // compare, remove old link, add new link, create new List List<String> listResult = new ArrayList<String>(); for (String extractedLink : listExtractedLink) { for (String newUrl : newLinks) { if (LinkBean.parse(extractedLink).getUrl().equals(newUrl)) { listResult.add(extractedLink); } } } List<String> listTemp = new ArrayList<String>(); listTemp.addAll(newLinks); for (String newUrl : newLinks) { for (String extractedLink : listExtractedLink) { if (newUrl.equals(LinkBean.parse(extractedLink).getUrl())) { listTemp.set(newLinks.indexOf(newUrl), ""); } } } for (String strTemp : listTemp) { if (!strTemp.equals("")) { listResult.add(strTemp); } } // Create an array of value to add to exo:links property Value[] values = new Value[listResult.size()]; for (String url : listResult) { if (url.indexOf(LinkBean.STATUS) < 0) { LinkBean linkBean = new LinkBean(url, LinkBean.STATUS_UNCHECKED); values[listResult.indexOf(url)] = valueFactory.createValue(linkBean.toString()); } else { values[listResult.indexOf(url)] = valueFactory.createValue(url); } } webContent.setProperty("exo:links", values); webContent.save(); }
public VNodeDefinition(Node node) throws RepositoryException { name = node.getProperty(JCR_NODETYPENAME).getString(); // do properties properties = new HashMap<String, VPropertyDefinitionI>(); childSuggestions = new HashMap<String, String>(); NodeIterator nodeIterator = node.getNodes(); while (nodeIterator.hasNext()) { Node definitionNode = nodeIterator.nextNode(); String nodeType = definitionNode.getProperty(AbstractProperty.JCR_PRIMARYTYPE).getString(); // do a property if (NT_PROPERTYDEFINITION.equals(nodeType)) { String propertyName = "*"; // default to wildcard name if (definitionNode.hasProperty(JCR_NAME)) { // only add non-autogenerated properties if (!definitionNode.getProperty(JCR_AUTOCREATED).getBoolean()) { propertyName = definitionNode.getProperty(JCR_NAME).getString(); properties.put(propertyName, new VPropertyDefinition(definitionNode)); } } else { // property with no name means this node can accept custom properties canAddProperties = true; } } // do a child suggestion if (NT_CHILDNODEDEFINITION.equals(nodeType)) { String childName = "*"; // only do well-defined childnodedefinitions with the following 2 jcr properties if (definitionNode.hasProperty(JCR_NAME) && definitionNode.hasProperty(JCR_DEFAULTPRIMARYTYPE)) { childSuggestions.put( definitionNode.getProperty(JCR_NAME).getString(), definitionNode.getProperty(JCR_DEFAULTPRIMARYTYPE).getString()); } } } // do supertypes supertypes = new HashSet<String>(); if (node.hasProperty(JCR_SUPERTYPES)) { for (Value value : node.getProperty(JCR_SUPERTYPES).getValues()) { supertypes.add(value.getString()); } } // set mixin status isMixin = node.hasProperty(JCR_ISMIXIN) && node.getProperty(JCR_ISMIXIN).getBoolean(); }
/** * Reads the list of recipients from the <code>james:recipients</code> property. * * @param node mail node * @return list of recipient, or an empty list if not set * @throws MessagingException if a messaging error occurs * @throws RepositoryException if a repository error occurs */ @SuppressWarnings("unchecked") private Collection<MailAddress> getRecipients(Node node) throws MessagingException, RepositoryException { try { Value[] values = node.getProperty("james:recipients").getValues(); Collection<MailAddress> recipients = new ArrayList<MailAddress>(values.length); for (Value value : values) { recipients.add(new MailAddress(value.getString())); } return recipients; } catch (PathNotFoundException e) { return Collections.EMPTY_LIST; } }
public List<ContentMap> getItems(Node item, String nodeType, String workspace) { final List<ContentMap> items = new ArrayList<ContentMap>(0); try { final Value[] values = item.getProperty(nodeType).getValues(); if (values != null) { for (Value value : values) { items.add(templatingFunctions.contentById(value.getString(), workspace)); } } } catch (RepositoryException e) { log.error("Exception while getting items", e.getMessage()); } return items; }
/** * Utility method used to convert a JCR {@link Value} object into a valid graph property value. * * @param value the JCR value; may be null * @param jcrProperty the JCR property, used to access the session (if needed) * @return the graph representation of the value * @throws RepositoryException if there is an error working with the session */ public Object convert(Value value, javax.jcr.Property jcrProperty) throws RepositoryException { if (value == null) return null; try { switch (value.getType()) { case javax.jcr.PropertyType.BINARY: return factories.getBinaryFactory().create(value.getBinary().getStream(), 0); case javax.jcr.PropertyType.BOOLEAN: return factories.getBooleanFactory().create(value.getBoolean()); case javax.jcr.PropertyType.DATE: return factories.getDateFactory().create(value.getDate()); case javax.jcr.PropertyType.DOUBLE: return factories.getDoubleFactory().create(value.getDouble()); case javax.jcr.PropertyType.LONG: return factories.getLongFactory().create(value.getLong()); case javax.jcr.PropertyType.NAME: return factories.getNameFactory().create(value.getString()); case javax.jcr.PropertyType.PATH: return factories.getPathFactory().create(value.getString()); case javax.jcr.PropertyType.REFERENCE: return factories.getReferenceFactory().create(value.getString()); case javax.jcr.PropertyType.STRING: return factories.getStringFactory().create(value.getString()); case javax.jcr.PropertyType.UNDEFINED: // We don't know what type of values these are, but we need to convert any value // that depends on namespaces (e.g., names and paths) into Graph objects. try { // So first try a name ... return factories.getNameFactory().create(value.getString()); } catch (ValueFormatException e) { // Wasn't a name, so try a path ... try { return factories.getPathFactory().create(value.getString()); } catch (ValueFormatException e2) { // Wasn't a path, so finally treat as a string ... return factories.getStringFactory().create(value.getString()); } } } } catch (ValueFormatException e) { // There was an error converting the JCR value into the appropriate graph value String typeName = javax.jcr.PropertyType.nameFromValue(value.getType()); throw new RepositoryException( JcrConnectorI18n.errorConvertingJcrValueOfType.text(value.getString(), typeName)); } return null; }
/** * Grants the specified permission to the role. Both permission and role nodes have to exist. The * {@link Session#save()} is not called by this method; it is the responsibility of the caller. * * @param permissionPath the path of the permission to be granted * @param rolePath the path of the role the permission should be granted to * @param session current JCR session * @return <code>true</code> if any modification was done; if the role already has that permission * assigned, <code>false</code> is returned. * @throws RepositoryException in case of an error */ public static boolean grantPermissionToRole( String permissionPath, String rolePath, JCRSessionWrapper session) throws RepositoryException { if (permissionPath == null || !permissionPath.startsWith("/permissions/")) { throw new IllegalArgumentException( "Illegal value for the permission path: " + permissionPath); } if (rolePath == null || rolePath.length() == 0) { throw new IllegalArgumentException("Illegal value for the role: " + rolePath); } boolean modified = true; JCRNodeWrapper permission = session.getNode(permissionPath); String permissionId = permission.getIdentifier(); JCRNodeWrapper role = session.getNode(rolePath.contains("/") ? rolePath : "/roles/" + rolePath); if (role.hasProperty("j:permissions")) { Value[] values = role.getProperty("j:permissions").getValues(); boolean alreadyPresent = false; for (Value value : values) { if (permissionId.equals(value.getString())) { alreadyPresent = true; break; } } if (!alreadyPresent) { Value[] newValues = new Value[values.length + 1]; System.arraycopy(values, 0, newValues, 0, values.length); newValues[values.length] = session.getValueFactory().createValue(permission, true); role.setProperty("j:permissions", newValues); logger.info("Granted permission {} to role {}", permission.getPath(), role.getPath()); } else { if (logger.isDebugEnabled()) { logger.debug( "Role {} already has permission {} granted", role.getPath(), permission.getPath()); } modified = false; } } else { role.setProperty( "j:permissions", new Value[] {session.getValueFactory().createValue(permission, true)}); logger.info("Granted permission {} to role {}", permission.getPath(), role.getPath()); } return modified; }
@Override public void delete() { try { @SuppressWarnings("unchecked") final Iterator<Property> references = node.getReferences(); @SuppressWarnings("unchecked") final Iterator<Property> weakReferences = node.getWeakReferences(); final Iterator<Property> inboundProperties = Iterators.concat(references, weakReferences); while (inboundProperties.hasNext()) { final Property prop = inboundProperties.next(); final List<Value> newVals = new ArrayList<>(); final Iterator<Value> propIt = property2values.apply(prop); while (propIt.hasNext()) { final Value v = propIt.next(); if (!node.equals(getSession().getNodeByIdentifier(v.getString()))) { newVals.add(v); LOGGER.trace("Keeping multivalue reference property when deleting node"); } } if (newVals.size() == 0) { prop.remove(); } else { prop.setValue(newVals.toArray(new Value[newVals.size()])); } } final Node parent; if (getNode().getDepth() > 0) { parent = getNode().getParent(); } else { parent = null; } final String name = getNode().getName(); node.remove(); if (parent != null) { createTombstone(parent, name); } } catch (final RepositoryException e) { throw new RepositoryRuntimeException(e); } }
@Override public JcrRepositoryDescriptor repositoryInfo() { Session session = (Session) this.getThreadLocalRequest().getSession().getAttribute("session"); JcrRepositoryDescriptor desc = new JcrRepositoryDescriptor(); Repository repo = session.getRepository(); try { String keys[] = session.getRepository().getDescriptorKeys(); for (int i = 0; i < keys.length; i++) { Value value = repo.getDescriptorValue(keys[i]); desc.add(keys[i], value != null ? value.getString() : "N/A"); } } catch (RepositoryException e) { log.log(Level.SEVERE, "Error getting repository information", e); } return desc; }
/* (non-Javadoc) * @see org.exoplatform.services.wcm.link.LiveLinkManagerService#getBrokenLinks(javax.jcr.Node) */ public List<String> getBrokenLinks(Node webContent) throws Exception { List<String> listBrokenUrls = (List<String>) brokenLinksCache.get(webContent.getUUID()); if (listBrokenUrls == null || listBrokenUrls.size() == 0) { listBrokenUrls = new ArrayList<String>(); if (webContent.hasProperty("exo:links")) { for (Value value : webContent.getProperty("exo:links").getValues()) { String link = value.getString(); LinkBean linkBean = LinkBean.parse(link); if (linkBean.isBroken()) { listBrokenUrls.add(linkBean.getUrl()); } } brokenLinksCache.put(webContent.getUUID(), listBrokenUrls); } } return listBrokenUrls; }
protected void assertProperty( AbstractJcrProperty property, javax.jcr.Node node, String name, int propertyType, Object... values) throws Exception { assertThat(property.getName(), is(name)); assertThat(property.getType(), is(propertyType)); assertThat(property.getParent(), is(node)); if (values.length > 1) { int i = 0; for (Value actual : property.getValues()) { String actualString = actual.getString(); String expectedString = context.getValueFactories().getStringFactory().create(values[i]); assertThat(actualString, is(expectedString)); assertCanObtainValue(actual, propertyType); ++i; } // Getting the single value should result in an error ... try { property.getValue(); fail("Should not be able to call Property.getValue() on multi-valued properties"); } catch (ValueFormatException e) { // expected ... } } else { String actualString = property.getValue().getString(); String expectedString = context.getValueFactories().getStringFactory().create(values[0]); assertThat(actualString, is(expectedString)); assertThat(actualString, is(property.getString())); assertCanObtainValue(property.getValue(), propertyType); // Getting the multiple values should result in an error ... try { property.getValues(); fail("Should not be able to call Property.getValues() on single-valued properties"); } catch (ValueFormatException e) { // expected ... } // Check resolving the reference ... if (propertyType == PropertyType.REFERENCE) { javax.jcr.Node referenced = property.getNode(); assertThat(referenced, is(notNullValue())); } } }
@Test public void shouldFindLatestCommitDetailsInMasterBranch() throws Exception { Node git = gitNode(); Node commits = git.getNode("commit"); Node commit = commits.getNodes().nextNode(); // the first commit ... // print = true; printDetails(commit); assertNodeHasObjectIdProperty(commit); assertNodeHasCommittedProperties(commit); assertThat(commit.getProperty("git:parents").isMultiple(), is(true)); for (Value parentValue : commit.getProperty("git:parents").getValues()) { String identifier = parentValue.getString(); Node parent = getSession().getNodeByIdentifier(identifier); assertThat(parent, is(notNullValue())); } assertThat(commit.getProperty("git:diff").getString(), is(notNullValue())); assertThat(commit.getProperty("git:tree").getNode().getPath(), is(treePathFor(commit))); }
@Override public String createData(Node node, Row row) { try { UserACL userACL = WCMCoreUtils.getService(UserACL.class); if (node.hasProperty("gtn:access-permissions")) { for (Value v : node.getProperty("gtn:access-permissions").getValues()) { if (userACL.hasPermission(v.getString())) { return node.getPath(); } } return null; } else { return node.getPath(); } } catch (RepositoryException e) { return null; } }