Package org.apache.tapestry.vlib.ejb

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


            return true;

        // If the user is logged in, they can borrow it if they are
        // not already holding it and aren't the owner.

        Book book = getBook();

        // If the book is not lendable, then disable the link.

        if (!book.isLendable())
            return true;

        // Otherwise, disabled the link if already holding it.

        return visit.isLoggedInUser(book.getHolderId());
    }
View Full Code Here


        {
            public Object remoteCallback() throws RemoteException
            {
                try
                {
                    Book book = getOperations().borrowBook(bookId, visit.getUserId());

                    home.setMessage(borrowedBook(book.getTitle()));

                    return null;
                }
                catch (BorrowException ex)
                {
View Full Code Here

        while (true)
        {
            try
            {
                IOperations operations = vengine.getOperations();
                Book book = operations.returnBook(bookId);

                setMessage(format("returned-book", book.getTitle()));

                break;
            }
            catch (FinderException ex)
            {
View Full Code Here

        while (true)
        {
            try
            {
                IOperations operations = vengine.getOperations();
                Book book = operations.getBook(bookId);

                setBookTitle(book.getTitle());

                break;
            }
            catch (FinderException ex)
            {
View Full Code Here

    {
        Object[] parameters = cycle.getServiceParameters();
        Integer bookPK = (Integer) parameters[0];

        VirtualLibraryEngine vengine = (VirtualLibraryEngine) getEngine();
        Book book = null;

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

                book = operations.deleteBook(bookPK);

                break;
            }
            catch (RemoveException ex)
            {
                throw new ApplicationRuntimeException(ex);
            }
            catch (RemoteException ex)
            {
                vengine.rmiFailure("Remote exception deleting book #" + bookPK + ".", ex, i++);
            }
        }

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

        myLibrary.setMessage(format("book-deleted", book.getTitle()));

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

        VirtualLibraryEngine vengine = (VirtualLibraryEngine) getEngine();
        IOperations operations = vengine.getOperations();

        try
        {
            Book book = operations.returnBook(bookPK);

            setMessage(format("returned-book", book.getTitle()));

            runQuery();
        }
        catch (FinderException ex)
        {
View Full Code Here

            return true;

        // If the user is logged in, they can borrow it if they are
        // not already holding it and aren't the owner.

        Book book = getBook();

        // If the book is not lendable, then disable the link.

        if (!book.isLendable())
            return true;

        // Otherwise, disabled the link if already holding it.

        return visit.isLoggedInUser(book.getHolderId());
    }
View Full Code Here

        while (true)
        {
            try
            {
                IOperations bean = vengine.getOperations();
                Book book = bean.borrowBook(bookPK, visit.getUserId());

                home.setMessage("Borrowed: " + book.getTitle());

                break;
            }
            catch (BorrowException ex)
            {
View Full Code Here

        List list = new ArrayList();
        Object[] columns = new Object[Book.N_COLUMNS];

        while (set.next())
        {
            Book book = convertRowToBook(set, columns);

            list.add(book);
        }

        _results = new Book[list.size()];
View Full Code Here

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

        Book result = null;

        try
        {
            connection = getConnection();
View Full Code Here

TOP

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

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.