Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Infowarning

July 19, 2010: These instructions are out-of-date, confusing and need a full review. If you are using Eclipse with DSpace for development, please help us to simplify and clarify these instructions. Please, work with the new page at DSpace IDE - Eclipse, Git, Maven, and Tomcat.

Table of Contents
outlinetrue
stylenone

Eclipse Tools: Prerequisite Installation

...

Unfortunately, there is no remote URL location for the sysdeo plugin. You will have to manually download the plugin and unzip it into the [eclipse]/plugins directory. Also, you will need to have Tomcat installed locally. Obtain the latest version of Tomcat from: http://jakarta.apache.org/tomcat

...

  1. Download the DSpace's Coding Conventions config file: dspace-eclipse-format.xml|IDE Integration - DSpace, Eclipse and Tomcat^dspace-eclipse-format.xml|||^Dspace-eclipse-format.xml|^Dspace-eclipse-format.xml|\Install either as workspace default or for your individual DSpace project(s).
  2. #* (Workspace Default) Select Window -> Preferences in Eclipse. Go to the Java -> Code Style -> Formatter. Click the "Import..." button and select the file.
    • (Individual Project) Right click on the DSpace project, select Properties. Go to the Java -> Code Style -> Formatter. Click the "Import..." button and select the file.

...

  1. Open the Tomcat preferences pane: Window -> Preferences -> Tomcat
  2. Select your installed Tomcat version, and its home page (hit Apply when finished). For example:
    • Tomcat Version: 6.x
    • Tomcat Home: /opt/tomcat6
  3. Under Tomcat -> Advanced, enter the Tomcat Base (hit Apply when finished). This should generally be the same as the Tomcat Home:
    • Tomcat Base: /opt/tomcat6
  4. Under Tomcat -> JVM Settings, you need to enter the JDK's tools.jar file for the "Classpath (before generated classpath)". You should find this in the directory [installed jdk]/lib/tools.jar Note: If you are using Mac OS X, the tools.jar library does not exist on the platform. Instead using classes.jar found at: /System/Library/Frameworks/JavaVM.framework/Versions/${JAVA_VERSION}/Classes/classes.jar
  5. Under Tomcat -> Tomcat Manager App, enter a username and password for the desired manager user. If this user doesn't already exist hit "Add user to tomcat-users.xml" (hit Apply when finished)

...

(If you are working with DSpace 1.5 see the Working with DSpace 1.5 section after this)unmigrated-wiki-markup

_NEEDS UPDATING -- Not sure this actually works\! \ [15 Apr 2008\]_

Checking out DSpace as a Tomcat Project

...

The installation path you give should be:

Code Block

  dspace.dir = <workspace>/dspace/working-copy

where <workspace> is the absolute path to your Eclipse workspace, and "working-copy" is the name of the directory into which we will install the DSpace application. Other configuration that you should ensure are set correctly are as follows (assuming installation on the local machine):

Code Block

  # DSpace base URL.  Include port number etc., but NOT trailing slash
  dspace.url = http://localhost:8080/dspace-svn

  # DSpace host name - should match base URL.  Do not include port number
  dspace.hostname = localhost

  # Name of the site
  dspace.name = DSpace 1.4.x in Eclipse

...

The following resources will be needed to be set to SVN Ignore, to ensure that unwanted resources are not committed to the repository:

Code Block

.cvsignore
.tomcatproject
build/
jsp/local
jsp/WEB-INF/lib
jsp/WEB-INF/web.xml
work
working-copy

...

  • dspace - The root module, which builds all of DSpace and holds the DSpace configurations
  • dspace-api - The DSpace API module, which contains all the primary business logic (Java code)
  • dspace-jspui - The JSP-based User Interface for DSpace
  • dspace-xmlui - The XML-based User Interface for DSpace (also known as Manakin)
    • dspace-xmlui-api - The primary API for the XML-UI for DSpace (including all Aspect Java code)
    • dspace-xmlui-wing - The Digital Repository Interface (DRI) API for XML-UI
    • dspace-xmlui-webapp - The XML-UI web application configurations (including all Aspect & Theme definitions)
  • dspace-oai - The OAI-PMH interface for DSpace
  • dspace-lni - The Lightweight Network Interface (LNI) for DSpace
    • dspace-lni-core - The primary API for LNI
    • dspace-lni-client - The client API for LNI (along with a simple sample client)
    • dspace-lni-webapp - The LNI web application configurations
  • Wiki Markup{{dspace-sword}} \ - The SWORD \ [interface for DSpace
    • dspace-sword-api - The SWORD API
    • dspace-sword-webapp - The SWORD web application
  • language-packs - The Internalization (I18N) language packs for DSpace (Currently JSP-UI only - the I18N for Manakin is in the dspace-xmlui-webapp module)
  • pom.xml - The Maven module, which contains the primary Maven configurations to build DSpace

...

The One-Big-Project Approach

Warning

Eclipse no longer supports the "Enable Nested Modules" option described below. See: https://issues.sonatype.org/browse/MNGECLIPSE-2291

This is the simplest approach and therefore is highly recommended for any new/novice developers. This approach allows you to checkout DSpace 1.5 as a single Eclipse Project. However, it only allows you to define a single user interface to debug tools using the Eclipse Tomcat plugin.

...

To ease building/cleaning your DSpace projects, it's highly recommended to create some quick "tasks" within Eclipse's "External Tools Dialog". To get to the External Tools Dialog, look in the Eclipse toolbar for the Green "play" (>) button with a Red toolbox under it. Click on it, and select "Open External Tools Dialog".

Info

March 3, 2011: If you are using Eclipse 3.6 (Helios), it's important to note that changes in the Eclipse API have both made the project configuration framework more efficient and flexible while making the Maven Build tasks obsolete (source). I will attempt to post more detailed documentation on changes. -petienne

  • DSpace Clean task (Cleans all of DSpace)
    • Right click on "Maven Build" section and select "New"
    • Name it something like "DSpace Clean"
    • Click the "Browse Workspace" button, and select your dspace sub-module (or separate project).
    • In the Goals, enter "clean", click Apply.
  • DSpace Assemble task (Assembles all of DSpace)
    • Right click on "Maven Build" section and select "New"
    • Name it something like "DSpace Assemble"
    • Click the "Browse Workspace" button, and select your dspace sub-module (or separate project).
    • In the Goals, enter "package", click Apply.
  • JSPUI Assemble task (Assembles just the JSP-UI - useful if you only changed the JSP-UI)
    • Right click on "Maven Build" section and select "New"
    • Name it something like "JSPUI Assemble"
    • Click the "Browse Workspace" button, and select your dspace-jspui sub-module (or separate project).
    • In the Goals, enter "package", click Apply.
  • XMLUI Assemble task (Assembles just the XML-UI - useful if you only changed the XML-UI)
    • Right click on "Maven Build" section and select "New"
    • Name it something like "XMLUI Assemble"
    • Click the "Browse Workspace" button, and select your dspace-xmlui sub-module (or separate project).
    • In the Goals, enter "package", click Apply.
  • You can also create tasks to assemble just the OAI-PMH interface (dspace-oai) or LNI (dspace-lni) similar to those for the XMLUI and JSPUI.

...

If you are looking at the Console view in Eclipse, you will know the build has been successful when you see it terminate with a message similar to the following:

Code Block

[INFO] ----------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL org.dspace:dspace:pom:1.5-SNAPSHOT (  task-segment: [package] )
[INFO] ----------------------------------------------------------------------------
[INFO] Total time: 32 second
[INFO] Finished at: Tue Nov 27 14:17:56 CST 2007
[INFO] Memory 8M/63M
[INFO] ----------------------------------------------------------------------------

...

The installation path you give should be:

Code Block

  dspace.dir = <dspace>

where <dspace> is the absolute path of the folder where you want DSpace to be installed. Other configuration that you should ensure are set correctly are as follows (assuming installation on the local machine):

Code Block

  # DSpace base URL.  Include port number etc., but NOT trailing slash
  dspace.url = http://localhost:8080/dspace-jspui

  # DSpace host name - should match base URL.  Do not include port number
  dspace.hostname = localhost

  # Name of the site
  dspace.name = DSpace 1.5

...

Go back into each of the Maven build tasks you defined in the Defining Maven Tasks in Eclipse section above, and add the following parameter:

Code Block

   dspace.config = <dspace>/config/dspace.cfg

...

  • Open the file dspace-svn/src/org/dspace/app/webui/servlet/DSpaceServlet.java
  • Scroll down to the method:
Code Block

 private void processRequest(HttpServletRequest request,
            HttpServletResponse response) throws ServletException, IOException

and find the line of code which reads:

Code Block

  // Are we resuming a previous request that was interrupted for
  // authentication?
  request = Authenticate.getRealRequest(request);

...

  • Open the file <workspace>/dspace-api/src/main/java/org/dspace/browse/Browse.java
  • Scroll down to the method:
Code Block

public static BrowseInfo getItemsByTitle(BrowseScope scope)
            throws SQLException
{
        scope.setBrowseType(ITEMS_BY_TITLE_BROWSE);
        scope.setAscending(true);
        scope.setSortByTitle(null);

        return doBrowse(scope);
}

...