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

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


    public PortletPropertyDescriptionResponse getPortletPropertyDescription(String userID)
    throws WSRPException {
        GetPortletPropertyDescription request = new GetPortletPropertyDescription();
        request.setPortletContext(getPortlet().getPortletContext());

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

        UserContext userCtx = getUserContext(userID);
        if (userCtx != null)
View Full Code Here


    throws WSRPException {
        GetPortletProperties request = new GetPortletProperties();
        request.setPortletContext(getPortlet().getPortletContext());
        request.setNames(names);

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

        UserContext userCtx = getUserContext(userID);
        if (userCtx != null)
View Full Code Here

    public PortletContext setPortletProperties(PropertyList properties, String userID)
    throws WSRPException {
        SetPortletProperties request = new SetPortletProperties();
        request.setPortletContext(getPortlet().getPortletContext());

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

        UserContext userCtx = getUserContext(userID);
        if (userCtx != null)
View Full Code Here

    protected Producer getProducer(String producerID) throws WSRPException {
        ProducerRegistry producerRegistry = getConsumerEnvironment().getProducerRegistry();
        Producer producer = producerRegistry.getProducer(producerID);
        if (producer == null) {
            // Create producer and register it
            RegistrationData regData = new RegistrationData();
            regData.setConsumerName("uPortal WSRP Consumer");
            regData.setConsumerAgent("uPortal WSRP Consumer");
            producer = new ProducerImpl(producerID, markupUrl, serviceDescUrl, regUrl, mgmtUrl, regData);
            producerRegistry.addProducer(producer);
        }
        //System.out.println("returning producer=" + producer.toString());
        return producer;
View Full Code Here

        return desc;
    }

    public static RegistrationData createRegistrationData(Configuration config,
                                                          ConsumerEnvironment env) {
        RegistrationData registrationData = new RegistrationData(
                env.getConsumerAgent(),
                env.getSupportedModes(),
                WSRPAdapter.CONSUMER_URL,  //consumer-name
                null,         //consumerUserScopes
                env.getSupportedWindowStates(),
View Full Code Here

                                     String userID)
    throws WSRPException {

        checkInitCookie(userID);

        ReleaseSessions request = new ReleaseSessions();

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

        request.setSessionIDs(sessionIDs);

        ReturnAny response = null;
        try {

            response = markupPort.releaseSessions(request);
View Full Code Here

        if (regCtx != null)
            request.setRegistrationContext(regCtx);

        request.setSessionIDs(sessionIDs);

        ReturnAny response = null;
        try {

            response = markupPort.releaseSessions(request);

        } catch (java.rmi.RemoteException wsrpFault) {
View Full Code Here

    /**
     * Create the runtime context for the current request.
     */
    protected RuntimeContext getRuntimeContext(WSRPBaseRequest request) {
        RuntimeContext runtimeContext = new RuntimeContext();
        runtimeContext.setUserAuthentication(consumerEnv.getUserAuthentication());
        runtimeContext.setPortletInstanceKey(request.getPortletInstanceKey());

        URLTemplateComposer templateComposer = consumerEnv.getTemplateComposer();
        if (templateComposer != null) {
            runtimeContext.setNamespacePrefix(templateComposer.getNamespacePrefix());
        }

        Boolean doesUrlTemplateProcess = null;
        try {

            PortletDescription desc = producer.getPortletDescription(getPortlet().getParent());

            if (desc != null) {

                doesUrlTemplateProcess = desc.getDoesUrlTemplateProcessing();
            }

        } catch (WSRPException e) {

            // do nothing since exception has been logged already
            // continue with assumption that portlet does not support template processing
        }

        if (doesUrlTemplateProcess != null && templateComposer != null && doesUrlTemplateProcess.booleanValue()) {
            Templates templates = new Templates();
            templates.setBlockingActionTemplate(templateComposer.createBlockingActionTemplate(true, true, true, true));
            templates.setRenderTemplate(templateComposer.createRenderTemplate(true, true, true, true));
            templates.setDefaultTemplate(templateComposer.createDefaultTemplate(true, true, true, true));
            templates.setResourceTemplate(templateComposer.createResourceTemplate(true, true, true, true));
            templates.setSecureBlockingActionTemplate(
                templateComposer.createSecureBlockingActionTemplate(true, true, true, true));
            templates.setSecureRenderTemplate(templateComposer.createSecureRenderTemplate(true, true, true, true));
            templates.setSecureDefaultTemplate(templateComposer.createSecureDefaultTemplate(true, true, true, true));
            templates.setSecureResourceTemplate(templateComposer.createSecureResourceTemplate(true, true, true, true));
            runtimeContext.setTemplates(templates);
        }

        runtimeContext.setSessionID(request.getSessionID());
        runtimeContext.setExtensions(null);

        return runtimeContext;
    }
View Full Code Here

        this.producer = consumerEnv.getProducerRegistry().getProducer(portlet.getPortletKey().getProducerId());
       
        this.portletPort = this.producer.getPortletManagementInterface();
        this.desc = this.producer.getPortletDescription(this.portlet.getPortletKey().getPortletHandle());

        ServiceDescription serviceDescription = this.producer.getServiceDescription(false);
        if (serviceDescription != null) {
            this.initCookie = serviceDescription.getRequiresInitCookie();
            if (initCookie == null) {
                initCookie = CookieProtocol.none; // TODO - get from config
            }
        }
    }
View Full Code Here

        try {
            UserSession userSession = consumerEnvironment.getSessionHandler().getUserSession(portletKey.getProducerId(), user.getUserID());
            PortletDescription portletDescription = producer.getPortletDescription(portletKey.getPortletHandle());
            GroupSession groupSession = userSession.getGroupSession(portletDescription.getGroupID());
            PortletSession portletSession = groupSession.getPortletSession(portletInstanceKey);
            SessionContext sessionContext = portletSession.getSessionContext();
            WSRPPortlet wsrpportlet = consumerEnvironment.getPortletRegistry().getPortlet(portletKey);
            PortletDriver portletDriver = consumerEnvironment.getPortletDriverRegistry().getPortletDriver(wsrpportlet);
   
            if (sessionContext != null) {
                String[] sessions = new String[1];
                sessions[0] = new String (sessionContext.getSessionID());
                portletDriver.releaseSessions(sessions, user.getUserID());
            }
           
            userSession.removeGroupSession(portletDescription.getGroupID());
        } catch (WSRPException e) {
View Full Code Here

TOP

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

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.