Note: Robocode Repository is now back up on a temporary server until the new Rails-based site is ready.
Source: Bots List: JSP Page
<%--
     $RCSfile: BotList.jsp,v $
    $Revision: 1.2 $
        $Date: 2001/09/05 03:19:10 $
      $Author: dan $
      Company: Developer Forge
    Copyright: Copyright (c) 2001

  Main Author: Dan Lynn

  [Top-Level Page]

  This page allows the user to search for bots.  It also allows the
  user to initiate the creation of a new bot or edit bots in the list.  Clicking
  on the bot name will take you to the bot detail page where the bot can be
  viewed or edited if the current user is the author of the bot.  Clicking on
  the author name in the list will trigger a search for all the bots uploaded by
  that author.  Clicking the 'New' button will go to the Bot Detail page and
  allow a new bot to be entered and uploaded.

  Note that the search results depend on whether or not the user is logged in.
  If the user is not logged-in then only bots that are publicly accessible will
  appear in the search results.  If the user is logged-in then all public bots
  and also any bots acceessible to a tribe that the user is a member of will be
  displayed.  If the current user is an Admin then all bots that match the
  search criteria will be displayed.
--%>


<%@ page
  errorPage="error.jsp"
  import="com.df.servlet.jsp.*,com.df.servlet.jsp.table.*"
%>
<%@ taglib uri="taglib.tld" prefix="df" %>


<%@ include file="Global.jsp"%>
<%-- Instantiate PageBean before pageAccess so that PageBean's pageAccess() method will be called --%>
<jsp:useBean id="botList" class="com.robocode.apps.repository.pagebeans.BotList" scope="session" />
<df:pageAccess controller="<%= controller %>" />
<%
  pageTitle = "Bots: List";
  navBarHiliteName = "Public Bots"; // name of button in nav bar to hilite
  bodyOnLoad = "document.form.botName.focus();document.form.botName.select()";
%>
<%@ include file="FrameTop.jsp" %>


<%-- Page Start ---------------------------------------------------------- --%>
<link rel="stylesheet" type="text/css" href="css/general.css">
<table class="data" width="100%" height="100%" cellspacing="0" cellpadding="0" border="0">
  <tr height="100%">
    <td height="100%" width="100%" valign="top">
<%-- Page Title ---------------------------------------------------------- --%>
      <table class="pageBorder" width="100%" border="0" cellspacing="0" cellpadding="0">
        <TR>
          <TD class="pageBorder"><%= pageTitle %></TD>
          <TD align="right">
            <table border="0" cellspacing="5" cellpadding="0">
              <tr>
                <td class="button"><A HREF='<%= FrameworkUtils.getButtonSubmit("newBot") %>'> New </A></td>
              </tr>
            </table>
          </TD>
        </TR>
      </table>
<%-- Filter -------------------------------------------------------------- --%>
      <TABLE class="filter" width="100%" border="0" cellspacing="0" cellpadding="10">
        <TR>
          <TD>
            <TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
              <TR>
                <TD class="filterTitle" nowrap>Filters:</TD>
              </TR>
              <TR>
                <TD nowrap align="right" width="160">Bot Name: </TD>
                <TD width="100" align="left">
                  <input type="text" name="botName" value='<df:getProperty pageBean="<%= botList %>" property="botName" />' onKeyPress="if (event.keyCode == 13) {form.action.value='search';form.submit();return false}">
                </TD>
              </TR>
              <TR>
                <TD nowrap align="right" width="160">Author: </TD>
                <TD width="100" align="left">
                  <input type="text" name="authorName" value='<df:getProperty pageBean="<%= botList %>" property="authorName" />' onKeyPress="if (event.keyCode == 13) {form.action.value='search';form.submit();return false}">
                </TD>
              </TR>
              <TR>
                <TD nowrap align="right">Since Date: </TD>
                <TD width="100" align="left">
                  <input type="text" name="uploadDate" value='<df:getProperty pageBean="<%= botList %>" property="uploadDate" />' onKeyPress="if (event.keyCode == 13) {form.action.value='search';form.submit();return false}">
                </TD>
                <TD class="invalidField">
                  <df:validationMessages pageBean="<%= botList %>" property="uploadDate" />
                </TD>
                <td align="right">
                  <table border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td class="button"><A HREF='<%= FrameworkUtils.getButtonSubmit("search") %>'> Search </A></td>
                    </tr>
                  </table>
                </td>
              </TR>
            </TABLE>
          </TD>
        </TR>
      </TABLE>
<%-- Results ------------------------------------------------------------- --%>
      <df:table
        id="botTable"
        model='<%= botList.getResults() %>'
      >
        <TABLE class="data" width="100%" border="0" cellspacing="0" cellpadding="0">
          <TR>
            <TH class="resultHeading" width="150" nowrap align="left">Name <span class="columnInstructions">(Click to View)</span></TH>
            <TH class="resultHeading" width="150" nowrap align="left">Author <span class="columnInstructions">(Click to Search)</span></TH>
            <TH class="resultHeading" width="150" nowrap align="left">Upload Date</TH>
            <TH class="resultHeading" width="100%" nowrap align="left">Downloads</TH>
          </TR>
          <TR>
            <TD><df:field name="botName" linked="true" /></TD>
            <TD><df:field name="authorName" linked="true" /></TD>
            <TD><df:field name="uploadDate" /></TD>
            <TD><df:field name="downloads" /></TD>
          </TR>
          <TR class="alternateRow">
            <TD><df:field name="botName" linked="true" /></TD>
            <TD><df:field name="authorName" linked="true" /></TD>
            <TD><df:field name="uploadDate" /></TD>
            <TD><df:field name="downloads" /></TD>
          </TR>
        </TABLE>
      </df:table>
<%-- Results End --------------------------------------------------------- --%>
    </td>
  </tr>
</table>
<%-- Page End ------------------------------------------------------------ --%>

<%@ include file="FrameBottom.jsp" %>