Package org.apache.cocoon.portal.wsrp.consumer

Examples of org.apache.cocoon.portal.wsrp.consumer.SimplePortletWindowSession


        final Map addParams = new HashMap();
        addParams.put(Constants.PORTLET_INSTANCE_KEY, portletInstanceKey);
        coplet.setTemporaryAttribute(ATTRIBUTE_NAME_CONSUMER_MAP, addParams);

        // get the window-state and -mode
        SimplePortletWindowSession windowSession;
        wsrpportlet = consumerEnvironment.getPortletRegistry().getPortlet(portletKey);

        try {
            // this call includes the getServiceDescription()-Invocation
            // additionally register() initCookie() and so on will be handled
View Full Code Here


            final String portletInstanceKey = (String)coplet.getTemporaryAttribute(ATTRIBUTE_NAME_PORTLET_INSTANCE_KEY);

            // getMarkup()
            final WSRPPortlet wsrpportlet = consumerEnvironment.getPortletRegistry().getPortlet(portletKey);

            SimplePortletWindowSession windowSession = getSimplePortletWindowSession(wsrpportlet, portletInstanceKey, user);
            final MarkupContext markupContext = this.getMarkupContext(wsrpportlet, windowSession, user);
            if ( markupContext == null || markupContext.getMarkupString() == null ) {
                throw new SAXException("No markup received from wsrp coplet " + coplet.getId());
            }
            final String content = markupContext.getMarkupString();
View Full Code Here

     */
    public SimplePortletWindowSession getSimplePortletWindowSession(WSRPPortlet portlet,
                                                                    String portletInstanceKey,
                                                                    User user)
    throws WSRPException {
        SimplePortletWindowSession windowSession = null;

        // get the user session
        SessionHandler sessionHandler = consumerEnvironment.getSessionHandler();
        UserSession userSession = sessionHandler.getUserSession(portlet.getPortletKey().getProducerId(), user.getUserID());

View Full Code Here

            Request request = new RequestImpl();
            String portletMode = requestObject.getParameter(Constants.PORTLET_MODE);
            String windowState = requestObject.getParameter(Constants.WINDOW_STATE);
           
            request.setInteractionState(requestObject.getParameter(Constants.INTERACTION_STATE));
            SimplePortletWindowSession windowSession = getSimplePortletWindowSession(wsrpPortlet, portletInstanceKey, user);
            windowSession.setNavigationalState(requestObject.getParameter(Constants.NAVIGATIONAL_STATE));

            if (portletMode != null) {
                windowSession.setMode(portletMode);
            }
            if (windowState != null) {
                if ( !windowState.equals(windowSession.getWindowState()) ) {
                    final Layout layout = (Layout)coplet.getTemporaryAttribute(ATTRIBUTE_NAME_LAYOUT);
                    final Layout fullScreenLayout = service.getEntryLayout(null);
                    if ( fullScreenLayout != null
                         && fullScreenLayout.equals( layout )
                         && !windowState.equals(WindowStates._maximized) ) {
                        FullScreenCopletEvent e = new FullScreenCopletEvent( coplet, null );
                        service.getComponentManager().getEventManager().send(e);
                    }
                    if ( windowState.equals(WindowStates._minimized) ) {
                        ChangeCopletInstanceAspectDataEvent e = new ChangeCopletInstanceAspectDataEvent(coplet, "size", SizingStatus.STATUS_MINIMIZED);
                        service.getComponentManager().getEventManager().send(e);
                    }
                    if ( windowState.equals(WindowStates._normal) ) {
                        ChangeCopletInstanceAspectDataEvent e = new ChangeCopletInstanceAspectDataEvent(coplet, "size", SizingStatus.STATUS_MAXIMIZED);
                        service.getComponentManager().getEventManager().send(e);
                    }
                    if ( windowState.equals(WindowStates._maximized) ) {
                        FullScreenCopletEvent e = new FullScreenCopletEvent( coplet, layout );
                        service.getComponentManager().getEventManager().send(e);
                    }
                    windowSession.setWindowState(windowState);
                }
            }
            if (requestObject.getParameter(Constants.URL_TYPE).equals(Constants.URL_TYPE_BLOCKINGACTION)) {
            // performBlockingInteraction()
                String parameter;
View Full Code Here

        final Map addParams = new HashMap();
        addParams.put(Constants.PORTLET_INSTANCE_KEY, portletInstanceKey);
        coplet.setTemporaryAttribute(ATTRIBUTE_NAME_CONSUMER_MAP, addParams);

        // get the window-state and -mode
        SimplePortletWindowSession windowSession;
        wsrpportlet = consumerEnvironment.getPortletRegistry().getPortlet(portletKey);

        try {
            // this call includes the getServiceDescription()-Invocation
            // additionally register() initCookie() and so on will be handled
View Full Code Here

            final String portletInstanceKey = (String)coplet.getTemporaryAttribute(ATTRIBUTE_NAME_PORTLET_INSTANCE_KEY);

            // getMarkup()
            final WSRPPortlet wsrpportlet = consumerEnvironment.getPortletRegistry().getPortlet(portletKey);

            SimplePortletWindowSession windowSession = getSimplePortletWindowSession(wsrpportlet, portletInstanceKey, user);
            final MarkupContext markupContext = this.getMarkupContext(wsrpportlet, windowSession, user);
            if ( markupContext == null || markupContext.getMarkupString() == null ) {
                throw new SAXException("No markup received from wsrp coplet " + coplet.getId());
            }
            final String content = markupContext.getMarkupString();
View Full Code Here

     */
    public SimplePortletWindowSession getSimplePortletWindowSession(WSRPPortlet portlet,
                                                                    String portletInstanceKey,
                                                                    User user)
    throws WSRPException {
        SimplePortletWindowSession windowSession = null;

        // get the user session
        SessionHandler sessionHandler = consumerEnvironment.getSessionHandler();
        UserSession userSession = sessionHandler.getUserSession(portlet.getPortletKey().getProducerId(), user.getUserID());

View Full Code Here

            Request request = new RequestImpl();
            String portletMode = requestObject.getParameter(Constants.PORTLET_MODE);
            String windowState = requestObject.getParameter(Constants.WINDOW_STATE);
           
            request.setInteractionState(requestObject.getParameter(Constants.INTERACTION_STATE));
            SimplePortletWindowSession windowSession = getSimplePortletWindowSession(wsrpPortlet, portletInstanceKey, user);
            windowSession.setNavigationalState(requestObject.getParameter(Constants.NAVIGATIONAL_STATE));

            if (portletMode != null) {
                windowSession.setMode(portletMode);
            }
            if (windowState != null) {
                if ( !windowState.equals(windowSession.getWindowState()) ) {
                    final Layout layout = (Layout)coplet.getTemporaryAttribute(ATTRIBUTE_NAME_LAYOUT);
                    final Layout fullScreenLayout = service.getEntryLayout(null);
                    if ( fullScreenLayout != null
                         && fullScreenLayout.equals( layout )
                         && !windowState.equals(WindowStates._maximized) ) {
                        FullScreenCopletEvent e = new FullScreenCopletEvent( coplet, null );
                        service.getComponentManager().getEventManager().send(e);
                    }
                    if ( windowState.equals(WindowStates._minimized) ) {
                        ChangeCopletInstanceAspectDataEvent e = new ChangeCopletInstanceAspectDataEvent(coplet, "size", SizingStatus.STATUS_MINIMIZED);
                        service.getComponentManager().getEventManager().send(e);
                    }
                    if ( windowState.equals(WindowStates._normal) ) {
                        ChangeCopletInstanceAspectDataEvent e = new ChangeCopletInstanceAspectDataEvent(coplet, "size", SizingStatus.STATUS_MAXIMIZED);
                        service.getComponentManager().getEventManager().send(e);
                    }
                    if ( windowState.equals(WindowStates._maximized) ) {
                        FullScreenCopletEvent e = new FullScreenCopletEvent( coplet, layout );
                        service.getComponentManager().getEventManager().send(e);
                    }
                    windowSession.setWindowState(windowState);
                }
            }
            if (requestObject.getParameter(Constants.URL_TYPE).equals(Constants.URL_TYPE_BLOCKINGACTION)) {
            // performBlockingInteraction()
                String parameter;
View Full Code Here

            final String portletInstanceKey = (String)copletInstanceData.getTemporaryAttribute(WSRPAdapter.ATTRIBUTE_NAME_PORTLET_INSTANCE_KEY);
            final User user = (User)copletInstanceData.getTemporaryAttribute(WSRPAdapter.ATTRIBUTE_NAME_USER);

            final WSRPPortlet portlet = this.environment.getPortletRegistry().getPortlet(portletKey);
            try {
                SimplePortletWindowSession windowSession = this.adapter.getSimplePortletWindowSession(portlet, portletInstanceKey, user);
                if ( this.environment != null && windowSession != null ) {
                    this.adapter.setCurrentCopletInstanceData(copletInstanceData);
                    URLGenerator urlGenerator = this.environment.getURLGenerator();

                    String[] supportedWindowStates = (String[])copletInstanceData.getTemporaryAttribute(WSRPAdapter.ATTRIBUTE_NAME_PORTLET_WINDOWSTATES);
                    String ws = windowSession.getWindowState();
                    if ( ws == null ) {
                        ws = WindowStates._normal;
                    }

                    if ( !ws.equals(WindowStates._minimized)
                         && ArrayUtils.contains(supportedWindowStates, WindowStates._minimized)) {
                        final Map p = new HashMap();
                        p.put(Constants.URL_TYPE, Constants.URL_TYPE_RENDER);
                        p.put(Constants.WINDOW_STATE, WindowStates._minimized);
                       
                        final String link = urlGenerator.getRenderURL(p);
                        XMLUtils.createElement(contenthandler, "minimize-uri", link);
                    }
                    if ( !ws.equals(WindowStates._normal)
                          && ArrayUtils.contains(supportedWindowStates, WindowStates._normal)) {
                        final Map p = new HashMap();
                        p.put(Constants.URL_TYPE, Constants.URL_TYPE_RENDER);
                        p.put(Constants.WINDOW_STATE, WindowStates._normal);

                        final String link = urlGenerator.getRenderURL(p);
                        XMLUtils.createElement(contenthandler, "maximize-uri", link);
                    }
                    if ( !ws.equals(WindowStates._maximized)
                          && ArrayUtils.contains(supportedWindowStates, WindowStates._maximized)) {
                        final Map p = new HashMap();
                        p.put(Constants.URL_TYPE, Constants.URL_TYPE_RENDER);
                        p.put(Constants.WINDOW_STATE, WindowStates._maximized);

                        final String link = urlGenerator.getRenderURL(p);                       
                        XMLUtils.createElement(contenthandler, "fullscreen-uri", link);
                    }

                    String[] supportedModes = (String[])copletInstanceData.getTemporaryAttribute(WSRPAdapter.ATTRIBUTE_NAME_PORTLET_MODES);
                    String pm = windowSession.getMode();
                    if ( pm == null ) {
                        pm = Modes._view;
                    }
                    if ( !pm.equals(Modes._edit)
                         && ArrayUtils.contains(supportedModes, Modes._edit) ) {
View Full Code Here

            final String portletInstanceKey = (String)copletInstanceData.getTemporaryAttribute(WSRPAdapter.ATTRIBUTE_NAME_PORTLET_INSTANCE_KEY);
            final User user = (User)copletInstanceData.getTemporaryAttribute(WSRPAdapter.ATTRIBUTE_NAME_USER);

            final WSRPPortlet portlet = this.environment.getPortletRegistry().getPortlet(portletKey);
            try {
                SimplePortletWindowSession windowSession = this.adapter.getSimplePortletWindowSession(portlet, portletInstanceKey, user);
                if ( this.environment != null && windowSession != null ) {
                    this.adapter.setCurrentCopletInstanceData(copletInstanceData);
                    URLGenerator urlGenerator = this.environment.getURLGenerator();

                    String[] supportedWindowStates = (String[])copletInstanceData.getTemporaryAttribute(WSRPAdapter.ATTRIBUTE_NAME_PORTLET_WINDOWSTATES);
                    String ws = windowSession.getWindowState();
                    if ( ws == null ) {
                        ws = WindowStates._normal;
                    }

                    if ( !ws.equals(WindowStates._minimized)
                         && ArrayUtils.contains(supportedWindowStates, WindowStates._minimized)) {
                        final Map p = new HashMap();
                        p.put(Constants.URL_TYPE, Constants.URL_TYPE_RENDER);
                        p.put(Constants.WINDOW_STATE, WindowStates._minimized);
                       
                        final String link = urlGenerator.getRenderURL(p);
                        XMLUtils.createElement(contenthandler, "minimize-uri", link);
                    }
                    if ( !ws.equals(WindowStates._normal)
                          && ArrayUtils.contains(supportedWindowStates, WindowStates._normal)) {
                        final Map p = new HashMap();
                        p.put(Constants.URL_TYPE, Constants.URL_TYPE_RENDER);
                        p.put(Constants.WINDOW_STATE, WindowStates._normal);

                        final String link = urlGenerator.getRenderURL(p);
                        XMLUtils.createElement(contenthandler, "maximize-uri", link);
                    }
                    if ( !ws.equals(WindowStates._maximized)
                          && ArrayUtils.contains(supportedWindowStates, WindowStates._maximized)) {
                        final Map p = new HashMap();
                        p.put(Constants.URL_TYPE, Constants.URL_TYPE_RENDER);
                        p.put(Constants.WINDOW_STATE, WindowStates._maximized);

                        final String link = urlGenerator.getRenderURL(p);                       
                        XMLUtils.createElement(contenthandler, "fullscreen-uri", link);
                    }

                    String[] supportedModes = (String[])copletInstanceData.getTemporaryAttribute(WSRPAdapter.ATTRIBUTE_NAME_PORTLET_MODES);
                    String pm = windowSession.getMode();
                    if ( pm == null ) {
                        pm = Modes._view;
                    }
                    if ( !pm.equals(Modes._edit)
                         && ArrayUtils.contains(supportedModes, Modes._edit) ) {
View Full Code Here

TOP

Related Classes of org.apache.cocoon.portal.wsrp.consumer.SimplePortletWindowSession

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.