Package oasis.names.tc.wsrp.v1.types

Examples of oasis.names.tc.wsrp.v1.types.RuntimeContext


       
    }

    protected MarkupParams getMarkupParams(WSRPBaseRequest request) {

        MarkupParams markupParams = new MarkupParams();
        ClientData clientData = null;

        // lets just set this to the consumer agent for now
        if (producer.getRegistrationData() != null) {
            clientData = new ClientData();
            clientData.setUserAgent(producer.getRegistrationData().getConsumerAgent());
        }
        markupParams.setClientData(clientData);
        markupParams.setSecureClientCommunication(this.service.getComponentManager().getLinkService().isSecure());
        markupParams.setLocales(consumerEnv.getSupportedLocales());

        markupParams.setMimeTypes(consumerEnv.getMimeTypes());

        markupParams.setMode(request.getMode());
        markupParams.setWindowState(request.getWindowState());
        markupParams.setNavigationalState(request.getNavigationalState());
        markupParams.setMarkupCharacterSets(consumerEnv.getCharacterEncodingSet());
        markupParams.setValidateTag(null); // TODO ValidateTag

        // TODO we could cache the modes and window states
        final MarkupType markupType = this.desc.getMarkupTypes(0);
        markupParams.setValidNewModes(this.getValidValues(consumerEnv.getSupportedModes(), markupType.getModes()));
        markupParams.setValidNewWindowStates(this.getValidValues(consumerEnv.getSupportedWindowStates(), markupType.getWindowStates()));

        markupParams.setExtensions(this.getMarkupParamsExtensions());

        return markupParams;
    }
View Full Code Here


                                             User user)
    throws WSRPException {
        WSRPRequestImpl wsrpRequest = new WSRPRequestImpl(windowSession, null, this.consumerEnvironment);

        PortletDriver portletDriver = consumerEnvironment.getPortletDriverRegistry().getPortletDriver(portlet);
        MarkupResponse response = portletDriver.getMarkup(wsrpRequest, user.getUserID());

        if (response != null) {
            SessionContext sessionContext = response.getSessionContext();
            if (sessionContext != null && windowSession != null) {
                windowSession.getPortletSession().setSessionContext(sessionContext);
            }

            return response.getMarkupContext();
        }
        return null;
    }
View Full Code Here

                                             User user)
    throws WSRPException {
        WSRPRequestImpl wsrpRequest = new WSRPRequestImpl(windowSession, null, this.consumerEnvironment);

        PortletDriver portletDriver = consumerEnvironment.getPortletDriverRegistry().getPortletDriver(portlet);
        MarkupResponse response = portletDriver.getMarkup(wsrpRequest, user.getUserID());

        if (response != null) {
            SessionContext sessionContext = response.getSessionContext();
            if (sessionContext != null && windowSession != null) {
                windowSession.getPortletSession().setSessionContext(sessionContext);
            }

            return response.getMarkupContext();
        }
        return null;
    }
View Full Code Here

    public MarkupResponse getMarkup(MarkupRequest markupRequest,
                                    String userID)
    throws WSRPException {
        checkInitCookie(userID);

        MarkupResponse response = null;

        try {

            MarkupContext markupContext = null;
            if ((markupContext = markupRequest.getCachedMarkup()) == null) {

                // getMarkup request
                GetMarkup request = new GetMarkup();

                request.setPortletContext(getPortlet().getPortletContext());
                request.setMarkupParams(getMarkupParams(markupRequest));
                request.setRuntimeContext(getRuntimeContext(markupRequest));

                RegistrationContext regCtx = producer.getRegistrationContext();
                if (regCtx != null)
                    request.setRegistrationContext(regCtx);

                UserContext userCtx = getUserContext(userID);
                if (userCtx != null) {
                    request.setUserContext(getUserContext(userID));
                }

                response = markupPort.getMarkup(request);

                parameterChecker.check(response);

            } else {

                response = new MarkupResponse();
                response.setMarkupContext(markupContext);
            }           
           
            Boolean requiresRewriting = response.getMarkupContext().getRequiresUrlRewriting();
            requiresRewriting = requiresRewriting == null ? Boolean.FALSE : requiresRewriting;

            if (requiresRewriting.booleanValue()) {
                // rewrite url's

                URLRewriter urlRewriter = consumerEnv.getURLRewriter();
                String rewrittenMarkup = urlRewriter.rewriteURLs(response.getMarkupContext().getMarkupString());

                if (rewrittenMarkup != null) {
                    response.getMarkupContext().setMarkupString(rewrittenMarkup);
                }
            }

        } catch (InvalidCookieFault cookieFault) {
View Full Code Here

                                             User user)
    throws WSRPException {
        WSRPRequestImpl wsrpRequest = new WSRPRequestImpl(windowSession, null, this.consumerEnvironment);

        PortletDriver portletDriver = consumerEnvironment.getPortletDriverRegistry().getPortletDriver(portlet);
        MarkupResponse response = portletDriver.getMarkup(wsrpRequest, user.getUserID());

        if (response != null) {
            SessionContext sessionContext = response.getSessionContext();
            if (sessionContext != null && windowSession != null) {
                windowSession.getPortletSession().setSessionContext(sessionContext);
            }

            return response.getMarkupContext();
        }
        return null;
    }
View Full Code Here

                                                          portletInstanceKey,
                                                          user);
            final PortletDescription desc = producer.getPortletDescription(portletHandle);
            coplet.setTemporaryAttribute(ATTRIBUTE_NAME_PORTLET_TITLE,
                                         desc.getTitle());
            final MarkupType markupType = desc.getMarkupTypes(0);
            coplet.setTemporaryAttribute(ATTRIBUTE_NAME_PORTLET_MODES, markupType.getModes());
            coplet.setTemporaryAttribute(ATTRIBUTE_NAME_PORTLET_WINDOWSTATES, markupType.getWindowStates());

        } catch (WSRPException e) {
            this.getLogger().error("Invoking getServiceDescription()", e);
        }
    }
View Full Code Here

                                                          portletInstanceKey,
                                                          user);
            final PortletDescription desc = producer.getPortletDescription(portletHandle);
            coplet.setTemporaryAttribute(ATTRIBUTE_NAME_PORTLET_TITLE,
                                         desc.getTitle());
            final MarkupType markupType = desc.getMarkupTypes(0);
            coplet.setTemporaryAttribute(ATTRIBUTE_NAME_PORTLET_MODES, markupType.getModes());
            coplet.setTemporaryAttribute(ATTRIBUTE_NAME_PORTLET_WINDOWSTATES, markupType.getWindowStates());

        } catch (WSRPException e) {
            this.getLogger().error("Invoking getServiceDescription()", e);
        }
    }
View Full Code Here

        markupParams.setNavigationalState(request.getNavigationalState());
        markupParams.setMarkupCharacterSets(consumerEnv.getCharacterEncodingSet());
        markupParams.setValidateTag(null); // TODO ValidateTag

        // TODO we could cache the modes and window states
        final MarkupType markupType = this.desc.getMarkupTypes(0);
        markupParams.setValidNewModes(this.getValidValues(consumerEnv.getSupportedModes(), markupType.getModes()));
        markupParams.setValidNewWindowStates(this.getValidValues(consumerEnv.getSupportedWindowStates(), markupType.getWindowStates()));

        markupParams.setExtensions(this.getMarkupParamsExtensions());

        return markupParams;
    }
View Full Code Here

                                                          portletInstanceKey,
                                                          user);
            final PortletDescription desc = producer.getPortletDescription(portletHandle);
            coplet.setTemporaryAttribute(ATTRIBUTE_NAME_PORTLET_TITLE,
                                         desc.getTitle());
            final MarkupType markupType = desc.getMarkupTypes(0);
            coplet.setTemporaryAttribute(ATTRIBUTE_NAME_PORTLET_MODES, markupType.getModes());
            coplet.setTemporaryAttribute(ATTRIBUTE_NAME_PORTLET_WINDOWSTATES, markupType.getWindowStates());

        } catch (WSRPException e) {
            this.getLogger().error("Invoking getServiceDescription()", e);
        }
    }
View Full Code Here

        ArrayList paramList = new ArrayList();
        Iterator params = this.formParameters.keySet().iterator();
        while (params.hasNext()) {
            String name = (String)params.next();

            NamedString parameter = new NamedString();
            parameter.setName(name);
            parameter.setValue((String)this.formParameters.get(name));
            paramList.add(parameter);
        }
       
        NamedString[] formParams = new NamedString[paramList.size()];
        paramList.toArray(formParams);
View Full Code Here

TOP

Related Classes of oasis.names.tc.wsrp.v1.types.RuntimeContext

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.