<Zymonic schemaVersion="1" maintainerEmailAddress="developers@zednax.com" xmlns="http://www.zymonic.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xh="http://www.w3.org/1999/xhtml" xsi:schemaLocation="http://www.zymonic.com http://www.zymonic.com/zymonic_config.xsd http://www.w3.org/1999/xhtml http://www.w3.org/2002/08/xhtml/xhtml1-strict.xsd">
  <Table>
    <ZName>zz_app_log_upload</ZName>
    <DisplayName>Zymonic App Log Upload</DisplayName>
    <ShortDescription>This allows apps to upload logs and administrators to view them.</ShortDescription>
    <Category>Zymonic</Category>
    <Field sequence="1">
      <ZName>zz_app_log_upload_id</ZName>
      <DisplayName>id</DisplayName>
      <SQLName>id</SQLName>
      <SQLFieldType>int</SQLFieldType>
      <ReadOnly>true</ReadOnly>
      <Hidden>true</Hidden>
    </Field>
    <Field sequence="2">
      <ZName>zz_app_log_upload_username</ZName>
      <DisplayName>Username</DisplayName>
      <SQLName>username</SQLName>
      <SQLFieldType>varchar</SQLFieldType>
      <MaximumLength>255</MaximumLength>
      <ReadOnly>true</ReadOnly>
      <FieldFillCalculation not_on_search="true">
        <ZName>zz_app_log_upload_username_fill</ZName>
        <FromParam>CurrentUser</FromParam>
      </FieldFillCalculation>
    </Field>
    <Field sequence="3" class="DateTime">
      <ZName>zz_app_log_upload_datetime</ZName>
      <DisplayName>Date &amp; Time</DisplayName>
      <ShortDescription>The date and time this log entry was created.</ShortDescription>
      <SQLName>log_datetime</SQLName>
      <MaximumLength>20</MaximumLength>
      <ReadOnly>true</ReadOnly>
      <PreSave>true</PreSave>
      <ClassOptions>
        <CaptureDate>true</CaptureDate>
        <DateFormat>%d/%m/%Y</DateFormat>
        <CaptureTime>true</CaptureTime>
        <TimeZone>
          <SystemOption>
            <ZName>default_timezone</ZName>
          </SystemOption>
        </TimeZone>
      </ClassOptions>
      <RangeSearch>
        <StartLabel>Start Date &amp; Time</StartLabel>
        <StartExtras>
          <ReadOnly>false</ReadOnly>
          <FieldFillCalculation></FieldFillCalculation>
        </StartExtras>
        <EndLabel>End Date &amp; Time</EndLabel>
        <EndExtras>
          <ReadOnly>false</ReadOnly>
          <FieldFillCalculation></FieldFillCalculation>
        </EndExtras>
      </RangeSearch>
      <Hidden>false</Hidden>
      <FieldFillCalculation>
        <ZName>zz_app_log_upload_datetime_fill</ZName>
        <FromParam format="%d/%m/%Y %H:%M:%S">CurrentDateTime</FromParam>
      </FieldFillCalculation>
    </Field>
    <Field class="File" sequence="4">
      <ZName>zz_app_log_upload_file</ZName>
      <DisplayName>Log File</DisplayName>
      <ShortDescription>Upload a log file (large text file accepted).</ShortDescription>
      <ClassOptions>
        <LocalDirectory create_if_not_found="true">/var/log/zymonic</LocalDirectory>
        <CreateLink>true</CreateLink>
      </ClassOptions>
      <SQLName>log_file</SQLName>
      <SQLFieldType>varchar</SQLFieldType>
      <MaximumLength>255</MaximumLength>
    </Field>
    <Field sequence="5">
      <ZName>zz_app_log_upload_comments</ZName>
      <DisplayName>User Comments</DisplayName>
      <ShortDescription>Optional user comments to accompany the uploaded log.</ShortDescription>
      <SQLName>comments</SQLName>
      <SQLFieldType>text</SQLFieldType>
      <ExtraCharacters>\!\#\$\%&amp;\'\(\)\*\+\,\-\.\/\:\;&lt;&gt;\?\@\[\]\^\_\`\{\|\}\~=</ExtraCharacters>
    </Field>
    <Key>
      <ZName>pk_app_log_uploadid</ZName>
      <UniqueKey>true</UniqueKey>
      <Autoincrement>true</Autoincrement>
      <FieldName>id</FieldName>
    </Key>
    <AutoCreateMaintenanceProcess>true</AutoCreateMaintenanceProcess>
    <AutoCreateFilter>true</AutoCreateFilter>
    <AutoCreateRelationshipPermissions>true</AutoCreateRelationshipPermissions>
    <RelationshipPermissions>
      <ZName>zz_append_only_auth</ZName>
    </RelationshipPermissions>
    <RelationshipPermissions>
      <ZName>zz_append_only_unauth</ZName>
    </RelationshipPermissions>
  </Table>
</Zymonic>
