Jump to content

Stratta - Multi-database Editor


Recommended Posts

  • 39 years later...

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...

strattadev.png

strattadev2.png

strattadev3.png

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

screen2lp.png

You can download this little test project here.

mirror

Stay tuned for more info!

Link to comment
Share on other sites

I wrote most of the long creature schema today. It includes the creature template information, but it also does cross-table queries for loot, dialog, spawn locations, etc. As you can see, not everything that appears in the schema is shown in the big table, even though they can be filtered. Eventually, I'm going to make it possible for the user to decide which columns are shown (it's currently a boolean in the schema class).

screen4zf.png

I'll work on making the Creature editing dialog. I think you guys will like it. As soon as the creatures tab for the TrinityZero plugin is complete, I'll slightly modify it for the MaNGOS plugin and release the first version.

nice first post :D

Thanks ^^

ooeh, grabbing data from database websites is one hell of a good idea! I'll be interested to see how you manage that :D

Right now, the idea is that each website will be yet another plugin. The StrattaWebsite interface will have functions to build the URLs for different pages given the ID or name of an object, as well as a parser which takes the html requested from said URL and returns a StrattaResults object (a hash table, basically). The core will then pass this results object to the database plugin, which will fit the data into the database schema before passing it to the server plugin which turns it into a query.

Link to comment
Share on other sites

  • 7 months later...
Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use