On Thu, Aug 30, 2012 at 10:43:27AM +0200, Hilton Gibson wrote:
> Please explain?
> What effect would this have on open systems?
> 
> On 29 August 2012 21:07, Mark H. Wood <[email protected]> wrote:
> 
> > Given that DSpace uses a value for dspace.dir passed in by other
> > means, just to *find* dspace.cfg, shouldn't dspace.dir be specifically
> > skipped when loading dspace.cfg?  What would it mean, to redefine
> > dspace.dir in the middle of starting up DSpace?

Dunno about open systems in general.  In DSpace, however, it means
that the place from which DSpace configuration is loaded can change in
the middle of loading said configuration, which might be useful in
special circumstances but is bound to be quite confusing.  Also it's
currently possible, for example, to load the configuration from one
installation of DSpace but use email templates, log directory,
etc. from another one at runtime.  Add "-Ddspace.dir=/dspace1" to
Tomcat startup, write "dspace.dir = /dspace2" in
/dspace1/config/dspace.cfg and watch the fun.

I should mention that these remarks apply to ConfigurationService, but
I don't know if ConfigurationManager behaves the same way.

For your entertainment I append a doc comment that I just expanded to
help me remember how DSpaceConfigurationService.loadInitialConfig()
assembles the configuration:

     * files in the file home and on the classpath.  Order:
     * <ol>
     *  <li>create {@code serverId} from local host name if available.</li>
     *  <li>create {@code dspace.testing = false}.
     *  <li>determine the value of {@code dspace.dir} and add to 
configuration.</li>
     *  <li>load {@code classpath:config/dspace_defaults.cfg}.</li>
     *  <li>copy system properties with names beginning "dspace." 
<em>except</em>
     *      {@code dspace.dir}, removing the "dspace." prefix from the 
name.</li>
     *  <li>load all {@code classpath:dspace/config-*.cfg} using whatever 
matched "*" as module prefix.</li>
     *  <li>load all {@code ${dspace.dir}/config/modules/*.cfg} using whatever 
matched "*" as module prefix.</li>
     *  <li>load {@code classpath:dspace.cfg}.</li>
     *  <li>load {@code ${dspace.dir}/config/dspace.cfg}.</li>
     * </ol>
     * 
     * <p>{@code dspace.dir} is determined thus:</p>
     * <ol>
     *  <li>the value of the system property {@code dspace.dir} if defined;</li>
     *  <li>else the value of {@code providedHome} if not null;</li>
     *  <li>else the servlet container's home + "/dspace/" if defined (see 
{@link getCatalina()});</li>
     *  <li>else the user's home directory if defined;</li>
     *  <li>else "/"
     * </ol>
     * 
     * @param providedHome DSpace home directory, or null.

-- 
Mark H. Wood, Lead System Programmer   [email protected]
Asking whether markets are efficient is like asking whether people are smart.

Attachment: pgp2Mr3wmreHa.pgp
Description: PGP signature

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Dspace-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-devel

Reply via email to