Project

General

Profile

1
<%@ page language="java"%>
2
<%@page import="org.ecoinformatics.sms.ontology.bioportal.OntologyService,org.ecoinformatics.sms.ontology.bioportal.OntologyBean,java.util.List"%>
3
<%@page import="org.ecoinformatics.sms.SMS,org.ecoinformatics.sms.ontology.Ontology"%>
4
<%
5
/**
6
 * 
7
 * '$RCSfile$'
8
 * Copyright: 2008 Regents of the University of California and the
9
 *             National Center for Ecological Analysis and Synthesis
10
 *    '$Author: leinfelder $'
11
 *      '$Date: 2010-09-07 11:39:22 -0700 (Tue, 07 Sep 2010) $'
12
 * '$Revision: 5539 $'
13
 * 
14
 * This program is free software; you can redistribute it and/or modify
15
 * it under the terms of the GNU General Public License as published by
16
 * the Free Software Foundation; either version 2 of the License, or
17
 * (at your option) any later version.
18
 * 
19
 * This program is distributed in the hope that it will be useful,
20
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22
 * GNU General Public License for more details.
23
     
24
 * You should have received a copy of the GNU General Public License
25
 * along with this program; if not, write to the Free Software
26
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
27
 */  
28
%>
29

    
30
<%@ include file="../../common/common-settings.jsp"%>
31
<%@ include file="../../common/configure-check.jsp"%>
32
<%
33
	// construct the drop down and the lookup key for the available ontologies
34
	StringBuffer dropDown = new StringBuffer();
35
	List<OntologyBean> beans = OntologyService.getInstance().getOntologyBeans();
36
	for (OntologyBean bean: beans) {
37

    
38
		dropDown.append("<option value='");
39
		dropDown.append(bean.getId());
40
		dropDown.append("'>");
41
		dropDown.append(bean.getDisplayLabel());
42
		dropDown.append("</option>");
43
		
44
	}
45
%>
46
<%
47
	//show the currently registered ontologies in metacat's plugin
48
	StringBuffer registeredDropDown = new StringBuffer();
49
	List<String> ontologies = SMS.getInstance().getOntologyManager().getOntologyIds();
50
	for (String uri: ontologies) {
51
		Ontology ontology = SMS.getInstance().getOntologyManager().getOntology(uri);
52
		String label = SMS.getInstance().getOntologyManager().getOntologyLabel(ontology);
53
		registeredDropDown.append("<option value='");
54
		registeredDropDown.append(uri);
55
		registeredDropDown.append("'>");
56
		registeredDropDown.append(label);
57
		registeredDropDown.append("</option>");
58
	}
59
%>
60

    
61
<html>
62
<head>
63
<title>Semantic search</title>
64
<link rel="stylesheet" type="text/css" href="<%=STYLE_SKINS_URL%>/semtools/semtools.css">
65

    
66
<script type="text/javascript">
67
                    	    // Set defaults for this installation
68
                    	    //var BP_SEARCH_SERVER = "http://oor-01.cim3.net";
69
                    	    //var BP_SITE = "Sandbox";
70
                    	    //var BP_ORG = "OOR";
71
                    	  </script>
72
<script language="Javascript" type="text/JavaScript"
73
	src="<%=STYLE_SKINS_URL%>/semtools/bioportal/form_complete.js">
74
</script>
75

    
76
<script language="javascript" type="text/javascript" src="<%=STYLE_SKINS_URL%>/semtools/semtools.js"></script>
77
<script language="javascript" type="text/javascript" src="<%=STYLE_COMMON_URL%>/branding.js"></script>
78

    
79
</head>
80
<body>
81
<script language="javascript">
82
	insertTemplateOpening("<%=CONTEXT_URL%>");
83
</script>
84

    
85
<h2>Ontology Management (Metacat)</h2>
86
<p>Ontologies should be registered in Metacat before they can be used in Annotation-based searches.</p>
87

    
88
<h3>Currently Registered Ontologies</h3>
89
<form method="POST" action="<%=SERVLET_URL%>" target="_top" id="existingRegistrationForm" name="existingRegistrationForm" ">
90
	<input name="qformat" value="semtools" type="hidden" />
91
	<table>
92
		<tr>
93
			<td>Action:</td>
94
			<td>
95
				<select name="action" id="action" disabled="disabled">
96
					<option value="registerOntology">Register Ontology</option>
97
					<option value="unregisterOntology" selected="selected">Unregister Ontology</option>
98
				</select>
99
			</td>
100
		</tr>
101
		<tr>
102
			<td>Ontology:</td>
103
			<td>
104
				<select name='id' id='id'>
105
					<%=registeredDropDown.toString()%>
106
				</select>
107
			</td>
108
		</tr>
109
		<tr>
110
			<td colspan="2"><input type="submit" value="Submit"/></td>
111
		</tr>
112
	</table>
113
</form>
114

    
115
<h3>Available BioPortal Ontologies</h3>
116
<form method="POST" action="<%=SERVLET_URL%>" target="_top" id="bioportalRegistrationForm" name="bioportalRegistrationForm" ">
117
	<input name="qformat" value="semtools" type="hidden" />
118
	<table>
119
		<tr>
120
			<td>Action:</td>
121
			<td>
122
				<select name="action" id="action">
123
					<option value="registerOntology">Register Ontology</option>
124
					<option value="unregisterOntology">Unregister Ontology</option>
125
				</select>
126
			</td>
127
		</tr>
128
		<tr>
129
			<td>Ontology:</td>
130
			<td>
131
				<select name='id' id='id'>
132
					<%=dropDown.toString()%>
133
				</select>
134
			</td>
135
		</tr>
136
		<tr>
137
			<td colspan="2"><input type="submit" value="Submit"/></td>
138
		</tr>
139
	</table>
140
</form>
141

    
142
<h3>Other Ontologies</h3>
143
<form method="POST" action="<%=SERVLET_URL%>" target="_top" id="registrationForm" name="registrationForm" ">
144
	<input name="qformat" value="semtools" type="hidden" />
145
	<table>
146
		<tr>
147
			<td>Action:</td>
148
			<td>
149
				<select name="action" id="action">
150
					<option value="registerOntology">Register Ontology</option>
151
					<option value="unregisterOntology">Unregister Ontology</option>
152
				</select>
153
			</td>
154
		</tr>
155
		<tr>
156
			<td>URI:</td>
157
			<td><input type="text" name="uri" id="uri" size="100" /></td>
158
		</tr>
159
		<tr>
160
			<td>URL:</td>
161
			<td><input type="text" name="url" id="url" size="100" /></td>
162
		</tr>
163
		<tr>
164
			<td colspan="2"><input type="submit" value="Submit"/></td>
165
		</tr>
166
	</table>
167
</form>
168

    
169
<h2>Ontology search (BioPortal)</h2>
170
<p>Not sure which BioPortal ontology to use?</p>
171
<p>Explore ontologies in BioPortal before registering them with Metacat. Use this search interface to find appropriate ontologies.</p>
172
<div id="bp_quick_jump"></div>
173
<script type="text/javascript">
174
    var BP_ontology_id = "all";
175
</script>
176
<script src="<%=STYLE_SKINS_URL%>/semtools/bioportal/quick_jump.js" type="text/javascript" charset="utf-8">
177
</script>
178

    
179
<h2>Tree browser (BioPortal)</h2>
180
<p>Explore existing ontologies in BioPortal</p>
181
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
182
	id="OntologyTree" width="300" height="100%"
183
	codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
184
	<param name="movie" value="http://keg.cs.uvic.ca/ncbo/ontologytree/OntologyTree.swf" />
185
	<param name="quality" value="high" />
186
	<param name="bgcolor" value="#ffffff" />
187
	<param name="allowScriptAccess" value="always" />
188
	<param name="flashVars" value="ontology=1523&alerterrors=false&canchangeontology=true&virtual=true" />
189
	<embed src="http://keg.cs.uvic.ca/ncbo/ontologytree/OntologyTree.swf" quality="high" bgcolor="#ffffff"
190
		width="300" height="100%" name="OntologyTree" align="middle"
191
		play="true"
192
		loop="false"
193
		allowScriptAccess="always"
194
		type="application/x-shockwave-flash"
195
		flashVars="ontology=1523&alerterrors=false&canchangeontology=true&virtual=true"
196
		pluginspage="http://www.adobe.com/go/getflashplayer">
197
	</embed>
198
</object>
199

    
200
<!-- Included default search/login -->
201
<% if ( PropertyService.getProperty("spatial.runSpatialOption").equals("true") ) { %>
202
<script language="javascript">
203
	insertMap("<%=CONTEXT_URL%>");
204
</script>
205
<br/>
206
<% } %>
207
  
208
<script language="javascript">
209
	insertSearchBox("<%=CONTEXT_URL%>");
210
	insertLoginBox("<%=CONTEXT_URL%>");	
211
</script>
212

    
213
<script language="javascript">
214
	insertTemplateClosing("<%=CONTEXT_URL%>");
215
</script>
216

    
217
</body>
218
</html>
(7-7/17)