...
Here I will show two ways to install and test this module.
For both approaches you should have Apache Maven installed. Then proceed using Subversion and check out the code from http://scm.dspace.org/svn/repo/modules/rest/branches/dspace-rest-gsoc10/
1) This way assumes you are running DSpace under Tomcat. Locate src/main/webapp/WEB-INF/web.xml
(under directory you just downloaded DSpace REST API). Find variable named dspace-config
and alter it to point to current location of dspace.cfg
file of your DSpace instance. Position into the root directory of the REST API and type maven package
. If everything goes well, in target
directory will be packaged dspace.war
. Use this file and deploy it to your current Tomcat instance. The application will be available under http://localhost:8080/rest/ by default.
Panel | ||||
---|---|---|---|---|
Note: The code for the REST API from the Google Summer of Code 2010 may be out of date with the latest version of dspace. It may help to import the latest stable version of DSpace through the REST-API pom.
|
For both approaches you should have Apache Maven installed. Then proceed using Subversion and check out the code from http://scm.dspace.org/svn/repo/modules/rest/branches/dspace-rest-gsoc10/
1) This way assumes you are running DSpace under Tomcat. Locate src/main/webapp/WEB-INF/web.xml
(under directory you just downloaded DSpace REST API). Find variable named dspace-config
and alter it to point to current location of dspace.cfg
file of your DSpace instance. Position into the root directory of the REST API and type maven package
. If everything goes well, in target
directory will be packaged dspace.war
. Use this file and deploy it to your current Tomcat instance. The application will be available under http://localhost:8080/rest/ by default.
2) You can run REST API under Jetty container. Proceed with the same steps as under #1. Then instead to deploy .war file to Tomcat web server, from the root of REST API source tree issue command mvn jetty:run-war
. This will run REST support under Jetty and the web point will be available at http://localhost:8080/dspace-rest/ by default.
(Option 3) Install as a DSpace Module
If you have an existing instance of DSpace that you are developing, you can connect the rest api module to your existing code base by adding it as a module.
Wiki Markup |
---|
Modify \[dspace-source\]/dspace/pom.xml by adding the path to the checked out rest code. |
Code Block |
---|
--- a/dspace/pom.xml
+++ b/dspace/pom.xml
@@ -505,6 +505,7 @@
-->
<modules>
<module>modules</module>
+ <module>../../../dspace-rest-gsoc10</module>
</modules>
<build>
|
Once you rebuild your dspace-src code with mvn package and ant update, you will additionally need to copy the compiled .war file produced in the dspace-rest-gsoc10 target directory to tomcat's webapps directory.
Code Block |
---|
cp /path/to/dspace-rest-gsoc10/target/dspace.war /var/lib/tomcat6/webapps/rest.war
|
Afterwards you can restart tomcat and visit the rest api in action at: 2) You can run REST API under Jetty container. Proceed with the same steps as under #1. Then instead to deploy .war file to Tomcat web server, from the root of REST API source tree issue command mvn jetty:run-war
. This will run REST support under Jetty and the web point will be available at http://localhost:8080/dspace-rest/ by default.
Possible problems:
- If you have troubles starting the application, try to check dspace-config
variable and make it to point to location dspace.cfg
using absolute addressing (take a look at commented line in configuration file).
...