Skip to content

Commit 11f8068

Browse files
akoclaude
andcommitted
docs: add DROP FOLDER documentation, examples, and help text
- Add docs-site reference page (drop-folder.md) - Add MDL example file (18-folder-examples.mdl) - Update quick reference, skills, help topics, and SUMMARY - Update create-folder.md See Also links Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent cdb0b73 commit 11f8068

File tree

8 files changed

+167
-1
lines changed

8 files changed

+167
-1
lines changed

.claude/skills/mendix/organize-project.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,26 @@ MOVE ENTITY CRM.Customer TO CustomerModule;
202202
MOVE ENUMERATION CRM.OrderStatus TO SharedModule;
203203
```
204204

205+
## Deleting Folders
206+
207+
Use `DROP FOLDER` to remove empty folders. The folder must not contain any documents or sub-folders.
208+
209+
```sql
210+
-- Drop an empty folder
211+
DROP FOLDER 'OldPages' IN MyModule;
212+
213+
-- Drop a nested folder (only the leaf is removed)
214+
DROP FOLDER 'Orders/Archive' IN MyModule;
215+
216+
-- Move contents out first, then drop
217+
MOVE MICROFLOW MyModule.ACT_Process TO MyModule;
218+
DROP FOLDER 'Processing' IN MyModule;
219+
```
220+
205221
## Validation Checklist
206222

207223
- [ ] Folder paths use `/` separator (not `\`)
208224
- [ ] FOLDER keyword placement is correct (before BEGIN for microflows, inside properties for pages)
209225
- [ ] Cross-module moves: checked impact with `SHOW IMPACT OF` first
210226
- [ ] Folder naming is consistent across modules
227+
- [ ] DROP FOLDER: verify folder is empty before dropping

cmd/mxcli/help_topics/move.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,18 @@ EXAMPLES
5757
SHOW IMPACT OF OldModule.CustomerPage;
5858
MOVE PAGE OldModule.CustomerPage TO NewModule;
5959

60+
DROP FOLDER
61+
-----------
62+
63+
Remove an empty folder from a module:
64+
DROP FOLDER 'FolderPath' IN Module;
65+
DROP FOLDER 'Parent/Child' IN Module;
66+
67+
The folder must be empty (no documents or sub-folders).
68+
Move contents out first if needed:
69+
MOVE MICROFLOW Module.Name TO Module;
70+
DROP FOLDER 'OldFolder' IN Module;
71+
6072
FOLDERS
6173
-------
6274

docs-site/src/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@
260260
- [Organization Statements](reference/organization/README.md)
261261
- [CREATE MODULE](reference/organization/create-module.md)
262262
- [CREATE FOLDER](reference/organization/create-folder.md)
263+
- [DROP FOLDER](reference/organization/drop-folder.md)
263264
- [MOVE](reference/organization/move.md)
264265
- [Session Statements](reference/session/README.md)
265266
- [SET](reference/session/set.md)

docs-site/src/reference/organization/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ Statements for organizing project structure: creating modules and folders, and m
66
|-----------|-------------|
77
| [CREATE MODULE](create-module.md) | Create a new module in the project |
88
| [CREATE FOLDER](create-folder.md) | Create a folder within a module for organizing documents |
9+
| [DROP FOLDER](drop-folder.md) | Drop an empty folder from a module |
910
| [MOVE](move.md) | Move a document to a different module or folder |

docs-site/src/reference/organization/create-folder.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,4 @@ CREATE PAGE MyModule.Order_Edit
5858

5959
## See Also
6060

61-
[CREATE MODULE](create-module.md), [MOVE](move.md)
61+
[CREATE MODULE](create-module.md), [DROP FOLDER](drop-folder.md), [MOVE](move.md)
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# DROP FOLDER
2+
3+
## Synopsis
4+
5+
DROP FOLDER 'folder_path' IN module_name;
6+
7+
## Description
8+
9+
Removes an empty folder from a module. The folder must contain no documents (pages, microflows, etc.) and no sub-folders. If the folder is not empty, the command returns an error indicating how many child units remain.
10+
11+
Nested folder paths use the `/` separator. Only the leaf folder is deleted; parent folders are not affected.
12+
13+
## Parameters
14+
15+
**folder_path**
16+
: The path of the folder to delete. Use `/` for nested folders (e.g., `'Orders/Processing'`).
17+
18+
**module_name**
19+
: The name of the module containing the folder.
20+
21+
## Examples
22+
23+
### Drop a simple folder
24+
25+
```sql
26+
DROP FOLDER 'OldPages' IN MyModule;
27+
```
28+
29+
### Drop a nested folder
30+
31+
```sql
32+
DROP FOLDER 'Orders/Archive' IN MyModule;
33+
```
34+
35+
### Move contents out first, then drop
36+
37+
```sql
38+
-- Move all documents to module root
39+
MOVE MICROFLOW MyModule.ACT_Process TO MyModule;
40+
MOVE PAGE MyModule.ProcessDetail TO MyModule;
41+
42+
-- Now the folder is empty and can be dropped
43+
DROP FOLDER 'Processing' IN MyModule;
44+
```
45+
46+
## Error Conditions
47+
48+
| Error | Cause |
49+
|-------|-------|
50+
| `folder is not empty: contains N child unit(s)` | The folder still has documents or sub-folders |
51+
| `folder not found: 'path' in Module` | No folder exists at the given path in the module |
52+
| `module not found: Module` | The specified module does not exist |
53+
54+
## See Also
55+
56+
[CREATE FOLDER](create-folder.md), [CREATE MODULE](create-module.md), [MOVE](move.md)

docs/01-project/MDL_QUICK_REFERENCE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ AUTHENTICATION Basic, Session
178178
|-----------|--------|-------|
179179
| Microflow folder | `FOLDER 'path'` (before BEGIN) | `CREATE MICROFLOW ... FOLDER 'ACT' BEGIN ... END;` |
180180
| Page folder | `Folder: 'path'` (in properties) | `CREATE PAGE ... (Folder: 'Pages/Detail') { ... }` |
181+
| Drop folder | `DROP FOLDER 'path' IN Module;` | Folder must be empty |
181182
| Move to folder | `MOVE PAGE\|MICROFLOW\|SNIPPET\|NANOFLOW\|ENUMERATION Module.Name TO FOLDER 'path';` | Folders created automatically |
182183
| Move to module root | `MOVE PAGE Module.Name TO Module;` | Removes from folder |
183184
| Move across modules | `MOVE PAGE Old.Name TO NewModule;` | **Breaks by-name references** — use `SHOW IMPACT OF` first |
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
-- ############################################################################
2+
-- FOLDER EXAMPLES
3+
-- ############################################################################
4+
--
5+
-- This file demonstrates the MDL syntax for managing project folders:
6+
-- creating documents in folders, moving documents between folders,
7+
-- and dropping empty folders.
8+
--
9+
-- Folders are created implicitly when referenced in FOLDER clauses or
10+
-- MOVE statements. DROP FOLDER removes empty folders explicitly.
11+
--
12+
-- Prerequisites: Assumes a module 'FolderTest' exists.
13+
--
14+
-- ############################################################################
15+
16+
create module FolderTest;
17+
18+
-- MARK: - Create Documents in Folders
19+
20+
/**
21+
* Level 1.1: Create a microflow in a folder (auto-creates the folder)
22+
*/
23+
CREATE MICROFLOW FolderTest.ACT_Process()
24+
RETURNS Boolean
25+
FOLDER 'Processing'
26+
BEGIN
27+
RETURN true;
28+
END;
29+
/
30+
31+
/**
32+
* Level 1.2: Create another microflow in a nested folder
33+
*/
34+
CREATE MICROFLOW FolderTest.ACT_Archive()
35+
RETURNS Boolean
36+
FOLDER 'Processing/Archive'
37+
BEGIN
38+
RETURN true;
39+
END;
40+
/
41+
42+
-- MARK: - Move Documents Between Folders
43+
44+
/**
45+
* Level 2.1: Move a microflow to a different folder (auto-creates target)
46+
*/
47+
MOVE MICROFLOW FolderTest.ACT_Process TO FOLDER 'Resources';
48+
/
49+
50+
/**
51+
* Level 2.2: Move a microflow to module root (out of folder)
52+
*/
53+
MOVE MICROFLOW FolderTest.ACT_Archive TO FolderTest;
54+
/
55+
56+
-- MARK: - Drop Folders
57+
58+
/**
59+
* Level 3.1: Drop an empty nested folder
60+
*/
61+
DROP FOLDER 'Processing/Archive' IN FolderTest;
62+
/
63+
64+
/**
65+
* Level 3.2: Drop the now-empty parent folder
66+
*/
67+
DROP FOLDER 'Processing' IN FolderTest;
68+
/
69+
70+
/**
71+
* Level 3.3: Move contents out, then drop folder
72+
*/
73+
MOVE MICROFLOW FolderTest.ACT_Process TO FolderTest;
74+
DROP FOLDER 'Resources' IN FolderTest;
75+
/
76+
77+
-- cleanup
78+
drop module FolderTest;

0 commit comments

Comments
 (0)