Many Turbine applications use Torque to access
databases. M.E.T.A. supplies you with a few schema files to preset your
database and to generate some data which can be put into the
database by running the torque:insert-sql
goal. All
schema files are located in the schema source directory and their
result is put into the target/sql
directory.
M.E.T.A. generates a dummy schema file for you. If want to use Torque to access a database, put your table definitions and data values into these files.
Name | Function | Description |
---|---|---|
<appname>-schema.xml | Torque Table definitions | From this file are the OM peer and object classes and the database specific SQL files to create the tables and indices built. |
<appname>-data.xml | Preset data | Torque allows you to describe data for your custom tables in
an XML file and load it into the database using the
torque:datasql and torque:insert-sql
goals. The syntax of this file is described in the <appname>-data.dtd
file and changes whenever your table definition file changes. |
<appname>-data.dtd | Data Type Definition for your custom tables | If you want to use the data loading goals of torque, you must describe
your data in XML which is validated against this DTD. You
don't have to update this file by hand, you can run the
torque:datadtd goal and copy the resulting file
from target/sql into your schema source directory
directory.The M.E.T.A. generated file is just a dummy because there are no custom tables defined at setup time. |
The plugin supplies you with a configuration file for generating an ID_TABLE
table which is used by the Torque IdBroker to generate unique table row IDs. If you run
the turbine:sql goal, SQL for this table is generated. There are no peer and object classes
for the id table. If you don't need these tables because you use a different way to generate unique IDs (e.g. sequences), you
can set the property turbine.app.torque.use.idtable to false and remove
all id-table related files from the schema source directory.
Even though the default M.E.T.A. setup and the demo application use no security, M.E.T.A. still
generates the necessary tables and informations to write a
security-enabled application.
M.E.T.A. supplies table definition and preset data to be used in
conjunction with the Torque
Security Service. The Schema is similar to the Default
Schema described on the Turbine web site.
M.E.T.A. also provides a demo for presetting security tables from an XML
file. turbine-security-data.xml
and
turbine-security-data.dtd
are provided as examples and
can be safely modified or removed if the values are not suitable for
your application. There is no code inside the M.E.T.A. plugin or the M.E.T.A.
demo application that uses the generated Users, Groups, Roles
or Permissions. These are only for demonstration purposes on how to generate SQL
statements from the XML data schema.
Note that loading security objects from XML files has a major
drawback: If you want to use password encryption, you must put the
encrypted strings into the Password
attributes of the
TurbineUser elements. If you want to put cleartext passwords into
the XML file, you must not use Password encryption (The default
M.E.T.A. configuration uses cleartext passwords).