Package org.apache.tapestry.vlib.ejb

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


    {
        VirtualLibraryEngine vengine = (VirtualLibraryEngine) getEngine();

        Integer targetUserId = getTargetUserId();

        Person target = vengine.readPerson(targetUserId);

        List selectedBooks = getSelectedBooks();

        int count = Tapestry.size(selectedBooks);

        if (count == 0)
        {
            setError(format("select-at-least-one-book", target.getNaturalName()));
            return;
        }

        Integer[] bookIds = (Integer[]) selectedBooks.toArray(new Integer[count]);

        int i = 0;
        while (true)
        {
            IOperations operations = vengine.getOperations();

            try
            {
                operations.transferBooks(targetUserId, bookIds);

                break;
            }
            catch (FinderException ex)
            {
                throw new ApplicationRuntimeException(ex);
            }
            catch (RemoteException ex)
            {
                vengine.rmiFailure(getMessage("update-failure"), ex, i++);
            }
        }

        MyLibrary myLibrary = (MyLibrary) cycle.getPage("MyLibrary");

        myLibrary.setMessage(format("transfered-books", Integer.toString(count), target
                .getNaturalName()));

        myLibrary.activate();
    }
View Full Code Here


        EntitySelectionModel result = new EntitySelectionModel();

        for (i = 0; i < persons.length; i++)
        {

            Person p = persons[i];
            Integer pk = p.getId();

            if (pk.equals(userPK))
                continue;

            result.add(pk, p.getNaturalName());
        }

        return result;
    }
View Full Code Here

    {
        VirtualLibraryEngine vengine = (VirtualLibraryEngine) getEngine();

        Integer targetUserId = getTargetUserId();

        Person target = vengine.readPerson(targetUserId);

        List selectedBooks = getSelectedBooks();

        int count = Tapestry.size(selectedBooks);

        if (count == 0)
        {
            setError(formatString("select-at-least-one-book", target.getNaturalName()));
            return;
        }

        Integer[] bookIds = (Integer[]) selectedBooks.toArray(new Integer[count]);

        int i = 0;
        while (true)
        {
            IOperations operations = vengine.getOperations();

            try
            {
                operations.transferBooks(targetUserId, bookIds);

                break;
            }
            catch (FinderException ex)
            {
                throw new ApplicationRuntimeException(ex);
            }
            catch (RemoteException ex)
            {
                vengine.rmiFailure(getMessage("update-failure"), ex, i++);
            }
        }

        MyLibrary myLibrary = (MyLibrary) cycle.getPage("MyLibrary");

        myLibrary.setMessage(
            format("transfered-books", Integer.toString(count), target.getNaturalName()));

        myLibrary.activate(cycle);
    }
View Full Code Here

        EntitySelectionModel result = new EntitySelectionModel();

        for (i = 0; i < persons.length; i++)
        {

            Person p = persons[i];
            Integer pk = p.getId();

            if (pk.equals(userPK))
                continue;

            result.add(pk, p.getNaturalName());
        }

        return result;
    }
View Full Code Here

    public void synchronizeUser(IRequestCycle cycle)
    {
        UserListEditMap map = getListEditMap();

        Person user = (Person) map.getValue();

        if (user == null)
        {
            setError(getMessage("out-of-date"));
            throw new PageRedirectException(this);
View Full Code Here

                "Error executing owner query.");
    }

    public void pageBeginRender(PageEvent event)
    {
        Person person = getPerson();

        if (person == null)
        {
            person = getRemoteTemplate().getPerson(getPersonId());
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

    public void testGetPerson() throws Exception
    {
        Integer personId = new Integer(33);

        IOperations operations = newOperations();
        Person person = new Person(new Object[Person.NUM_COLUMNS]);

        expect(operations.getPerson(personId)).andReturn(person);

        replayControls();
View Full Code Here

            public Object doRemote()
                throws RemoteException
            {
                try
                {
                    Person user = getOperations().registerNewUser(
                            getFirstName(), getLastName(), getEmail(),
                            password1);

                    getLogin().loginUser(user);
View Full Code Here

                throws RemoteException
            {

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

                    loginUser(person);

                    return null;
                }
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.