Project

General

Profile

« Previous | Next » 

Revision 6870

Merged most recent changes from trunk into the RST converted version of the Administrator's Guide. Now the Sphinx/RST version is up to date rlative to the most recent word document, and is now the active copy. The MS Word document will be deprecated and removed. All future changes should be made to the RST version.

View differences:

docs/dev/metacat/source/replication.rst
61 61
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
62 62
To add, remove, or alter servers on your home server's Replication list, or to 
63 63
activate and customize the Delta-T handler, use the Replication control panel, 
64
which is accessed at the following URL::
64
which is accessed via the Metacat Administration interface at the following URL::
65 65
 
66
   http://somehost.somelocation.edu/context/style/skins/dev/replControl.html
66
   http://somehost.somelocation.edu/context/admin
67 67
   
68 68
"http://somehost.somelocation.edu/context" should be replaced with the name 
69 69
of your Metacat server and context (e.g., http://knb.ecoinformatics.org/knb/). 
......
79 79
remove a replication server after replication has occurred is to remove the 
80 80
certificates. 
81 81

  
82
Also note that you must SCP partner certificates to your machine; you cannot 
83
use the "Download Certificate from" option on the Control Panel. For more 
84
information about creating and installing certificates, please see Generating 
85
and Exchanging Security Certificates.
86

  
87 82
Generating and Exchanging Security Certificates
88 83
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
89 84
Before you can take advantage of Metacat's replication feature, you must 
90 85
generate security certificates on both the replication partner and home servers. 
91
The certificates will be exchanged so that each machine understands that the 
92
other has replication access.
86
Depending on how the certificates are generated, the certificates may need to be
87
exchanged so that each machine "trusts" that the other has replication access.
88
Certificates that are purchased from a commercial and well-recognized 
89
Certificate Authority do not need to be exchanged with the other replication
90
partner before replication takes place.  Metacat replication relies on SSL with
91
client certificate authentication enabled.  When a replication partner server 
92
communicates with another replication partner, it presents a certificate that
93
serves to verify and authenticate that the server is trusted.
93 94

  
94
The process for generating certificates is different for Metacat servlets 
95
running under Tomcat and those under Tomcat/Apache (the recommended configuration). 
96
For instructions on generating and exchanging certificates on systems running 
97
only Tomcat (and Java 6), see Generating a Certificate for Tomcat standalone 
98
(no Apache).
95
If you must generate a self-signed certificate, the partner replication server 
96
will need the public certificate added to its existing Certificate Authorities. 
99 97

  
100 98
Generate Certificates for Metacat running under Apache/Tomcat
101 99
.............................................................
102 100
Note: Instructions are for Ubuntu/Debian systems.
103 101

  
104
1. Generate a certificate key using openssl. The key will be named 
102
1. Generate a private key using openssl. The key will be named 
105 103
   ``<hostname>-apache.key``, where ``<hostname>`` is the name of your Metacat 
106 104
   server. Example values for the individual key fields are included in the
107 105
   table below.
......
144 142
   you'd like, but keep in mind that the file will be sent to the partner 
145 143
   machine used for replication. The certificate name should have enough 
146 144
   meaning that someone who sees it on that machine can figure out where it 
147
   came from. 
145
   came from and for what purpose it should be used. 
148 146

  
149
3. Enter the certificate into Apache's security configuration. You must 
147
3. Enter the certificate into Apache's security configuration. This will
148
   be used to identify your server to a replication partner. You must 
150 149
   register the certificate in the local Apache instance. Note that the 
151 150
   security files may be in a different directory from the one used in the 
152 151
   instructions depending on how you installed Apache. Copy the certificate and 
......
157 156
     sudo cp <hostname>-apache.crt /etc/ssl/certs 
158 157
     sudo cp <hostname>-apache.key /etc/ssl/private 
159 158

  
160
4. Apache needs to know about Metacat SSL. The helper file named "knb-ssl" has 
161
   rules that tell Apache which traffic to route to the Metacat SSL port. Set up 
162
   SSL by dropping the knb-ssl file into the sites-available directory and 
163
   running ``a2ensite`` to enable the site: 
159
4. Apache needs to be configured to request a “client certificate” when the 
160
   replication API is utilized. The helper file named "knb-ssl" has default 
161
   rules that configure Apache for SSL and client certificate authentication. 
162
   Set up these SSL settings by copying the knb-ssl file into the ``sites-available`` 
163
   directory, editing pertinent values to match your system and running 
164
   ``a2ensite`` to enable the site. (Note: some settings in knb-ssl need to be 
165
   changed to match the specifics of your system.) 
164 166

  
165 167
   ::
166 168
   
......
173 175
   
174 176
     sudo /etc/init.d/apache2 restart
175 177

  
176
6. SCP ``<hostname>-apache.crt`` to the replication partner machine.
178
6. If using a self-signed certificate, SCP ``<hostname>-apache.crt`` to the 
179
   replication partner machine where it will be added as an additional 
180
   Certificate Authority.
177 181

  
178
Generating a Certificate for Tomcat standalone (no Apache)
179
..........................................................
180
If you are running Metacat under Tomcat (no Apache), generate keys in the Java 
181
default key store.  The generated key is placed into the binary certificate's 
182
file located at ``/etc/java-1.5.0-sun/security/cacerts``.
182
If using self-signed certificates, after you have created and SCP'd a 
183
certificate file to each replication partner, and received a certificate file 
184
from each partner in return, both home and partner servers must add the 
185
respective partner certificates as Certificate Authorities.
183 186

  
184
1. Generate the key by running the following command (note that you must be 
185
   logged in as the root user to use the keytool):
186
   
187
   ::
188
    
189
     keytool -genkey -alias <aliasname> -keyalg RSA -validity 800 -keystore /etc/java-1.6.0-sun/security/cacerts
190 187

  
191
   ``<aliasname>`` is a unique name that you choose for this key. Something 
192
   like "<hostname-tomcat>" might be appropriate, where ``<hostname-tomcat>`` 
193
   is the name of the Metacat host. 
194

  
195
2. The Password-keytool will ask for a password. If writing to a pre-existing 
196
   keystore, you must know the password. If you are creating a new keystore, 
197
   the password you enter will become the keystore password. 
198

  
199
   Sample values when creating certificate: 
200

  
201
   ::
202
   
203
     What is your first and last name? myserver.nceas.ucsb.edu (note: use the host name without port number) 
204
     What is the name of your organizional unit? NCEAS 
205
     What is the name of your organizional unit? UCSB 
206
     What is the name of your City or Locality? Santa Barbara 
207
     What is the name of your State or Province? California (note: this is spelled in full) 
208
     What is the two-letter country code for this unit? US 
209

  
210
3. Create a certificate by running the command:
211
   
212
   ::
213
    
214
     keytool -export -alias <aliasname> -file <outputfile>.cert -keystore /etc/java-1.6.0-sun/security/cacerts
215

  
216
   ``<aliasname>`` is the same name you used when you created the key file. A 
217
   file named ``<outputfile>.cert`` will be created in the directory from which 
218
   you ran the keytool command. You can name the output file anything you like, 
219
   but keep in mind that it will be sent to the partner machine used for 
220
   replication. The filename should have enough meaning that someone who sees 
221
   it on that machine can figure out where it came from. Again, something like 
222
   "<hostname>-tomcat.cert" will suffice. 
223

  
224
4. Edit the Tomcat server file at ``$TOMCAT_HOME/conf/server.xml`` to enable 
225
   SSL in Tomcat.
226
    
227
   * Uncomment the section that starts with "<Connector port="8443" ...
228
     (Note: Databased Information comments start with <!-- and end with -->). 
229

  
230
   * Add two attribute to that section: 
231

  
232
     ::
233
     
234
       keystoreFile="/etc/java-1.6.0-sun/security/cacerts"
235
       keystorePass="<keystore_password>"
236

  
237
     where ``<keystore_password>`` is the password you used when you created 
238
     or accessed the keystore. 
239
 
240
5. SCP the certificate to the partner server.
241

  
242 188
To import a certificate
243 189
.......................
244
1. Log in as a root user (the keytool must run as a root user)
190
1. Copy it into the Apache directory
245 191
   
246 192
   ::
247 193
   
248
     sudo su –
194
     sudo cp <remotehostfilename> /etc/ssl/certs/
249 195

  
250
2. Import the remote certificate by running: 
196
2. Rehash the certificates for Apache by running: 
251 197

  
252 198
   ::
253 199
   
254
     keytool -import -alias <remotehostalias> -file <remotehostfilename>.crt -keystore /etc/java-1.6.0-sun/security/cacerts
200
     cd /etc/ssl/certs
201
     sudo c_rehash
255 202

  
203

  
256 204
   where the ``<remotehostfilename>`` is the name of the certificate file 
257 205
   created on the remote partner machine and SCP'd to the home machine. 
258
   The ``<remotehostalias>`` is the name the certificate will use in the 
259
   keystore. The name should identify the remote host. 
260 206

  
261 207
Update your Metacat database
262 208
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
......
272 218
To update your Metacat database to use replication, select the "Add this server" 
273 219
radio button from the Replication Control Panel, enter the partner server name, 
274 220
and specify how the replication should occur (whether to replicate xml, data, 
275
or use the local machine as a hub). Note that you cannot download certificates 
276
using this interface.
221
or use the local machine as a hub).
277 222

  
278 223
To update the database using SQL
279 224
................................
docs/dev/metacat/source/submitting.rst
176 176
wish to appear in the registry.
177 177

  
178 178
Once you have saved your changes, you must restart Tomcat for them to come 
179
into effect. To restart Tomcat, log in as the user that runs your Tomcat 
180
server (often "tomcat") and type: /etc/init.d/tomcat5.5 restart or an 
179
into effect. To restart Tomcat, type: ``sudo /etc/init.d/tomcat6 restart`` or an 
181 180
equivalent command appropriate to your operating system. 
182 181

  
183 182
.. figure:: images/screenshots/image037.jpg
......
794 793

  
795 794
.. Note::
796 795

  
797
  The EarthGrid/EcoGrid web service API is *deprecated* and will be removed from
798
  a future version of Metacat.  Its functionality is being replaced by the 
799
  standardized DataONE REST service interface.
796
  The EarthGrid/EcoGrid web service API is *deprecated* as of Metacat 2.0.0 and 
797
  will be removed from a future version of Metacat.  Its functionality is being 
798
  replaced by the standardized DataONE REST service interface. The EarthGrid API
799
  will be completely removed by the end of 2013.
800 800
   
801 801
The EarthGrid (aka EcoGrid) provides access to disparate data on different 
802 802
networks (e.g., KNB, GBIF, GEON) and storage systems (e.g., Metacat and SRB), 
......
867 867

  
868 868
Creating Your Own Client
869 869
------------------------
870

  
871
.. Note::
872

  
873
  NOTE: The Client API (and underlying servlet implementation) has been 
874
  deprecated as of Metacat 2.0.0. Future development should utilize the DataONE 
875
  REST service methods. The Client API will be completely removed by the end of 2013.
876
  
870 877
Metacat's client API is available in Java and Perl (the Java interface is 
871 878
described in this section and further detailed in the appendix). Some of the 
872 879
API is also available in Python and Ruby. The API allows client applications 
......
876 883

  
877 884
The Client API is defined by the interface edu.ucsb.nceas.metacat.client.Metacat, 
878 885
and all operations are fully defined in the javadoc_ documentation. To use the 
879
client API, include the ``metacat-client.jar``, ``utilities.jar``, and 
886
client API, include the ``metacat-client.jar``, ``utilities.jar``, ``commons-io-2.0.jar``, and 
880 887
``httpclient.jar`` in your classpath. After including these classes, you can 
881 888
begin using the API methods (see the next table). 
882 889

  
docs/dev/metacat/source/intro.rst
103 103
* The appearance of Metacat's Web interface can be customized via skins. 
104 104
* Metacat fully supports the DataONE Member Node interface, allowing Metacat deployments to easily participate in the DataONE federation
105 105

  
106
.. figure:: images/screenshots/image007.jpg
106
.. figure:: images/screenshots/image007.png
107 107
   :align: center
108 108

  
109 109
   Metacat's default home page. Users can customize the appearance using skins.
docs/dev/metacat/source/geoserver.rst
1 1
Metacat's Use of Geoserver
2 2
==========================
3 3

  
4
GeoServer 1.4.0, an open source Web Mapping Service (WMS) written in Java, is 
4
GeoServer 2.0.2, an open source Web Mapping Service (WMS) written in Java, is 
5 5
bundled with Metacat and can be used to render spatial data as web-deliverable 
6
maps (see figure). Metacat uses Community MapBuilder (a pure HTML and JavaScript 
7
application that uses AJAX and XSLT) to provide a web-based user interface for 
8
interacting with the generated maps. You can use any WMS-compatible client 
9
(e.g., ArcGIS, QGIS, JUMP, UDig, OpenLayers, Mapbender, Map Builder). Please 
10
note the mapping functionality is only supported for Metacat servlets running 
11
under Tomcat 6 or later. 
6
maps. Metacat uses OpenLayers (http://openlayers.org/) to provide a web-based 
7
user interface for interacting with the generated maps. You can use any 
8
WMS-compatible client (e.g., ArcGIS, QGIS, JUMP, UDig, OpenLayers, Mapbender, 
9
Map Builder). 
12 10

  
13 11
IMPORTANT: Regardless of whether you plan on using the mapping functionality 
14 12
you should, for security purposes, configure GeoServer so that it doesn't 
15 13
use the default password. For instructions, please see 
16
Geoserver Password Configuration.
14
Geoserver Configuration.
17 15

  
18 16
.. figure:: images/screenshots/image051.jpg
19 17
   :align: center
......
27 25

  
28 26
Currently, GeoServer can be used with the following limitations:
29 27

  
30
* The GeoServer will only map documents that are publicly available. This is 
28
* GeoServer will only map documents that are publicly available. This is 
31 29
  because the mapping server's support for permissions control is not as 
32 30
  fine-grained as Metacat's.
33
* The GeoServer can only access documents that conform to one chosen schema. 
34
  This is because only one set of xpaths can be defined in the Metacat properties.
35
* GeoServer 1.4, the version bundled with Metacat, does not support raster 
36
  input (e.g., satellite imagery or digital elevation models). We suggest 
37
  setting up UMN Mapserver if you aim to serve raster data. 
38 31

  
39 32
Metacat developers plan to continue extending and improving Metacat's mapping 
40 33
capabilities. If you are interested in contributing to those efforts, or if 
41 34
you are interested in learning more about the architecture and future plans for 
42
the mapping software.
35
the mapping software, please contact the Metacat  development 
36
team  (metacat-dev@ecoinformatics.org).
43 37

  
44 38
Installing and Configuring
45 39
--------------------------
46
Metacat's GeoServer is automatically installed when Metacat is installed. If 
47
you do NOT wish to run GeoServer, set the runSpatialOption property in the 
48
``metacat.properties`` file (found in the source code's lib directory) to 
49
false before building and deploying Metacat. 
40
The GeoServer webapp should be installed as a sibling of Metacat. If you do 
41
NOT wish to run GeoServer, the deployment can be skipped, but any skins that 
42
use maps will not render correctly. (NOTE: Geoserver recommends using a PermGen 
43
space setting of at least 128MB.). 
50 44

  
51
The GeoServer bundled with Metacat comes with a world-countries base layer 
52
and a default configuration that is already aware of Metacat's spatial cache. 
53
To further configure GeoServer, use its Web-based configuration utility, 
45
Metacat comes with a pre-configured data directory to be used by GeoServer. 
46
This includes a world-countries base layer and a default configuration that 
47
is already aware of Metacat's spatial cache. The Metacat configuration interface 
48
is used to configure GeoServer to use this shared data directory. To further 
49
configure GeoServer, use the Web-based configuration utility, 
54 50
which is available at: http://your.server.com/context/geoserver.jsp 
55 51
(e.g., http://knb.ecoinformatics.org/knb/geoserver.jsp). 
56 52

  
......
59 55
* Adding a Map to a Web Page or Skin
60 56
* Configuring the Size and Initial Extent of the Map
61 57
* Configuring the Layout of the HTML Mapping Interface
62
* Changing the Lat/Long Display to Degree-Minutes-Seconds
63 58
* Configuring the "Select Location Drop-down Menu
64 59
* Configuring the Visual Portrayal of Geospatial Data (e.g., symbology and color)
65 60
* Adding Other Spatial Datasets to the Web Map
66 61

  
67
.. figure:: images/screenshots/image053.jpg
62
.. figure:: images/screenshots/image053.png
68 63
   :align: center
69 64
   
70 65
   GeoServer's Web-based administrative interface.
71 66

  
72 67
Note: Some configurations may need to be made to the XML files as well.
73 68

  
74
Community Mabuilder, which Metacat uses as the front-end for GeoServer's WMS 
75
service, provides interface components or "widgets" (e.g., the map, a box zoom, 
76
layer list, "Select Location" drop-down menu, scale bar, lat/long coordinates, 
77
and a query form) that make it easy to deploy highly-functional Web mapping 
78
applications with minimal coding. The WMS layers are configured through a Web 
79
Map Context (WMC) document. This context document can be edited to customize 
80
the initial extent of the map, the ordering and visibility of layers and, of 
81
course, the source and name of the WMS layer.
69
OpenLayers, which Metacat uses as the front-end for GeoServer's WMS service, 
70
provides interface components or "widgets" (e.g., the map, a box zoom, layer 
71
list, "Select Location" drop-down menu, scale bar, lat/long coordinates, and 
72
a query form) that make it easy to deploy web-based mapping applications with 
73
minimal coding.
82 74

  
83
Mapbuilder has three main configuration files used to customize the map 
84
interface (Table 5.1). If you plan to customize the map interface, you must 
85
use a source code distribution of Metacat. Default configurations are in::
75
OpenLayers has three main configuration files used to customize the map interface.
76
Default configurations are in::
86 77

  
87
  $METACAT/lib/style/common/spatial_templates/spatial1/
78
  $METACAT/lib/style/common/spatial/
79
  
80
+----------------------------------+---------------+-------------------------------------------------------------+
81
| Document                         | Location      | Description                                                 |
82
+==================================+===============+=============================================================+
83
| The named location file          | locations.jsp | The list of pre-defined locations (name and lat/lon bounds) |
84
+----------------------------------+---------------+-------------------------------------------------------------+
85
| Main map rendering functions     | maps.js       | Defines the map, widgets and their behavior                 |
86
+----------------------------------+---------------+-------------------------------------------------------------+
87
| The rendered map and page layout | map.jsp       | Loads the map and controls the HTML layout of the widgets.  |
88
+----------------------------------+---------------+-------------------------------------------------------------+
88 89

  
89
+--------------------------------+-------------+---------------------------------------------------------------------+
90
| Document                       | Location    | Description                                                         |
91
+================================+=============+=====================================================================+
92
| Web map context document (WMC) | context.xml | The WMC is used to customize the initial extent of the map,         |
93
|                                |             | the order of the map layers, and the source and name of each layer. |
94
+--------------------------------+-------------+---------------------------------------------------------------------+
95
| Mapbuilder configuration file  | context.xml | Defines the Mapbuilder widgets and their behavior                   |
96
+--------------------------------+-------------+---------------------------------------------------------------------+
97
| The Map file                   | map.html    | Loads the Mapbuilder JavaScript library and controls the            |
98
|                                |             | HTML layout of the widgets.                                         |
99
+--------------------------------+-------------+---------------------------------------------------------------------+
100

  
101 90
NOTE: By default, the first time Metacat is restarted, it generates a 
102 91
"spatial cache" containing geographic information about documents in its 
103 92
repository. This default behavior is specified in lib/metacat.properties, 
......
116 105
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
117 106
To add a map to a Web page, simply include the map interface using an iframe:: 
118 107

  
119
  <iframe scrolling="no" frameborder="0" width="736" height="520" 
120
          src="/knb/style/common/spatial_templates/spatial1/map.html">
108
  <iframe scrolling="no" frameborder="0" width="780" height="420" 
109
          src="/knb/style/common/spatial/map.jsp">
121 110
  </iframe>
122 111

  
123
The map URL, ``/knb/style/common/spatial_templates/spatial1/map.html``, is 
124
the default map interface. If you plan to customize the map interface, copy 
125
the spatial1 directory into your skin's directory (either the default or 
112
The map URL, ``/knb/style/common/spatial/map.jsp``, is 
113
the default map interface. If you plan to customize the map interface, copy
114
the map.jsp file into your skin's directory (either the default or 
126 115
customized skin directory). 
127 116

  
128 117
::
129 118

  
130
  cp -r style/common/spatial_templates/spatial1 /style/skins/<myskin>/spatial
119
  cp -r style/common/spatial/map.jsp /style/skins/<myskin>/spatial
131 120

  
132
You can access the customized map with the URL: ``/knb/style/skins/<myskin>/spatial/map.html`` 
121
You can access the customized map with the URL: ``/knb/style/skins/<myskin>/spatial/map.jsp`` 
133 122

  
134 123
Configuring the Size and Initial Extent of the Map
135 124
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
136 125
Before you configure the size and initial extent of the map, make sure that you 
137
have copied the default spatial settings into your skin's directory (see :doc:`configuration`). 
138
Once the settings have been copied, you can modify the map's initial extent in 
139
the context settings: ``${skin.dir}/spatial/context.xml``. 
126
have copied the map layout page into your skin's directory (See 
127
:doc:`configuration` for directions). Once the file has been copied, you can 
128
modify the map's initial extent in: ``${skin.dir}/spatial/map.jsp``.
140 129

  
141
To change the map size and/or initial extent, edit the following lines::
130
To change the map’s initial extent, edit the bounding box. The default is to 
131
show the entire globe. The ``initMap()`` function should also be given the skin 
132
name so that spatial search results can be correctly styled.
142 133

  
143
  <Window width="720" height="360" />
144
  <BoundingBox SRS="EPSG:4326" minx="-180" miny="-90" maxx="180" maxy="90" />
134
::
145 135

  
146
Where ``width`` and ``height`` specify the map size in pixels, ``minx/maxx`` 
147
represent the range of longitudes and ``miny/maxy`` represent the range of latitudes. 
136
  <script type="text/javascript">
137
      function init() {
138
         var bounds = new OpenLayers.Bounds(-180,-90,180,90); 
139
         // make the map for this skin 
140
         initMap("<%=GEOSERVER_URL%>", "<%=SERVLET_URL%>", "default", bounds);
141
      }
142
  </script>
148 143

  
144
The size (height/width) of the map can be controlled by the ``#map`` CSS entry 
145
included in the ``map.jsp`` page.
146

  
149 147
Configuring the Layout of the HTML Mapping Interface
150 148
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
151
Before you configure the size and initial extent of the map, make sure that 
152
you have copied the default spatial settings into your skin's directory. 
153
Once the settings have been copied, you can modify the layout here: 
154
``${skin.dir}/spatial/map.html``.
149
The size and initial extent of the map can be edited in : ${skin.dir}/spatial/map.jsp.
155 150

  
156
``Map.html`` is a simple HTML file with a tabular layout. Map components are 
157
abstracted into "widgets", blocks with a specific id (e.g., locationsSelect 
158
and mainButtonBar), which can be reorganized within the table. 
159
To customize the map extent and appearance, modify the Web map context 
160
document (``context.xml``) and/or Mapbuilder's configuration file (``config.xml``). 
161
Both files are in the spatial directory inside the skins folder.
151
The map.jsp is a simple container that can be included in other more complex 
152
pages if desired. It contains the map, widgets and location dropdown list.
162 153

  
163
Changing the Lat/Long Display to Degree-Minutes-Seconds
164
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
165
By default, the map display shows the cursor's position in decimal degrees 
166
(the preferred format for many GPS/GIS applications). To report coordinates as 
167
degrees minutes-seconds, edit the spatial configuration file:
168

  
169
1. If you have not already copied the default spatial settings into your skin's 
170
   directory, do so now
171
2. Open the ${skin.dir}/spatial/config.xml file.
172
3. Edit the CursorTrack widget so that the content is the following: 
173

  
174
::
175

  
176
  <CursorTrack id="cursorTrack">
177
     <mouseHandler>mainMap</mouseHandler>
178
     <showDMS>true</showDMS>
179
     <showLatLong>true</showLatLong>
180
  </CursorTrack>
181

  
182
4. Save and close the configuration file.
183

  
184 154
Configuring the "Select Location" Drop-down Menu
185 155
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
186
Before you configure the menu items, make sure that you have copied the default 
187
spatial settings into your skin's directory. 
188

  
189 156
The locations that appear in the "Select Location" drop-down menu are specified 
190
in the ``${skin.dir}/spatial/named_locations.xml`` file. Each location is 
191
defined as a ``gml:featureMember``. Edit the featureMember's ``gml:name`` and 
192
``gml:coordinates`` fields to edit or add new locations. 
157
in the ``locations.jsp`` file. The locations.jsp can be copied from the common 
158
spatial template into your skin directory. Each location is defined as an 
159
HTML ``<option/>`` tag. Edit the value and label to edit or add new locations.
193 160

  
194 161
::
195 162

  
196
  <gml:featureMember>
197
     <locationDef>
198
          <gml:name>ACM Wilderness Field Station</gml:name>
199
          <spatialKeyword>
200
               <gml:location>
201
                    <gml:Envelope srsName="http://www.opengis.net/gml/srs/epsg.xml#4326">
202
                         <gml:coordinates>-91.956,47.87 -91.706,48.12</gml:coordinates>
203
                    </gml:Envelope>
204
               </gml:location>
205
          </spatialKeyword>
206
     </locationDef>
207
  </gml:featureMember> 
163
  <option value=“-149.725,68.475 -149.3254,68.725”> Arctic LTER (ARC)</option>
208 164

  
209 165
Configuring the Visual Portrayal of Geospatial Data (e.g., symbology and color)
210 166
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
......
213 169
``/lib/spatial/geoserver/data/styles/`` and are named data_points_style.sld and 
214 170
data_bounds_style.sld, respectively. 
215 171

  
216
You can find a more detailed tutorial on using SLD with GeoServer at::
172
You can find a more detailed tutorial on using SLD with GeoServer in the GeoServer documentation::
217 173

  
218
  http://geoserver.org/display/GEOSDOC/SLD+Intro+Tutorial.
174
  http://docs.geoserver.org/
219 175

  
220 176
Adding Other Spatial Datasets to the Web Map
221 177
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
......
230 186

  
231 187
To register the data set and add it to the map:
232 188

  
233
1. Point your browser to http://your.server/context/geoserver.jsp, log in to 
234
   GeoServer, and navigate to the "Data Stores" configuration page 
235
   under Config > Data > Stores. 
236
2. Create a new Shapefile and assign it a DataStore ID. The DataStore ID can 
237
   contain letters and numbers. It is just used internally, and should be 
238
   unique. Click New.
189
1. Point your browser to ``http://your.server/geoserver``, log in to GeoServer, 
190
   and navigate to the "Data Stores" configuration page under ``Data > Stores``. 
191
2. Create a new vector data source from a Shapefile in the “metacat” workspace.
239 192

  
240
.. figure:: images/screenshots/image055.jpg
193
.. figure:: images/screenshots/image055.png
241 194
   :align: center
242 195
   
243 196
   Creating a new shapefile using GeoServers web-based administrative interface.
244 197

  
245
3. On the next screen, select the "metacat" namespace from the drop-down menu 
246
   and point to the GIS data file on the file system, relative to:
247

  
248
   ::
249

  
250
     {tomcat.dir}/webapps/{context}/
251

  
252
   The Description, if specified, is mostly used internally to provide other 
198
3. The Description, if specified, is mostly used internally to provide other 
253 199
   administrators with information about the DataStore. Click Submit.
200
4. Navigate to the "Layers" configuration page under Data > Layers. 
201
   Add a new Layer from your new data source.
202
5. You should also define a spatial reference system (SRS) number for the new 
203
   layer. Most lat/long data is "4326". If your data is in another projection, 
204
   determine its spatial reference system using the help links provided.
254 205

  
255
4. Navigate to the "Feature Type" configuration page under 
256
   Config > Data > Feature Type. Select your new data store from the 
257
   drop-down menu. Click New.
258
5. Style the layer using a style from the drop-down style menu, or click 
259
   "Create new SLD" to create a new Style object and corresponding SLD 
260
   (this option provides more control over the style). You should also define a 
261
   spatial reference system (SRS) number for the new layer. 
262
   Most lat/long data is "4326". If your data is in another projection,
263
   determine its spatial reference system using the help links provided. 
264

  
265
.. figure:: images/screenshots/image057.jpg
206
.. figure:: images/screenshots/image057.png
266 207
   :align: center
267 208
   
268
   GeoServer's FeatureType Editor. The Style and SRS settings discussed in step 5 are highlighted.
209
   GeoServer's FeatureType configuration. The SRS settings discussed in step 5 are highlighted.
269 210

  
270
6. Click "Apply" and "Save" 
271
7. Try out the styled data set as a WMS layer using a URL like: 
211
6. Style the layer using a style from the drop-down menu on the Publishing tab, 
212
   or create a new SLD to create a new style object and corresponding SLD 
213
   (this option provides more control over the style). 
214
7. Try out the styled data set as a WMS layer using a the Layer Preview.
272 215

  
273
   ::
216
.. figure:: images/screenshots/image058.png
217
   :align: center
218
   
219
   GeoServer's Layer Preview allows you to see an OpenLayer rendering of the new layer.
274 220

  
275
     http://your.server/context/wms?VERSION=1.1.1&REQUEST=GetMap&SERVICE=WMS&LAYERS=metacat:newLayer&SRS=EPSG:4326&BBOX=-180,-90,180,90&WIDTH=720&HEIGHT=360&FORMAT=image/gif&STYLES=&TRANSPARENT=TRUE&UNIQUEID= 
276

  
277
   Where your.server/context is the name of your server and context (e.g., 
278
   http://knb.ecoinformatics.org/knb) and newLayer is the name of the new layer. 
279
   The other parameters control which part of the layer is displayed.
280

  
281
   If data is properly displayed, add the map to your map context document (Step 8).
282

  
283
8. Locate the Web map context document (usually {skin}/spatial/context.xml) and 
284
   open the file in a text editor.
285
9. Locate the Layer entry for an existing layer next to which you wish to stack 
286
   your layer (the first layers in the context are rendered at the bottom). 
287

  
288
10. Create a new Layer entry, by copying and pasting the existing entry for the 
289
    metacat data_points layer and editing the Layer Name and Title. The title 
290
    is displayed in the map legend. Note: if you'd like to use transparency, 
291
    leave the image format set to image/gif (IE pre-7 has trouble with PNG 
292
    transparency).
293

  
294
    ::
295
    
296
      <Layer queryable="0" hidden="0">
297
      <Server service="OGC:WMS" version="1.1.1"
298
      title="DatasetPoints">
299
        <OnlineResource xlink:type="simple" xlink:href="../../../../wms" />
300
      </Server>
301
      <Name>metacat:data_points</Name>
302
      <Title>Dataset Points</Title>
303
      <SRS>EPSG:4326</SRS>
304
      <FormatList>
305
        <Format current="1">image/gif</Format>
306
      </FormatList>
307
      </Layer>
308

  
309
11. Point your browser to the map interface. Your new layer should appear with 
221
8. Copy the default ``map.js`` file that assembles the map in OpenLayers 
222
   (``style/common/spatial/map.js``) to your skin’s spatial directory.
223
9. Edit the init() method to include your new layer in the map – either as an 
224
   overlay or as a base layer.
225
10. Point your browser to the map interface. Your new layer should appear with 
310 226
    the existing ones.
311 227

  
312 228
Adding External Spatial Data Made Publically Available through WMS
313 229
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
314 230
There are hundreds of sources of spatial data made publically available 
315
through WMS. (check out http://wms-sites.com for good catalog). To add these 
316
data sources to your map, locate your skin's context file 
317
(``${skin.dir}/spatial/context.xml``) and add a new Layer by copying and 
318
pasting an existing Layer and modifying as appropriate: modify the 
319
OnlineResourceURL, Name, Title and Style to match the WMS layer you'd like to 
320
use. See the mapbuilder Add WMS Tutorial for further details.
231
through WMS (check out http://wms-sites.com for a good catalog). To add these 
232
data sources to your map, add the layers in your skin’s ``spatial/map.js`` file.
321 233

  
322 234
Spatial Queries
323 235
---------------
docs/dev/metacat/source/install.rst
18 18

  
19 19
  * In order to use the Metacat Registry (and for a more robust Web-serving environment in general), the Apache Web server should be installed with Tomcat and the two should be integrated. See the installing Apache for more information.
20 20

  
21
* Java_ 6 (Note: Java 5 is deprecated)
21
* `Java 6`_ (Note: Java 5 is deprecated)
22 22

  
23 23
.. _PostgreSQL: http://www.postgresql.org/
24 24

  
......
30 30

  
31 31
.. _Apache HTTPD Server: http://httpd.apache.org/
32 32

  
33
.. _Java: http://www.oracle.com/technetwork/java/javaee/overview/index.html
33
.. _Java 6: http://www.oracle.com/technetwork/java/javaee/overview/index.html
34 34

  
35 35
System requirements for running Metacat:
36 36

  
......
58 58
they are doing, here are the steps needed to install Metacat. Detailed
59 59
instructions for each step are in the next section.
60 60

  
61
1. Download and install prerequisites (Java_ 6, `Apache Tomcat`_ 6, PostgreSQL_, `Apache HTTPD Server`_), including the tomcat6 init.d script
61
1. Download and install prerequisites (`Java 6`_, `Apache Tomcat`_ 6, PostgreSQL_, `Apache HTTPD Server`_)
62 62
2. Create a database in PostgreSQL named 'metacat' and authorize access to it in ``pb_hba.conf`` for the user 'metacat'
63 63
3. Log in to PostgreSQL and create the 'metacat' user
64 64
4. Download Metacat from the `Metacat Download Page`_ and extract the archive
65 65
5. ``sudo mkdir /var/metacat; sudo chown -R <tomcat_user> /var/metacat``
66 66
6. ``sudo cp <metacat_package_dir>/knb.war <tomcat_app_dir>``
67
7. ``sudo /etc/init.d/tomcat5.5 restart``
67
7. ``sudo /etc/init.d/tomcat6 restart``
68 68
8. Configure Metacat through the Web interface
69 69

  
70 70
.. _Metacat Download Page: http://knb.ecoinformatics.org/software/metacat/
......
106 106
knb.war            The Metacat Web archive file (WAR) 
107 107
knb                The Web definition file used by Apache on Ubuntu/Debian 
108 108
                   Linux systems. 
109
Knb.ssl            The SSL definition file used by Apache on Ubuntu/Debian 
109
knb.ssl            The SSL definition file used by Apache on Ubuntu/Debian 
110 110
                   Linux systems.
111 111
jk.conf            The JkMount configuration file used by Apache on 
112 112
                   Ubuntu/Debian Linux systems. 
113 113
workers.properties The workers definition file used by Apache on Ubuntu/Debian 
114 114
                   Linux systems. 
115
tomcat5.5          The Tomcat startup script for Tomcat 5.5 installed with 
116
                   apt-get on Ubuntu/Debian Linux systems.
117 115
authority          The optional LSID Server application WAR
118 116
================== ===========================================================
119 117

  
......
181 179
also highly recommend that you install Apache Web server, as it provides a more
182 180
robust Web-serving environment and is required by some Metacat functionality. 
183 181

  
184
* Java_ 6
182
* `Java 6`_
185 183
* `Apache Tomcat`_ 
186 184
* `Apache HTTPD Server`_ (Highly Recommended)
187 185
* PostgreSQL_ Database (or Oracle_)
......
215 213

  
216 214
If you are running Ubuntu_/Debian, get Tomcat by typing::
217 215

  
218
  sudo apt-get install tomcat5.5
216
  sudo apt-get install tomcat6
219 217

  
220 218
Otherwise, get Tomcat from the `Apache Tomcat`_ page.
221 219

  
222
Install the Metacat-friendly Tomcat start-up script by typing::
223

  
224
  sudo /etc/init.d/tomcat5.5 stop
225
  sudo mv /etc/init.d/tomcat5.5 /etc/init.d/tomcat5.5.bak
226
  sudo cp <metacat_package_dir>/debian/tomcat5.5 /etc/init.d/tomcat5.5
227
  sudo chmod +x /etc/init.d/tomcat5.5
228

  
229

  
230 220
Apache HTTPD Server (Highly Recommended)
231 221
........................................
232 222
Although you have the option of running Metacat with only the Tomcat server, we
......
352 342
  sudo /etc/init.d/apache2 restart
353 343

  
354 344

  
355
PostgreSQL Database 
345
PostgreSQL Database
356 346
...................
357 347
Metacat has been most widely tested with PostgreSQL_ and we recommend using it.
358 348
Instructions for installing and configuring Oracle are also included in the
......
486 476

  
487 477
Ant should be installed on your system and the "ant" executable shell script
488 478
should be available in the user's path. The latest Metacat release was tested
489
with Ant 1.6.5. 
479
with Ant 1.8.2. 
490 480

  
491 481
Installing Metacat
492 482
~~~~~~~~~~~~~~~~~~
......
515 505
    sudo chown -R <tomcat_user> /var/metacat
516 506

  
517 507

  
518
3)  Install the Metacat WAR in the Tomcat web-application directory. For instructions on downloading the Metacat WAR, please see Downloading Metacat.  Typically, Tomcat will look for its application files (WAR files) in the <tomcat_home>/webapps directory (e.g., /usr/share/tomcat5.5/webapps). Your instance of Tomcat may be configured to look in a different directory. We will refer to the Tomcat application directory as <tomcat_app_dir>.  NOTE: The name of the WAR file (e.g., knb.war) provides the application context, which appears in the URL of the Metacat (e.g., http://yourserver.com/knb/). To change the context, simply change the name of the WAR file to the desired name before copying it.  To install the Metacat WAR:
508
3.  Install the Metacat WAR in the Tomcat web-application directory. For instructions on downloading the Metacat WAR, please see Downloading Metacat.  Typically, Tomcat will look for its application files (WAR files) in the <tomcat_home>/webapps directory (e.g., /usr/share/tomcat6/webapps). Your instance of Tomcat may be configured to look in a different directory. We will refer to the Tomcat application directory as <tomcat_app_dir>.  NOTE: The name of the WAR file (e.g., knb.war) provides the application context, which appears in the URL of the Metacat (e.g., http://yourserver.com/knb/). To change the context, simply change the name of the WAR file to the desired name before copying it.  To install the Metacat WAR:
519 509

  
520 510
  ::
521 511

  
......
526 516

  
527 517
  ::
528 518

  
529
    /etc/init.d/tomcat5.5 restart
519
    /etc/init.d/tomcat6 restart
530 520

  
531 521
Congratulations! You have now installed Metacat. If everything is installed
532 522
correctly, you should see the Authentication Configuration screen (Figure 2.1)
......
534 524
http://knb.ecoinformatics.org/knb) into a browser. For more information about
535 525
configuring Metacat, please see the Configuration Section.
536 526

  
537
.. figure:: images/screenshots/image009.jpg
527
.. figure:: images/screenshots/image009.png
538 528
   :align: center
539 529

  
540 530
   The Authentication Configuration screen appears the first time you open a 
......
552 542

  
553 543
  ::
554 544

  
555
    /etc/init.d/tomcat5.5 stop
545
    /etc/init.d/tomcat6 stop
556 546

  
557 547
3. Back up the existing Metacat installation. Although not required, we highly recommend that you back up your existing Metacat to a backup directory (<backup_dir>) before installing a new one. You can do so by typing:
558 548

  
......
584 574

  
585 575
  ::
586 576

  
587
    /etc/init.d/tomcat5.5 restart
577
    /etc/init.d/tomcat6 restart
588 578

  
589 579

  
590 580
7. Run your new Metacat servlet. Go to a Web browser and visit your installed
......
710 700

  
711 701
  ::
712 702

  
713
    sudo cp <metacat_package_directory>/authority.war /usr/share/tomcat5.5/webapps
703
    sudo cp <metacat_package_directory>/authority.war /usr/share/tomcat6/webapps
714 704
 
715 705
2. Set up the LSID server by dropping the authority file into Apache's
716 706
   sites-available directory and running a2ensite to enable the site:
......
765 755

  
766 756
  ::
767 757

  
768
    /etc/init.d/tomcat5.5 restart
758
    /etc/init.d/tomcat6 restart
769 759

  
770 760
5. If you are running Tomcat behind the Apache server (the recommended
771 761
   configuration), set up and enable the authority service site configurations by
......
824 814

  
825 815
1. Browse to the KNB Software Download Page. In the Metacat section, select
826 816
   the link that looks like: metacat-bin-X.X.X.zip, where X.X.X is the latest
827
   version of Metacat (e.g., 1.9.0).
817
   version of Metacat (e.g., 2.0.0).
828 818

  
829 819
2. Choose to download and Save the file locally. 
830 820

  
......
844 834
Before you can install and run Metacat, you must ensure that a recent Java SDK,
845 835
PostgreSQL and Tomcat are installed, configured, and running correctly. 
846 836

  
847
* Java_ 6
837
* `Java 6`_
848 838
* `Apache Tomcat`_
849 839
* PostgreSQL_ Database
850 840

  
......
873 863
.............
874 864
We recommend that you install Tomcat version 6.  To download and install Tomcat:
875 865

  
876
1. Browse to: http://tomcat.apache.org/download-55.cgi 
866
1. Browse to: http://tomcat.apache.org/
877 867
2. Download the Tomcat core zip file 
878 868
3. Extract Tomcat files to C:\Program Files\tomcat using the windows zip
879 869
   utility. 
docs/dev/metacat/source/index.rst
2 2
Metacat Administrator's Guide
3 3
=============================
4 4

  
5
.. sidebar:: Version: 2.0.0 Release
5
.. sidebar:: Version: 2.0.0
6 6

  
7 7
    .. image:: themes/readable/static/metacat-logo.png
8 8
       :height: 130pt
......
12 12
        http://bugzilla.ecoinformatics.org
13 13

  
14 14
    License: GPL
15
    Release Date: January 20, 2012
15 16

  
16 17
Metacat is a repository for data and metadata (documentation about data) that helps 
17 18
scientists find, understand and effectively use data sets they manage or that 
docs/dev/metacat/source/configuration.rst
73 73
If you make changes to the authentication settings, you must restart Tomcat to 
74 74
put them into effect.
75 75

  
76
.. figure:: images/screenshots/image013.png
76
.. figure:: images/screenshots/image009.png
77 77
   :align: center
78 78

  
79 79
   Configuring Authentication Values.
......
118 118
In the log-in screen enter your user name and password and click 
119 119
the "Login" button.
120 120

  
121
.. figure:: images/screenshots/image015.jpg
121
.. figure:: images/screenshots/image015.png
122 122
   :align: center
123 123

  
124 124
   Logging into Metacat.
......
169 169
version of Metacat, you must restart the Tomcat server for the changes to 
170 170
take effect.
171 171

  
172
.. Note::
173
   
174
   Need to update this next figure!
175
   
172 176
.. figure:: images/screenshots/image019.png
173 177
   :align: center
174 178

  
......
294 298

  
295 299
   Upgrading an existing database.
296 300

  
297
Geoserver Password Configuration (Highly Recommended)
298
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
301
Geoserver Configuration (Highly Recommended)
302
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
299 303
.. sidebar:: Manual Geoserver Update
300 304

  
301 305
  Alternatively, you can change the Geoserver username and password manually by 
302 306
  directly logging in to the Geoserver. To configure the credentials manually: 
303 307

  
304
  1. Go to the Geoserver admin page: http://<your_context_url>/geoserver.jsp. 
308
  1. Go to the Geoserver admin page: http://<your_context_url>/geoserver/ 
305 309
  2. Log in using the default username and password ( admin / geoserver ) 
306 310
  3. Navigate to the Password Change Page.  Enter a new user and password and click Submit. 
307 311
  4. Click Apply then Save to save your new password. 
308

  
309
  Note that once you change the Geoserver credentials manually, you cannot use 
310
  the Metacat configuration tool to change it again (until a new Metacat 
311
  upgrade or installation).
312 312
  
313 313
Metacat comes bundled with a Web Mapping Service called Geoserver, which 
314 314
converts spatial data into Web-deliverable map images. Geoserver installs with 
315
a default administrative username and password. We highly recommend that you 
316
change the default log-in information so that only local administrators can make 
317
changes to your Geoserver. For more information about Geoserver, 
315
a default administrative username and password. *We highly recommend that you 
316
change the default credentials so that only local administrators can make 
317
changes to your Geoserver.* For more information about Geoserver, 
318 318
see :doc:`geoserver`.
319 319

  
320 320
When you choose the Geoserver Configuration link from the main configuration 
321
screen, Metacat will prompt you for a new user name and password. After you 
322
enter the new credentials, the Metacat server contacts the embedded Geoserver s
323
erver and updates the log-in settings.
321
screen, Metacat will prompt you for a few important details about your Geoserver 
322
installation. The data directory and context settings allow Geoserver and 
323
Metacat to share the same spatial data store and render maps within Metacat skins. 
324
The security configuration prompts for a new admin password. After you enter 
325
the new settings, Metacat writes the information to the Geoserver deployment.
324 326

  
325
If you wish to reset the Geoserver credentials at another time, click the 
326
Bypass button. The Geoserver will remain configured with the default user name 
327
and password, and the main configuration screen will display the "bypassed" 
328
status beside the Geoserver settings. You will be able to run Metacat, just as 
329
if the settings were configured.
327
The default settings are typically appropriate for most Metacat deployments, 
328
but if you wish to skip the Geoserver configuration, click the Bypass button. 
329
Geoserver (if deployed) will remain with a default configuration and the main 
330
Metacat configuration screen will display the "bypassed" status beside the 
331
Geoserver settings. You will be able to run Metacat, but maps will not be 
332
rendered.
330 333

  
331 334
.. figure:: images/screenshots/image031.png
332 335
   :align: center
333 336

  
334
   Resetting the Geoserver password.
337
   Configuring Geoserver.
335 338

  
336 339
Additional Configuration
337 340
------------------------
......
356 359
  <CONTEXT_DIR>/WEB_INF/metacat.properties
357 360

  
358 361
Where ``<CONTEXT_DIR>`` is the directory in which the Metacat application code 
359
lives (e.g., ``/usr/share/tomcat5.5/webapps/knb``). The path is a combination 
360
of the Web application directory (e.g., ``/usr/share/tomcat5.5/webapps/``) and 
362
lives (e.g., ``/var/lib/tomcat6/webapps/knb``). The path is a combination 
363
of the Web application directory (e.g., ``/var/lib/tomcat6/webapps/``) and 
361 364
the Metacat context directory (e.g., ``knb``). Both values depend upon how your 
362 365
system was set up during installation.
363 366

  
......
415 418

  
416 419
  ::
417 420
  
418
    /etc/init.d/tomcat5.5 restart
421
    /etc/init.d/tomcat6 restart
419 422

  
420 423
Navigate to Metacat's Configuration utility  and select the Configure Skins 
421 424
option. Your custom skin should appear as a choice in the skins list. Change 

Also available in: Unified diff