BASEDIR "/src/"; LIBARY MCMS { VERSION "1.0.1.3"; GENTABLEXML REPLACE; DEFINE LanguId AS String(16); DEFINE InstanceId AS String(64); DEFINE ValueKey AS String(64); ENUM PartType(system,plugin,module,comp); ENUM OnlineStatus(online,maintain,offline,timed); ENUM Visibility(none,user,all,acl); MODEL Model.Website { id ObjectID; parent_id NULLABLE REF Website:id DROP=CASCADE ALTER=CASCADE; domain String(255); online NULLABLE ENUM OnlineStatus; publish_start NULLABLE DateTime; publish_end NULLABLE DateTime; PKEY id; } MODEL Model.WebsiteSetting { site_id NULLABLE REF Website:id DROP=CASCADE ALTER=CASCADE; instance InstanceId; key ValueKey; value NULLABLE String(255); PKEY site_id,instance; } DATAMODEL InstallInfo { type ENUM PartType; key ValueKey; version String(10); attrib Integer; PKEY type,key; } MODEL Model.ModuleInstance { site_id NULLABLE REF Website:id; base_menu_id NULLABLE Integer DEFAULT NULL; instance InstanceId; module String(128); visible NULLABLE ENUM Visibility; publish_start NULLABLE DateTime DEFAULT NULL; publish_end NULLABLE DateTime DEFAULT NULL; PKEY site_id,instance; } MODEL Model.Menu { id ObjectID; site_id NULLABLE REF Website:id; title String(255); visible Integer DEFAULT 7; publish_start NULLABLE DateTime DEFAULT NULL; publish_end NULLABLE DateTime DEFAULT NULL; langu NULLABLE LanguId; // language identifier langukey NULLABLE ValueKey; // common id to sync the text entries of different languages PKEY id; INDEX site_id site_id; } MODEL Model.MenuItem { id ObjectID; menu_id REF Menu:id DROP=CASCADE ALTER=CASCADE; parent_id NULLABLE REF MenuItem:id; real_id Integer DEFAULT 0; title String(255); visible Integer DEFAULT 7; publish_start NULLABLE DateTime DEFAULT NULL; publish_end NULLABLE DateTime DEFAULT NULL; langu NULLABLE LanguId; // language identifier langukey NULLABLE ValueKey; // common id to sync the text entries of different languages priority Short DEFAULT 0; targe Short DEFAULT 0; link String(255); PKEY id; } MODEL Model.MenuBlock { id ObjectID; site_id NULLABLE REF Website:id; block_id String(64); menu_id NULLABLE REF Menu:id; start_level Short; end_level Short; showattr Integer DEFAULT 0; visual String(64); class String(64); PKEY id; UNIQUE site_block site_id,block_id; } DATAMODEL Account { id ObjectID; site_id NULLABLE REF Website:id; login String(160); password String(128); state Short DEFAULT 0; valid_from NULLABLE DateTime DEFAULT NULL; valid_until NULLABLE DateTime DEFAULT NULL; authtoken String(64); last_login NULLABLE DateTime DEFAULT NULL; last_active NULLABLE DateTime DEFAULT NULL; failed_login_count Integer DEFAULT 0; failed_login_last NULLABLE DateTime DEFAULT NULL; failed_login_lastsrc NULLABLE String(64) DEFAULT NULL; email String(255); seed Integer; masteradmin Boolean; PKEY id; INDEX uid site_id,login; } DATAMODEL AccountSetting { id REF Account:id; instance NULLABLE InstanceId; key NULLABLE ValueKey; value String(255); PKEY id,instance,key; } DATAMODEL AccountTextSetting { id REF Account:id; instance NULLABLE InstanceId; key ValueKey; value Text; PKEY id,instance,key; } DATAMODEL AccountBinSetting { id REF Account:id; instance NULLABLE InstanceId; key ValueKey; value Blob; PKEY id,instance,key; } DATAMODEL Group { id ObjectID; site_id NULLABLE REF Website:id; name String(160); state Short DEFAULT 0; masteradmin Boolean; PKEY id; } DATAMODEL Groupmembers { group_id REF Group:id DROP=CASCADE ALTER=CASCADE; account_id REF Account:id DROP=CASCADE ALTER=CASCADE; } DATAMODEL Groupsetting { id REF Group:id DROP=CASCADE ALTER=CASCADE; instance NULLABLE InstanceId; key ValueKey; value String(255); PKEY id,instance,key; } DATAMODEL GroupTextSettings { id REF Group:id; instance NULLABLE InstanceId; key ValueKey; value Text; PKEY id,instance,key; } DATAMODEL GroupBinSettings { id REF Group:id; instance NULLABLE InstanceId; key ValueKey; value Blob; PKEY id,instance,key; } DATAMODEL ACL { account_id NULLABLE REF Account:id; group_id NULLABLE REF Group:id; site_id NULLABLE REF Website:id; instance NULLABLE InstanceId; key ValueKey; value Short DEFAULT 0; INDEX ids account_id,group_id; } MODEL Model.ModuleInstanceACL { account_id NULLABLE REF Account:id; group_id NULLABLE REF Group:id; site_id NULLABLE REF Website:id; instance NULLABLE InstanceId; publish_start NULLABLE DateTime; publish_end NULLABLE DateTime; INDEX site_instance site_id,instance; } MODEL Model.Block { site_id REF Website:id; name String(32); plugin String(128); publish_start NULLABLE DateTime; publish_end NULLABLE DateTime; PKEY site_id,name; } DATAMODEL Log { id LongSerial; parent NULLABLE Long; eventtime DateTime DEFAULT NOW; site_id NULLABLE Integer; level Short; area String(20); areaname NULLABLE String(64); user NULLABLE String(128); code NULLABLE Integer; message String(255); PKEY id; } MODEL Model.Content { id ObjectID; // unique id site_id Integer; instance InstanceId; // module instance key NULLABLE ValueKey; // key langu NULLABLE LanguId; // language identifier langukey NULLABLE ValueKey; // common id to sync the text entries of different languages state Integer; title String(255); descr String(255); content HTML; publish_start NULLABLE DateTime; publish_end NULLABLE DateTime; revision Integer DEFAULT 0; read_count Integer DEFAULT 0; created_by_id NULLABLE UserID DEFAULT NULL; created_by_name NULLABLE String(64) DEFAULT NULL; created_at NULLABLE DateTime DEFAULT NULL; modified_by_id NULLABLE UserID DEFAULT NULL; modified_by_name NULLABLE String(64) DEFAULT NULL; modified_at NULLABLE DateTime DEFAULT NULL; deleted_by_id NULLABLE UserID DEFAULT NULL; deleted_by_name NULLABLE String(64) DEFAULT NULL; deleted_at NULLABLE DateTime DEFAULT NULL; PKEY id; INDEX site_instance site_id,instance,key; } MODEL Model.Comment { id ObjectID; // unique id site_id Integer; instance InstanceId; // module instance key NULLABLE ValueKey; // key state Short DEFAULT 0; parent_id NULLABLE Integer; parent_key NULLABLE ValueKey; parent_comment NULLABLE REF Comment:id; // comment on comments langu NULLABLE LanguId; // language identifier langukey NULLABLE ValueKey; // common id to sync the text entries of different languages revision Integer DEFAULT 0; read_count Integer DEFAULT 0; title String(255) DEFAULT ''; content Text; created_by_id NULLABLE UserID DEFAULT NULL; created_by_name NULLABLE String(64) DEFAULT NULL; created_at NULLABLE DateTime DEFAULT NULL; modified_by_id NULLABLE UserID DEFAULT NULL; modified_by_name NULLABLE String(64) DEFAULT NULL; modified_at NULLABLE DateTime DEFAULT NULL; deleted_by_id NULLABLE UserID DEFAULT NULL; deleted_by_name NULLABLE String(64) DEFAULT NULL; deleted_at NULLABLE DateTime DEFAULT NULL; PKEY id; INDEX site_instance site_id,instance,key; } // ABSTRACT ~MODEL User.UserBase IMPLEMENTS MCMS.User.iUser { // id Integer; // login String(255); // password Password(255); // email EMail; // site_id Integer; // timezone NULLABLE String(16) DEFAULT NULL; // locale NULLABLE String(16) DEFAULT NULL; // last_login NULLABLE DateTime DEFAULT NULL; // last_active NULLABLE DateTime DEFAULT NULL; // failed_login_count NULLABLE Integer DEFAULT NULL; // failed_login_last NULLABLE DateTime DEFAULT NULL; // failed_login_lastsrc NULLABLE String(48) DEFAULT NULL; // masteradmin Boolean; // // METHOD getId=id; // // METHOD getSiteId=NULL; // // METHOD getLogin=ATTRSTRING("login"); // METHOD getPassword=ATTRSTRING("password"); // METHOD setMasterAdmin($value) { // $this->masteradmin = (boolean) $value; // } // METHOD isMasterAdmin() { // return (boolean) $this->masteradmin; // } // METHOD isAuthenticated() { // return $this->id > 0; // } // METHOD __toString=ATTRSTRING("login"); // } SERVICE Service.Content { METHOD getContent(Integer id) GETS id=id AS Content FROM "content"; METHOD storeContent(Content c) STORES c:id IN "content"; } } PLUGIN AUTH MCMS.AuthDefault { VERSION "1.0.1.3"; } PLUGIN AUTH MCMS.AuthADS { VERSION "1.0.1.3"; } PLUGIN AUTH MCMS.AuthLDAP { VERSION "1.0.1.3"; } PLUGIN CONTENT MCMS.MainContent PREFIX MM { VERSION "1.0.1.3"; SERVICE ACL { } SERVICE Instance { METHOD createInstance(Integer siteId, String name, String module, String access); METHOD getInstance(Integer siteId, String name) GETS side_id=siteId,instance=name AS #LIBARY:MCMS.ModuleInstance FROM "moduleinstances"; METHOD removeInstance(Integer siteId, String name); } } PLUGIN CONTENT MCMS.MainMenu { VERSION "1.0.1.3"; }