/** * encode handle for a JackRabbit search * @param handle the page handle * @return handle encoded ISO9075 */ public static String encodeISO9075(String handle) { return ISO9075.encodePath(handle); }
protected String buildXPathQueryLockedNodesForUsers(final String previewConfigurationPath, final List<String> userIds) { if (userIds.isEmpty()) { throw new IllegalArgumentException("List of user IDs cannot be empty"); } StringBuilder xpath = new StringBuilder("/jcr:root"); xpath.append(ISO9075.encodePath(previewConfigurationPath)); xpath.append("//element(*,"); xpath.append(getNodeType()); xpath.append(")["); String concat = ""; for (String userId : userIds) { xpath.append(concat); xpath.append('@'); xpath.append(GENERAL_PROPERTY_LOCKED_BY); xpath.append(" = '"); xpath.append(userId); xpath.append("'"); concat = " or "; } xpath.append("]"); return xpath.toString(); }
xpath.append(ISO9075.encodePath(previewConfigurationPath)); if (workspace) { xpath.append("/hst:workspace");
buffer.append("."); } else { buffer.append(ISO9075.encodePath(commonPathPrefix)); buffer.append(ISO9075.encodePath(commonPathPrefix)); buffer.append("/");
buffer.append("."); } else { buffer.append(ISO9075.encodePath(commonPathPrefix)); buffer.append(ISO9075.encodePath(commonPathPrefix)); buffer.append("/");
buffer.append("."); } else { buffer.append(ISO9075.encodePath(commonPathPrefix)); buffer.append(ISO9075.encodePath(commonPathPrefix)); buffer.append("/");
final String path = ISO9075.encodePath(name); try { if ( node.hasProperty(path) ) { final String oldKey = ISO9075.encodePath(name); if (!oldKey.equals(key) && node.hasProperty(oldKey)) { final Property prop = node.getProperty(oldKey);
public Collection<ContentMap> getEntries() { List<ContentMap> results = new ArrayList<>(); try { String orderByNodeValue = PropertyUtil.getString(content, "orderBy"); String sortDirectionNodeValue = PropertyUtil.getString(content, "direction"); String link = PropertyUtil.getString(content, "link"); if (StringUtils.isEmpty(orderByNodeValue)) { orderByNodeValue = orderBy; } if (StringUtils.isEmpty(sortDirectionNodeValue)) { sortDirectionNodeValue = sortDirection; } String queryString = "/jcr:root" + ISO9075.encodePath(link) + "/data[1]/*/* order by " + orderByNodeValue + " " + sortDirectionNodeValue; NodeIterator feeds = this.runQuery(queryString); while (feeds.hasNext()) { Node feed = feeds.nextNode(); results.add(new ContentMap(feed)); } log.debug("returning collection with {} items.", "" + results.size()); return results; } catch (RepositoryException e) { log.error(e.getLocalizedMessage(), e); } return null; }
final String path = ISO9075.encodePath(name); try { if ( node.hasProperty(path) ) { final String oldKey = ISO9075.encodePath(name); if (node.hasProperty(oldKey)) { final Property prop = node.getProperty(oldKey);
path = value; pathConstraint = ISO9075.encodePath(path) + "//*"; } else if (property.equals(TYPE)) { String[] nts = Text.explode(value, ',');
public Collection<ContentMap> getFeeds() { try { String link = PropertyUtil.getString(content, "link"); String queryString = "/jcr:root" + ISO9075.encodePath(link) + "/data" + "/element(*, mgnl:content) order by @jcr:name "; NodeIterator queryResultNode = this.runQuery(queryString); // not sorting by jcr:name in the query until jsr-283 is implemented so do this manually Set<Node> results = new TreeSet<Node>(new Comparator<Node>() { @Override public int compare(Node o1, Node o2) { return NodeUtil.getName(o1).compareTo(NodeUtil.getName(o2)); } }); results.addAll(NodeUtil.asList(NodeUtil.asIterable(queryResultNode))); return templatingFunctions.asContentMapList(results); } catch (RepositoryException e) { log.error(e.getLocalizedMessage(), e); } return null; }
path = value; pathConstraint = ISO9075.encodePath(path) + "//*"; } else if (property.equals(TYPE)) { String[] nts = Text.explode(value, ',');
path = value; pathConstraint = ISO9075.encodePath(path) + "//*"; } else if (property.equals(TYPE)) { String[] nts = Text.explode(value, ',');
@SuppressWarnings("unchecked") public Collection<ContentMap> getItems(String singleFeedHandle) { try { String orderByNodeValue = PropertyUtil.getString(content, "orderBy"); String sortDirectionNodeValue = PropertyUtil.getString(content, "direction"); if (StringUtils.isEmpty(orderByNodeValue)) { orderByNodeValue = orderBy; } if (StringUtils.isEmpty(sortDirectionNodeValue)) { sortDirectionNodeValue = sortDirection; } String queryString = "/jcr:root" + ISO9075.encodePath(singleFeedHandle) + "/* order by " + orderByNodeValue + " " + sortDirectionNodeValue; Collection<Node> results = NodeUtil.asList(NodeUtil.asIterable(this.runQuery(queryString))); return templatingFunctions.asContentMapList(results); } catch (RepositoryException e) { log.error(e.getLocalizedMessage(), e); } return Collections.EMPTY_LIST; }