extensions/net.sf.basedb.examples/trunk/resources/filter_annotated.jsp

Code
Comments
Other
Rev Date Author Line
1391 15 Sep 11 nicklas 1 <%-- 
1391 15 Sep 11 nicklas 2   Copyright (C) 2011 Nicklas Nordborg
1391 15 Sep 11 nicklas 3
1391 15 Sep 11 nicklas 4   This file is part of the Example Code Package for BASE.
1391 15 Sep 11 nicklas 5   Available at http://baseplugins.thep.lu.se/
1391 15 Sep 11 nicklas 6   BASE main site: http://base.thep.lu.se/
1391 15 Sep 11 nicklas 7   
1391 15 Sep 11 nicklas 8   This is free software; you can redistribute it and/or
1391 15 Sep 11 nicklas 9   modify it under the terms of the GNU General Public License
1391 15 Sep 11 nicklas 10   as published by the Free Software Foundation; either version 3
1391 15 Sep 11 nicklas 11   of the License, or (at your option) any later version.
1391 15 Sep 11 nicklas 12   
1391 15 Sep 11 nicklas 13   The software is distributed in the hope that it will be useful,
1391 15 Sep 11 nicklas 14   but WITHOUT ANY WARRANTY; without even the implied warranty of
1391 15 Sep 11 nicklas 15   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1391 15 Sep 11 nicklas 16   GNU General Public License for more details.
1391 15 Sep 11 nicklas 17   
1391 15 Sep 11 nicklas 18   You should have received a copy of the GNU General Public License
1391 15 Sep 11 nicklas 19   along with BASE. If not, see <http://www.gnu.org/licenses/>.
1391 15 Sep 11 nicklas 20 --%>
1027 07 Apr 09 nicklas 21 <%@ page
1027 07 Apr 09 nicklas 22   pageEncoding="UTF-8"
1027 07 Apr 09 nicklas 23   session="false"
1019 03 Apr 09 nicklas 24   import="net.sf.basedb.core.SessionControl"
1019 03 Apr 09 nicklas 25   import="net.sf.basedb.core.ItemContext"
1019 03 Apr 09 nicklas 26   import="net.sf.basedb.core.Item"
1019 03 Apr 09 nicklas 27   import="net.sf.basedb.core.PropertyFilter"
1019 03 Apr 09 nicklas 28   import="net.sf.basedb.core.Operator"
1019 03 Apr 09 nicklas 29   import="net.sf.basedb.util.Values"
1019 03 Apr 09 nicklas 30   import="net.sf.basedb.clients.web.Base"
1019 03 Apr 09 nicklas 31   import="net.sf.basedb.clients.web.util.HTML"
1019 03 Apr 09 nicklas 32   import="java.util.Date"
1019 03 Apr 09 nicklas 33 %>
1019 03 Apr 09 nicklas 34 <%@ taglib prefix="base" uri="/WEB-INF/base.tld" %>
1019 03 Apr 09 nicklas 35 <%
1019 03 Apr 09 nicklas 36 final SessionControl sc = Base.getExistingSessionControl(pageContext, true);
1019 03 Apr 09 nicklas 37 final String ID = sc.getId();
1019 03 Apr 09 nicklas 38 final Item itemType = Item.valueOf(request.getParameter("item_type"));
1019 03 Apr 09 nicklas 39 final ItemContext cc = sc.getCurrentContext(itemType);
1019 03 Apr 09 nicklas 40 final PropertyFilter annotationFilter = cc.getPropertyFilter("annotationSet");
1019 03 Apr 09 nicklas 41 final Operator operator = annotationFilter == null ? 
1019 03 Apr 09 nicklas 42     null : annotationFilter.getOperator();
1019 03 Apr 09 nicklas 43 try
1019 03 Apr 09 nicklas 44 {
1019 03 Apr 09 nicklas 45   %>
2205 29 Jan 14 nicklas 46   <base:page type="popup" title="Annotation filter" id="annotation-filter">
2205 29 Jan 14 nicklas 47   <base:head scripts="~scripts/common.js" />
1019 03 Apr 09 nicklas 48   <base:body>
1537 16 Feb 12 nicklas 49     <h1>Annotation filter</h1>
1537 16 Feb 12 nicklas 50     
1019 03 Apr 09 nicklas 51     <form name="filter">
1537 16 Feb 12 nicklas 52     <div class="content bottomborder">
1537 16 Feb 12 nicklas 53       <table class="fullform smaller">
1537 16 Feb 12 nicklas 54       <tr class="dynamic">
1537 16 Feb 12 nicklas 55         <th>Filter</th>
1537 16 Feb 12 nicklas 56         <td>
2205 29 Jan 14 nicklas 57           <label><input type="radio" name="what" value="<>" 
1537 16 Feb 12 nicklas 58             <%=operator == Operator.NEQ ? "checked" : "" %>
2205 29 Jan 14 nicklas 59             >Show only items with annotations</label><br>
2205 29 Jan 14 nicklas 60           <label><input type="radio" name="what" value="=" 
1537 16 Feb 12 nicklas 61             <%=operator == Operator.EQ ? "checked" : "" %>
2205 29 Jan 14 nicklas 62             >Show only item without annotations</label><br>
2205 29 Jan 14 nicklas 63           <label><input type="radio" name="what" value="" 
1537 16 Feb 12 nicklas 64             <%=operator == null ? "checked" : "" %>
2205 29 Jan 14 nicklas 65             >Show all items</label><br>
1537 16 Feb 12 nicklas 66         </td>
1537 16 Feb 12 nicklas 67       </tr>
1537 16 Feb 12 nicklas 68       </table>
1019 03 Apr 09 nicklas 69     </div>
1019 03 Apr 09 nicklas 70     </form>
1537 16 Feb 12 nicklas 71     
1537 16 Feb 12 nicklas 72     <base:buttongroup subclass="dialogbuttons">
2205 29 Jan 14 nicklas 73       <base:button id="btnOk" title="Ok" />
2205 29 Jan 14 nicklas 74       <base:button id="close" title="Cancel" />
1537 16 Feb 12 nicklas 75     </base:buttongroup>
1019 03 Apr 09 nicklas 76   </base:body>
1019 03 Apr 09 nicklas 77   </base:page>
1019 03 Apr 09 nicklas 78   <%
1019 03 Apr 09 nicklas 79 }
1019 03 Apr 09 nicklas 80 finally
1019 03 Apr 09 nicklas 81 {
1019 03 Apr 09 nicklas 82   
1019 03 Apr 09 nicklas 83 }
1019 03 Apr 09 nicklas 84 %>