BASEDIR "/src/"; MODULE MCMS.Guestbook EXTENDS Mod.Base.Base { @version "1.0.2"; GENTABLEXML REPLACE; GENSCRIPT REPLACE "update" UPDATE FROM "1.0.1" { ALTER TABLE entrys ADDCOL email; ALTER TABLE entrys ADDCOL url; ALTER TABLE entrys ADDCOL ip; ALTER TABLE comments ADDCOL email; ALTER TABLE comments ADDCOL url; ALTER TABLE comments ADDCOL ip; } MODEL Entry { id ObjectID; site_id Integer; instance String(32); langu String(5); state Short; email NULLABLE EMail; url NULLABLE URL; content Text; ip NULLABLE String(48); created_by_id NULLABLE UserID; created_by_name String(128); created_at DateTime; modified_by_id NULLABLE UserID; modified_by_name NULLABLE String(128); modified_at NULLABLE DateTime; revision Integer; ~comments Object; ~locked Boolean; PKEY id; INDEX site site_id; } MODEL Comment { id ObjectID; entry_id REF Entry:id DROP=CASCADE ALTER=CASCADE; state Integer; email NULLABLE EMail; url NULLABLE URL; comment Text; ip NULLABLE String(48); created_at DateTime; created_by_id UserID; PKEY id; INDEX entry entry_id; } SERVICE Repos { METHOD storeEntry(Entry e) STORES e:id IN "m_mcms#guestbook_entrys"; METHOD getEntry(String instance, Integer id) GETS instance=instance,id=id AS Entry FROM "m_mcms#guestbook_entrys"; METHOD removeEntry(Entry e) REMOVES e(id=id) FROM "m_mcms#guestbook_entrys"; } view index { LIST Entry entries>entry { SHOW Entry entry; } } view add { SHOW FORM Entry entry; } action addPost { } view addOK { } view delAsk { CHECKPERM delEntry; } action removeEntry { CHECKPERM delEntry; } }