Package org.apache.tapestry.vlib.ejb

Examples of org.apache.tapestry.vlib.ejb.IPerson


    public void updatePerson(Integer personId, Map attributes)
        throws FinderException, RemoteException
    {
        IPersonHome home = getPersonHome();

        IPerson person = home.findByPrimaryKey(personId);

        person.updateEntityAttributes(attributes);
    }
View Full Code Here


    public Person login(String email, String password)
        throws RemoteException, LoginException
    {
        IPersonHome home = getPersonHome();
        IPerson person = null;
        Person result = null;

        try
        {
            person = home.findByEmail(email);
        }
        catch (FinderException ex)
        {
            throw new LoginException("Unknown e-mail address.", false);
        }

        if (!person.getPassword().equals(password))
            throw new LoginException("Invalid password.", true);

        try
        {
            result = getPerson((Integer) person.getPrimaryKey());
        }
        catch (FinderException ex)
        {
            throw new LoginException("Could not read person.", false);
        }

        if (result.isLockedOut())
            throw new LoginException(
                    "You have been locked out of the Virtual Library.", false);

        // Set the last access time for any subsequent login.

        person.setLastAccess(new Timestamp(System.currentTimeMillis()));

        return result;
    }
View Full Code Here

    public Map getPersonAttributes(Integer personId)
        throws FinderException, RemoteException
    {
        IPersonHome home = getPersonHome();

        IPerson person = home.findByPrimaryKey(personId);

        return person.getEntityAttributes();
    }
View Full Code Here

        attributes.put("firstName", firstName.trim());
        attributes.put("email", email.trim());
        attributes.put("password", password.trim());
        attributes.put("lastAccess", new Timestamp(System.currentTimeMillis()));

        IPerson person = home.create(attributes);

        Integer personId = (Integer) person.getPrimaryKey();

        try
        {
            return getPerson(personId);
        }
View Full Code Here

        int count = Tapestry.size(updated);

        for(int i = 0; i < count; i++)
        {
            Person u = updated[i];
            IPerson person = home.findByPrimaryKey(u.getId());

            person.setAdmin(u.isAdmin());
            person.setLockedOut(u.isLockedOut());
        }

        count = Tapestry.size(resetPassword);

        for(int i = 0; i < count; i++)
        {
            IPerson person = home.findByPrimaryKey(resetPassword[i]);

            person.setPassword(newPassword);
        }

        count = Tapestry.size(deleted);

        if (count > 0)
View Full Code Here

    public void updatePerson(Integer personId, Map attributes) throws FinderException,
            RemoteException
    {
        IPersonHome home = getPersonHome();

        IPerson person = home.findByPrimaryKey(personId);

        person.updateEntityAttributes(attributes);
    }
View Full Code Here

    }

    public Person login(String email, String password) throws RemoteException, LoginException
    {
        IPersonHome home = getPersonHome();
        IPerson person = null;
        Person result = null;

        try
        {
            person = home.findByEmail(email);
        }
        catch (FinderException ex)
        {
            throw new LoginException("Unknown e-mail address.", false);
        }

        if (!person.getPassword().equals(password))
            throw new LoginException("Invalid password.", true);

        try
        {
            result = getPerson((Integer) person.getPrimaryKey());
        }
        catch (FinderException ex)
        {
            throw new LoginException("Could not read person.", false);
        }

        if (result.isLockedOut())
            throw new LoginException("You have been locked out of the Virtual Library.", false);

        // Set the last access time for any subsequent login.

        person.setLastAccess(new Timestamp(System.currentTimeMillis()));

        return result;
    }
View Full Code Here

    public Map getPersonAttributes(Integer personId) throws FinderException, RemoteException
    {
        IPersonHome home = getPersonHome();

        IPerson person = home.findByPrimaryKey(personId);

        return person.getEntityAttributes();
    }
View Full Code Here

        attributes.put("firstName", firstName.trim());
        attributes.put("email", email.trim());
        attributes.put("password", password.trim());
        attributes.put("lastAccess", new Timestamp(System.currentTimeMillis()));

        IPerson person = home.create(attributes);

        Integer personId = (Integer) person.getPrimaryKey();

        try
        {
            return getPerson(personId);
        }
View Full Code Here

        int count = Tapestry.size(updated);

        for (int i = 0; i < count; i++)
        {
            Person u = updated[i];
            IPerson person = home.findByPrimaryKey(u.getId());

            person.setAdmin(u.isAdmin());
            person.setLockedOut(u.isLockedOut());
        }

        count = Tapestry.size(resetPassword);

        for (int i = 0; i < count; i++)
        {
            IPerson person = home.findByPrimaryKey(resetPassword[i]);

            person.setPassword(newPassword);
        }

        count = Tapestry.size(deleted);

        if (count > 0)
View Full Code Here

TOP

Related Classes of org.apache.tapestry.vlib.ejb.IPerson

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.