Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: added installation notes to install rest api as a module to dspace, and how to update poms to 1.7.1

...

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.

Wiki Markup
To do so, modify \[dspace-rest-api-source\]/pom.xml

Code Block

Index: pom.xml
===================================================================
--- pom.xml	(revision 6356)
+++ pom.xml	(working copy)
@@ -18,7 +18,7 @@
     <parent>
         <artifactId>dspace-parent</artifactId>
         <groupId>org.dspace</groupId>
-        <version>1.6.0-SNAPSHOT</version><!--dspace2.version-->
+        <version>1.7.1</version><!--dspace2.version-->
     </parent>

     <repositories>
@@ -100,7 +100,7 @@
             <groupId>org.dspace</groupId>
             <artifactId>dspace-api</artifactId>
             <scope>compile</scope>
-            <version>1.6.2-SNAPSHOT</version>
+            <version>1.7.1</version>
         </dependency>

         <dependency>
@@ -121,7 +121,7 @@
             <groupId>org.dspace</groupId>
             <artifactId>dspace-jspui-api</artifactId>
             <scope>compile</scope>
-            <version>1.6.2-SNAPSHOT</version>
+            <version>1.7.1</version>
             <exclusions>
                 <exclusion>
                     <groupId>org.dspace</groupId>
@@ -133,7 +133,7 @@
             <groupId>org.dspace</groupId>
             <artifactId>dspace-api-lang</artifactId>
             <scope>compile</scope>
-            <version>1.5.2.2-SNAPSHOT</version>
+            <version>1.7.1.0</version>
         </dependency>

         <!--

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&nbsp;\[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).

...