Package org.apache.wsrp4j.consumer

Examples of org.apache.wsrp4j.consumer.User


            return;
        }

        // get the wsrp user and store it as an attribute on the instance
        final String currentUserID = this.service.getComponentManager().getProfileManager().getUser().getUserName();      
        User user = this.consumerEnvironment.getUserRegistry().getUser(currentUserID);
        if ( user == null ) {
            // create a new user
            user = new UserImpl(currentUserID);
            user.setUserContext(this.userContextProvider.createUserContext(currentUserID));
            this.consumerEnvironment.getUserRegistry().addUser(user);
        }
        coplet.setTemporaryAttribute(ATTRIBUTE_NAME_USER, user);

        // get the portlet handle
View Full Code Here


            // get the portlet key and the user
            final PortletKey portletKey = (PortletKey)coplet.getTemporaryAttribute(ATTRIBUTE_NAME_PORTLET_KEY);
            if ( portletKey == null ) {
                throw new SAXException("WSRP configuration is missing: portlet key.");
            }
            final User user = (User)coplet.getTemporaryAttribute(ATTRIBUTE_NAME_USER);
            if ( user == null ) {
                throw new SAXException("WSRP configuration is missing: user.");
            }
           
            final String portletInstanceKey = (String)coplet.getTemporaryAttribute(ATTRIBUTE_NAME_PORTLET_INSTANCE_KEY);
View Full Code Here

     */
    public void logout(CopletInstanceData coplet) {
      super.logout(coplet);

        PortletKey portletKey = (PortletKey)coplet.getTemporaryAttribute(ATTRIBUTE_NAME_PORTLET_KEY);
        User user = (User)coplet.getTemporaryAttribute(ATTRIBUTE_NAME_USER);
        final String portletInstanceKey = (String)coplet.getTemporaryAttribute(ATTRIBUTE_NAME_PORTLET_INSTANCE_KEY);
        Producer producer = consumerEnvironment.getProducerRegistry().getProducer(portletKey.getProducerId());
       
        // releaseSession()
        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) {
            this.getLogger().error("session deregister()", e);
View Full Code Here

       
        try {
            PortletKey portletKey = (PortletKey)coplet.getTemporaryAttribute(ATTRIBUTE_NAME_PORTLET_KEY);
            final String portletInstanceKey = (String)coplet.getTemporaryAttribute(ATTRIBUTE_NAME_PORTLET_INSTANCE_KEY);
            WSRPPortlet wsrpPortlet = consumerEnvironment.getPortletRegistry().getPortlet(portletKey);
            User user = (User) coplet.getTemporaryAttribute(ATTRIBUTE_NAME_USER);
           
            org.apache.cocoon.environment.Request requestObject = ObjectModelHelper.getRequest(service.getObjectModel());
            java.util.Enumeration formParameter = requestObject.getParameterNames();

            Request request = new RequestImpl();
View Full Code Here

    /**
     * @see org.apache.wsrp4j.consumer.driver.GenericConsumerEnvironment#getSupportedLocales()
     */
    public String[] getSupportedLocales() {
        CopletInstanceData coplet = this.adapter.getCurrentCopletInstanceData();
        User user = (User)coplet.getTemporaryAttribute(WSRPAdapter.ATTRIBUTE_NAME_USER);
       
        return ((UserContextExtension)user.getUserContext()).getSupportedLocales();
    }
View Full Code Here

    /**
     * @see org.apache.wsrp4j.consumer.ConsumerCapabilities#getUserAuthentication()
     */
    public String getUserAuthentication() {
        CopletInstanceData coplet = this.adapter.getCurrentCopletInstanceData();
        User user = (User)coplet.getTemporaryAttribute(WSRPAdapter.ATTRIBUTE_NAME_USER);
       
        return ((UserContextExtension)user.getUserContext()).getUserAuthentication();
    }
View Full Code Here

    /**
     * @see org.apache.wsrp4j.consumer.driver.GenericConsumerEnvironment#getSupportedLocales()
     */
    public String[] getSupportedLocales() {
        CopletInstanceData coplet = this.adapter.getCurrentCopletInstanceData();
        User user = (User)coplet.getTemporaryAttribute(WSRPAdapter.ATTRIBUTE_NAME_USER);
       
        return ((UserContextExtension)user.getUserContext()).getSupportedLocales();
    }
View Full Code Here

    /**
     * @see org.apache.wsrp4j.consumer.ConsumerCapabilities#getUserAuthentication()
     */
    public String getUserAuthentication() {
        CopletInstanceData coplet = this.adapter.getCurrentCopletInstanceData();
        User user = (User)coplet.getTemporaryAttribute(WSRPAdapter.ATTRIBUTE_NAME_USER);
       
        return ((UserContextExtension)user.getUserContext()).getUserAuthentication();
    }   
View Full Code Here

    protected UserContext getUserContext(String userID) {
        UserContext userContext = null;

        if (userID != null) {
            User user = consumerEnv.getUserRegistry().getUser(userID);

            if (user != null) {
                userContext = user.getUserContext();
            }
        }
       
        // workaround for Oracle bug, always send a userContext with dummy value
        // if none was provided
View Full Code Here

                title = localizedTitle.getValue();
            }
            XMLUtils.createElement(contenthandler, "title", title);           

            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 ) {
View Full Code Here

TOP

Related Classes of org.apache.wsrp4j.consumer.User

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.