Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions mdl-examples/widgetdemo/01-domain-model.mdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
-- WidgetDemo: self-contained domain model (no external dependencies)
-- Provides entities and enumerations for the widget showcase page.

CREATE MODULE WidgetDemo;
CREATE MODULE ROLE WidgetDemo.User;

CREATE ENUMERATION WidgetDemo.ENUM_Priority (
LOW 'Low',
MEDIUM 'Medium',
HIGH 'High',
CRITICAL 'Critical'
);

CREATE ENUMERATION WidgetDemo.ENUM_Status (
DRAFT 'Draft',
ACTIVE 'Active',
COMPLETED 'Completed',
ARCHIVED 'Archived'
);

CREATE ENUMERATION WidgetDemo.ENUM_Category (
GENERAL 'General',
INPUT 'Input',
DISPLAY 'Display',
STRUCTURE 'Structure',
DATA_DISPLAY 'Data Display'
);

CREATE PERSISTENT ENTITY WidgetDemo.DemoItem (
Title: String(unlimited) NOT NULL,
Description: String(unlimited),
Code: String(unlimited),
Category: Enumeration(WidgetDemo.ENUM_Category) DEFAULT WidgetDemo.ENUM_Category.GENERAL,
Priority: Enumeration(WidgetDemo.ENUM_Priority) DEFAULT WidgetDemo.ENUM_Priority.MEDIUM,
ItemStatus: Enumeration(WidgetDemo.ENUM_Status) DEFAULT WidgetDemo.ENUM_Status.DRAFT,
IsActive: Boolean DEFAULT true,
Score: Integer DEFAULT 0,
Amount: Decimal DEFAULT 0,
DateCreated: DateTime,
DueDate: DateTime,
Progress: Decimal DEFAULT 0,
Rating: Integer DEFAULT 3,
Notes: String(unlimited),
ImageUrl: String(unlimited)
);

CREATE NON-PERSISTENT ENTITY WidgetDemo.Helper (
Attribute: Enumeration(WidgetDemo.ENUM_Category) DEFAULT WidgetDemo.ENUM_Category.GENERAL
);

CREATE ASSOCIATION WidgetDemo.Helper_DemoItem (
FROM WidgetDemo.Helper TO WidgetDemo.DemoItem,
Type: ReferenceSet
);

GRANT WidgetDemo.User ON WidgetDemo.DemoItem (CREATE, DELETE, READ *, WRITE *);
6 changes: 6 additions & 0 deletions mdl-examples/widgetdemo/02-snippet.mdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
-- WidgetDemo: Button showcase snippet (referenced by 03-showcase-page)

CREATE SNIPPET WidgetDemo.SNIPPET_ButtonShowcase {
ACTIONBUTTON btnInfo (Caption: 'Info Button', Action: CLOSE_PAGE, ButtonStyle: Info)
ACTIONBUTTON btnLink (Caption: 'Link Button', Action: CLOSE_PAGE, ButtonStyle: Link)
}
Loading