BASEDIR "/src/"; MODULEX MCMS.News EXTENDS Base { VERSION "1.0.0"; GENTABLEXML REPLACE; ENUM visibility (public,useronly,hidden); MODEL Entry { id ObjectID; site_id Integer; instance String(32); created_at DateTime; created_by_id Integer; ~created_by Object; state ENUM visibility; title String(255); content HTML; details HTML; PKEY id; UNIQUE siteinstance site_id,instance; } MODEL Comment { id ObjectID; news_id REF Entry:id DROP=CASCADE ALTER=CASCADE; created_at DateTime; created_by_id Integer; created_by_name String(64); content Text; PKEY id; INDEX news_id news_id; } SERVICE Repos { METHOD getIndex(Integer siteId, String instance); METHOD getHistory(Integer siteId, String instance, Integer page, Integer pagesize, Boolean reverse); METHOD storeEntry(Entry e) STORES e:id IN "m_mcms#news_entrys"; METHOD getEntry(Integer id) GETS id=id AS Entry FROM "m_mcms#news_entrys"; METHOD deleteEntry(Entry c) REMOVES c(id=id) FROM "m_mcms#news_entrys" CASCADE Comment FROM "m_mcms#news_comments"(id=news_id); METHOD getComments(Entry newsEntry, Integer page, Integer pagesize, Boolean reverse); METHOD storeComment(Comment e) STORES e:id IN "m_mcms#news_comments"; METHOD getComment(Integer id) GETS id=id AS Comment FROM "m_mcms#news_comments"; METHOD deleteComment(Comment c) REMOVES c(id=id) FROM "m_mcms#news_comments"; } view index { } view history { } view details { SHOW Entry news; LIST Comment comments:comment { SHOW Comment comment; } } action addComment { } view newEntry NOTEMPLATE { } action createEntry { } view editEntry { FORM Entry news; } action updateEntry { } view delaskEntry { } action deleteEntry { } view delaskComment { } action deleteComment { } }