package org.melati.admin.test;

table UploadedFile
    (displayname = "Uploaded File")
    (description = "A file uploaded by a user")
    (category = "Data")
    (cachelimit = unlimited)
    (seqcached) {

    (primary)Integer id
        (displaylevel = summary)
        (sortdescending);

    String filename 
        (size=unlimited) 
        (width=40)
        (description = "The path name of the file, relative to the server root")
        (displaylevel = primary)
        (displayorderpriority = 0)
        (searchability = yes)
        (renderinfo="UploadURL")
        ;

    // Date and time fields added to excercise adaptors
    Date datefield
      (displayname = "Date Field")
      // (description = null)
      // usereditable
      (nullable)
      (width = 20)
      (height = 1)
      // (renderinfo = null)
      // (rangelow_string = null)
      // (rangelimit_string = null)
      (displayorder = 5)
      // usercreateable
      (displaylevel = summary)
      (searchability = yes)
      // (displayorderpriority = null)
      // Not sortdescending
      // Not indexed
      // Not unique
      ;
    Date datefielddropdown
      (displayname = "Date Field")
      // (description = null)
      // usereditable
      (nullable)
      (width = 20)
      (height = 1)
      (renderinfo = "dropdown")
      // (rangelow_string = null)
      // (rangelimit_string = null)
      (displayorder = 5)
      // usercreateable
      (displaylevel = summary)
      (searchability = yes)
      // (displayorderpriority = null)
      // Not sortdescending
      // Not indexed
      // Not unique
      ;
    Date datefieldmydropdown
      (displayname = "Date Field")
      // (description = null)
      // usereditable
      (nullable)
      (width = 20)
      (height = 1)
      (renderinfo = "monthyeardropdown")
      // (rangelow_string = null)
      // (rangelimit_string = null)
      (displayorder = 5)
      // usercreateable
      (displaylevel = summary)
      (searchability = yes)
      // (displayorderpriority = null)
      // Not sortdescending
      // Not indexed
      // Not unique
      ;
    Timestamp timestampfield
      (displayname = "Timestamp Field")
      // (description = null)
      // usereditable
      (nullable)
      (width = 20)
      (height = 1)
      (renderinfo = "dropdown")
      // (rangelow_string = null)
      // (rangelimit_string = null)
      (displayorder = 10)
      // usercreateable
      (displaylevel = summary)
      (searchability = yes)
      // (displayorderpriority = null)
      // Not sortdescending
      // Not indexed
      // Not unique
      ;
    
}

table UploadedImage
    (displayname = "Uploaded Image")
    (description = "An image uploaded by a user")
    (category = "Data")
    (cachelimit = unlimited)
    (seqcached) {

    (primary)Integer id
        (displaylevel = summary)
        (sortdescending);

    String filename 
        (size=unlimited)
        (width=40)
        (description = "The path name of the file, relative to the server root")
        (displaylevel = primary)
        (displayorderpriority = 0)
        (searchability = yes)
        (renderinfo="ImageUpload")
        ;

}
table Parent
    (category = "Data")
    (cachelimit = unlimited)
    (description = "A node with zero or more children")
    (seqcached) {

    (primary)Integer id
        (displaylevel = summary)
        (sortdescending);

    String name
        (size=unlimited) 
        (description = "The name")
        (width=40)
        (displaylevel = primary)
        (displayorderpriority = 0)
        (searchability = yes)
        ;
    UploadedImage image 
        (description = "The image")
        (nullable)
        ;
}
table Child
    (category = "Data")
    (description = "A node with a parent")
    {

        (primary)Integer id
        (displaylevel = summary)
        ;
    Parent parent
        (description="The parent")
        ;
    
    String name
        (size=unlimited) 
        (width=40)
        (description = "The name")
        (displaylevel = primary)
        (displayorderpriority = 0)
        (searchability = yes)
        ;
    UploadedImage image 
        (description = "The image")
        (nullable)
        ;
    Boolean deleted
      (deleted)
      (indexed)
      (description = "Whether deleted")
      (displaylevel = record)
      (searchability = no)
        ;
}


table Specialised
    (displayname = "Specialised")
    (description = "An AdminSpecialised object")
    (category = "Data")
    (cachelimit = unlimited)
    (seqcached) {

    (primary)Integer id
        (displaylevel = summary)
        (sortdescending);

    String name 
        (size=unlimited) 
        (width=40)
        (description = "The name of the thing")
        (displaylevel = primary)
        (displayorderpriority = 0)
        (searchability = yes)
        (renderinfo="UploadURL")
        ;
}
table Markup
    (displayname = "Markup")
    (description = "An HTML markup fragment")
    (category = "Data")
    (cachelimit = unlimited)
    (seqcached) {

    (primary)Integer id
        (displaylevel = summary)
        (sortdescending);

    String text
        (size=unlimited) 
        (width=40)
        (description = "The text")
        (displaylevel = primary)
        (displayorderpriority = 0)
        (searchability = yes)
        ;
}

table User extends org.melati.poem.User 
    (displayorder = 2010)
    (description = "An emailed User")
    (category = "User") {

    String email 
      (size=unlimited) 
      (nullable)
      (width=40)
      (description = "The user's email address")
      (displaylevel = summary)
      (displayorder = 50)
      (searchability = yes);

}


