SimpleAddonMechanism/CodeReorganization

From DSpace Wiki

Jump to: navigation, search

Reorganizing the codebase for 1.5 will open up many doors for dspace modularity. But more simply, in this initial refactoring, we are factoring out the webapplication codebase for the JSPUI and the OAI webapplications into separate projects. These modifications outlined below will complete the following restructuring:

Contents

[edit] Overview

Image:Restructure.png

Itinerary of moves:

dspace-oai
Move dspace/src/org.dspace.app.oaito dspace-oai/src/main/java/org.dspace.app.oai
Move dspace/etc/oai-web.xmlto dspace-oai/src/webapp/WEB-INF/web.xml
Move dspace/lib/oaicat.jarto dspace-oai/lib/oaicat.jar
dspace-jspui
Move dspace/src/org.dspace.app.webappto dspace-jspui/src/main/java/org.dspace.app.webapp
Move dspace/etc/dspace-web.xmlto dspace-jspui/src/webapp/WEB-INF/web.xml
Move dspace/lib/jstl.jarto dspace-jsp/lib/jstl.jar
Move dspace/lib/standard.jarto dspace-jsp/lib/standard.jar
dspace-api
Move dspace/src/org.dspaceto dspace-api/src/main/java/org.dspace
Move dspace/libto dspace-api/lib


These steps describe all the operations necessary to prepare DSpace for 1.5 (dspace-xmlui, addon mechanism, etc). Once the structure has been worked out and the community likes the result this script will be run on the SVN trunk.

[edit] Preparation

  1. Check out DSpace trunk
  2. Apply Media:Uiutil-refactor.patch to release dependencies on webui in mets.MetsExporter

[edit] SVN shell script to accomplish important source tree moves

Sometimes it's better just to converse on a subject in code, Here are the following svn moves and commits to accomplish restructuring above (this doesn't include any refactorings of code, build or configuration, just code, resource and library moves).

Note: Incremental Commits occur throughout this script to assure that parent locations exist in svn repo prior to svn mv's, this helps to assure that file history is properly brought along and the mv doesn't turn into a add without history.

Media:Svn-restructure.sh

[edit] Post Reorganization additions

Apply Media:Create-addon-project-dirs.patch to create the maven pom.xml build descriptors.

[edit] Handling Changes to project organization in the patch queue and working copies.

[edit] Patch Queue

Most patches already require "massaging" the level at which they are applied, there are patches in the patch queue which were made outside of svn and cvs which will never really be applicable.

To get patches that are properly created against the current dspace trunk to be applicable against the new reorganized trunk, I've written a little string replacement ant script that should do the trick.

Media:Build.xml

Place this in the same directory as your patch and execute it using the following command:

ant -Dpatch=<your-file-here>

It will process the paths within the patch so that they point at the appropriate locations. Caution, it's best to make a backup copy and compare them using diff to verify that the paths have been adjusted properly.

[edit] Working copies

  1. If the developer has done minor changes and can save those somewhere, then simply checkout a new copy of trunk and move changes by hand.
  2. If the changes are more pervasive.
    • Create a patch against the current working copy revision
    • process it with the above script to move the file locations
    • reapply the patch to a new checkout of the trunk.
Personal tools