[open-ils-commits] r8097 - trunk/Open-ILS/src/java/org/open_ils
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Nov 20 12:24:47 EST 2007
Author: erickson
Date: 2007-11-20 12:07:12 -0500 (Tue, 20 Nov 2007)
New Revision: 8097
Modified:
trunk/Open-ILS/src/java/org/open_ils/Sys.java
Log:
added an optional idlPath param to init plus some docs
Modified: trunk/Open-ILS/src/java/org/open_ils/Sys.java
===================================================================
--- trunk/Open-ILS/src/java/org/open_ils/Sys.java 2007-11-20 16:04:59 UTC (rev 8096)
+++ trunk/Open-ILS/src/java/org/open_ils/Sys.java 2007-11-20 17:07:12 UTC (rev 8097)
@@ -15,6 +15,19 @@
private static IDLParser idlParser = null;
+ /**
+ * Initializes the connection to the OpenSRF network and parses the IDL file.
+ * @param attrs A map of configuration attributes. Options include:<br/>
+ * <ul>
+ * <li>configFile - The OpenSRF core config file</li>
+ * <li>configContext - The path to the config chunk in the config XML, typically "opensrf"</li>
+ * <li>logProtocol - Currently supported option is "file".</li>
+ * <li>logLevel - The log level. Options are 1,2,3, or 4 (error, warn, info, debug)</li>
+ * <li>syslogFacility - For future use, when syslog is a supported log option</li>
+ * <li>idlFile - The path to the IDL file. May be relative or absolute. If this option is
+ * not provided, the system will ask the OpenSRF Settings server for the IDL file path.</li>
+ * </ul>
+ */
public static void init(Map<String, String> attrs) throws ConfigException, SessionException, IOException, IDLException {
String configFile = attrs.get("configFile");
@@ -23,6 +36,7 @@
String logFile = attrs.get("logFile");
String logLevel = attrs.get("logLevel");
String syslogFacility = attrs.get("syslogFacility");
+ String idlFile = attrs.get("idlFile");
if(idlParser != null) {
@@ -42,11 +56,12 @@
/** connect to the opensrf network. */
org.opensrf.Sys.bootstrapClient(configFile, configContext);
- /** Grab the IDL file setting */
- SettingsClient client = SettingsClient.instance();
- String idlFile = client.getString("/IDL");
+ /** Grab the IDL file setting if not explicitly provided */
+ if(idlFile == null) {
+ SettingsClient client = SettingsClient.instance();
+ idlFile = client.getString("/IDL");
+ }
-
/** Parse the IDL if necessary */
idlParser = new IDLParser(idlFile);
idlParser.parse();
More information about the open-ils-commits
mailing list