Adjusting the MetaType xml

Smartsite 7.7 - ...

The generated MetaType xml for the FileTypes table is nearly complete, however it does not contain the appropriate field definition(s) for e.g. fields which do have a foreign key relation with another table.

Foreign key relation

The FileTypes table contains the nrMimeType column, which does have a foreign key relation to the MimeTypes table.

To include this information within the MetaType, replace the field definition for this column with the definition as shown below.

XML CopyCode image Copy Code
    <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>