Package org.brixcms.jcr.api

Examples of org.brixcms.jcr.api.JcrNodeIterator$Wrapper


        return children;
    }

    private List<AbstractJcrTreeNode> loadChildren() {
        List<AbstractJcrTreeNode> children = new ArrayList<AbstractJcrTreeNode>();
        JcrNodeIterator iterator = nodeModel.getObject().getNodes();
        List<BrixNode> entries = new ArrayList<BrixNode>((int) iterator.getSize());
        while (iterator.hasNext()) {
            entries.add((BrixNode) iterator.nextNode());
        }

        for (BrixNode entry : entries) {
            if (!entry.isHidden() && (displayFoldersOnly() == false || entry.isFolder()) &&
                    SitePlugin.get().canViewNodeChildren(entry, Context.ADMINISTRATION)) {
View Full Code Here


    private void buildChildren() {
        children = new ArrayList<JcrTreeNode>();
        JcrSession session = Brix.get().getCurrentSession(workspaceId);
        BrixNode root = (BrixNode) session.getItem(Brix.get().getRootPath());
        JcrNodeIterator iterator = root.getNodes();
        while (iterator.hasNext()) {
            BrixNode node = (BrixNode) iterator.nextNode();
            if (node instanceof TreeAwareNode) {
                JcrTreeNode treeNode = ((TreeAwareNode) node).getTreeNode(node);
                if (treeNode != null) {
                    children.add(treeNode);
                }
View Full Code Here

                getParameters().set(i, values[i].getString());
            }
        }
        if (node.hasNode("parameter")) {
            getParameters().clearNamed();
            JcrNodeIterator i = node.getNodes("parameter");
            while (i.hasNext()) {
                BrixNode n = (BrixNode) i.nextNode();
                if (n.hasProperty("key") && n.hasProperty("values")) {
                    String key = n.getProperty("key").getString();
                    JcrValue values[] = n.getProperty("values").getValues();
                    for (JcrValue v : values) {
                        getParameters().set(key, v.getString());
View Full Code Here

            loadEntry((BrixNode) node.getNode("menu"), root);
        }
    }

    private void loadEntry(BrixNode node, Entry entry) {
        JcrNodeIterator i = node.getNodes("child");
        while (i.hasNext()) {
            BrixNode child = (BrixNode) i.nextNode();
            ChildEntry e = new ChildEntry(entry);
            loadChildEntry(child, e);
            loadEntry(child, e);
            entry.getChildren().add(e);
        }
View Full Code Here

        JcrNode node = event.getNode();
        touch(node);
        if (node.getDepth() == 0 || node.isNodeType("nt:folder")) {
            // go through immediate children to determine if there are any
            // modified ones
            JcrNodeIterator iterator = node.getNodes();
            while (iterator.hasNext()) {
                JcrNode n = iterator.nextNode();
                if (n.isModified() || n.isNew()) {
                    touch(n);
                } else if (n.hasNode("jcr:content")) {
                    JcrNode content = n.getNode("jcr:content");
                    if (content.isModified() || content.isNew()) {
View Full Code Here

        if (!hasNode(RULES)) {
            return Collections.emptyList();
        } else {
            JcrNode rules = getNode(RULES);
            List<Rule> result = new ArrayList<Rule>();
            JcrNodeIterator n = rules.getNodes();
            while (n.hasNext()) {
                Rule rule = Rule.load(n.nextNode());
                result.add(rule);
            }

            if (sortByPriority) {
                Collections.sort(result, new Comparator<Rule>() {
View Full Code Here

    public List<BrixNode> getMenuNodes(String workspaceId) {
        BrixNode root = getRootNode(workspaceId, false);
        if (root != null) {
            List<BrixNode> result = new ArrayList<BrixNode>();
            JcrNodeIterator i = root.getNodes("menu");
            while (i.hasNext()) {
                result.add((BrixNode) i.nextNode());
            }
            return result;
        } else {
            return Collections.emptyList();
        }
View Full Code Here

        private static final long serialVersionUID = 1L;

        @Override
        protected List<Entry> load() {
            JcrNode tile = (JcrNode) getDefaultModelObject();
            JcrNodeIterator entryNodes = tile.getNodes("entry");
            ArrayList<Entry> entries = new ArrayList<Entry>((int) entryNodes.getSize());

            while (entryNodes.hasNext()) {
                JcrNode entryNode = entryNodes.nextNode();
                Entry entry = new Entry();
                entry.name = entryNode.getProperty("name").getString();
                entry.message = entryNode.getProperty("message").getString();
                entry.timestamp = new Date(entryNode.getProperty("timestamp").getLong());
                entries.add(entry);
View Full Code Here

        return false;
    }

    public List<BrixNode> getTileNodes() {
        List<BrixNode> result = new ArrayList<BrixNode>();
        JcrNodeIterator iterator = container.getNodes(TILE_NODE_NAME);
        while (iterator.hasNext()) {
            BrixNode node = (BrixNode) iterator.nextNode();
            if (node.isNodeType(JCR_TYPE_BRIX_TILE)) {
                result.add(node);
            }
        }
        return result;
View Full Code Here

    public BrixNode getTile(String id) {
        if (id == null) {
            throw new IllegalArgumentException("tile id cannot be null");
        }
        JcrNodeIterator iterator = container.getNodes(TILE_NODE_NAME);
        while (iterator.hasNext()) {
            BrixNode node = (BrixNode) iterator.nextNode();
            if (node.isNodeType(JCR_TYPE_BRIX_TILE) && id.equals(getTileId(node))) {
                return node;
            }
        }
        return null;
View Full Code Here

TOP

Related Classes of org.brixcms.jcr.api.JcrNodeIterator$Wrapper

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.