<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@page contentType="text/html"%>
<%@page import="java.util.Collection" %>
<%@page import="java.util.Enumeration" %>
<%@page import="net.jini.core.lookup.ServiceItem" %>
<%@page import="net.jini.core.lookup.ServiceTemplate" %>
<%@page import="net.jini.core.lookup.ServiceRegistrar" %>
<%@page import="net.jini.core.entry.Entry" %>
<%@page import="net.jini.core.lookup.ServiceID" %>
<%@page import="net.jini.core.lookup.ServiceMatches" %>
<%@page import="net.jini.lookup.entry.ServiceType" %>
<%@page import="edu.columbia.print.ninja.core.AdminBean" %>
<%@page import="java.util.prefs.*"%>
<%@page import="java.io.*"%>
<%@page import="net.jini.print.lookup.AttributeEntry" %>
<%@page import="com.sun.rio.resources.client.*" %>
<%@ taglib prefix="sql" uri="http://java.sun.com/jstl/sql" %>


<jsp:useBean id="prix" scope="session" class="edu.columbia.print.ninja.core.AdminBean" />
<%
edu.columbia.print.ninja.core.AdminBean serviceBean = prix;
pageContext.setAttribute("properties", ResourceBundle.getBundle("edu.columbia.print.ninja.prix.resource"));
%>
<c:set var="alias">/prix</c:set>

<html>
<head>
<title><c:out value="${alias}"/></title>
<STYLE>
.popup
{
COLOR: #9F141A;
CURSOR: help;
TEXT-DECORATION: none
}
</STYLE>
</head>
<% if(request.getParameter("view")==null) { %>
    <FRAMESET cols="30%,70%" framespacing="1" border="1">
    <FRAME SRC="<c:out value='${alias}'/>/selector.jsp?view=lookup" name="nav">
    <FRAME SRC="<c:out value='${alias}'/>/main.html" name="main" scrolling="auto">
    </FRAMESET>
<%}
else {%>
    <%@include file="include/watch_list.jsp"%>
    <%@include file="include/get_uri.jsp"%>
    <c:choose>
        <c:when test="${param.view=='main'}">
			<FRAMESET rows="10%,90%" framespacing="1" border="1">
			<FRAME src="<c:out value='${alias}'/>/selector.jsp?view=name&uri=<c:out value='${param.uri}'/>" name="main1">
			<c:choose>
				<c:when test="${param.next=='http'}">
					<c:set var="src" value="${param.uri}"/>
				</c:when>
				<c:otherwise>
					<c:if test="${!empty param.sid}">
					<%
						StringTokenizer t = new StringTokenizer(request.getParameter("sid"), "|");
						serviceBean.setServiceContext(new ServiceID(Long.parseLong(t.nextToken()), Long.parseLong(t.nextToken())));
					%>
					</c:if>
					<c:set var="src"><c:out value='${alias}'/>/selector.jsp?view=<c:out value='${param.next}'/></c:set>
				</c:otherwise>
			</c:choose>
			<FRAME src="<c:out value='${src}'/>" name="main2" scrolling="auto">
			</FRAMESET>

        </c:when>
        <c:when test="${param.view=='name'}">
		    <body>
			<h2><c:out value="${param.uri}"/></h2>
		    </body>
        </c:when>
        <c:when test="${param.view=='lookup'}">
		    <body>
            <%@include file="lookup.jsp"%>
		    </body>
        </c:when>
        <c:when test="${param.view=='configure'}">
		    <body>
            <%@include file="configure.jsp"%>
		    </body>
        </c:when>
        <c:when test="${param.view=='monitor'}">
		    <body>
            <%@include file="monitor.jsp"%>
		    </body>
        </c:when>
        <c:when test="${param.view=='listing'}">
		    <body>
            <%@include file="listing.jsp"%>
		    </body>
        </c:when>
        <c:when test="${param.view=='history'}">
		    <body>
            <%@include file="history.jsp"%>
		    </body>
        </c:when>
    </c:choose>
<%}%>

</html>
