Here's a little pet project I've been working on called Stratta. It's a multi-platform, multi-language, multi-database, multi-server database client. It's still in pretty early development, but most of the difficult parts are completed. It takes in languages, server types (MySQL, Oracle, etc.), and database types (MaNGOS, Ascent, etc.) as plugins specified in XML. While I'm writing the TrinityCore Zero database plugin first, I plan to add MaNGOS very soon. Here are a few early screenshots...
and a quick example of how the database modules work. The programmer makes his own enumeration where necessary, and lays out the schema for the specific search panel. The search panel can do cross-table searches in different database server types (Oracle, MySQL, etc.).
To make the database plugin TrinityCoreZero, I created a class stratta.database.trinityzero.TrinityZero, added the jar to its classpath, then added the following line into the file Databases.xml:
<database name="TrinityCore Zero" class="stratta.database.trinityzero.TrinityZero"/>
TrinityZero implements and interface called TrinityDatabase, which defines all of the necessary procedures. The database class is responsible for the editing dialogs as well as the search schema, so you get both the nice custom GUI when editing an object as well as the functional, easy to implement search. Here is the example getPanels() function in the TrinityZero class which defines the actual content:
public StrattaSearchPanel[] getPanels()
{
StrattaSearchPanel[] panels = new StrattaSearchPanel[3];
panels[0] = createRealmPanel();
panels[1] = createCreaturePanel();
panels[2] = createCreatureSpawnPanel();
return panels;
}
and here is the createRealmPanel() function
private StrattaSearchPanel createRealmPanel()
{
//The search panel constructor takes the tab title, the StrattaDatabase object, and the editing dialog
//as parameters
StrattaSearchPanel realm = new StrattaSearchPanel("Realms", this, new RealmEditDialog(null, true));
realm.addField(new StrattaSchema("Id", "id", "realmlist", long.class));
realm.addField(new StrattaSchema("Name", "name", "realmlist", String.class));
realm.addField(new StrattaSchema("Address", "address", "realmlist", String.class));
realm.addField(new StrattaSchema("Port", "port", "realmlist", int.class));
realm.addField(new StrattaSchema("Icon", "icon", "realmlist", TrinityZeroEnum.RealmIcon.class));
realm.addField(new StrattaSchema("Color", "color", "realmlist", TrinityZeroEnum.RealmColor.class));
realm.addField(new StrattaSchema("Time Zone", "timezone", "realmlist", TrinityZeroEnum.RealmTimeZone.class));
realm.addField(new StrattaSchema("Security Level", "allowedSecurityLevel", "realmlist", int.class));
return realm;
}
You simply pass in the database schema and the editing dialog classes for each tab, and the rest is handled automatically.
Furthermore, I plan to add the ability to pull data straight from database websites such as wowarmory, wowhead, and thottbot. I created a test project to do this as shown in this image
You can download this little test project here.
mirror
Stay tuned for more info!