All Versions
- DSpace 7.x (Current Release)
- DSpace 8.x (Unreleased)
- DSpace 6.x (EOL)
- DSpace 5.x (EOL)
- More Versions...
Table of Contents | ||||||
---|---|---|---|---|---|---|
|
The DSpace Spring Service Manager supports overriding configuration at many levels.
...
Configuring Addons to support spring Spring happens at two levels, default spring . Default Spring configuration is available int he dspace jar resources or war in the DSpace JAR or WAR resources directory and allows the addon developer to inject their configuration into the service manager at load time. The second level is in the deployed [dspace.dir ]/config/spring director directory where configurations can be provided on a addon module by addon module basis.unmigrated-wiki-markup
This latter method requires the addon to implement a SpringLoader to identify the location to look for spring Spring configuration and a place configuration files into that location. This can be seen inside the current \ [DSDOCDEV:dspace-src\source]/config/modules/spring.cfg
The ordering of the loading of Spring configuration is the following:
...
There are 2 ways to create a new spring Spring addon: a new spring Spring file can be located in the resources directory or in the configuration [dspace.dir]/config/spring directory. A spring 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 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 Spring files will be processed into services.
...
This directory has the following subdirectories in which spring Spring files can be placed:
The reason why there is a separate directory is that if a service cannot be loaded, which would the case for the configurable workflow (the jspui JSPUI would not be able to retrieve the xmlui XMLUI interface classes), the kernel will crash and DSpace will not start.
...
So you need to indeed create a new directory in [dspace.dir]/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:
...
After the class has been created you will also need to add it add to the "springloader.modules" property located in the [dspace.dir]/config/modules/spring.cfg.
The spring Spring service manager will check this property to ensure that only the interface implementations which it can find the class for are loaded in.
By doing this way we add give some flexibility to the developers so that they can always create their own spring Spring modules & and then spring Spring will not crash when it can't find a certain class.
...
...
Please see the following tutorials:
...
...
TODO: Provide docs similar to:
...
Please see the following tutorials:
new DSpace().getServiceManager().getServiceByName(....);
...
See Please see Architectural Overview here: DSpace Services Framework
...
Please see the DSpace Services Framework
Several good Spring / DSpace Services Tutorials are already available: