openjpa/openjpa-examples/openbooks/web/header.jsp

117 lines
4.3 KiB
Plaintext

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%--
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
--%>
<!-- ========================================================================= -->
<!-- This layout page is included in every page of OpenBooks web application -->
<!-- The layout splits the screen into four divisions -->
<!-- header : a header section -->
<!-- left : houses the navigation menu items -->
<!-- content: houses JSP page content -->
<!-- footer : a footer section -->
<!-- This page has not properly closed its HTML or BODY tag. The tags are -->
<!-- closed by the footer page -->
<!-- ========================================================================= -->
<HTML>
<HEAD>
<title>OpenBooks: A sample JPA web application</title>
<link type="text/css" rel="stylesheet" href="openbooks.css">
<script type="text/javascript" src="openbooks.js"></script>
</HEAD>
<body>
<%!
/**
* Lookup keys for Session/Requeust data used throught pages.
*/
public static String KEY_USER = "user";
public static String KEY_SERVICE = "OpenBookService";
public static String KEY_CART = "cart";
public static String KEY_ACTION = "action";
public static String KEY_ISBN = "isbn";
public static String KEY_OID = "oid";
public static String ACTION_ADD = "add";
public static String ACTION_DELIVER = "deliver";
public static String ACTION_DETAILS = "details";
public static String PAGE_BOOKS = "query.jsp";
public static String PAGE_ORDERS = "orders.jsp";
public static String PAGE_CART = "cart.jsp";
public static String PAGE_HOME = "intro.jsp";
public static String PAGE_LOGIN = "register.jsp";
public static String PAGE_SEARCH = "search.jsp";
public static String PAGE_CHECKOUT = "checkout.jsp";
public static String FORM_TITLE = "title";
public static String FORM_AUTHOR = "title";
public static String FORM_PRICE_MAX = "maxPrice";
public static String FORM_PRICE_MIN = "minPrice";
%>
<!-- Header division displays the title and right-justified current user name -->
<!-- and a Shopping Cart icon for active sessions -->
<div id="header">
<table>
<colgroup>
<col align="left" width="75%">
<col align="right" width="25%">
</colgroup>
<TBODY>
<TR>
<TD><img src="images/OpenBooks.jpg" width="25px" height="25px" border="0"> OpenBooks</TD>
<TD>
<%
Object currentUser = session.getAttribute("user");
boolean activeSession = currentUser != null;
if (activeSession) {
%>
<A HREF="cart.jsp"><img src="images/Add2Cart.jpg" border="0" width="25px" height="25px"></A>
&nbsp;&nbsp; <%= currentUser.toString() %>
<%
}
%>
</TD>
</TR>
</TBODY>
</table>
</div>
<!-- Left menu navigation displays the items based on current session status -->
<!-- and a Shopping Cart icon for active sessions -->
<div id="left">
<ul>
<li><a href="intro.jsp">Login</a></li>
<%
if (activeSession) {
%>
<li><a href="search.jsp">Search/Buy Books</a></li>
<li><a href="orders.jsp">View Orders</a></li>
<%
}
%>
<li><a href="http://fisheye6.atlassian.com/browse/openjpa/trunk/openjpa-examples/openbooks/src/main/java/openbook/server/OpenBookService.java?r=HEAD"
target="_blank">
View Code</a></li>
</ul>
</div>