MetaType Xml

Smartsite 7.7 - ...

The MetaType xml defines the data: which fields from which table, datatypes, restrictions, etc.

The example below shows the metatype xml for the FileTypes table.

XML CopyCode image Copy Code
<metatype name="FileTypes" xmlns="http://smartsite.nl/namespaces/metatype/2.0">
  <fields>
    <field name="Nr" primarykey="true">
      <definition datatype="int" nillable="false" />
    </field>
    <field name="Name">
      <definition datatype="string" nillable="false">
        <restriction>
          <maxlength value="50" />
        </restriction>
      </definition>
    </field>
    <field name="Code">
      <definition datatype="string" nillable="false">
        <restriction>
          <maxlength value="20" />
        </restriction>
      </definition>
    </field>
    <field name="nrMimeType">
      <definition relation="1-m">
        <columns keycolumn="nr">
          <column name="nr" datatype="int" nillable="false" />
          <column name="name" datatype="string" />
        </columns>
      </definition>
      <storagehandler>
        <properties>
          <property name="externaltable">MimeTypes</property>
          <property name="externalkeyfield">Nr</property>
          <property name="externalextrafields">Name</property>
        </properties>
      </storagehandler>
    </field>
    <field name="FileExtension">
      <definition datatype="string" nillable="true">
        <restriction>
          <maxlength value="10" />
        </restriction>
      </definition>
    </field>
  </fields>
  <storagehandler handler="DatabaseStorageHandler">
    <properties>
      <property name="table">FileTypes</property>
    </properties>
  </storagehandler>
</metatype>