5 Replies Latest reply on May 24, 2006 5:21 AM by theute

    Portlet with the user name

    antitrust1982

      hello all,

      I want to create a JBPM portlet. In order to implante this one in the portal I want to print fist the name of my user who logged. But I can't find the methode or class which permit to have the user name of the logged person.

      Someboy know which one I must to use.

      Thank you for your help

      regards

      Antitrust1982

        • 1. Re: Portlet with the user name
          theute

          You should really read the spec

          request.getRemoteUser();

          • 2. Re: Portlet with the user name
            antitrust1982

            excuse me but I think you speak about JBPM specification. I want the loggin of Jboss Portal. I think this because I can't find your class in the javadoc and I remember of a similar class in jBpm.

            thank you for you help

            • 3. Re: Portlet with the user name
              theute

              Portlet spec:


              PLT.11.1.6 Security Attributes
              The PortletRequest interface offers a set of methods that provide security information
              about the user and the connection between the user and the portal. These methods are:
              ? getAuthType
              ? getRemoteUser
              ? getUserPrincipal
              ? isUserInRole
              ? isSecure

              [...]

              The getRemoteUser method returns the login name of the user making this request.


              In the API:
              http://docs.jboss.com/jbportal/v2.2/javadoc/javax/portlet/PortletRequest.html#getRemoteUser()

              You *must* read the spec...

              • 4. Re: Portlet with the user name
                antitrust1982

                Hi all,


                I tried to use getRemoteUser() this methode is a PortletRequest's methode, but the PortletRequest class is an interface then I can use it directly in order to have my login name. So I have seen which classes are implement this class and I find ActionRequestImpl, but the constructor of this class needs an action invocation which needs a InputContext. I don't understand how I can have this InputContext. And how I can use the classes from portal in my portlet.


                So when I wrote my portlet , I don't understand how I can link my portlet and the portlet context. If you have an example or some clues in order toexplain how I can take the login name easily, can you send me please?


                thank you for your help

                antitrust1982

                • 5. Re: Portlet with the user name
                  theute

                  Please read the spec from the top to bottom... I insist till everything is there for portlet development.

                  You are trying to get your username either from a render method or an action method. So you have access either to a RenderRequest object or a ActionRequest object. Both objects extend PortletRequest.