Ignore:
Timestamp:
2004-10-21T15:27:23+13:00 (20 years ago)
Author:
kjdon
Message:

added the engine type as a parm to the constructor - cos we need to use an engine straight away.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/greenstone3-extensions/vishnu/src/vishnu/testvis/object/DataManager.java

    r8344 r8403  
    454454    }
    455455
    456     public DataManager(Vishnu d)
     456    public DataManager(Vishnu d) {
     457    this(d, null);
     458    }
     459    public DataManager(Vishnu d, String engine)
    457460    {
    458461        displayFrame = d;
    459     Engine engine = new Engine(displayFrame);
     462    if (engine != null && !engine.equals("")) {
     463        engine_type = engine;
     464    }
     465    Engine theEngine;
     466    try {
     467        theEngine = (Engine)Class.forName("vishnu.testvis.object."+engine_type).newInstance();
     468    } catch (Exception e) {
     469        System.err.println("Couldn't create an engine "+engine_type+ ", aborting query");
     470        System.err.println(e);
     471        return;
     472    }
     473
     474    theEngine.setDisplay(displayFrame);
    460475    Vector q = new Vector();
    461476    q.addElement("initialise");
    462     collections = engine.getCollections(q);
     477    collections = theEngine.getCollections(q);
    463478    }
    464479
Note: See TracChangeset for help on using the changeset viewer.