Download - GBIF Development Tools

southdakotascrawnyData Management

Nov 29, 2012 (4 years and 8 months ago)

202 views

SETTING UP METACAT ND GCAT

Introduction

The document describes how to setup
Metacat

and
GCAT

development environments.

SOFTWARE TOOLS NEEDED

Download

and install the following software and make sure they are in you ENV path.

You will need the following
tools
. Most recent version will do fine.



Java (
http://www.sun.com/java/
)



Tortoise SVN (
http://tortoisesvn.tigris.org/
)



Eclipse (
http://www.eclipse.org/
)



Maven (
http://maven.apache.org/
)



Ant (
http://ant.apache.org/
)



Apache Tomcat (
http://tomcat.apache.org/
)



Post
Gr
es
SQL (
http://www.postgresql.org/
)

THINGS TO NOTE

When installing and setting up eclipse, please add in eclipse subversion plugins as well as maven plugins.




GBIF METADATA
CODE REPOSITORY

The gbif metadata cod
e repository can be found at:

http://code.google.com/p/gbif
-
metadata/source/checkout


PROJECT SETUP

Access the code repository and download the following projects to your local folder

http://code.google.com/p/gbif
-
metadata/source/browse/#svn/trunk/gbif
-
metacatFacade

http://code.google.com/p/gbif
-
metadata/source/browse/#svn/trunk/metacat
-
customisation


Once the checkout is done. Open eclipse to setup the projects.

F
irst setup metacat
-
customisation

METACAT
-
CUSTOMISATION

This project is the KNB
Metacat

project with a few gbif custom changes and updates as well as an import
of other side projects within knb
Metacat

into one general repository.
Initially

the idea was to
build
on
top

on
Metacat

with gbif updates and changes, however it was quickly discovered that
Metacat

was a
brittle project to change and update. As such minimal changes were done to
Metacat

and it was
renamed
Metacat
-
customization. Other side projects within knb such as utilities and eco
-
grid which
Metacat

had some
dependencies

were also
downloaded

and imported into the metacat
-
customisation
repository
.

The new project
GCAT

is the default metadata data project that
co
ntains

gbif
custom interface

into
Metacat
.
GCAT

is a sort
of

façade to
METACAT
. It relies on rest services built on top of
Metacat
.
GCAT
and Metacat therefore go hand in hand.

To read more about knb
Metacat

project
please

see
http://knb.ecoinformatics.org/software/metacat/

It is advisable to read the document on setting up metacat at
http://knb.ecoinformatics.org/software/metacat/

Before
proceeding

with setting up metacat
-
customisation below. In fact you should setup the metacat
database as
described

in the document before proceeding. The metacat setup described in the
document is essentially the same the setup for metacat
-
customisa
tion with a few
caveats

noted below.

Pay special note to how to configure the metacat application as described in the document. It is
essentially how to configure the metacat
-
customisation
application
.

It is always a good idea to be able to run metacat as
it is under knb, to see the differences between
metacat
-
customisation and metacat. You should be able to download knb source metacat source code
from knb and setup the base metacat application just for reference in case you need to verify
something. See kn
b
website

for how to proceed here.


TO SETUP METACAT
-
CUSTOMISATION

1.

Open eclipse and create a new project.

2.

Create it as a

java

project with an ant file.

3.

Browse to metacat
-
customisation folder and select the build.xml there

4.

Renamed the output folder from the

default eclipse ‘bin’ to ‘build’

5.

Make sure that the following directories are included in the src folders

a.

/metacat
-
customisation/src

b.

/metacat
-
customisation/utilities

c.

/metacat
-
customisation/seek

d.


6.


7.

Proceed to create the project.

8.

When the project had been cr
eated, make sure to uncheck ‘Build Project Automatically’ from
eclipse Project menu.

9.

Open up build.properties.

a.

Make sure that the paths in build.properties match your
environment
.

10.

Open up build.xml

a.

You should not have to make any changes here but make sure

that the default target is
war.

11.

Run ant build target ‘war’ to build the project. You should have a knb.war file in the ‘dist’ folder.

12.

Copy the knb.war file to tomcat webapps.

13.

Start tomcat.

14.

Make sure you can access the web application at
http
://<your_host_name_here>:<your_port_here>/knb/

15.

Make sure you can access knb admin page at
http://<your_host_name_here>:<your_port_here>/knb/
admin

16.

If this is your first time setting up the project, I would advise going through the admin page.

17.

Fill out the required fields on the admin page.

18.

And rebuild and restart.

THINGS TO NOTE

19.

Metacat depends on metacat.properties to configure the application. The file is under the lib
directory. It pays to become
familiar

with it.

20.

To setup the metacat databa
se access metacat documentation at knb and read about setting up
metacat. The


Once metacat
-
customisation is up and running, it is time to setup GCAT.


SETTING UP GCAT.

The idea of GCAT comes from the fact the customizing metacat was not easy.

It was decided to create a façade interface to metacat and allow metacat to essentially exist at it is and
implement new gbif metadata requirements under GCAT. To do this metacat was enhanced with a rest
API to call into metacat functionality. GCAT then ca
lls metacat using the rest API. GCAT reproduces the
metacat User Interface and acts as the front to metacat now.


GCAT is a maven project once GCAT has been checked out from the repository from a command line do
the following to setup GCAT.

1.

Access the GCAT

root folder

2.

Run the following command ‘mvn clean install’

3.

Once the command has run successfully run the following command

4.

‘mvn eclipse:eclipse’

5.

Once this has run successfully

6.

Open Eclipse and import the GCAT project as a maven project into eclipse.

7.

Run
maven install from eclipse to build the project again

8.

The output war file should be in the target folder

9.

Copy gcat.war to your tomcat webapps folder.

10.

Start tomcat and access
GCAT

at
http://<your_host_name_here>:<your_port_here>/gcat/


BUILDIN
G METACAT AND GCAT FOR THE PRODUCTION ENVIRONMENT

There are a few changes to note when building metacat
-
customisation and
GCAT

for deployment to the
test/production server. The test server is called metacatdev.gbif.org.

TO BUILD METACAT
-
CUSTOMISATION for m
etacatdev.

1.

In the lib folder, c
opy metac
at.properties
to metacat.properties.windows to save the current
copy.

2.

Review metacat.properties and m
ake sure that any updates to your metacat.properties are
rolled into metacat.properties.metacatdev.

3.

Overwrite metac
at.properties in the lib folder with metacat.properties.metacatdev.

4.

Run ant build.

5.

Copy the knb.war file to metacatdev.gbif.org.

6.

Deploy it under the tomcat installed there.

7.

Overwrite

metacat.properties with metacat.properties.windows.


TO BUILD GCAT for m
etacatdev

1.

In the resources folder, c
opy
application
.properties to
application.
properties.
dev

to save the
current copy.

2.

Review application.properties and m
ake sure that any updates to your
application.
properties
are rolled into
application.properties
.
prod
.

3.

Overwrite
application.properties
in the
resource

folder with
application.properties.prod.

4.

Run ant build.

5.

Copy the
gcat.
war file to metacatdev.gbif.org.

6.

Deploy it under the tomcat installed there.

7.

Overwrite

application.properties
with
application.propertie
s.dev

NOTE : UPDATE THIS DOCUMENT AS NEEDED IF THINGS CHANGES OR MISSING DETAILS OR STEPS ARE
FOUND