Package org.apache.jetspeed.decoration

Examples of org.apache.jetspeed.decoration.PageEditAccess


    public void doView( RenderRequest request, RenderResponse response ) throws PortletException, IOException
    {
        RequestContext context = getRequestContext(request);

        ContentPage requestPage = context.getPage();      
        PageEditAccess pageEditAccess = (PageEditAccess)context.getAttribute(PortalReservedParameters.PAGE_EDIT_ACCESS_ATTRIBUTE);
        if ( requestPage == null)
        {
            // Targetting this portlet REQUIRES that the ProfilerValve has been invoked!
            throw new PortletException("Current request page not available.");
        }
        if (pageEditAccess == null)
        {
            // Targetting this portlet REQUIRES that the ProfilerValve has been invoked!
            throw new PortletException("Current PageEditAccess not available.");           
        }
       
        Boolean editing = ( pageEditAccess.isEditing() &&
                            PortletMode.VIEW.equals(request.getPortletMode()) &&
                            request.isPortletModeAllowed(PortletMode.EDIT))
                          ? Boolean.TRUE : Boolean.FALSE;
                                        
        PortletWindow window = context.getPortalURL().getNavigationalState().getMaximizedWindow();
View Full Code Here


    public void processAction(ActionRequest request, ActionResponse response) throws PortletException, IOException
    {
        RequestContext requestContext = (RequestContext)request.getAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE);
       
        ContentPage requestPage = requestContext.getPage();      
        PageEditAccess pageEditAccess = (PageEditAccess)requestContext.getAttribute(PortalReservedParameters.PAGE_EDIT_ACCESS_ATTRIBUTE);
        if ( requestPage == null || pageEditAccess == null )
        {
            // Targetting this portlet with an ActionRequest REQUIRES that the ProfilerValve has been invoked!
            throw new PortletException("Current request page or PageEditAccess not available.");
        }

        decoratorCache.invalidate(requestContext);
       
        String pageMode = request.getParameter("pageMode");
        if ( pageMode != null )
        {
            if ( "view".equals(pageMode) )
            {
                pageEditAccess.setEditing(false);
            }
            else if ( "edit".equals(pageMode) && pageEditAccess.isEditAllowed() )
            {
                if ( this.editorType != null && this.editorType.equals( "desktop" ) )
                {
                    String redirectUrl = this.desktop.getPortalUrl( requestContext, requestContext.getPath() );
                    redirectUrl += "?editPage=true&portal=true";
                    response.sendRedirect( redirectUrl );
                }
                else
                {
                    pageEditAccess.setEditing(true);
                }
            }
            return;
        }
       
        if ( pageEditAccess.isEditAllowed() && request.isPortletModeAllowed(PortletMode.EDIT) )
        {
            String layout = null;
           
            boolean addLayout = request.getParameter("jsAddLayout") != null;
            if ( addLayout || request.getParameter("jsChangeLayout") != null )
View Full Code Here

    public void doView( RenderRequest request, RenderResponse response ) throws PortletException, IOException
    {
        RequestContext context = getRequestContext(request);

        ContentPage requestPage = context.getPage();      
        PageEditAccess pageEditAccess = (PageEditAccess)context.getAttribute(PortalReservedParameters.PAGE_EDIT_ACCESS_ATTRIBUTE);
        if ( requestPage == null || pageEditAccess == null )
        {
            // Targetting this portlet REQUIRES that the ProfilerValve has been invoked!
            throw new PortletException("Current request page or PageEditAccess not available.");
        }
       
        Boolean editing = ( pageEditAccess.isEditing() &&
                            PortletMode.VIEW.equals(request.getPortletMode()) &&
                            request.isPortletModeAllowed(PortletMode.EDIT))
                          ? Boolean.TRUE : Boolean.FALSE;
                                        
        PortletWindow window = context.getPortalURL().getNavigationalState().getMaximizedWindow();
View Full Code Here

    public void processAction(ActionRequest request, ActionResponse response) throws PortletException, IOException
    {
        RequestContext requestContext = (RequestContext)request.getAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE);
       
        ContentPage requestPage = requestContext.getPage();      
        PageEditAccess pageEditAccess = (PageEditAccess)requestContext.getAttribute(PortalReservedParameters.PAGE_EDIT_ACCESS_ATTRIBUTE);
        if ( requestPage == null || pageEditAccess == null )
        {
            // Targetting this portlet with an ActionRequest REQUIRES that the ProfilerValve has been invoked!
            throw new PortletException("Current request page or PageEditAccess not available.");
        }

        decoratorCache.invalidate(requestContext);
       
        String pageMode = request.getParameter("pageMode");
        if ( pageMode != null )
        {
            if ( "view".equals(pageMode) )
            {
                pageEditAccess.setEditing(false);
            }
            else if ( "edit".equals(pageMode) && pageEditAccess.isEditAllowed() )
            {
                if ( this.editorType != null && this.editorType.equals( "desktop" ) )
                {
                    String redirectUrl = this.desktop.getPortalUrl( requestContext, requestContext.getPath() );
                    redirectUrl += "?editPage=true&portal=true";
                    response.sendRedirect( redirectUrl );
                }
                else
                {
                    pageEditAccess.setEditing(true);
                }
            }
            return;
        }
       
        if ( pageEditAccess.isEditAllowed() && request.isPortletModeAllowed(PortletMode.EDIT) )
        {
            String layout = null;
           
            boolean addLayout = request.getParameter("jsAddLayout") != null;
            if ( addLayout || request.getParameter("jsChangeLayout") != null )
View Full Code Here

    public void doView( RenderRequest request, RenderResponse response ) throws PortletException, IOException
    {
        RequestContext context = getRequestContext(request);

        ContentPage requestPage = context.getPage();      
        PageEditAccess pageEditAccess = (PageEditAccess)context.getAttribute(PortalReservedParameters.PAGE_EDIT_ACCESS_ATTRIBUTE);
        if ( requestPage == null || pageEditAccess == null )
        {
            // Targetting this portlet REQUIRES that the ProfilerValve has been invoked!
            throw new PortletException("Current request page or PageEditAccess not available.");
        }
       
        Boolean editing = ( pageEditAccess.isEditing() &&
                            PortletMode.VIEW.equals(request.getPortletMode()) &&
                            request.isPortletModeAllowed(PortletMode.EDIT))
                          ? Boolean.TRUE : Boolean.FALSE;
                                        
        PortletWindow window = context.getPortalURL().getNavigationalState().getMaximizedWindow();
View Full Code Here

    public void processAction(ActionRequest request, ActionResponse response) throws PortletException, IOException
    {
        RequestContext requestContext = (RequestContext)request.getAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE);
       
        ContentPage requestPage = requestContext.getPage();      
        PageEditAccess pageEditAccess = (PageEditAccess)requestContext.getAttribute(PortalReservedParameters.PAGE_EDIT_ACCESS_ATTRIBUTE);
        if ( requestPage == null || pageEditAccess == null )
        {
            // Targetting this portlet with an ActionRequest REQUIRES that the ProfilerValve has been invoked!
            throw new PortletException("Current request page or PageEditAccess not available.");
        }
       
        String pageMode = request.getParameter("pageMode");
        if ( pageMode != null )
        {
            if ( "view".equals(pageMode) )
            {
                pageEditAccess.setEditing(false);
            }
            else if ( "edit".equals(pageMode) && pageEditAccess.isEditAllowed() )
            {
                if ( this.editorType != null && this.editorType.equals( "desktop" ) )
                {
                    String redirectUrl = this.desktop.getPortalUrl( requestContext, requestContext.getPath() );
                    redirectUrl += "?editPage=true&portal=true";
                    response.sendRedirect( redirectUrl );
                }
                else
                {
                    pageEditAccess.setEditing(true);
                }
            }
            return;
        }
       
        if ( pageEditAccess.isEditAllowed() && request.isPortletModeAllowed(PortletMode.EDIT) )
        {
            String layout = null;
           
            boolean addLayout = request.getParameter("jsAddLayout") != null;
            if ( addLayout || request.getParameter("jsChangeLayout") != null )
View Full Code Here

    public void doView( RenderRequest request, RenderResponse response ) throws PortletException, IOException
    {
        RequestContext context = getRequestContext(request);

        ContentPage requestPage = context.getPage();      
        PageEditAccess pageEditAccess = (PageEditAccess)context.getAttribute(PortalReservedParameters.PAGE_EDIT_ACCESS_ATTRIBUTE);
        if ( requestPage == null)
        {
            // Targetting this portlet REQUIRES that the ProfilerValve has been invoked!
            throw new PortletException("Current request page not available.");
        }
        if (pageEditAccess == null)
        {
            // Targetting this portlet REQUIRES that the ProfilerValve has been invoked!
            throw new PortletException("Current PageEditAccess not available.");           
        }
       
        Boolean editing = ( pageEditAccess.isEditing() &&
                            PortletMode.VIEW.equals(request.getPortletMode()) &&
                            request.isPortletModeAllowed(PortletMode.EDIT))
                          ? Boolean.TRUE : Boolean.FALSE;
                                        
        PortletWindow window = context.getPortalURL().getNavigationalState().getMaximizedWindow();
View Full Code Here

    public void processAction(ActionRequest request, ActionResponse response) throws PortletException, IOException
    {
        RequestContext requestContext = (RequestContext)request.getAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE);
       
        ContentPage requestPage = requestContext.getPage();      
        PageEditAccess pageEditAccess = (PageEditAccess)requestContext.getAttribute(PortalReservedParameters.PAGE_EDIT_ACCESS_ATTRIBUTE);
        if ( requestPage == null || pageEditAccess == null )
        {
            // Targetting this portlet with an ActionRequest REQUIRES that the ProfilerValve has been invoked!
            throw new PortletException("Current request page or PageEditAccess not available.");
        }

        decoratorCache.invalidate(requestContext);
       
        String pageMode = request.getParameter("pageMode");
        if ( pageMode != null )
        {
            if ( "view".equals(pageMode) )
            {
                pageEditAccess.setEditing(false);
            }
            else if ( "edit".equals(pageMode) && pageEditAccess.isEditAllowed() )
            {
                if ( this.editorType != null && this.editorType.equals( "desktop" ) )
                {
                    String redirectUrl = this.desktop.getPortalUrl( requestContext, requestContext.getPath() );
                    redirectUrl += "?editPage=true&portal=true";
                    response.sendRedirect( redirectUrl );
                }
                else
                {
                    pageEditAccess.setEditing(true);
                }
            }
            return;
        }
       
        if ( pageEditAccess.isEditAllowed() && request.isPortletModeAllowed(PortletMode.EDIT) )
        {
            String layout = null;
           
            boolean addLayout = request.getParameter("jsAddLayout") != null;
            if ( addLayout || request.getParameter("jsChangeLayout") != null )
View Full Code Here

    public void doView( RenderRequest request, RenderResponse response ) throws PortletException, IOException
    {
        RequestContext context = getRequestContext(request);

        ContentPage requestPage = context.getPage();      
        PageEditAccess pageEditAccess = (PageEditAccess)context.getAttribute(PortalReservedParameters.PAGE_EDIT_ACCESS_ATTRIBUTE);
        if ( requestPage == null)
        {
            // Targeting this portlet REQUIRES that the ProfilerValve has been invoked!
            throw new PortletException("Current request page not available.");
        }
        if (pageEditAccess == null)
        {
            // Targeting this portlet REQUIRES that the ProfilerValve has been invoked!
            throw new PortletException("Current PageEditAccess not available.");           
        }
       
        Boolean editing = ( pageEditAccess.isEditing() &&
                            PortletMode.VIEW.equals(request.getPortletMode()) &&
                            request.isPortletModeAllowed(PortletMode.EDIT))
                          ? Boolean.TRUE : Boolean.FALSE;
                                        
        PortletWindow window = context.getPortalURL().getNavigationalState().getMaximizedWindow();
View Full Code Here

    public void processAction(ActionRequest request, ActionResponse response) throws PortletException, IOException
    {
        RequestContext requestContext = getRequestContext(request);
       
        ContentPage requestPage = requestContext.getPage();      
        PageEditAccess pageEditAccess = (PageEditAccess)requestContext.getAttribute(PortalReservedParameters.PAGE_EDIT_ACCESS_ATTRIBUTE);
        if ( requestPage == null || pageEditAccess == null )
        {
            // Targeting this portlet with an ActionRequest REQUIRES that the ProfilerValve has been invoked!
            throw new PortletException("Current request page or PageEditAccess not available.");
        }

        decoratorCache.invalidate(requestContext);
       
        String pageMode = request.getParameter("pageMode");
        if ( pageMode != null )
        {
            if ( "view".equals(pageMode) )
            {
                pageEditAccess.setEditing(false);
            }
            else if ( "edit".equals(pageMode) && pageEditAccess.isEditAllowed() )
            {
                if ( this.editorType != null && this.editorType.equals( "desktop" ) )
                {
                    String redirectUrl = this.desktop.getPortalUrl( requestContext, requestContext.getPath() );
                    redirectUrl += "?editPage=true&portal=true";
                    response.sendRedirect( redirectUrl );
                }
                else
                {
                    pageEditAccess.setEditing(true);
                }
            }
            return;
        }
       
        if ( pageEditAccess.isEditAllowed() && request.isPortletModeAllowed(PortletMode.EDIT) )
        {
            String layout = null;
           
            boolean addLayout = request.getParameter("jsAddLayout") != null;
            if ( addLayout || request.getParameter("jsChangeLayout") != null )
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.decoration.PageEditAccess

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.