Skip to content
Merged

Misc #247

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
4 changes: 2 additions & 2 deletions mdl-examples/doctype-tests/01-domain-model-examples.mdl
Original file line number Diff line number Diff line change
Expand Up @@ -1692,7 +1692,7 @@ create persistent entity DmTest.Attachment extends System.FileDocument (
* plus adds metadata for product catalog display.
*/
@position(2300, 200)
create persistent entity DmTest.ProductPhoto extends System.image (
create persistent entity DmTest.ProductPhoto extends System.Image (
/** Photo caption for display */
PhotoCaption: string(200),
/** Display sort order */
Expand Down Expand Up @@ -1784,7 +1784,7 @@ create persistent entity DmTest.InternalDocument extends System.FileDocument;
* Both keywords are supported; EXTENDS is preferred for new code.
*/
@position(2300, 600)
create persistent entity DmTest.ProfilePhoto generalization System.image (
create persistent entity DmTest.ProfilePhoto generalization System.Image (
/** Whether this photo has been approved by admin */
IsApproved: boolean default false
);
Expand Down
2 changes: 1 addition & 1 deletion mdl-examples/doctype-tests/06-rest-client-examples.mdl
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,7 @@ begin
-- $latestHttpResponse is a system variable (System.HttpResponse) that is
-- automatically populated after SEND REST REQUEST. Check its Content
-- attribute to determine if the call returned data.
if $latestHttpResponse/content != empty then
if $latestHttpResponse/Content != empty then
set $success = true;
log info node 'RestTest' 'ACT_TestHeaders: headers echoed';
else
Expand Down
40 changes: 20 additions & 20 deletions mdl-examples/doctype-tests/08-security-examples.mdl
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,11 @@ describe user role 'Administrator';
/**
* Create a simple module role without description.
*/
create module role SecTest.user;
create module role SecTest.User;
/

-- Describe a specific module role (shows DDL + which user roles include it)
describe module role SecTest.user;
describe module role SecTest.User;

-- ============================================================================
-- Level 2.2: Module Role with Description
Expand Down Expand Up @@ -235,7 +235,7 @@ create module role SecTest.Viewer description 'Read-only access for viewing data
/**
* Allow the User role to execute the customer creation microflow.
*/
grant execute on microflow SecTest.ACT_Customer_Create to SecTest.user;
grant execute on microflow SecTest.ACT_Customer_Create to SecTest.User;
/

-- Verify the grant
Expand All @@ -249,7 +249,7 @@ show access on microflow SecTest.ACT_Customer_Create;
/**
* Allow both User and Administrator roles to process orders.
*/
grant execute on microflow SecTest.ACT_Order_Process to SecTest.user, SecTest.Administrator;
grant execute on microflow SecTest.ACT_Order_Process to SecTest.User, SecTest.Administrator;
/

-- ============================================================================
Expand All @@ -269,7 +269,7 @@ grant execute on microflow SecTest.ACT_Customer_Delete to SecTest.Administrator;
/**
* Remove User's ability to process orders (admin-only now).
*/
revoke execute on microflow SecTest.ACT_Order_Process from SecTest.user;
revoke execute on microflow SecTest.ACT_Order_Process from SecTest.User;
/

-- Verify the revoke
Expand All @@ -290,7 +290,7 @@ revoke execute on microflow SecTest.ACT_Customer_Delete from SecTest.Administrat
/**
* Granting a role that already has access is a no-op (safe to repeat).
*/
grant execute on microflow SecTest.ACT_Customer_Create to SecTest.user;
grant execute on microflow SecTest.ACT_Customer_Create to SecTest.User;
/


Expand All @@ -308,7 +308,7 @@ grant execute on microflow SecTest.ACT_Customer_Create to SecTest.user;
/**
* Allow users to view the customer overview page.
*/
grant view on page SecTest.Customer_Overview to SecTest.user;
grant view on page SecTest.Customer_Overview to SecTest.User;
/

-- Verify
Expand All @@ -322,7 +322,7 @@ show access on page SecTest.Customer_Overview;
/**
* Allow both users and administrators to view orders.
*/
grant view on page SecTest.Order_Overview to SecTest.user, SecTest.Administrator;
grant view on page SecTest.Order_Overview to SecTest.User, SecTest.Administrator;
/

-- ============================================================================
Expand All @@ -332,7 +332,7 @@ grant view on page SecTest.Order_Overview to SecTest.user, SecTest.Administrator
/**
* Remove User's view access on order overview (admin-only now).
*/
revoke view on page SecTest.Order_Overview from SecTest.user;
revoke view on page SecTest.Order_Overview from SecTest.User;
/

-- Verify - should only show Administrator
Expand Down Expand Up @@ -374,7 +374,7 @@ grant SecTest.Viewer on SecTest.Customer (read *);
/**
* Grant read access to specific attributes, write to a subset.
*/
grant SecTest.user on SecTest.Customer (read (Name, Email), write (Email));
grant SecTest.User on SecTest.Customer (read (Name, Email), write (Email));
/

-- ============================================================================
Expand All @@ -384,7 +384,7 @@ grant SecTest.user on SecTest.Customer (read (Name, Email), write (Email));
/**
* Grant access only to active customers using an XPath constraint.
*/
grant SecTest.user on SecTest.Order (read *, write *) where '[Status = ''Open'']';
grant SecTest.User on SecTest.Order (read *, write *) where '[Status = ''Open'']';
/

-- Verify entity access
Expand All @@ -398,7 +398,7 @@ show access on SecTest.Customer;
/**
* GRANT is additive: adding Notes access preserves existing Name and Email.
*/
grant SecTest.user on SecTest.Customer (read (Notes));
grant SecTest.User on SecTest.Customer (read (Notes));
/

-- ============================================================================
Expand All @@ -409,13 +409,13 @@ grant SecTest.user on SecTest.Customer (read (Notes));
* Remove read access on a specific attribute (Notes).
* Other permissions are preserved.
*/
revoke SecTest.user on SecTest.Customer (read (Notes));
revoke SecTest.User on SecTest.Customer (read (Notes));
/

/**
* Downgrade write to read-only on Email.
*/
revoke SecTest.user on SecTest.Customer (write (Email));
revoke SecTest.User on SecTest.Customer (write (Email));
/

-- ============================================================================
Expand Down Expand Up @@ -446,7 +446,7 @@ show access on SecTest.Customer;
/**
* Create a user role and assign a single module role.
*/
create or modify user role RegularUser (System.user, SecTest.user);
create or modify user role RegularUser (System.User, SecTest.User);
/

-- ============================================================================
Expand All @@ -456,7 +456,7 @@ create or modify user role RegularUser (System.user, SecTest.user);
/**
* A user role can include roles from multiple modules.
*/
create or modify user role PowerUser (System.user, SecTest.user, SecTest.Administrator);
create or modify user role PowerUser (System.User, SecTest.User, SecTest.Administrator);
/

-- ============================================================================
Expand Down Expand Up @@ -607,7 +607,7 @@ create module role SecTest.Manager description 'Can manage customers and orders'
* Step 2: Grant microflow access based on roles.
* Users can create customers, managers and admins can do everything.
*/
grant execute on microflow SecTest.ACT_Customer_Create to SecTest.user, SecTest.Manager;
grant execute on microflow SecTest.ACT_Customer_Create to SecTest.User, SecTest.Manager;
grant execute on microflow SecTest.ACT_Customer_Delete to SecTest.Manager, SecTest.Administrator;
grant execute on microflow SecTest.ACT_Order_Process to SecTest.Manager, SecTest.Administrator;
/
Expand All @@ -616,7 +616,7 @@ grant execute on microflow SecTest.ACT_Order_Process to SecTest.Manager, SecTest
* Step 3: Grant page access based on roles.
* All roles can see customers, only managers+ can see orders.
*/
grant view on page SecTest.Customer_Overview to SecTest.user, SecTest.Manager, SecTest.Administrator;
grant view on page SecTest.Customer_Overview to SecTest.User, SecTest.Manager, SecTest.Administrator;
grant view on page SecTest.Order_Overview to SecTest.Manager, SecTest.Administrator;
/

Expand Down Expand Up @@ -648,8 +648,8 @@ show access on page SecTest.Order_Overview;
-- When a module has partial access rules (not all entities covered by all
-- roles), MxBuild reports CE0066 regardless of security level.
revoke SecTest.Administrator on SecTest.Customer;
revoke SecTest.user on SecTest.Customer;
revoke SecTest.user on SecTest.Order;
revoke SecTest.User on SecTest.Customer;
revoke SecTest.User on SecTest.Order;
revoke SecTest.Manager on SecTest.Customer;


2 changes: 1 addition & 1 deletion mdl-examples/doctype-tests/12-styling-examples.mdl
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ create page StyleTest.P003_Design_Properties
(
title: 'Design Properties',
layout: Atlas_Core.Atlas_Default,
url: 'style_003_design_properties/{Task}',
url: 'style_003_design_properties/{task}',
params: { $task: StyleTest.task }
)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ drop configuration 'Staging';
/**
* Example 4.1: Set default language
*/
alter settings LANGUAGE DefaultLanguageCode = 'en_US';
alter settings language DefaultLanguageCode = 'en_US';

/**
* Example 4.2: Configure workflow settings
Expand Down
8 changes: 4 additions & 4 deletions mdl-examples/doctype-tests/alter-workflow.mdl
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@ end;

-- Targeting microflow: (System.Workflow, context) -> List of System.User
create microflow WFTest.ACT_TargetUsers (
$workflow: System.workflow,
$workflow: System.Workflow,
$context: WFTest.OrderContext
)
returns list of System.user as $users
returns list of System.User as $users
begin
@position(200,200)
retrieve $users from System.user;
retrieve $users from System.User;
@position(400,200) return $users;
end;
/
Expand Down Expand Up @@ -109,7 +109,7 @@ create page WFTest.AlternateTaskPage (
create page WFTest.OverviewPage (
title: 'Workflow Overview',
layout: Atlas_Core.Atlas_Default,
params: { $workflow: System.workflow }
params: { $workflow: System.Workflow }
) {
layoutgrid g1 {
row r1 {
Expand Down
2 changes: 1 addition & 1 deletion mdl-examples/doctype-tests/workflow-microflow-actions.mdl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ end workflow;
-- ############################################################################

create microflow TestModule.MF_WorkflowActions (
$workflow: System.workflow,
$workflow: System.Workflow,
$ContextObj: TestModule.DeliveryContext,
$UserTask: System.WorkflowUserTask
)
Expand Down
2 changes: 1 addition & 1 deletion mdl-examples/mes/02-catalog-domain-model.mdl
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ index (SKU);
*/
@position(350, 250)
create persistent entity ProductCatalog.ProductImage
extends System.image (
extends System.Image (
/** Caption describing the image */
ImageCaption: string(500),
/** Whether this is the primary display image */
Expand Down
12 changes: 6 additions & 6 deletions mdl/backend/mpr/workflow_mutator.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@ func (m *mprWorkflowMutator) SetProperty(prop string, value string) error {
}
return nil

case "EXPORT_LEVEL":
case "export_level":
dSet(m.rawData, "ExportLevel", value)
return nil

case "DUE_DATE":
case "due_date":
dSet(m.rawData, "DueDate", value)
return nil

Expand All @@ -100,7 +100,7 @@ func (m *mprWorkflowMutator) SetProperty(prop string, value string) error {

func (m *mprWorkflowMutator) SetPropertyWithEntity(prop string, value string, entity string) error {
switch prop {
case "OVERVIEW_PAGE":
case "overview_page":
if value == "" {
dSet(m.rawData, "AdminPage", nil)
} else {
Expand Down Expand Up @@ -180,7 +180,7 @@ func (m *mprWorkflowMutator) SetActivityProperty(activityRef string, atPos int,
}
return nil

case "TARGETING_MICROFLOW":
case "targeting_microflow":
userTargeting := bson.D{
{Key: "$ID", Value: bsonutil.NewIDBsonBinary()},
{Key: "$Type", Value: "Workflows$MicroflowUserTargeting"},
Expand All @@ -189,7 +189,7 @@ func (m *mprWorkflowMutator) SetActivityProperty(activityRef string, atPos int,
dSet(actDoc, "UserTargeting", userTargeting)
return nil

case "TARGETING_XPATH":
case "targeting_xpath":
userTargeting := bson.D{
{Key: "$ID", Value: bsonutil.NewIDBsonBinary()},
{Key: "$Type", Value: "Workflows$XPathUserTargeting"},
Expand All @@ -198,7 +198,7 @@ func (m *mprWorkflowMutator) SetActivityProperty(activityRef string, atPos int,
dSet(actDoc, "UserTargeting", userTargeting)
return nil

case "DUE_DATE":
case "due_date":
dSet(actDoc, "DueDate", value)
return nil

Expand Down
12 changes: 6 additions & 6 deletions mdl/backend/mpr/workflow_mutator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ func TestWorkflowMutator_SetProperty_ExportLevel(t *testing.T) {
doc = append(doc, bson.E{Key: "ExportLevel", Value: "Usable"})
m := newMutator(doc)

if err := m.SetProperty("EXPORT_LEVEL", "Hidden"); err != nil {
if err := m.SetProperty("export_level", "Hidden"); err != nil {
t.Fatalf("SetProperty EXPORT_LEVEL failed: %v", err)
}
if got := dGetString(m.rawData, "ExportLevel"); got != "Hidden" {
Expand Down Expand Up @@ -436,7 +436,7 @@ func TestWorkflowMutator_SetActivityProperty_DueDate(t *testing.T) {
act = append(act, bson.E{Key: "DueDate", Value: ""})
m := newMutator(makeWorkflowDoc(act))

if err := m.SetActivityProperty("Review", 0, "DUE_DATE", "${PT48H}"); err != nil {
if err := m.SetActivityProperty("Review", 0, "due_date", "${PT48H}"); err != nil {
t.Fatalf("SetActivityProperty DUE_DATE failed: %v", err)
}

Expand Down Expand Up @@ -1220,7 +1220,7 @@ func TestWorkflowMutator_SetActivityProperty_TargetingMicroflow(t *testing.T) {
act = append(act, bson.E{Key: "UserTargeting", Value: nil})
m := newMutator(makeWorkflowDoc(act))

if err := m.SetActivityProperty("Review", 0, "TARGETING_MICROFLOW", "MyModule.AssignReviewer"); err != nil {
if err := m.SetActivityProperty("Review", 0, "targeting_microflow", "MyModule.AssignReviewer"); err != nil {
t.Fatalf("SetActivityProperty TARGETING_MICROFLOW failed: %v", err)
}

Expand All @@ -1242,7 +1242,7 @@ func TestWorkflowMutator_SetActivityProperty_TargetingXPath(t *testing.T) {
act = append(act, bson.E{Key: "UserTargeting", Value: nil})
m := newMutator(makeWorkflowDoc(act))

if err := m.SetActivityProperty("Review", 0, "TARGETING_XPATH", "[Role = 'Admin']"); err != nil {
if err := m.SetActivityProperty("Review", 0, "targeting_xpath", "[Role = 'Admin']"); err != nil {
t.Fatalf("SetActivityProperty TARGETING_XPATH failed: %v", err)
}

Expand All @@ -1265,7 +1265,7 @@ func TestWorkflowMutator_SetPropertyWithEntity_OverviewPage(t *testing.T) {
doc = append(doc, bson.E{Key: "AdminPage", Value: nil})
m := newMutator(doc)

if err := m.SetPropertyWithEntity("OVERVIEW_PAGE", "MyModule.OverviewPage", ""); err != nil {
if err := m.SetPropertyWithEntity("overview_page", "MyModule.OverviewPage", ""); err != nil {
t.Fatalf("SetPropertyWithEntity OVERVIEW_PAGE failed: %v", err)
}

Expand All @@ -1285,7 +1285,7 @@ func TestWorkflowMutator_SetPropertyWithEntity_OverviewPage_Clear(t *testing.T)
}})
m := newMutator(doc)

if err := m.SetPropertyWithEntity("OVERVIEW_PAGE", "", ""); err != nil {
if err := m.SetPropertyWithEntity("overview_page", "", ""); err != nil {
t.Fatalf("SetPropertyWithEntity clear failed: %v", err)
}

Expand Down
6 changes: 3 additions & 3 deletions mdl/executor/cmd_alter_workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ func execAlterWorkflow(ctx *ExecContext, s *ast.AlterWorkflowStmt) error {
switch o := op.(type) {
case *ast.SetWorkflowPropertyOp:
switch o.Property {
case "OVERVIEW_PAGE":
// OVERVIEW_PAGE uses Entity as the page qualified name (Value is unused).
case "overview_page":
// overview_page uses Entity as the page qualified name (Value is unused).
qn := o.Entity.Module + "." + o.Entity.Name
if qn == "." {
qn = ""
Expand Down Expand Up @@ -91,7 +91,7 @@ func execAlterWorkflow(ctx *ExecContext, s *ast.AlterWorkflowStmt) error {
switch o.Property {
case "page":
value = o.PageName.Module + "." + o.PageName.Name
case "TARGETING_MICROFLOW":
case "targeting_microflow":
value = o.Microflow.Module + "." + o.Microflow.Name
}
if err := mutator.SetActivityProperty(o.ActivityRef, o.AtPosition, o.Property, value); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion mdl/executor/cmd_businessevents.go
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ func createBusinessEventService(ctx *ExecContext, stmt *ast.CreateBusinessEventS
msg.TypeName = "BusinessEvents$Message"

// Set publish/subscribe based on operation
switch strings.ToUpper(msgDef.Operation) {
switch strings.ToLower(msgDef.Operation) {
case "publish":
msg.CanSubscribe = true // Service publishes → others subscribe
case "subscribe":
Expand Down
Loading
Loading