source: trunk/www/common/columns/add_parent_column.jsp @ 7773

Last change on this file since 7773 was 7773, checked in by Nicklas Nordborg, 2 years ago

References #2202: Include information from parent items in list pages

Implemented a simple dialog for selecting parent item columns. It currently allows selecting to display the name of a parent item or any annotation that is attached to it. It can probably be improved a bit more.

File size: 3.3 KB
Line 
1<%-- $Id: save_preset.jsp 6607 2014-11-19 14:52:20Z nicklas $
2  ------------------------------------------------------------------
3  Copyright (C) 2020 Nicklas Nordborg
4
5  This file is part of BASE - BioArray Software Environment.
6  Available at http://base.thep.lu.se/
7
8  BASE is free software; you can redistribute it and/or
9  modify it under the terms of the GNU General Public License
10  as published by the Free Software Foundation; either version 3
11  of the License, or (at your option) any later version.
12
13  BASE is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  GNU General Public License for more details.
17
18  You should have received a copy of the GNU General Public License
19  along with BASE. If not, see <http://www.gnu.org/licenses/>.
20  ------------------------------------------------------------------
21
22--%>
23<%@ page pageEncoding="UTF-8" session="false"
24  import="net.sf.basedb.core.SessionControl"
25  import="net.sf.basedb.core.Item"
26  import="net.sf.basedb.core.SyncFilter.SourceItemTransform"
27  import="net.sf.basedb.clients.web.Base"
28  import="net.sf.basedb.clients.web.util.HTML"
29  import="net.sf.basedb.util.Values"
30  import="net.sf.basedb.util.listable.SourceItemTransformerFactory"
31  import="net.sf.basedb.util.listable.ListableUtil"
32  import="java.util.List"
33%>
34<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %>
35<%
36final SessionControl sc = Base.getExistingSessionControl(pageContext, true);
37final String ID = sc.getId();
38final Item itemType = Item.valueOf(request.getParameter("item_type"));
39
40SourceItemTransformerFactory factory = ListableUtil.getTransformerFactory(itemType);
41List<Item> allowedParentItems = factory.getSupportedSourceItems(SourceItemTransform.PARENT_TO_CHILD);
42%>
43<base:page type="popup" title="Add parent item column">
44<base:head scripts="~add_parent_column.js" />
45<base:body>
46  <h1>Add parent item column <base:help helpid="columns.configure.add_parent_column" /></h1>
47
48  <form name="parents" method="post">
49  <input type="hidden" name="ID" value="<%=ID%>">
50  <input type="hidden" name="item_type" value="<%=itemType.name()%>">
51 
52  <div class="content">
53    <table class="fullform input100 smaller bottomborder">
54    <tr>
55      <th>Parent type</th>
56      <td>
57        <select name="parentType" id="parentType" style="min-width: 15em;">
58          <option value="">- select -
59          <%
60          for (Item parentType : allowedParentItems)
61          {
62            %>
63            <option value="<%=parentType.name()%>"><%=parentType.toString()%>
64            <%
65          }
66          %>
67        </select>
68      </td>
69    </tr>
70    <tr>
71      <th>Subtype</th>
72      <td>
73        <select name="subtype" id="subtype" style="min-width: 15em;">
74          <option value="">- select -
75        </select>
76        <label><input type="checkbox" id="showAllAnnotationTypes" name="showAllAnnotationTypes">Show annotation types for all subtypes</label>
77      </td>
78    </tr>
79    <tr class="dynamic">
80      <th>Column</th>
81      <td>
82        <select name="column" id="column" style="min-width: 25em; height: calc(100% - 3em);" multiple>
83        </select>
84      </td>
85    </tr>
86    </table>
87  </div>
88  </form>
89
90  <base:buttongroup subclass="dialogbuttons">
91    <base:button id="btnAdd" title="Add" />
92    <base:button id="close" title="Close" />
93  </base:buttongroup>
94
95</base:body>
96</base:page>
97
98
Note: See TracBrowser for help on using the repository browser.