If the database server is running, we are now ready to go.
Save you changes and (re)start service-linux.sh
Open a terminal and start a mysql session
mysql -u root -p
show databases;
+-------------------+
| Database |
+-------------------+
| ... |
| interformDatabase |
+-------------------+
use interformDatabase;
show tables;
+-----------------------------+
| Tables_in_interformDatabase |
+-----------------------------+
| job |
+-----------------------------+
describe job;
+---------------------+----------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------------+----------+------+-----+---------+----------------+
| c_persist_id | int(11) | NO | PRI | NULL | auto_increment |
| c_was_processed | int(11) | YES | | NULL | |
| c_created_date_time | datetime | YES | | NULL | |
| c_xml | blob | NO | | NULL | |
+---------------------+----------+------+-----+---------+----------------+
insert into job (c_xml, c_was_processed) values ('<xml/>', 0);
select * from job;
+--------------+-----------------+---------------------+--------+
| c_persist_id | c_was_processed | c_created_date_time | c_xml |
+--------------+-----------------+---------------------+--------+
| 1 | 1 | NULL | <xml/> |
+--------------+-----------------+---------------------+--------+
Depending on what you InterFormNG template does you might get an error.
Let's add some more information (fields) to the database.
On the tab 'Hibernate Configuration' add the following before the line '</class>'
<property name="referenceId" column="C_JOB_REFERENCE" />
<property name="serviceLockIdentifier" column="C_JOB_ID" />
<property name="statusCode" column="C_STATUS_CODE" />
<property name="severityCode" column="C_SEVERITY_LEVEL" />
<property name="statusMessage" column="C_STATUS_MESSAGE">
<type name="com.interform400.xml.plugin.db.hibernate.TruncatingStringUserType">
<param name="maxLength">1024</param>
</type>
</property>
<property name="processedDate" column="C_PRINTED_DATE_TIME" />
<property name="processingPriority">
<column name="C_PRIORITY" default="1" />
</property>
<map table="METADATA" name="metaData" lazy="false">
<key column="id" />
<index column="C_METADATA_KEY" type="string" />
<element column="C_METADATA_VALUE" type="string" />
</map>
Save and restart service-linux.sh
In the mysql session you'll notice that there are now 2 tables
show tables;
+-----------------------------+
| Tables_in_interformDatabase |
+-----------------------------+
| job |
| metadata |
+-----------------------------+
describe job;
+---------------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------------+--------------+------+-----+---------+----------------+
| c_persist_id | int(11) | NO | PRI | NULL | auto_increment |
| c_was_processed | int(11) | YES | | NULL | |
| c_created_date_time | datetime | YES | | NULL | |
| c_xml | blob | NO | | NULL | |
| c_job_reference | varchar(255) | YES | | NULL | |
| c_job_id | varchar(255) | YES | | NULL | |
| c_status_code | varchar(255) | YES | | NULL | |
| c_severity_level | int(11) | YES | | NULL | |
| c_status_message | varchar(255) | YES | | NULL | |
| c_printed_date_time | datetime | YES | | NULL | |
| c_priority | int(11) | YES | | 1 | |
+---------------------+--------------+------+-----+---------+----------------+
describe metadata;
+------------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+------------------+--------------+------+-----+---------+-------+
| id | int(11) | NO | PRI | NULL | |
| c_metadata_value | varchar(255) | YES | | NULL | |
| c_metadata_key | varchar(255) | NO | PRI | NULL | |
+------------------+--------------+------+-----+---------+-------+
Try creating a new record.
This time we also get some metadata back.
insert into job (c_xml, c_was_processed) values ('<xml/>', 0);
select * from metadata;
+----+------------------------+-------------------------------------------+
| id | c_metadata_value | c_metadata_key |
+----+------------------------+-------------------------------------------+
| 3 | HP Color LaserJet 4700 | documentType |
| 3 | media | interform.destination.printer.mediaSize |
| 3 | portrait | interform.destination.printer.orientation |
| 3 | archive | mediaType |
+----+------------------------+-------------------------------------------+
This data will of course, depend on what you do in your template.