Package org.apache.jetspeed.page.document

Examples of org.apache.jetspeed.page.document.NodeSet


    public NodeSet getPageTemplates(Object proxy) throws NodeException
    {
        // latently subset page templates by type from aggregated children
        if (!pageTemplatesAggregated)
        {
            NodeSet allChildren = getAll(proxy);
            if (allChildren != null)
            {
                pageTemplates = allChildren.subset(PageTemplate.DOCUMENT_TYPE);
            }
            pageTemplatesAggregated = true;
        }
        return pageTemplates;
    }
View Full Code Here


     */
    public PageTemplate getPageTemplate(Object proxy, String name) throws PageNotFoundException, NodeException
    {
        // search for page template by name or absolute path from
        // aggregated page templates
        NodeSet allPageTemplates = getPageTemplates(proxy);
        if (allPageTemplates != null)
        {
            PageTemplate pageTemplate = (PageTemplate)allPageTemplates.get(name);
            if (pageTemplate != null)
            {
                return pageTemplate;
            }
        }
View Full Code Here

    public NodeSet getFragmentDefinitions(Object proxy) throws NodeException
    {
        // latently subset fragment definition by type from aggregated children
        if (!fragmentDefinitionsAggregated)
        {
            NodeSet allChildren = getAll(proxy);
            if (allChildren != null)
            {
                fragmentDefinitions = allChildren.subset(FragmentDefinition.DOCUMENT_TYPE);
            }
            fragmentDefinitionsAggregated = true;
        }
        return fragmentDefinitions;
    }
View Full Code Here

     */
    public FragmentDefinition getFragmentDefinition(Object proxy, String name) throws PageNotFoundException, NodeException
    {
        // search for fragment definition by name or absolute path from
        // aggregated fragment definitions
        NodeSet allFragmentDefinitions = getFragmentDefinitions(proxy);
        if (allFragmentDefinitions != null)
        {
            FragmentDefinition fragmentDefinition = (FragmentDefinition)allFragmentDefinitions.get(name);
            if (fragmentDefinition != null)
            {
                return fragmentDefinition;
            }
        }
View Full Code Here

                SearchFolder searchFolder = (SearchFolder)foldersIter.next();
                Folder folder = searchFolder.folder;
                String locatorName = searchFolder.locatorName;

                // create and save proxies for concrete children
                NodeSet children = folder.getAll();
                Iterator childrenIter = children.iterator();
                while (childrenIter.hasNext())
                {
                    Node child = (Node)childrenIter.next();
                    String childName = child.getName();
View Full Code Here

        if (separatorIndex != -1)
        {
            // match folder name
            String folderName = path.substring(0,separatorIndex);
            String folderPath = (folder.getPath().endsWith(Folder.PATH_SEPARATOR) ? folder.getPath() : folder.getPath() + Folder.PATH_SEPARATOR) + folderName;
            NodeSet matchedFolders = null;
            if (regexp)
            {
                // get regexp matched folders
                matchedFolders = ((FolderImpl)folder).getFolders(false).inclusiveSubset(folderPath);
            }
            else
            {
                // get single matched folder
                Folder matchedFolder = getFolder(folderPath);
                if (matchedFolder != null)
                {
                    matchedFolders = new NodeSetImpl(folder.getPath());
                    matchedFolders.add(matchedFolder);
                }
            }
            if ((matchedFolders == null) || (matchedFolders.size() == 0))
            {
                throw new FolderNotFoundException("Cannot find folder" + folderName + " in " + folder.getPath());
            }

            // match recursively over matched folders
            path = path.substring(separatorIndex);
            Iterator matchedFoldersIter = matchedFolders.iterator();
            while (matchedFoldersIter.hasNext())
            {
                Folder matchedFolder = (Folder) matchedFoldersIter.next();
                getNodes(matchedFolder, path, regexp, matched);
            }
View Full Code Here

    private void updateFolderNodes(FolderImpl folderImpl) throws FolderNotUpdatedException
    {
        try
        {
            // update folder documents
            NodeSet nodes = folderImpl.getAllNodes();
            Iterator nodesIter = nodes.iterator();
            while (nodesIter.hasNext())
            {
                Node node = (Node) nodesIter.next();
                if (node instanceof Page)
                {
                    updatePage((Page)node);
                }
                else if (node instanceof Link)
                {
                    updateLink((Link)node);
                }
                else if (node instanceof PageSecurity)
                {
                    updatePageSecurity((PageSecurity)node);
                }
            }

            // update folders last: breadth first recursion
            nodesIter = nodes.iterator();
            while (nodesIter.hasNext())
            {
                Node node = (Node) nodesIter.next();
                if (node instanceof Folder)
                {
View Full Code Here

     * @throws DocumentException
     */
    public NodeSet getFolders(boolean checkAccess) throws DocumentException
    {
        // get list of all folders
        NodeSet folders = getAllNodes().subset(FOLDER_TYPE);

        // filter node set by access
        if (checkAccess)
        {
            folders = checkAccess(folders, JetspeedActions.VIEW);
View Full Code Here

     * @throws NodeException
     */
    public NodeSet getPages(boolean checkAccess) throws NodeException
    {
        // get list of all pages
        NodeSet pages = getAllNodes().subset(Page.DOCUMENT_TYPE);

        // filter node set by access
        if (checkAccess)
        {
            pages = checkAccess(pages, JetspeedActions.VIEW);
View Full Code Here

     * @throws NodeException
     */
    public NodeSet getLinks(boolean checkAccess) throws NodeException
    {
        // get list of all links
        NodeSet links = getAllNodes().subset(Link.DOCUMENT_TYPE);

        // filter node set by access
        if (checkAccess)
        {
            links = checkAccess(links, JetspeedActions.VIEW);
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.page.document.NodeSet

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.