Examples of Visit


Examples of org.apache.tapestry.vlib.Visit

    private static final long ONE_WEEK_MILLIS = 1000l * 60l * 60l * 24l * 7l;

    public boolean isNewlyAdded()
    {
        IEngine engine = getPage().getEngine();
        Visit visit = (Visit) engine.getVisit();
        Timestamp lastAccess = null;

        if (visit != null)
            lastAccess = visit.getLastAccess();

    Book book = getBook();

        Timestamp dateAdded = book.getDateAdded();

View Full Code Here

Examples of org.apache.tapestry.vlib.Visit

    }

    public boolean isLoggedIn()
    {
        IEngine engine = getPage().getEngine();
        Visit visit = (Visit) engine.getVisit();

        if (visit == null)
            return false;

        return visit.isUserLoggedIn();
    }
View Full Code Here

Examples of org.apache.tapestry.vlib.Visit

    }

    public boolean isAdmin()
    {
        IEngine engine = getPage().getEngine();
        Visit visit = (Visit) engine.getVisit();

        if (visit == null)
            return false;

        IRequestCycle cycle = getPage().getRequestCycle();

        return visit.isUserLoggedIn() && visit.getUser(cycle).isAdmin();
    }
View Full Code Here

Examples of org.apache.tapestry.vlib.Visit

        page.activate(cycle);
    }

    public void login(IRequestCycle cycle)
    {
        Visit visit = (Visit) cycle.getEngine().getVisit();

        if (visit != null && visit.isUserLoggedIn())
            return;

        ICallback callback = new PageCallback(getPage().getPageName());
        Login loginPage = (Login) cycle.getPage("Login");
        loginPage.setCallback(callback);
View Full Code Here

Examples of org.apache.tapestry.vlib.Visit

        runQuery();
    }

    private void runQuery()
    {
        Visit visit = (Visit) getVisit();
        Integer userId = visit.getUserId();

        VirtualLibraryEngine vengine = (VirtualLibraryEngine) getEngine();

        SortOrdering ordering = new SortOrdering(getSortColumn(), isDescending());
View Full Code Here

Examples of org.apache.tapestry.vlib.Visit

{
    public abstract Book getBook();

    public boolean isLinkDisabled()
    {
        Visit visit = (Visit) getPage().getVisit();

        if (!visit.isUserLoggedIn())
            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

Examples of org.apache.tapestry.vlib.Visit

    public void borrow(IRequestCycle cycle)
    {
        Object[] parameters = cycle.getServiceParameters();
        Integer bookPK = (Integer) parameters[0];

        Visit visit = (Visit) getPage().getVisit();
        Home home = (Home) cycle.getPage("Home");
        VirtualLibraryEngine vengine = (VirtualLibraryEngine)cycle.getEngine();

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

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

                break;
            }
View Full Code Here

Examples of org.apache.tapestry.vlib.Visit

    private static final long ONE_WEEK_MILLIS = 1000l * 60l * 60l * 24l * 7l;

    public boolean isNewlyAdded()
    {
        IEngine engine = getPage().getEngine();
        Visit visit = (Visit) engine.getVisit();
        Timestamp lastAccess = null;

        if (visit != null)
            lastAccess = visit.getLastAccess();

    Book book = getBook();

        Timestamp dateAdded = book.getDateAdded();

View Full Code Here

Examples of org.apache.tapestry.workbench.Visit

    private static String[] _tabOrder;

    public void pageBeginRender(PageEvent event)
    {
        Visit visit = (Visit) getPage().getEngine().getVisit(event.getRequestCycle());

        setActivePageName(visit.getActiveTabName());

        if (_tabOrder == null)
        {
            String tabOrderValue = getMessages().getMessage("tabOrder");
View Full Code Here

Examples of org.apache.tapestry.workbench.Visit

        return getAsset(name);
    }

    public void selectPage(IRequestCycle cycle, String newPageName)
    {
        Visit visit = (Visit) getPage().getEngine().getVisit(cycle);

        visit.setActiveTabName(newPageName);

        cycle.activate(newPageName);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.