Package net.sf.jportlet.impl

Examples of net.sf.jportlet.impl.UserImpl


        String template = request.getParameter( KEY_TEMPLATE );
        if ( template == null )
        {
            if ( request.getAttribute( "user" ) == null )
            {
                UserImpl user = new UserImpl( "", "", "", "", "", request.getLocale(  ) );
                request.setAttribute( "user", user );
            }

            include( "edit.vm", request, response );
        }
View Full Code Here


        PortletContext ctx = event.getPortlet(  ).getPortletConfig(  ).getPortletContext(  );
        UserService    usr = ( UserService ) ctx.getService( UserService.NAME );
        try
        {
            /* Get the user */
            UserImpl u = ( UserImpl ) usr.getUserByEmail( email );

            /* Generate the email message */
            String subject = "Password Requested";
            StringBuffer body = new StringBuffer();
            body.append( u.getFirstname(  ) + " " + u.getLastname(  ) + "\n" );
            body.append( "Here is your requested password\n" );
            body.append( " Login: " + u.getId(  ) + "\n" );
            body.append( " Password: " + u.getPassword(  ) + "\n\n" );

            /* Send the message */
            MailService mailer = ( MailService ) ctx.getService( MailService.NAME );
            mailer.send( null, new Address[] { new InternetAddress( u.getEmail(  ) ) }, subject, body.toString(), MailService.MIME_TEXT );
        }
        catch ( UserNotFoundException u )
        {
            ctx.getLog(  ).warn( email + " not found", u );
        }
View Full Code Here

        {
            throw new PortletException( "Unexpected error", e );
        }

        /* Handle Errors */
        UserImpl user = new UserImpl( userId, password, email, firstname, lastname, locale );
        request.setAttribute( "user", user );
        if ( register )
        {
            doRegister( event, request );
        }
View Full Code Here

    {
        boolean           debug = __log.isDebugEnabled(  );
        Connection        cnn = null;
        PreparedStatement stmt = null;
        ResultSet         rs = null;
        UserImpl          usr;
       
        try
        {
            if ( debug )
            {
                __log.debug( "executing SQL: " + _getUserSQL );
            }

            cnn  = getConnection();
            stmt = cnn.prepareStatement( _getUserSQL );
            stmt.setString( 1, userId );

            rs = stmt.executeQuery(  );

            if ( rs.next(  ) )
            {
                usr = new UserImpl(  );
                usr.setId( rs.getString( 1 ) );
                usr.setPassword( rs.getString( 2 ) );
                usr.setEmail( rs.getString( 3 ) );
                usr.setFirstname( rs.getString( 4 ) );
                usr.setLastname( rs.getString( 5 ) );
                usr.setLocale( LocaleHelper.getLocale( rs.getString( 6 ), null ) );

                return usr;
            }
            else
            {
View Full Code Here

            cnn.setAutoCommit( true );
            rs = stmt.executeQuery(  );

            /* Sync the request */
            UserImpl user = new UserImpl( userId, password, email, firstname, lastname, LocaleHelper.getLocale( locale, null ) );
            ( ( PortletRequestImpl ) request ).userChanged( user );
        }
        catch ( SQLException e )
        {
            throw new UserException( e );
View Full Code Here

    {
        boolean           debug = __log.isDebugEnabled(  );
        Connection        cnn = null;
        PreparedStatement stmt = null;
        ResultSet         rs = null;
        UserImpl          usr;
       
        try
        {
            if ( debug )
            {
                __log.debug( "executing SQL: " + _getUserByEmailSQL );
            }

            cnn  = getConnection();
            stmt = cnn.prepareStatement( _getUserByEmailSQL );
            stmt.setString( 1, email );

            rs = stmt.executeQuery(  );

            if ( rs.next(  ) )
            {
                usr = new UserImpl(  );
                usr.setId( rs.getString( 1 ) );
                usr.setPassword( rs.getString( 2 ) );
                usr.setEmail( rs.getString( 3 ) );
                usr.setFirstname( rs.getString( 4 ) );
                usr.setLastname( rs.getString( 5 ) );
                usr.setLocale( LocaleHelper.getLocale( rs.getString( 6 ), null ) );

                return usr;
            }
            else
            {
View Full Code Here

TOP

Related Classes of net.sf.jportlet.impl.UserImpl

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.