Skip to content

Commit 4da5973

Browse files
authored
Merge pull request #247 from mendixlabs/misc
Misc
2 parents 962dcae + 0be0143 commit 4da5973

31 files changed

Lines changed: 127 additions & 120 deletions

mdl-examples/doctype-tests/01-domain-model-examples.mdl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1692,7 +1692,7 @@ create persistent entity DmTest.Attachment extends System.FileDocument (
16921692
* plus adds metadata for product catalog display.
16931693
*/
16941694
@position(2300, 200)
1695-
create persistent entity DmTest.ProductPhoto extends System.image (
1695+
create persistent entity DmTest.ProductPhoto extends System.Image (
16961696
/** Photo caption for display */
16971697
PhotoCaption: string(200),
16981698
/** Display sort order */
@@ -1784,7 +1784,7 @@ create persistent entity DmTest.InternalDocument extends System.FileDocument;
17841784
* Both keywords are supported; EXTENDS is preferred for new code.
17851785
*/
17861786
@position(2300, 600)
1787-
create persistent entity DmTest.ProfilePhoto generalization System.image (
1787+
create persistent entity DmTest.ProfilePhoto generalization System.Image (
17881788
/** Whether this photo has been approved by admin */
17891789
IsApproved: boolean default false
17901790
);

mdl-examples/doctype-tests/06-rest-client-examples.mdl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -793,7 +793,7 @@ begin
793793
-- $latestHttpResponse is a system variable (System.HttpResponse) that is
794794
-- automatically populated after SEND REST REQUEST. Check its Content
795795
-- attribute to determine if the call returned data.
796-
if $latestHttpResponse/content != empty then
796+
if $latestHttpResponse/Content != empty then
797797
set $success = true;
798798
log info node 'RestTest' 'ACT_TestHeaders: headers echoed';
799799
else

mdl-examples/doctype-tests/08-security-examples.mdl

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -191,11 +191,11 @@ describe user role 'Administrator';
191191
/**
192192
* Create a simple module role without description.
193193
*/
194-
create module role SecTest.user;
194+
create module role SecTest.User;
195195
/
196196

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

200200
-- ============================================================================
201201
-- Level 2.2: Module Role with Description
@@ -235,7 +235,7 @@ create module role SecTest.Viewer description 'Read-only access for viewing data
235235
/**
236236
* Allow the User role to execute the customer creation microflow.
237237
*/
238-
grant execute on microflow SecTest.ACT_Customer_Create to SecTest.user;
238+
grant execute on microflow SecTest.ACT_Customer_Create to SecTest.User;
239239
/
240240

241241
-- Verify the grant
@@ -249,7 +249,7 @@ show access on microflow SecTest.ACT_Customer_Create;
249249
/**
250250
* Allow both User and Administrator roles to process orders.
251251
*/
252-
grant execute on microflow SecTest.ACT_Order_Process to SecTest.user, SecTest.Administrator;
252+
grant execute on microflow SecTest.ACT_Order_Process to SecTest.User, SecTest.Administrator;
253253
/
254254

255255
-- ============================================================================
@@ -269,7 +269,7 @@ grant execute on microflow SecTest.ACT_Customer_Delete to SecTest.Administrator;
269269
/**
270270
* Remove User's ability to process orders (admin-only now).
271271
*/
272-
revoke execute on microflow SecTest.ACT_Order_Process from SecTest.user;
272+
revoke execute on microflow SecTest.ACT_Order_Process from SecTest.User;
273273
/
274274

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

296296

@@ -308,7 +308,7 @@ grant execute on microflow SecTest.ACT_Customer_Create to SecTest.user;
308308
/**
309309
* Allow users to view the customer overview page.
310310
*/
311-
grant view on page SecTest.Customer_Overview to SecTest.user;
311+
grant view on page SecTest.Customer_Overview to SecTest.User;
312312
/
313313

314314
-- Verify
@@ -322,7 +322,7 @@ show access on page SecTest.Customer_Overview;
322322
/**
323323
* Allow both users and administrators to view orders.
324324
*/
325-
grant view on page SecTest.Order_Overview to SecTest.user, SecTest.Administrator;
325+
grant view on page SecTest.Order_Overview to SecTest.User, SecTest.Administrator;
326326
/
327327

328328
-- ============================================================================
@@ -332,7 +332,7 @@ grant view on page SecTest.Order_Overview to SecTest.user, SecTest.Administrator
332332
/**
333333
* Remove User's view access on order overview (admin-only now).
334334
*/
335-
revoke view on page SecTest.Order_Overview from SecTest.user;
335+
revoke view on page SecTest.Order_Overview from SecTest.User;
336336
/
337337

338338
-- Verify - should only show Administrator
@@ -374,7 +374,7 @@ grant SecTest.Viewer on SecTest.Customer (read *);
374374
/**
375375
* Grant read access to specific attributes, write to a subset.
376376
*/
377-
grant SecTest.user on SecTest.Customer (read (Name, Email), write (Email));
377+
grant SecTest.User on SecTest.Customer (read (Name, Email), write (Email));
378378
/
379379

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

390390
-- Verify entity access
@@ -398,7 +398,7 @@ show access on SecTest.Customer;
398398
/**
399399
* GRANT is additive: adding Notes access preserves existing Name and Email.
400400
*/
401-
grant SecTest.user on SecTest.Customer (read (Notes));
401+
grant SecTest.User on SecTest.Customer (read (Notes));
402402
/
403403

404404
-- ============================================================================
@@ -409,13 +409,13 @@ grant SecTest.user on SecTest.Customer (read (Notes));
409409
* Remove read access on a specific attribute (Notes).
410410
* Other permissions are preserved.
411411
*/
412-
revoke SecTest.user on SecTest.Customer (read (Notes));
412+
revoke SecTest.User on SecTest.Customer (read (Notes));
413413
/
414414

415415
/**
416416
* Downgrade write to read-only on Email.
417417
*/
418-
revoke SecTest.user on SecTest.Customer (write (Email));
418+
revoke SecTest.User on SecTest.Customer (write (Email));
419419
/
420420

421421
-- ============================================================================
@@ -446,7 +446,7 @@ show access on SecTest.Customer;
446446
/**
447447
* Create a user role and assign a single module role.
448448
*/
449-
create or modify user role RegularUser (System.user, SecTest.user);
449+
create or modify user role RegularUser (System.User, SecTest.User);
450450
/
451451

452452
-- ============================================================================
@@ -456,7 +456,7 @@ create or modify user role RegularUser (System.user, SecTest.user);
456456
/**
457457
* A user role can include roles from multiple modules.
458458
*/
459-
create or modify user role PowerUser (System.user, SecTest.user, SecTest.Administrator);
459+
create or modify user role PowerUser (System.User, SecTest.User, SecTest.Administrator);
460460
/
461461

462462
-- ============================================================================
@@ -607,7 +607,7 @@ create module role SecTest.Manager description 'Can manage customers and orders'
607607
* Step 2: Grant microflow access based on roles.
608608
* Users can create customers, managers and admins can do everything.
609609
*/
610-
grant execute on microflow SecTest.ACT_Customer_Create to SecTest.user, SecTest.Manager;
610+
grant execute on microflow SecTest.ACT_Customer_Create to SecTest.User, SecTest.Manager;
611611
grant execute on microflow SecTest.ACT_Customer_Delete to SecTest.Manager, SecTest.Administrator;
612612
grant execute on microflow SecTest.ACT_Order_Process to SecTest.Manager, SecTest.Administrator;
613613
/
@@ -616,7 +616,7 @@ grant execute on microflow SecTest.ACT_Order_Process to SecTest.Manager, SecTest
616616
* Step 3: Grant page access based on roles.
617617
* All roles can see customers, only managers+ can see orders.
618618
*/
619-
grant view on page SecTest.Customer_Overview to SecTest.user, SecTest.Manager, SecTest.Administrator;
619+
grant view on page SecTest.Customer_Overview to SecTest.User, SecTest.Manager, SecTest.Administrator;
620620
grant view on page SecTest.Order_Overview to SecTest.Manager, SecTest.Administrator;
621621
/
622622

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

655655

mdl-examples/doctype-tests/12-styling-examples.mdl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ create page StyleTest.P003_Design_Properties
154154
(
155155
title: 'Design Properties',
156156
layout: Atlas_Core.Atlas_Default,
157-
url: 'style_003_design_properties/{Task}',
157+
url: 'style_003_design_properties/{task}',
158158
params: { $task: StyleTest.task }
159159
)
160160
{

mdl-examples/doctype-tests/14-project-settings-examples.mdl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ drop configuration 'Staging';
124124
/**
125125
* Example 4.1: Set default language
126126
*/
127-
alter settings LANGUAGE DefaultLanguageCode = 'en_US';
127+
alter settings language DefaultLanguageCode = 'en_US';
128128

129129
/**
130130
* Example 4.2: Configure workflow settings

mdl-examples/doctype-tests/alter-workflow.mdl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,13 @@ end;
6565

6666
-- Targeting microflow: (System.Workflow, context) -> List of System.User
6767
create microflow WFTest.ACT_TargetUsers (
68-
$workflow: System.workflow,
68+
$workflow: System.Workflow,
6969
$context: WFTest.OrderContext
7070
)
71-
returns list of System.user as $users
71+
returns list of System.User as $users
7272
begin
7373
@position(200,200)
74-
retrieve $users from System.user;
74+
retrieve $users from System.User;
7575
@position(400,200) return $users;
7676
end;
7777
/
@@ -109,7 +109,7 @@ create page WFTest.AlternateTaskPage (
109109
create page WFTest.OverviewPage (
110110
title: 'Workflow Overview',
111111
layout: Atlas_Core.Atlas_Default,
112-
params: { $workflow: System.workflow }
112+
params: { $workflow: System.Workflow }
113113
) {
114114
layoutgrid g1 {
115115
row r1 {

mdl-examples/doctype-tests/workflow-microflow-actions.mdl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ end workflow;
2929
-- ############################################################################
3030

3131
create microflow TestModule.MF_WorkflowActions (
32-
$workflow: System.workflow,
32+
$workflow: System.Workflow,
3333
$ContextObj: TestModule.DeliveryContext,
3434
$UserTask: System.WorkflowUserTask
3535
)

mdl-examples/mes/02-catalog-domain-model.mdl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ index (SKU);
151151
*/
152152
@position(350, 250)
153153
create persistent entity ProductCatalog.ProductImage
154-
extends System.image (
154+
extends System.Image (
155155
/** Caption describing the image */
156156
ImageCaption: string(500),
157157
/** Whether this is the primary display image */

mdl/backend/mpr/workflow_mutator.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,11 @@ func (m *mprWorkflowMutator) SetProperty(prop string, value string) error {
8585
}
8686
return nil
8787

88-
case "EXPORT_LEVEL":
88+
case "export_level":
8989
dSet(m.rawData, "ExportLevel", value)
9090
return nil
9191

92-
case "DUE_DATE":
92+
case "due_date":
9393
dSet(m.rawData, "DueDate", value)
9494
return nil
9595

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

101101
func (m *mprWorkflowMutator) SetPropertyWithEntity(prop string, value string, entity string) error {
102102
switch prop {
103-
case "OVERVIEW_PAGE":
103+
case "overview_page":
104104
if value == "" {
105105
dSet(m.rawData, "AdminPage", nil)
106106
} else {
@@ -180,7 +180,7 @@ func (m *mprWorkflowMutator) SetActivityProperty(activityRef string, atPos int,
180180
}
181181
return nil
182182

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

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

201-
case "DUE_DATE":
201+
case "due_date":
202202
dSet(actDoc, "DueDate", value)
203203
return nil
204204

mdl/backend/mpr/workflow_mutator_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ func TestWorkflowMutator_SetProperty_ExportLevel(t *testing.T) {
183183
doc = append(doc, bson.E{Key: "ExportLevel", Value: "Usable"})
184184
m := newMutator(doc)
185185

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

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

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

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

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

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

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

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

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

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

0 commit comments

Comments
 (0)