Package org.apache.jetspeed.om.page

Examples of org.apache.jetspeed.om.page.Page


            folderCount++;
        }
        Iterator pages = srcFolder.getPages().iterator();
        while (pages.hasNext())
        {
            Page srcPage = (Page)pages.next();
            Page dstPage = lookupPage(srcPage.getPath());
            if (null != dstPage)
            {
                if (isOverwritePages())
                {
                    System.out.println("overwriting page " + srcPage.getPath());                           
View Full Code Here


            String roles = request.getParameter("roles");
            String groups = request.getParameter("groups");
            String users = request.getParameter("users");
            String permissions = request.getParameter("permissions");
           
            Page page = this.pageManager.getPage(path);
            Fragment fragment = page.getFragmentById(fragmentId);
           
            if (fragment == null)
            {
                throw new IllegalStateException("Cannot find fragment: " + fragmentId);
            }
View Full Code Here

            String roles = request.getParameter("roles");
            String groups = request.getParameter("groups");
            String users = request.getParameter("users");
            String permissions = request.getParameter("permissions");
           
            Page page = this.pageManager.getPage(path);
            Fragment fragment = page.getFragmentById(fragmentId);
           
            if (fragment == null)
            {
                throw new IllegalStateException("Cannot find fragment: " + fragmentId);
            }
View Full Code Here

    throws NodeException
    {       
        Iterator pages = srcFolder.getPages().iterator();
        while (pages.hasNext())
        {
            Page srcPage = (Page)pages.next();
            String path = concatenatePaths(destinationPath, srcPage.getName());
            if (!pageManager.pageExists(path))
            {
                Page dstPage = pageManager.copyPage(srcPage, path);
                pageManager.updatePage(dstPage);
            }
            //Commented, as these were creating the duplicate objects
            /*           
            else
View Full Code Here

        {
            String path = request.getParameter("path");
            String fragmentId = request.getParameter("fragment");
            String [] securityConstraintRefs = request.getParameterValues("securityConstraintRef");
           
            Page page = this.pageManager.getPage(path);
            Fragment fragment = page.getFragmentById(fragmentId);
           
            if (fragment == null)
            {
                throw new IllegalStateException("Cannot find fragment: " + fragmentId);
            }
View Full Code Here

        pageManager.updateFolder(dstFolder);
       
        Iterator pages = srcFolder.getPages().iterator();
        while (pages.hasNext())
        {
            Page srcPage = (Page)pages.next();
            String path = PageManagerUtils.concatenatePaths(destinationPath, srcPage.getName());
            Page dstPage = pageManager.copyPage(srcPage, path);
            pageManager.updatePage(dstPage);
        }
    
        Iterator links = srcFolder.getLinks().iterator();
        while (links.hasNext())
View Full Code Here

    /* (non-Javadoc)
     * @see org.apache.jetspeed.page.PageManager#newPage(java.lang.String)
     */
    public Page newPage(String path)
    {
        Page page = null;
        try
        {
            // factory create the page and set id/path
            page = (Page)createObject(this.pageClass);           
            if (!path.startsWith(Folder.PATH_SEPARATOR))
            {
                path = Folder.PATH_SEPARATOR + path;
            }
            if (!path.endsWith(Page.DOCUMENT_TYPE))
            {
                path += Page.DOCUMENT_TYPE;
            }
            page.setPath(path);
           
            // create the default fragment
            page.setRootFragment(newFragment());           
        }
        catch (ClassCastException e)
        {
            String message = "Failed to create page object for " + this.pageClass;
            log.error(message, e);
View Full Code Here

   
    public Page copyPage(Page source, String path)
    throws NodeException
    {
        // create the new page and copy attributes
        Page page = newPage(path);
        page.setTitle(source.getTitle());
        page.setShortTitle(source.getShortTitle());
        page.setVersion(source.getVersion());
        page.setDefaultDecorator(source.getDefaultDecorator(Fragment.LAYOUT), Fragment.LAYOUT);
        page.setDefaultDecorator(source.getDefaultDecorator(Fragment.PORTLET), Fragment.PORTLET);
        page.setSkin(source.getSkin());
        page.setHidden(source.isHidden());
       
        // copy locale specific metadata
        page.getMetadata().copyFields(source.getMetadata().getFields());
       
        // copy security constraints
        SecurityConstraints srcSecurity = source.getSecurityConstraints();       
        if ((srcSecurity != null) && !srcSecurity.isEmpty())
        {
            SecurityConstraints copiedSecurity = copySecurityConstraints(PAGE_NODE_TYPE, srcSecurity);
            page.setSecurityConstraints(copiedSecurity);
        }   

        // copy menu definitions
        List menus = source.getMenuDefinitions();
        if (menus != null)
        {
            List copiedMenus = copyMenuDefinitions(PAGE_NODE_TYPE, menus);
            page.setMenuDefinitions(copiedMenus);
        }       
       
        // copy fragments
        Fragment root = copyFragment(source.getRootFragment(), source.getRootFragment().getName());
        page.setRootFragment(root);
       
        return page;
    }
View Full Code Here

            // caching the pages collection for this folder
            return getPageManager().getPage(this, name);
        }

        // select page by name from cached pages collection
        Page page = (Page)getPagesNodeSet().get(name);
        if (page == null)
        {
            throw new PageNotFoundException("Page not found: " + name);
        }

        // check for view access on page
        page.checkAccess(JetspeedActions.VIEW);

        return page;
    }
View Full Code Here

     * @throws NodeException
     */
    public Page getPage(String name, boolean checkAccess) throws PageNotFoundException, NodeException
    {
        // get page
        Page page = (Page) getAllNodes().subset(Page.DOCUMENT_TYPE).get(name);
        if (page == null)
        {
            throw new PageNotFoundException("Jetspeed PSML page not found: " + name);
        }

        // check access
        if (checkAccess)
        {
            page.checkAccess(JetspeedActions.VIEW);
        }
        return page;
    }
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.om.page.Page

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.