Package org.apache.tapestry.vlib.ejb

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


            public Object doRemote() throws RemoteException
            {

                try
                {
                    Person person = getOperations().login(getEmail(), password);

                    loginUser(person);

                    return null;
                }
View Full Code Here


        Iterator i = valueSet.iterator();
        int index = 0;

        while (i.hasNext())
        {
            Person person = (Person) i.next();

            result[index++] = person.getId();
        }

        return result;
    }
View Full Code Here

    @Message
    public abstract String transferedBooks(int count, String fromName, String toName);

    public void activate(Integer fromUserId, Integer toUserId)
    {
        Person fromUser = getRemoteTemplate().getPerson(fromUserId);

        IPropertySelectionModel model = buildUserBookModel(fromUser);

        if (model.getOptionCount() == 0)
        {
            TransferBooksSelect page = getSelectPage();
            page.setError(userHasNoBooks(fromUser.getNaturalName()));
            return;
        }

        setFromUserId(fromUserId);
        setFromUser(fromUser);
View Full Code Here

     * toUser and userBookModel properties at the start of each request cycle.
     */

    public void pageBeginRender(PageEvent event)
    {
        Person fromUser = getFromUser();

        if (fromUser == null)
        {
            fromUser = getRemoteTemplate().getPerson(getFromUserId());
            setFromUser(fromUser);
        }

        if (getUserBookModel() == null)
            setUserBookModel(buildUserBookModel(fromUser));

        Person toUser = getToUser();
        if (toUser == null)
        {
            toUser = getRemoteTemplate().getPerson(getToUserId());
            setToUser(toUser);
        }
View Full Code Here

    public IPage formSubmit()
    {
        List selectedBooks = getSelectedBooks();

        final Integer[] keys = (Integer[]) selectedBooks.toArray(new Integer[0]);
        final Person toUser = getToUser();

        RemoteCallback callback = new RemoteCallback()
        {
            public Object doRemote() throws RemoteException
            {
                try
                {
                    getOperations().transferBooks(toUser.getId(), keys);
                }
                catch (FinderException ex)
                {
                    throw new ApplicationRuntimeException(ex);
                }

                return null;
            }
        };

        getRemoteTemplate().execute(callback, "Unable to transfer ownership of books.");

        Person fromUser = getFromUser();

        TransferBooksSelect selectPage = getSelectPage();

        selectPage.setMessage(transferedBooks(keys.length, fromUser.getNaturalName(), toUser
                .getNaturalName()));

        return selectPage;
    }
View Full Code Here

    {
        Connection connection = null;
        IStatement statement = null;
        ResultSet set = null;

        Person result = null;

        try
        {
            connection = getConnection();
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()));
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++)
View Full Code Here

        columns[Person.EMAIL_COLUMN] = set.getString(column++);
        columns[Person.LOCKED_OUT_COLUMN] = getBoolean(set, column++);
        columns[Person.ADMIN_COLUMN] = getBoolean(set, column++);
        columns[Person.LAST_ACCESS_COLUMN] = set.getTimestamp(column++);

        return new Person(columns);
    }
View Full Code Here

     *
     **/

    public Person readPerson(Integer personId)
    {
        Person result = null;

        int i = 0;
        while (true)
        {
            IOperations operations = getOperations();
View Full Code Here

TOP

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

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.