finished basic account add
[Bookkeeping.git] / src / com / interrupt / bookkeeping / system / BookkeepingSystem.java
blob219bd801f622815f40e714d18a27de925b3a141d
2 package com.interrupt.bookkeeping.system;
5 import java.util.List;
6 import java.util.ArrayList;
7 import java.util.Iterator;
8 import java.util.Map;
9 import java.io.File;
10 import java.io.FileWriter;
12 import org.xmldb.api.DatabaseManager;
13 import org.xmldb.api.base.Collection;
14 import org.xmldb.api.base.Database;
15 import org.xmldb.api.base.XMLDBException;
16 import org.xmldb.api.modules.XMLResource;
18 import com.interrupt.bob.base.IBob;
19 import com.interrupt.bob.base.BobSystem;
21 //import com.interrupt.bob.core.Main;
23 //import com.interrupt.bob.core.IXmlProcessor;
24 //import com.interrupt.bob.core.XmlProcessor;
25 //import com.interrupt.bob.core.IQueue;
26 import com.interrupt.bob.processor.ProcessorException;
27 import com.interrupt.bookkeeping.ISystem;
28 import com.interrupt.spittoon.Spittoon;
30 public class BookkeepingSystem {
33 private static BookkeepingSystem _instance = null;
35 private ISystem MODEL = null;
36 private Spittoon spittoon = null;
39 private BookkeepingSystem() {}
42 public static void initialise() {
43 BookkeepingSystem.instance();
47 // First time calling an instance will initialise the system
48 public static BookkeepingSystem instance() {
50 if(_instance == null) {
51 _instance = new BookkeepingSystem();
52 _instance._initialise();
54 return _instance;
58 public void _initialise() {
60 System.getProperties().setProperty(com.interrupt.bob.util.Util.DEF, BookkeepingSystemProperties.instance().getProperty("bob.def"));
61 System.getProperties().setProperty(com.interrupt.bob.util.Util.BASE, ".");
62 System.getProperties().setProperty(com.interrupt.bob.util.Util.END, ".xml");
64 // initialise BookkeepingSystemProperties
65 BookkeepingSystemProperties.instance();
67 // initialise Spittoon
68 //spittoon = Spittoon.instance();
69 //MODEL = spittoon.load();
72 public void shutdown() {
73 //spittoon.shutdown();
76 public ISystem getMODEL() {
77 return MODEL;
79 public void setMODEL(ISystem model) {
80 MODEL = model;
83 public void saveModel() {
84 //spittoon.save(MODEL);
88 public void updateModel() {
89 //spittoon.updateSystem(MODEL);
93 public void deleteModel() {
94 //spittoon.delete();