Revision 3034
Added by perry over 18 years ago
lib/style/skins/knp/map.css | ||
---|---|---|
1 |
/* |
|
2 |
* '$RCSfile$' |
|
3 |
* Purpose: Default style sheet for KNB project web pages |
|
4 |
* Using this stylesheet rather than placing styles directly in |
|
5 |
* the KNB web documents allows us to globally change the |
|
6 |
* formatting styles of the entire site in one easy place. |
|
7 |
* Copyright: 2000 Regents of the University of California and the |
|
8 |
* National Center for Ecological Analysis and Synthesis |
|
9 |
* Authors: Matt Jones |
|
10 |
* |
|
11 |
* '$Author$' |
|
12 |
* '$Date$' |
|
13 |
* '$Revision$' |
|
14 |
* |
|
15 |
* This program is free software; you can redistribute it and/or modify |
|
16 |
* it under the terms of the GNU General Public License as published by |
|
17 |
* the Free Software Foundation; either version 2 of the License, or |
|
18 |
* (at your option) any later version. |
|
19 |
* |
|
20 |
* This program is distributed in the hope that it will be useful, |
|
21 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
22 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
23 |
* GNU General Public License for more details. |
|
24 |
* |
|
25 |
* You should have received a copy of the GNU General Public License |
|
26 |
* along with this program; if not, write to the Free Software |
|
27 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
28 |
*/ |
|
29 |
#mapContainer { |
|
30 |
position: absolute; |
|
31 |
right: 0px; |
|
32 |
top: 0px; |
|
33 |
/* |
|
34 |
width: 290px; |
|
35 |
*/ |
|
36 |
} |
|
37 |
|
|
38 |
#mapControl { |
|
39 |
height: 48px; |
|
40 |
width: 31px; |
|
41 |
} |
|
42 |
|
|
43 |
div#mapControlHide, |
|
44 |
div#mapControlShow { |
|
45 |
width: 100%; |
|
46 |
height: 100%; |
|
47 |
vertical-align: center; |
|
48 |
} |
|
49 |
|
|
50 |
div#mapControl a { |
|
51 |
display: block; |
|
52 |
margin: 0; padding:0; |
|
53 |
width:100%; |
|
54 |
height:100%; |
|
55 |
overflow:hidden; |
|
56 |
} |
|
57 |
|
|
58 |
|
|
59 |
div#mapControlShow { |
|
60 |
background: transparent url(/knp/style/skins/knp/images/show_map.gif) no-repeat bottom left; |
|
61 |
/* |
|
62 |
background: transparent url(http://nebulous.msi.ucsb.edu:8080/geoserver/data/mbdemos/demo/metacat_wfs/show_map.gif) no-repeat bottom left; |
|
63 |
*/ |
|
64 |
} |
|
65 |
|
|
66 |
div#mapControlHide { |
|
67 |
background: transparent url(/knp/style/skins/knp/images/hide_map.gif) no-repeat bottom left; |
|
68 |
/* |
|
69 |
background: transparent url(http://nebulous.msi.ucsb.edu:8080/geoserver/data/mbdemos/demo/metacat_wfs/hide_map.gif) no-repeat bottom left; |
|
70 |
*/ |
|
71 |
} |
|
72 |
|
|
73 |
div#mapControlShow a { |
|
74 |
background: transparent url(/knp/style/skins/knp/images/show_map.gif) no-repeat top left; |
|
75 |
/* |
|
76 |
background: transparent url(http://nebulous.msi.ucsb.edu:8080/geoserver/data/mbdemos/demo/metacat_wfs/show_map.gif) no-repeat top left; |
|
77 |
*/ |
|
78 |
} |
|
79 |
div#mapControlHide a { |
|
80 |
background: transparent url(/knp/style/skins/knp/images/hide_map.gif) no-repeat top left; |
|
81 |
/* |
|
82 |
background: transparent url(http://nebulous.msi.ucsb.edu:8080/geoserver/data/mbdemos/demo/metacat_wfs/hide_map.gif) no-repeat top left; |
|
83 |
*/ |
|
84 |
} |
|
85 |
div#mapControlShow a:hover, |
|
86 |
div#mapControlHide a:hover { |
|
87 |
background:none; |
|
88 |
text-decoration: none; |
|
89 |
} |
|
90 |
|
|
91 |
/* |
|
92 |
div#mapControlShow a { |
|
93 |
background: #efefef url(http://nebulous.msi.ucsb.edu:8080/geoserver/data/mbdemos/demo/metacat_wfs/left_arrow.gif) no-repeat center center; |
|
94 |
} |
|
95 |
div#mapControlHide a { |
|
96 |
background: #efefef url(http://nebulous.msi.ucsb.edu:8080/geoserver/data/mbdemos/demo/metacat_wfs/right_arrow.gif) no-repeat center center; |
|
97 |
} |
|
98 |
|
|
99 |
div#mapControlShow a:hover, |
|
100 |
div#mapControlHide a:hover { |
|
101 |
background-color: #e0e0e0 ; |
|
102 |
text-decoration: none; |
|
103 |
} |
|
104 |
*/ |
|
105 | 0 |
lib/style/skins/default/default.js | ||
---|---|---|
100 | 100 |
var LOGINBOX_URL |
101 | 101 |
= "@style-skins-path@/default/include_login.jsp"; |
102 | 102 |
|
103 |
var MAP_URL |
|
104 |
= "@style-skins-path@/default/include_map.jsp"; |
|
105 |
|
|
103 | 106 |
// Location of the header that will be displayed at the top of the page |
104 | 107 |
var LEFTCOL_URL |
105 | 108 |
= ""; |
... | ... | |
143 | 146 |
//(metacat only) advanced search box iframe class |
144 | 147 |
var IFRAME_ADVANCED_SEARCHBOX_CLASS = "iframeadvancedsearchboxclass"; |
145 | 148 |
|
149 |
// Interactive Map |
|
150 |
var IFRAME_MAP_CLASS = "iframemapclass"; |
|
151 |
|
|
146 | 152 |
//(metacat only) login box iframe class |
147 | 153 |
var IFRAME_LOGINBOX_CLASS = "iframeloginboxclass"; |
148 | 154 |
|
lib/style/skins/default/index.jsp | ||
---|---|---|
48 | 48 |
insertTemplateOpening(); |
49 | 49 |
insertSearchBox(); |
50 | 50 |
</script> |
51 |
</br>
|
|
51 |
<br/>
|
|
52 | 52 |
<script language="javascript"> |
53 |
insertMap(); |
|
54 |
</script> |
|
55 |
<br/> |
|
56 |
<script language="javascript"> |
|
53 | 57 |
insertLoginBox(); |
54 | 58 |
</script> |
55 | 59 |
<script language="javascript"> |
lib/style/skins/default/default.css | ||
---|---|---|
56 | 56 |
margin: 0px; |
57 | 57 |
} |
58 | 58 |
|
59 |
.iframemapclass { |
|
60 |
height: 570px; |
|
61 |
width: 100%; |
|
62 |
border: 0px; |
|
63 |
margin: 0px; |
|
64 |
} |
|
65 |
|
|
59 | 66 |
.iframeloginboxclass { |
60 | 67 |
height: 250px; |
61 | 68 |
width: 100%; |
lib/style/skins/default/include_map.jsp | ||
---|---|---|
1 |
<%@ page language="java" %> |
|
2 |
<!-- |
|
3 |
/** |
|
4 |
* '$RCSfile$' |
|
5 |
* Authors: Matthew Perry |
|
6 |
* Copyright: 2005 University of New Mexico and |
|
7 |
* Regents of the University of California and the |
|
8 |
* National Center for Ecological Analysis and Synthesis |
|
9 |
* For Details: http://www.nceas.ucsb.edu/ |
|
10 |
* |
|
11 |
* '$Author$' |
|
12 |
* '$Date$' |
|
13 |
* '$Revision$' |
|
14 |
* |
|
15 |
* This program is free software; you can redistribute it and/or modify |
|
16 |
* it under the terms of the GNU General Public License as published by |
|
17 |
* the Free Software Foundation; either version 2 of the License, or |
|
18 |
* (at your option) any later version. |
|
19 |
* |
|
20 |
* This program is distributed in the hope that it will be useful, |
|
21 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
22 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
23 |
* GNU General Public License for more details. |
|
24 |
* |
|
25 |
* You should have received a copy of the GNU General Public License |
|
26 |
* along with this program; if not, write to the Free Software |
|
27 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
28 |
* |
|
29 |
*/ |
|
30 |
--> |
|
31 |
<%@ include file="settings.jsp"%> |
|
32 |
<%@ include file="session_vars.jsp"%> |
|
33 |
<!-- *********************** START Map ************************* --> |
|
34 |
<html> |
|
35 |
<head> |
|
36 |
<title>Metacat Data Catalog Map</title> |
|
37 |
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> |
|
38 |
<link href="<%=relativeRoot%>/default.css" rel="stylesheet" type="text/css"> |
|
39 |
|
|
40 |
<script language="javascript" |
|
41 |
type="text/javascript" src="<%=relativeRoot%>/default.js"> |
|
42 |
</script> |
|
43 |
</head> |
|
44 |
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"> |
|
45 |
<table width="750px" align="center" cellspacing="0" cellpadding="0" > |
|
46 |
<tr> |
|
47 |
<td width="10" align="right" valign="top"> |
|
48 |
<img src="<%=relativeRoot%>/images/panelhead_bg_lcorner.gif" |
|
49 |
width="10" height="21"> |
|
50 |
</td> |
|
51 |
<td class="sectionheader"> |
|
52 |
Data Catalog Map |
|
53 |
</td> |
|
54 |
<td width="10" align="left" valign="top"> |
|
55 |
<img src="<%=relativeRoot%>/images/panelhead_bg_rcorner.gif" |
|
56 |
width="10" height="21"> |
|
57 |
</td> |
|
58 |
</tr> |
|
59 |
<tr> |
|
60 |
<td colspan="3"> |
|
61 |
<table width="100%" cellspacing="0" cellpadding="0" border="0" class="subpanel"> |
|
62 |
<tr><td> |
|
63 |
<iframe frameborder="0" width="750" height="520" src="<%=relativeRoot%>/../../common/spatial_templates/spatial1/map.html"> You need iframe support </iframe> |
|
64 |
</td></tr> |
|
65 |
</table> |
|
66 |
</td> |
|
67 |
</tr> |
|
68 |
</table> |
|
69 |
</body> |
|
70 |
</html> |
|
71 |
|
|
72 |
|
|
0 | 73 |
lib/style/skins/knp/index.jsp | ||
---|---|---|
25 | 25 |
*/ |
26 | 26 |
%> |
27 | 27 |
<%@ include file="../../common/common-settings.jsp"%> |
28 |
<%@ include file="../../common/map-settings.jsp"%> |
|
29 |
<% |
|
30 |
|
|
31 |
//SPATIAL_MAP = "knp"; |
|
32 |
SPATIAL_TEMPLATE = "basic_layers"; |
|
33 |
|
|
34 |
/* Construct Web Map URL |
|
35 |
String mapUrl = SPATIAL_BASE_URL + |
|
36 |
"?map=" + SPATIAL_MAP + |
|
37 |
"&template=" + SPATIAL_TEMPLATE + |
|
38 |
"&client=" + SPATIAL_CLIENT; |
|
39 |
*/ |
|
40 |
|
|
41 |
//String mapUrl = "@systemidserver@/@context@/spatial/mapbuilder/demo/metacat_knp/pma.html"; |
|
42 |
|
|
43 |
String mapUrl = "@systemidserver@/@context@/style/skins/knp/spatial/pma.html"; |
|
44 |
%> |
|
28 | 45 |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
29 | 46 |
<html> |
30 | 47 |
<head> |
... | ... | |
39 | 56 |
</head> |
40 | 57 |
<body> |
41 | 58 |
<script language="JavaScript"> |
59 |
|
|
42 | 60 |
function getMapFrame() { |
43 | 61 |
return document.getElementById('mapFrame'); |
44 | 62 |
} |
45 | 63 |
insertTemplateOpening(); |
46 | 64 |
insertSearchBox(); |
47 | 65 |
</script> |
66 |
|
|
48 | 67 |
<table width="100%" border="0" cellspacing="0" cellpadding="0"> |
49 | 68 |
<tr><td colspan="1" style="padding-right:60px"> |
50 | 69 |
<p> |
... | ... | |
178 | 197 |
</p> |
179 | 198 |
</td> |
180 | 199 |
<td class="mapColumn" rowspan="2" style="vertical-align:top"> |
181 |
<iframe src="http://dataknp.sanparks.org/geoserver/data/mbdemos/demo/metacat_wfs/pma.html" class="mapFrame" |
|
182 |
id="mapFrame" name="mapFrame" marginheight="0" marginwidth="0" border="0" framespacing="0" hspace="0" vspace="0" frameborder="0" scrolling="no">Your browser does not support the iframe tag. <a href="http://dataknp.sanparks.org/geoserver/data/mbdemos/demo/metacat_wfs/pma.html" target="_blank">This content</a> should have been displayed at this location</iframe> |
|
200 |
<iframe src="<%=mapUrl%>" class="mapFrame" |
|
201 |
id="mapFrame" name="mapFrame" marginheight="0" marginwidth="0" border="0" |
|
202 |
framespacing="0" hspace="0" vspace="0" frameborder="0" scrolling="no"> |
|
203 |
Your browser does not support the iframe tag. |
|
204 |
<a href="<%=mapUrl%>" target="_blank"> |
|
205 |
This content</a> should have been displayed at this location |
|
206 |
</iframe> |
|
183 | 207 |
</td></tr> |
184 | 208 |
<tr><td> |
185 | 209 |
<p> |
lib/style/skins/dev/devtools.html | ||
---|---|---|
12 | 12 |
<li><a href="validate.html">validate a doc</a></li> |
13 | 13 |
<li><a href="replControl.html">replication control</a></li> |
14 | 14 |
<li><a href="querymetacat.html">query the db</a></li> |
15 |
<li><a href="map.jsp">map interface</a></li> |
|
15 | 16 |
</ul> |
16 | 17 |
</body> |
17 | 18 |
</html> |
lib/style/common/branding.js | ||
---|---|---|
159 | 159 |
|
160 | 160 |
} |
161 | 161 |
|
162 |
|
|
162 | 163 |
/** |
164 |
* inserts the header referenced by the SEARCHBOX_URL setting |
|
165 |
*/ |
|
166 |
function insertMap() { |
|
167 |
|
|
168 |
if (!_isBlank(MAP_URL)) { |
|
169 |
|
|
170 |
_createIFrameWithURL(MAP_URL, IFRAME_MAP_CLASS); |
|
171 |
} |
|
172 |
|
|
173 |
} |
|
174 |
|
|
175 |
/** |
|
163 | 176 |
* inserts the header referenced by the ADVANCED_SEARCHBOX_URL setting |
164 | 177 |
*/ |
165 | 178 |
function insertAdvancedSearchBox() { |
lib/metacat.properties | ||
---|---|---|
222 | 222 |
ValidateHarvestListSuccess=Success validating harvest list,Debug |
223 | 223 |
|
224 | 224 |
# End of Harvester properties |
225 |
|
|
226 |
|
|
227 |
# BEGIN spatial options |
|
228 |
runSpatialOption=true |
|
229 |
regenerateCacheOnRestart=true |
|
230 |
|
|
231 |
# XML paths to the four bounding coordinates |
|
232 |
# these paths must be included in your indexPaths variable in build.properties |
|
233 |
# these are the defaults for EML and have not been tested with other schemas |
|
234 |
westBoundingCoordinatePath=geographicCoverage/boundingCoordinates/westBoundingCoordinate |
|
235 |
eastBoundingCoordinatePath=geographicCoverage/boundingCoordinates/eastBoundingCoordinate |
|
236 |
southBoundingCoordinatePath=geographicCoverage/boundingCoordinates/southBoundingCoordinate |
|
237 |
northBoundingCoordinatePath=geographicCoverage/boundingCoordinates/northBoundingCoordinate |
|
238 |
|
|
239 |
metacatUrl=@systemidserver@@servlet-path@ |
|
240 |
baseUrl=@systemidserver@@html-path@ |
|
241 |
# END spatial options |
src/spatial/cpp/metacat_shapefile.cpp | ||
---|---|---|
29 | 29 |
#include <stdlib.h> |
30 | 30 |
#include <string.h> |
31 | 31 |
#include <math.h> |
32 |
#include "iostream.h"
|
|
32 |
#include "iostream" |
|
33 | 33 |
#include <fstream> |
34 | 34 |
#include <string> |
35 | 35 |
#include <vector> |
... | ... | |
117 | 117 |
hSHPHandle = SHPCreate( pszFilename, nSHPType ); |
118 | 118 |
|
119 | 119 |
ii = 0; |
120 |
for ( ii = 0; ii < number_data_lines; ii++ ) |
|
120 |
for ( ii = 0; ii < number_data_lines_x; ii++ )
|
|
121 | 121 |
{ |
122 | 122 |
double area_coef = sqrt( pow((max_pntx[2][ii]-min_pntx[2][ii]),2) + pow((max_pnty[2][ii]-min_pnty[2][ii]),2) ); |
123 | 123 |
double ave_x = ( (min_pntx[2][ii]+max_pntx[2][ii])/2 ); |
124 | 124 |
double ave_y = ( (min_pnty[2][ii]+max_pnty[2][ii])/2 ); |
125 | 125 |
double ave_z = ( pointz[2][ii] ); |
126 | 126 |
|
127 |
cout << "area coef: " << area_coef << endl; |
|
128 |
|
|
127 | 129 |
if (ave_x < 180 && ave_x > -180 && ave_y < 90 && ave_y >-90 ) { |
128 | 130 |
|
129 | 131 |
psShape = SHPCreateObject( SHPT_POINT, ii, 0, NULL, NULL, 1, &ave_x, &ave_y, &ave_z, NULL ); |
... | ... | |
132 | 134 |
SHPDestroyObject( psShape ); |
133 | 135 |
//do the update to the dbf file too |
134 | 136 |
iRecord = DBFGetRecordCount( hDBF ); |
135 |
|
|
137 |
|
|
136 | 138 |
DBFWriteStringAttribute(hDBF, iRecord, url_field, urlvec[ii].c_str() ); |
137 | 139 |
DBFWriteStringAttribute(hDBF, iRecord, docid_field, docidvec[ii].c_str() ); |
138 | 140 |
DBFWriteIntegerAttribute(hDBF, iRecord, id_field, int(ii) ); |
src/edu/ucsb/nceas/metacat/MetaCatUtil.java | ||
---|---|---|
53 | 53 |
|
54 | 54 |
public static HashMap skinconfigs = new HashMap(); |
55 | 55 |
|
56 |
private static Options options = null; |
|
56 |
private static edu.ucsb.nceas.utilities.Options options = null;
|
|
57 | 57 |
|
58 | 58 |
private static boolean debug = true; |
59 | 59 |
|
... | ... | |
74 | 74 |
} catch (Exception e) { |
75 | 75 |
System.err.println("Error in MetaCatUtil static block:" |
76 | 76 |
+ e.getMessage()); |
77 |
e.printStackTrace(); |
|
77 | 78 |
} |
78 | 79 |
|
79 | 80 |
// read administrator and moderator lists from metacat.properties |
... | ... | |
111 | 112 |
public static String getOption(String optionName) |
112 | 113 |
{ |
113 | 114 |
if (options == null) { |
114 |
options = Options.getInstance(); |
|
115 |
options = edu.ucsb.nceas.utilities.Options.getInstance();
|
|
115 | 116 |
} |
117 |
if (options == null) { |
|
118 |
MetaCatUtil.printMessage("options is null"); |
|
119 |
} |
|
116 | 120 |
String value = options.getOption(optionName); |
117 | 121 |
return value; |
118 | 122 |
} |
... | ... | |
125 | 129 |
public static void setOption(String optionName, String newValue) |
126 | 130 |
{ |
127 | 131 |
if (options == null) { |
128 |
options = Options.getInstance(); |
|
132 |
options = edu.ucsb.nceas.utilities.Options.getInstance();
|
|
129 | 133 |
} |
130 | 134 |
options.setOption(optionName, newValue); |
131 | 135 |
|
src/edu/ucsb/nceas/metacat/MetaCatServlet.java | ||
---|---|---|
70 | 70 |
import com.oreilly.servlet.multipart.Part; |
71 | 71 |
|
72 | 72 |
import edu.ucsb.nceas.utilities.Options; |
73 |
import edu.ucsb.nceas.metacat.spatial.MetacatSpatialQuery; |
|
74 |
import edu.ucsb.nceas.metacat.spatial.MetacatSpatialDocument; |
|
75 |
import edu.ucsb.nceas.metacat.spatial.MetacatSpatialDataset; |
|
76 |
import edu.ucsb.nceas.metacat.spatial.MetacatSpatialConstants; |
|
73 |
import edu.ucsb.nceas.metacat.spatial.SpatialHarvester; |
|
77 | 74 |
|
78 | 75 |
/** |
79 | 76 |
* A metadata catalog server implemented as a Java Servlet |
... | ... | |
207 | 204 |
MetaCatUtil.skinconfigs.put(skinName, skinOption); |
208 | 205 |
} |
209 | 206 |
|
207 |
/* |
|
208 |
* If spatial option is turned on and set to regenerate the |
|
209 |
* spatial cache on restart, trigger the harvester |
|
210 |
*/ |
|
211 |
if ( MetaCatUtil.getOption("runSpatialOption").equals("true") && |
|
212 |
MetaCatUtil.getOption("regenerateCacheOnRestart").equals("true") ) { |
|
210 | 213 |
|
211 |
if (MetacatSpatialConstants.runSpatialOption == true ) { |
|
212 |
|
|
213 |
// create a spatial index of the database |
|
214 |
MetacatSpatialConstants.setServerContext(MetaCatUtil.getOption("server")); |
|
215 |
MetacatSpatialQuery _spatialQuery = new MetacatSpatialQuery(); |
|
216 |
|
|
217 |
// issue the query -- using the geographic bounds of the Earth |
|
218 |
MetacatSpatialDataset _data = _spatialQuery.queryDatasetByCartesianBounds(-180, -90, 180, 90); |
|
219 |
|
|
220 |
// write the data to the appropriate theme |
|
221 |
_data.writeMetacatSpatialCache(); |
|
222 |
|
|
223 |
} |
|
214 |
// Begin timer |
|
215 |
long before = System.currentTimeMillis(); |
|
216 |
|
|
217 |
// regenerate the entire spatial cache |
|
218 |
// may be expensive with many documents |
|
219 |
SpatialHarvester sh = new SpatialHarvester(); |
|
220 |
sh.regenerate(); |
|
221 |
sh.destroy(); |
|
222 |
|
|
223 |
// End timer |
|
224 |
long after = System.currentTimeMillis(); |
|
225 |
MetaCatUtil.printMessage(" ------ Spatial Harvester Time " + (after - before) + "ms"); |
|
226 |
|
|
227 |
} else { |
|
228 |
MetaCatUtil.printMessage(" \n **** Spatial cache is not set to regenerate on restart"); |
|
229 |
} |
|
224 | 230 |
|
225 | 231 |
|
226 | 232 |
MetaCatUtil.printMessage("Metacat (" + Version.getVersion() |
... | ... | |
782 | 788 |
String sess_id) { |
783 | 789 |
|
784 | 790 |
Logger logMetacat = Logger.getLogger(MetaCatServlet.class); |
785 |
//MBJDELETED MetacatSpatialQuery _spatialQuery = new MetacatSpatialQuery(); |
|
786 | 791 |
|
787 |
if (MetacatSpatialConstants.runSpatialOption == false ) {
|
|
792 |
if ( !MetaCatUtil.getOption("runSpatialOption").equals("true") ) {
|
|
788 | 793 |
response.setContentType("text/html"); |
789 | 794 |
out.println("<html> Metacat Spatial Option is turned off <html>"); |
790 | 795 |
out.close(); |
791 | 796 |
return ; |
792 | 797 |
} |
793 | 798 |
|
794 |
MetacatSpatialQuery _spatialQuery = new MetacatSpatialQuery(); |
|
799 |
//MetacatSpatialQuery _spatialQuery = new MetacatSpatialQuery();
|
|
795 | 800 |
|
796 | 801 |
|
797 | 802 |
// switch -- html/xml print |
... | ... | |
2298 | 2303 |
out.println("Document deleted."); |
2299 | 2304 |
out.println("</success>"); |
2300 | 2305 |
logMetacat.info("Document deleted."); |
2306 |
|
|
2307 |
// Delete from spatial cache |
|
2308 |
SpatialHarvester sh = new SpatialHarvester(); |
|
2309 |
sh.addToDeleteQue( MetaCatUtil.getSmartDocId( docid[0] ) ); |
|
2310 |
sh.destroy(); |
|
2311 |
|
|
2301 | 2312 |
} |
2302 | 2313 |
catch (AccessionNumberException ane) { |
2303 | 2314 |
response.setContentType("text/xml"); |
src/edu/ucsb/nceas/metacat/DocumentImpl.java | ||
---|---|---|
51 | 51 |
import java.util.Vector; |
52 | 52 |
|
53 | 53 |
import edu.ucsb.nceas.dbadapter.AbstractDatabase; |
54 |
import edu.ucsb.nceas.metacat.spatial.SpatialHarvester; |
|
54 | 55 |
|
55 | 56 |
import org.apache.log4j.Logger; |
56 | 57 |
import org.xml.sax.ContentHandler; |
... | ... | |
124 | 125 |
protected long rootnodeid; |
125 | 126 |
private ElementNode rootNode = null; |
126 | 127 |
private TreeSet nodeRecordList = null; |
128 |
|
|
127 | 129 |
|
128 | 130 |
private static Logger logMetacat = Logger.getLogger(DocumentImpl.class); |
129 | 131 |
|
... | ... | |
1338 | 1340 |
} |
1339 | 1341 |
|
1340 | 1342 |
logMetacat.warn("BuildIndex complete for docid " + docid); |
1343 |
|
|
1344 |
// Adds the docid to the spatial data cache |
|
1345 |
SpatialHarvester spatialHarvester = new SpatialHarvester(); |
|
1346 |
logMetacat.warn(" --------- Attempting to update the spatial cache for docid " + docid ); |
|
1347 |
spatialHarvester.addToUpdateQue(docid); |
|
1348 |
spatialHarvester.destroy(); |
|
1349 |
|
|
1341 | 1350 |
} |
1342 | 1351 |
|
1343 | 1352 |
/** |
... | ... | |
2880 | 2889 |
// add force delete replcation document here. |
2881 | 2890 |
ForceReplicationHandler frh = new ForceReplicationHandler( |
2882 | 2891 |
accnum, ForceReplicationHandler.DELETE, isXML, notifyServer); |
2892 |
|
|
2893 |
// Deletes the docid from the spatial data cache |
|
2894 |
/* MPTODO : getting "non-static variable cannot be reffered to from a static context" error |
|
2895 |
SpatialHarvester spatialHarvester = new SpatialHarvester(); |
|
2896 |
logMetacat.warn(" --------- Attempting to delete the spatial cache for docid " + docid ); |
|
2897 |
spatialHarvester.addToDeleteQue(docid); |
|
2898 |
spatialHarvester.destroy(); |
|
2899 |
*/ |
|
2900 |
|
|
2883 | 2901 |
} |
2884 | 2902 |
|
2885 | 2903 |
private static String getDocTypeFromDB(DBConnection conn, String docidWithoutRev) |
src/edu/ucsb/nceas/metacat/DocumentImplWrapper.java | ||
---|---|---|
39 | 39 |
import org.xml.sax.SAXParseException; |
40 | 40 |
import org.xml.sax.helpers.XMLReaderFactory; |
41 | 41 |
|
42 |
import edu.ucsb.nceas.metacat.spatial.MetacatSpatialDocument; |
|
42 |
//import edu.ucsb.nceas.metacat.spatial.MetacatSpatialDocument;
|
|
43 | 43 |
|
44 | 44 |
/** |
45 | 45 |
* This class a wrapper class for documentimpl for insert or update. It will |
... | ... | |
70 | 70 |
String action, String docid, String user, String[] groups) |
71 | 71 |
throws Exception |
72 | 72 |
{ |
73 |
|
|
74 |
//jhh register this transaction with the Metacat Spatial Option |
|
75 |
MetacatSpatialDocument msdoc = new MetacatSpatialDocument(docid); |
|
76 |
|
|
77 | 73 |
return DocumentImpl.write(conn, xml, pub, dtd, action, docid, user, |
78 | 74 |
groups, ruleBase, needValidation); |
79 | 75 |
} |
src/edu/ucsb/nceas/metacat/DBQuery.java | ||
---|---|---|
59 | 59 |
import edu.ucsb.nceas.morpho.datapackage.Triple; |
60 | 60 |
import edu.ucsb.nceas.morpho.datapackage.TripleCollection; |
61 | 61 |
|
62 |
import edu.ucsb.nceas.metacat.spatial.MetacatSpatialQuery; |
|
63 |
import edu.ucsb.nceas.metacat.spatial.PersistentMetacatSpatialDataset; |
|
64 |
import edu.ucsb.nceas.metacat.spatial.MetacatSpatialDataset; |
|
65 |
import edu.ucsb.nceas.metacat.spatial.MetacatSpatialDocument; |
|
66 |
import edu.ucsb.nceas.metacat.spatial.MetacatSpatialConstants; |
|
67 | 62 |
|
68 | 63 |
/** |
69 | 64 |
* A Class that searches a relational DB for elements and attributes that have |
... | ... | |
392 | 387 |
throws Exception |
393 | 388 |
{ |
394 | 389 |
|
395 |
MetacatSpatialDataset metacatSpatialData = null; |
|
396 |
|
|
397 |
if (MetacatSpatialConstants.runSpatialOption == true ) { |
|
398 |
metacatSpatialData = new MetacatSpatialDataset(); |
|
399 |
} |
|
400 | 390 |
int offset = 1; |
401 | 391 |
// this is a hack for offset |
402 | 392 |
if (out == null) |
... | ... | |
456 | 446 |
while (tableHasRows) |
457 | 447 |
{ |
458 | 448 |
docid = rs.getString(1).trim(); |
459 |
//if ( METACAT_SPATIAL ) { |
|
460 |
if (MetacatSpatialConstants.runSpatialOption == true ) { |
|
461 |
System.out.println("###################################################"); |
|
462 |
System.out.println("###################################################"); |
|
463 |
System.out.println("###################################################"); |
|
464 |
System.out.println("###################################################"); |
|
465 |
System.out.println("###################################################"); |
|
466 |
System.out.println("################ " + docid + " ####################"); |
|
467 |
|
|
468 |
// make sure that the spatial dataset is initialized |
|
469 |
MetacatSpatialQuery spatialQuery = new MetacatSpatialQuery(); |
|
470 |
|
|
471 |
// create the spatial document |
|
472 |
MetacatSpatialDocument msdoc = spatialQuery.getSpatialDocument(docid); |
|
473 |
|
|
474 |
// add the spatial document to the spatial dataset |
|
475 |
metacatSpatialData.add(msdoc); |
|
476 |
|
|
477 |
// write the persistent spatial dataset |
|
478 |
//////metacatSpatialData.write(); |
|
479 |
|
|
480 |
System.out.println("###################################################"); |
|
481 |
System.out.println("###################################################"); |
|
482 |
System.out.println("###################################################"); |
|
483 |
System.out.println("###################################################"); |
|
484 |
System.out.println("###################################################"); |
|
485 |
} |
|
486 | 449 |
docname = rs.getString(2); |
487 | 450 |
doctype = rs.getString(3); |
488 | 451 |
createDate = rs.getString(4); |
... | ... | |
658 | 621 |
|
659 | 622 |
|
660 | 623 |
//write the persistent spatial dataset |
624 |
/* |
|
661 | 625 |
if(metacatSpatialData != null){ |
662 | 626 |
metacatSpatialData.writeTextQueryData(); |
663 | 627 |
} |
664 |
|
|
628 |
*/ |
|
629 |
|
|
665 | 630 |
return resultsetBuffer; |
666 | 631 |
}//findReturnDoclist |
667 | 632 |
|
build.properties | ||
---|---|---|
110 | 110 |
compile.optimize=true |
111 | 111 |
|
112 | 112 |
# paths to be indexed when document is inserted. these are the paths which will be searched often |
113 |
indexPaths=organizationName,originator/individualName/surName,originator/individualName/givenName,originator/organizationName,creator/individualName/surName,creator/individualName/givenName,creator/organizationName,dataset/title,keyword,northBoundingCoordinate,southBoundingCoordinate,westBoundingCoordinate,eastBoundingCoordinate,title,entityName,individualName/surName,abstract/para,surName,givenName,para,geographicDescription,literalLayout,eastbc,northbc,westbc,southbc,dataset/access/allow/principal,entityName,taxonRankValue,dataset/dataTable/physical/distribution/online/url,dataset/spatialRaster/physical/distribution/online/url,@packageId,/reviewHistory/review/packageId,EcogridRegEntry/description,EcogridRegEntry/serviceName,EcogridRegEntry/endPoint,associatedParty/individualName/surName,associatedParty/organizationName,coverage/temporalCoverage/singleDateTime/alternativeTimeScale/timeScaleName,coverage/temporalCoverage/rangeOfDates/beginDate/alternativeTimeScale/timeScaleName,coverage/temporalCoverage/rangeOfDates/endDate/alternativeTimeScale/timeScaleName
|
|
113 |
indexPaths=organizationName,originator/individualName/surName,originator/individualName/givenName,originator/organizationName,creator/individualName/surName,creator/individualName/givenName,creator/organizationName,dataset/title,keyword,geographicCoverage/boundingCoordinates/northBoundingCoordinate,geographicCoverage/boundingCoordinates/southBoundingCoordinate,geographicCoverage/boundingCoordinates/westBoundingCoordinate,geographicCoverage/boundingCoordinates/eastBoundingCoordinate,eastBoundingCoordinate,title,entityName,individualName/surName,abstract/para,surName,givenName,para,geographicDescription,literalLayout,eastbc,northbc,westbc,southbc,dataset/access/allow/principal,entityName,taxonRankValue,dataset/dataTable/physical/distribution/online/url,dataset/spatialRaster/physical/distribution/online/url,@packageId,/reviewHistory/review/packageId,EcogridRegEntry/description,EcogridRegEntry/serviceName,EcogridRegEntry/endPoint,associatedParty/individualName/surName,associatedParty/organizationName,coverage/temporalCoverage/singleDateTime/alternativeTimeScale/timeScaleName,coverage/temporalCoverage/rangeOfDates/beginDate/alternativeTimeScale/timeScaleName,coverage/temporalCoverage/rangeOfDates/endDate/alternativeTimeScale/timeScaleName
|
|
114 | 114 |
|
115 | 115 |
# Flag to install ecogird or not. Possible values are true or false |
116 | 116 |
install.ecogrid=false |
117 |
|
|
118 |
# Flag to install and enable spatial metacat options |
|
119 |
install.spatial=true |
|
120 |
|
|
117 | 121 |
# The metacat current dir's abolute value. If you set install.ecogrid=false, this variable |
118 | 122 |
# do NOT need to be configured |
119 | 123 |
metacat.dir=/home/tao/project/metacat |
build.xml | ||
---|---|---|
48 | 48 |
<condition property="enable.ecogrid"> |
49 | 49 |
<equals arg1="${install.ecogrid}" arg2="true" /> |
50 | 50 |
</condition> |
51 |
|
|
52 |
<!-- Determine if geoserver and spatial options are to be enabled --> |
|
53 |
<condition property="enable.spatial"> |
|
54 |
<equals arg1="${install.spatial}" arg2="true" /> |
|
55 |
</condition> |
|
51 | 56 |
|
52 | 57 |
<target name="check-db"> |
53 | 58 |
<condition property="use-oracle"> |
... | ... | |
159 | 164 |
<include name="msbase.jar"/> |
160 | 165 |
<include name="msutil.jar"/> |
161 | 166 |
<include name="mssqlserver.jar"/> |
167 |
</fileset> |
|
168 |
|
|
169 |
<!-- Include geoserver, geotools, et. al. --> |
|
170 |
<fileset dir="lib/spatial/geoserver/WEB-INF/lib"> |
|
171 |
<include name="*.jar"/> |
|
162 | 172 |
</fileset> |
173 |
<pathelement location="lib/spatial/geoserver/WEB-INF/classes"/> |
|
174 |
|
|
163 | 175 |
</path> |
164 | 176 |
|
165 | 177 |
<!-- It is less likely you'll need to make any changes from here down, |
... | ... | |
770 | 782 |
</sql> |
771 | 783 |
</target> |
772 | 784 |
|
785 |
<target name="install-spatial" depends="jar,clientjar,harvesterjar" if="enable.spatial" |
|
786 |
description="Installs spatial option for metacat"> |
|
787 |
|
|
788 |
<property name="spatial.dir" value="./lib/spatial"/> |
|
789 |
<property name="spatial.geoserver.dir" value="${spatial.dir}/geoserver"/> |
|
790 |
<property name="spatial.webinf-mods" value="${spatial.dir}/WEB-INF"/> |
|
791 |
|
|
792 |
<!-- Copy geoserver libs into ${war.lib} --> |
|
793 |
<copy todir="${war.lib}" filtering="no"> |
|
794 |
<fileset dir="${spatial.geoserver.dir}/WEB-INF/lib"> |
|
795 |
<include name="**"/> |
|
796 |
</fileset> |
|
797 |
</copy> |
|
798 |
|
|
799 |
<!-- Copy everything in geoservers WEB-INF (except the libs) into ${war.webinf} --> |
|
800 |
<copy todir="${war.webinf}" filtering="no"> |
|
801 |
<fileset dir="${spatial.geoserver.dir}/WEB-INF"> |
|
802 |
<exclude name="lib/**"/> |
|
803 |
<exclude name="web.xml"/> |
|
804 |
</fileset> |
|
805 |
</copy> |
|
806 |
|
|
807 |
<!-- Copy the rest of the geoserver codebase into ${war.context} --> |
|
808 |
<copy todir="${war.context}" filtering="no"> |
|
809 |
<fileset dir="${spatial.geoserver.dir}"> |
|
810 |
<exclude name="WEB-INF/**"/> |
|
811 |
<exclude name="index.jsp"/> |
|
812 |
</fileset> |
|
813 |
</copy> |
|
814 |
|
|
815 |
<!-- Copy the geoserver index.jsp but rename it to avoid conflicting w/metcat --> |
|
816 |
<copy file="${spatial.geoserver.dir}/WEB-INF/pages/index.jsp" |
|
817 |
tofile="${war.context}/geoserver.jsp" |
|
818 |
overwrite="true" |
|
819 |
filtering="no"/> |
|
820 |
|
|
821 |
<!-- Copy the geoserver/metacat combined web.xml into ${build.war}/web.xml --> |
|
822 |
<copy file="${spatial.webinf-mods}/web.xml.combined" |
|
823 |
tofile="${build.war}/web.xml" |
|
824 |
overwrite="true" |
|
825 |
filtering="no"/> |
|
826 |
|
|
827 |
<!-- Copy the rest of the modified geoserver web-inf files |
|
828 |
<copy todir="${war.webinf}" filtering="no"> |
|
829 |
<fileset dir="${spatial.webinf-mods}"> |
|
830 |
<exclude name="web.xml.combined"/> |
|
831 |
</fileset> |
|
832 |
</copy> --> |
|
833 |
|
|
834 |
</target> |
|
835 |
|
|
836 |
|
|
773 | 837 |
<target name="install" depends="install-ecogrid" description="* Full Install *"> |
774 | 838 |
<mkdir dir="${datafilepath}" /> |
775 | 839 |
<mkdir dir="${inlinedatafilepath}" /> |
... | ... | |
927 | 991 |
<echo message="Install Skin completed." /> |
928 | 992 |
</target> |
929 | 993 |
|
930 |
<target name="war" depends="warPrepare,warMSSQL" |
|
994 |
<target name="war" depends="warPrepare,warMSSQL,install-spatial"
|
|
931 | 995 |
description="Create a web archive (WAR) for servlet deployment"> |
932 | 996 |
<mkdir dir="${dist.dir}" /> |
933 | 997 |
<war destfile="${dist.dir}/${metacat.context}.war" |
... | ... | |
996 | 1060 |
<exclude name="lsid_conf/**"/> |
997 | 1061 |
<exclude name="LiveMap_30/**"/> |
998 | 1062 |
<exclude name="skin.configs/**"/> |
1063 |
<exclude name="spatial/geoserver/**"/> |
|
1064 |
<exclude name="spatial/WEB-INF/**"/> |
|
999 | 1065 |
</fileset> |
1000 | 1066 |
</copy> |
1001 | 1067 |
</target> |
Also available in: Unified diff
initial import of changes to metacat source and config files to support spatial option