Versions Compared

Key

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

...

Wiki Markup
Configuring Addons to support Spring happens at two levels.  Default Spring configuration is available in the DSpace JAR or WAR resources directory and allows the addon developer to inject configuration into the service manager at load time.  The second level is in the deployed \[dspace\]/config/spring directory where configurations can be provided on a addon module by addon module basis.

...

Wiki Markup
There are 2 ways to create a new Spring addon:  a new Spring file can be located in the resources directory or in the configuration \[dspace\]/config/spring directory. A Spring file can also be located in both of these locations but the configuration directory gets preference and will override any configurations located in the resources directory. 

...

In the resources directory of a certain module, a Spring file can be added if it matches the following pattern: "spring/spring-dspace-addon-*-services.xml". An example of this can be found in the dspace-discovery-solr block in the DSpace trunk. (spring-dspace-addon-discovery-services.xml)
Wherever this jar is loaded (JSPUI module, XMLUI module, DSpace command line, ...) the Spring files will be processed into services.

Wiki Markup
Addon located in the \[dspace\]/config/spring directory

This directory has the following subdirectories in which Spring files can be placed:

...

Wiki Markup
So you need to indeed create a new directory in \[dspace\]/config/spring. Next you need to create a class that inherits from the "org.dspace.kernel.config.SpringLoader". This class only contains one method named getResourcePaths(). What we do now at the moment is implement this in the following manner:

...

Wiki Markup
After the class has been created you will also need to add it to the "springloader.modules" property located in the \[dspace\]/config/modules/spring.cfg.
The Spring service manager will check this property to ensure that only the interface implementations which it can find the class for are loaded in.

...