ICT:FinalConfig-Chapter: Difference between revisions
No edit summary |
No edit summary |
||
| (22 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
= Final Configuration for the Chapter Entity = | = Final Configuration for the Chapter Entity = | ||
Document revision: {{#time:Y-m-d|{{REVISIONTIMESTAMP}}}} by {{REVISIONUSER}} | |||
The aim is to create an interface without MediaWiki clutter and well protected to avoid confusing users with unnecessary elements on the page. | |||
The Cargo template follows what has been decided in the DBML and is fully aligned with the reference entities Place and Organisation. | |||
The Chapter entity is structurally simple: | |||
- it is recursive (parent chapter) | |||
- it has no foreign keys to other entities | |||
This entity serves as the reference for the simplest recursive pattern in the system. | |||
This configuration deliberately favors explicit behavior and robustness over visual polish or implicit framework behavior, in order to ensure long-term maintainability. | |||
= Cargo Table: = | = Cargo Table: = | ||
Template:Chapter | Template:Chapter | ||
<pre> | <pre> | ||
<noinclude> | <noinclude> | ||
Chapter data template | Chapter data template | ||
</noinclude> | |||
{{#cargo_declare: | {{#cargo_declare: | ||
_table=Chapters | |_table=Chapters | ||
| | |Code=Page | ||
| | |Label=String | ||
| | |Parent=Page | ||
| | |Sequence=Integer | ||
| | |Description=Text | ||
| | |StartDate=Date | ||
| | |EndDate=Date | ||
| | |Notes=Text | ||
}} | }} | ||
{{# | {{#cargo_store: | ||
|Code={{FULLPAGENAME}} | |||
|Label={{{Label|}}} | |||
|Parent={{{Parent|}}} | |||
|Sequence={{{Sequence|}}} | |||
|Description={{{Description|}}} | |||
|StartDate={{{StartDate|}}} | |||
|EndDate={{{EndDate|}}} | |||
|Notes={{{Notes|}}} | |||
}} | |||
== {{{Label|}}} == | |||
{{DISPLAYTITLE:{{{Label}}}}} | |||
{{#if:{{{Parent|}}}| | |||
'''Parent chapter:''' [[{{{Parent}}}]] | |||
}} | }} | ||
'''Notes:''' | |||
{{{Notes|}}} | |||
</pre> | |||
Once the template is created, the Cargo table must be created manually. | |||
If modifications are made to the table structure, the table must be recreated and the temporary table swapped via the Cargo administration interface. | |||
The field Code stores the full page name (including namespace) to ensure unambiguous identification. | |||
Important conventions: | |||
- Field names start with a capital letter | |||
- Code is the page name and acts as the technical identifier | |||
- Label is the human-readable name and is mandatory for all entities | |||
- Parent is stored as a Page field | |||
- The field name Label must not be renamed, as it is relied upon by shared JavaScript validation logic | |||
Special lines at the bottom of the template: | |||
<pre> | |||
== {{{Label|}}} == | |||
{{DISPLAYTITLE:{{{Label}}}}} | |||
{{#if:{{{Parent|}}}| | |||
'''Parent chapter:''' [[{{{Parent}}}]] | |||
}} | |||
'''Notes:''' | |||
{{{Notes|}}} | |||
</pre> | </pre> | ||
These lines ensure that the human-readable name (Label) is consistently used as the visible page title, while the actual page name remains the stable technical identifier (Code). | |||
This decoupling allows renaming the label without breaking Cargo relations or dashboards. | |||
= Page Form: = | |||
Form:Chapter | |||
<pre> | <pre> | ||
<noinclude> | <noinclude> | ||
| Line 53: | Line 98: | ||
|no footer | |no footer | ||
}}} | }}} | ||
''Fields marked with (*) are required.'' | |||
{{{for template|Chapter}}} | {{{for template|Chapter}}} | ||
| Line 58: | Line 104: | ||
{| class="formtable" | {| class="formtable" | ||
! Code | |||
| {{ | | {{PAGENAME}} | ||
|- | |- | ||
! | ! Name (*) | ||
| {{{field| | | {{{field|Label}}} | ||
|- | |- | ||
! | ! Parent chapter | ||
| {{ | | {{{field|Parent | ||
|input type=combobox | |||
|values from namespace=Chapter | |||
|placeholder=Top level (no parent) | |||
}}} | |||
|- | |||
! Sequence | |||
| {{{field|Sequence}}} | |||
|- | |- | ||
! Description | ! Description | ||
| {{{field| | | {{{field|Description|input type=textarea}}} | ||
|- | |- | ||
! Start date | ! Start date | ||
| {{{field| | | {{{field|StartDate|input type=datepicker|year range=1800:2100|show year dropdown|show month dropdown}}} | ||
|- | |- | ||
! End date | ! End date | ||
| {{{field| | | {{{field|EndDate|input type=datepicker|year range=1800:2100|show year dropdown|show month dropdown}}} | ||
|- | |- | ||
! Notes | ! Notes | ||
| {{{field| | | {{{field|Notes|input type=textarea}}} | ||
|} | |} | ||
| Line 95: | Line 143: | ||
{{{standard input|save}}} | {{{standard input|save}}} | ||
{{{end template}}} | |||
</pre> | |||
{{{ | The first section avoids MediaWiki edit clutter. | ||
<pre> | |||
{{{info | |||
|no summary | |||
|no preview | |||
|no minor edit | |||
|no watch | |||
|no footer | |||
}}} | |||
</pre> | |||
The field Label (displayed to the user as “Name”) is mandatory for all entities. | |||
This requirement is not implemented using the Page Forms |mandatory option, as this produces unusable white error boxes in the dark Vector-2022 environment. | |||
Instead: | |||
- the requirement is communicated via text and (*) | |||
- enforcement is handled via JavaScript at save time | |||
= Dashboard page = | |||
Dashboard:Chapter | |||
<pre> | |||
= 📘 Costa Sano Research CHAPTER Dashboard = | |||
📖 [[Dashboard:Chapter/Help|Need Help?]] | |||
{| class="wikitable sortable" | |||
! Code !! Name !! Parent | |||
{{#cargo_query: | |||
tables=Chapters | |||
|fields=_pageName,_pageTitle,Label,Parent | |||
|where=_pageNamespace=3004 | |||
|order by=_pageTitle | |||
|format=template | |||
|template=ChapterRow | |||
|named args=yes | |||
|cache=no | |||
}} | |||
|} | |||
Choose your chapter code corresponding to above table and respecting the naming conventions. | |||
{{#forminput: | |||
form=Chapter | |||
|namespace=Chapter | |||
|button text=➕ New chapter | |||
|returnto=Dashboard:Chapter | |||
}} | |||
<div style="text-align:right; font-size:90%;"> | |||
Last updated: {{CURRENTDAY}} {{CURRENTMONTHNAME}} {{CURRENTYEAR}} – {{CURRENTTIME}} UTC | |||
</div> | |||
</pre> | |||
IMPORTANT: | |||
Dashboard tables are positional. | |||
The number and order of: | |||
- table headers | |||
- Cargo query fields | |||
- row template cells | |||
MUST match exactly. | |||
Only the first column (Code) is clickable and leads to the edit form. | |||
All other columns are displayed as plain text to prevent navigation to record pages. | |||
= Row transclusion Template = | |||
Template:ChapterRow | |||
<pre> | |||
<includeonly> | |||
|- | |||
| {{#formlink: | |||
form=Chapter | |||
|target={{{_pageName}}} | |||
|link text={{{_pageTitle}}} | |||
|returnto=Dashboard:Chapter | |||
}} | |||
| {{{Label}}} | |||
| {{#if:{{{Parent|}}}|{{#titleparts:{{{Parent}}}|1}}|—}} | |||
</includeonly> | |||
</pre> | |||
Parent values are displayed as plain text (not links) to prevent users from navigating directly to record pages. All record editing is performed via forms accessed from the dashboard. | |||
= Javascript = | |||
The Chapter entity reuses the same shared JavaScript infrastructure as Place and Organisation: | |||
- dashboard auto-purge | |||
- save-time mandatory field enforcement (Label) | |||
- no Page Forms |mandatory usage | |||
No Chapter-specific JavaScript is required. | |||
All Chapter pages are stored in the Chapter namespace with the page name acting as the Code. | |||
Example: | |||
<pre> | |||
{{Chapter | |||
|Label=In the beginning | |||
|Description=Chapter describing what happened before Berck-sur-Mer... | |||
|StartDate=1800-01 | |||
|EndDate=1849-12 | |||
|Notes=NIHIL | |||
}} | |||
</pre> | </pre> | ||
Such pages are configuration pages and must be accessed via the dashboard, not directly. | |||
== References: == | |||
* [[mediawikiwiki:Extension:Cargo/Storing_data|Cargo table explanation]] | |||
* [[mediawikiwiki:Extension:Page_Forms|Page Forms explained]] | |||
[[Category:FinalConfig]] | |||
Latest revision as of 11:21, 17 February 2026
Final Configuration for the Chapter Entity
Document revision: 2026-02-17 by Mngr
The aim is to create an interface without MediaWiki clutter and well protected to avoid confusing users with unnecessary elements on the page. The Cargo template follows what has been decided in the DBML and is fully aligned with the reference entities Place and Organisation.
The Chapter entity is structurally simple: - it is recursive (parent chapter) - it has no foreign keys to other entities
This entity serves as the reference for the simplest recursive pattern in the system.
This configuration deliberately favors explicit behavior and robustness over visual polish or implicit framework behavior, in order to ensure long-term maintainability.
Cargo Table:
Template:Chapter
<noinclude>
Chapter data template
</noinclude>
{{#cargo_declare:
|_table=Chapters
|Code=Page
|Label=String
|Parent=Page
|Sequence=Integer
|Description=Text
|StartDate=Date
|EndDate=Date
|Notes=Text
}}
{{#cargo_store:
|Code={{FULLPAGENAME}}
|Label={{{Label|}}}
|Parent={{{Parent|}}}
|Sequence={{{Sequence|}}}
|Description={{{Description|}}}
|StartDate={{{StartDate|}}}
|EndDate={{{EndDate|}}}
|Notes={{{Notes|}}}
}}
== {{{Label|}}} ==
{{DISPLAYTITLE:{{{Label}}}}}
{{#if:{{{Parent|}}}|
'''Parent chapter:''' [[{{{Parent}}}]]
}}
'''Notes:'''
{{{Notes|}}}
Once the template is created, the Cargo table must be created manually. If modifications are made to the table structure, the table must be recreated and the temporary table swapped via the Cargo administration interface.
The field Code stores the full page name (including namespace) to ensure unambiguous identification.
Important conventions: - Field names start with a capital letter - Code is the page name and acts as the technical identifier - Label is the human-readable name and is mandatory for all entities - Parent is stored as a Page field - The field name Label must not be renamed, as it is relied upon by shared JavaScript validation logic
Special lines at the bottom of the template:
== {{{Label|}}} ==
{{DISPLAYTITLE:{{{Label}}}}}
{{#if:{{{Parent|}}}|
'''Parent chapter:''' [[{{{Parent}}}]]
}}
'''Notes:'''
{{{Notes|}}}
These lines ensure that the human-readable name (Label) is consistently used as the visible page title, while the actual page name remains the stable technical identifier (Code).
This decoupling allows renaming the label without breaking Cargo relations or dashboards.
Page Form:
Form:Chapter
<noinclude>
Form for creating and editing Chapter pages.
</noinclude>
{{{info
|no summary
|no preview
|no minor edit
|no watch
|no footer
}}}
''Fields marked with (*) are required.''
{{{for template|Chapter}}}
{| class="formtable"
! Code
| {{PAGENAME}}
|-
! Name (*)
| {{{field|Label}}}
|-
! Parent chapter
| {{{field|Parent
|input type=combobox
|values from namespace=Chapter
|placeholder=Top level (no parent)
}}}
|-
! Sequence
| {{{field|Sequence}}}
|-
! Description
| {{{field|Description|input type=textarea}}}
|-
! Start date
| {{{field|StartDate|input type=datepicker|year range=1800:2100|show year dropdown|show month dropdown}}}
|-
! End date
| {{{field|EndDate|input type=datepicker|year range=1800:2100|show year dropdown|show month dropdown}}}
|-
! Notes
| {{{field|Notes|input type=textarea}}}
|}
{{{standard input|save}}}
{{{end template}}}
The first section avoids MediaWiki edit clutter.
{{{info
|no summary
|no preview
|no minor edit
|no watch
|no footer
}}}
The field Label (displayed to the user as “Name”) is mandatory for all entities. This requirement is not implemented using the Page Forms |mandatory option, as this produces unusable white error boxes in the dark Vector-2022 environment.
Instead: - the requirement is communicated via text and (*) - enforcement is handled via JavaScript at save time
Dashboard page
Dashboard:Chapter
= 📘 Costa Sano Research CHAPTER Dashboard =
📖 [[Dashboard:Chapter/Help|Need Help?]]
{| class="wikitable sortable"
! Code !! Name !! Parent
{{#cargo_query:
tables=Chapters
|fields=_pageName,_pageTitle,Label,Parent
|where=_pageNamespace=3004
|order by=_pageTitle
|format=template
|template=ChapterRow
|named args=yes
|cache=no
}}
|}
Choose your chapter code corresponding to above table and respecting the naming conventions.
{{#forminput:
form=Chapter
|namespace=Chapter
|button text=➕ New chapter
|returnto=Dashboard:Chapter
}}
<div style="text-align:right; font-size:90%;">
Last updated: {{CURRENTDAY}} {{CURRENTMONTHNAME}} {{CURRENTYEAR}} – {{CURRENTTIME}} UTC
</div>
IMPORTANT: Dashboard tables are positional. The number and order of: - table headers - Cargo query fields - row template cells MUST match exactly.
Only the first column (Code) is clickable and leads to the edit form. All other columns are displayed as plain text to prevent navigation to record pages.
Row transclusion Template
Template:ChapterRow
<includeonly>
|-
| {{#formlink:
form=Chapter
|target={{{_pageName}}}
|link text={{{_pageTitle}}}
|returnto=Dashboard:Chapter
}}
| {{{Label}}}
| {{#if:{{{Parent|}}}|{{#titleparts:{{{Parent}}}|1}}|—}}
</includeonly>
Parent values are displayed as plain text (not links) to prevent users from navigating directly to record pages. All record editing is performed via forms accessed from the dashboard.
Javascript
The Chapter entity reuses the same shared JavaScript infrastructure as Place and Organisation: - dashboard auto-purge - save-time mandatory field enforcement (Label) - no Page Forms |mandatory usage
No Chapter-specific JavaScript is required.
All Chapter pages are stored in the Chapter namespace with the page name acting as the Code.
Example:
{{Chapter
|Label=In the beginning
|Description=Chapter describing what happened before Berck-sur-Mer...
|StartDate=1800-01
|EndDate=1849-12
|Notes=NIHIL
}}
Such pages are configuration pages and must be accessed via the dashboard, not directly.