The following is a simple example of how you can create a test repository definition file that defines item descriptors and also uses <add-item>
, <remove-item>
, and <query-items>
tags to manipulate repository items.
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <!-- This is a simple xml template demonstrating add-item, remove-item, and query-items tags. --> <!DOCTYPE gsa-template SYSTEM "http://www.atg.com/dtds/gsa/gsa_1.0.dtd"> <gsa-template> <header> <name>Test 1</name> <author>Marty</author> <version>1</version> </header> <!-- This defines the item-descriptor --> <item-descriptor name="users" default="true"> <table name="users" id-column-names="id" type="primary"> <property name="prop1"/> </table> </item-descriptor> <!-- This removes from the database any of 'users' with id = 1 --> <remove-item item-descriptor="users" id="1"/> <!-- This adds to the database an instance of 'users' with id = 1 --> <add-item item-descriptor="users" id="1"> <set-property name="prop1" value="Marty"/> </add-item> <!-- This queries the database for any of 'users' with prop1 = "Marty" --> <query-items item-descriptor="users"> prop1="Marty" </query-items> </gsa-template>