Package com.tap5.hotelbooking.components

Source Code of com.tap5.hotelbooking.components.Workspace

package com.tap5.hotelbooking.components;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.List;

import org.apache.tapestry5.Link;
import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.annotations.SessionState;
import org.apache.tapestry5.ioc.annotations.Inject;
import org.apache.tapestry5.services.PageRenderLinkSource;

import com.tap5.hotelbooking.data.UserWorkspace;
import com.tap5.hotelbooking.entities.Booking;

/**
* Display the list of current booking that has not been confirmed yet. You can click on displayed
* link to continue
*
* @author ccordenier
* @author karesti
*/
public class Workspace
{
    @SuppressWarnings("unused")
    @Property
    private DateFormat format = new SimpleDateFormat("MM/dd/yyyy");

    @SessionState
    @Property
    private UserWorkspace userWorkspace;

    @Inject
    private PageRenderLinkSource linkSource;

    @Property
    private Booking current;

    public List<Booking> getBookings()
    {
        return userWorkspace.getNotConfirmed();
    }

    public Link getBookLink()
    {
        Link result = linkSource.createPageRenderLinkWithContext("book", current.getHotel());
        return result;
    }

    public boolean getIsCurrent()
    {
        return current.equals(userWorkspace.getCurrent().equals(current));
    }
}
TOP

Related Classes of com.tap5.hotelbooking.components.Workspace

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.