'D_PATRON_ITEMS' : false,
'D_PATRON_CHECKOUT_ITEMS' : false,
- 'D_PATRON_HOLDS' : true,
+ 'D_PATRON_HOLDS' : false,
'D_PATRON_BILLS' : false,
'D_PATRON_EDIT' : false,
- 'D_CHECKIN' : true,
+ 'D_CHECKIN' : false,
'D_CHECKIN_ITEMS' : false,
- 'D_HOLD_CAPTURE' : true,
+ 'D_HOLD_CAPTURE' : false,
'D_HOLD_CAPTURE_ITEMS' : false,
'D_CAT' : false,
'D_EXPLODE' : false,
'D_FM_UTILS' : false,
- 'D_PRINT' : true,
+ 'D_PRINT' : false,
'D_SES' : true,
'D_SES_FUNC' : false,
'D_SES_RESULT' : true,
--- /dev/null
+sdump('D_TRACE','Loading file.js\n');
+
+var dirService = Components.classes["@mozilla.org/file/directory_service;1"].
+ getService( Components.interfaces.nsIProperties );
+
+function create_input_stream(file) {
+ try {
+ if (typeof(file)=='string') file = get_file( file );
+ var f = Components.classes["@mozilla.org/network/file-input-stream;1"]
+ .createInstance(Components.interfaces.nsIFileInputStream);
+ if (file && file.exists()) {
+ f.init(file, 0x01, 0, 0);
+ var s = Components.classes["@mozilla.org/scriptableinputstream;1"]
+ .createInstance(Components.interfaces.nsIScriptableInputStream);
+ if (f) {
+ s.init(f);
+ return s;
+ }
+ }
+ } catch(E) {
+ sdump('D_ERROR', E);
+ }
+ return null;
+}
+
+function create_output_stream(file) {
+ try {
+ if (typeof(file)=='string') file = get_file( file );
+ var f = Components.classes["@mozilla.org/network/file-output-stream;1"]
+ .createInstance(Components.interfaces.nsIFileOutputStream);
+ if (file) {
+ if (! file.exists()) file.create( 0, 0640 );
+ f.init(file, 0x02 | 0x08 | 0x20, 0644, 0);
+ return f;
+ }
+ } catch(E) {
+ sdump('D_ERROR', E);
+ }
+ return null;
+}
+
+function get_file( fname ) {
+ try {
+ file = dirService.get( "AChrom", Components.interfaces.nsIFile );
+ file.append(mw.myPackageDir); file.append("content"); file.append("conf"); file.append("fname");
+ return file;
+ } catch(E) {
+ sdump('D_ERROR', E);
+ return null;
+ }
+}
<script src="error.js" /> <!-- more like output handling -->
<script src="util.js" /> <!-- miscellaneous scripts. want to make this empty -->
+ <script src="file.js" /> <!-- file IO -->
<script src="datetime.js" /> <!-- date & time related functions -->
<script src="functional.js" /> <!-- neat use of first-class functions, and some predecessors -->
<script src="fm_utils.js" /> <!-- some convenience functions for fieldmapper objects -->