Jump to content

ICT:FinalConfig - ORGANISATION: Difference between revisions

From Costa Sano MediaWiki
No edit summary
No edit summary
 
(4 intermediate revisions by the same user not shown)
Line 4: Line 4:


The aim is to create an interface without MediaWiki clutter and well protected to avoid confusing users with unnecessary elements on the page.  
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. It is the third implementation of an entity in order to finetune a final dashboard layout.
The Cargo template follows what has been decided in the DBML and is fully aligned with the reference entity Place.
 
The Organisation entity is the first entity combining:
- recursiveness (parent organisation)
- a foreign key to another entity (Place)
 
This configuration validates that recursion and foreign keys can safely coexist within the same entity model.
 
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: =
Line 11: Line 19:
<noinclude>
<noinclude>
Organisation data template
Organisation data template
</noinclude>


{{#cargo_declare:
{{#cargo_declare:
  _table=Organisations
  |_table=Organisations
  |name=String
  |Code=Page
  |code=String
  |Label=String
  |description=Text
  |Parent=Page
  |place_id=Page
  |Place=Page
  |contact_information=Text
  |Description=Text
  |notes=Text
|Contact=Text
  |Notes=Text
}}
 
{{#cargo_store:
|Code={{FULLPAGENAME}}
|Label={{{Label|}}}
|Parent={{{Parent|}}}
|Place={{{Place|}}}
|Description={{{Description|}}}
|Contact={{{Contact|}}}
|Notes={{{Notes|}}}
}}
}}


{{#forminput:form=Organisation}}
== {{{Label|}}} ==
</noinclude>
{{DISPLAYTITLE:{{{Label}}}}}


{{#cargo_store:
{{#if:{{{Parent|}}}|
name={{{name|}}}
'''Parent organisation:''' [[{{{Parent}}}]]
|code={{PAGENAME}}
|description={{{description|}}}
|place_id={{{place_id|}}}
|contact_information={{{contact_information|}}}
|notes={{{notes|}}}
}}
}}


== {{{name|}}} ==
{{#if:{{{Place|}}}|
'''Located in:''' [[{{{Place}}}]]
}}


'''Notes:'''
{{{Notes|}}}
</pre>
</pre>


Once the template is created don't forget to manually force the creation of the Cargo table.
Once the template is created, the Cargo table must be created manually.
If modifications are done to the table, one needs to manually update the table and then go to the Cargo interface to swap the temporary table to become the official one. Take care what is inside and outside
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 and safe use as a foreign key across entities.
 
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 and Place are stored as Page fields
- 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>
<pre>
<noinclude>
== {{{Label|}}} ==
{{DISPLAYTITLE:{{{Label}}}}}
 
{{#if:{{{Parent|}}}|
'''Parent organisation:''' [[{{{Parent}}}]]
}}
 
{{#if:{{{Place|}}}|
'''Located in:''' [[{{{Place}}}]]
}}
 
'''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, dashboards, or foreign keys.


= Page Form: =
= Page Form: =
Line 58: Line 104:
|no footer
|no footer
}}}
}}}
''Fields marked with (*) are required.''


{{{for template|Organisation}}}
{{{for template|Organisation}}}
Line 63: Line 110:
{| class="formtable"
{| class="formtable"


! Name
! Code
| {{{field|name|mandatory}}}
| {{PAGENAME}}
|-
|-


! Code
! Name (*)
| {{PAGENAME}}
| {{{field|Label}}}
|-
|-


! Description
! Parent organisation
| {{{field|description|input type=textarea}}}
| {{{field|Parent
|input type=combobox
|values from namespace=Organisation
|placeholder=Top level (no parent)
}}}
|-
|-


! Place
! Located in (Place)
| {{{field|place_id
| {{{field|Place
  |label=Located in
|input type=combobox
  |input type=combobox
|values from namespace=Place
  |values from namespace=Place
|placeholder=Select a place
  |existing values only
  |placeholder=Select a place
}}}
}}}
|-
! Description
| {{{field|Description|input type=textarea}}}
|-
|-


! Contact information
! Contact information
| {{{field|contact_information|input type=textarea}}}
| {{{field|Contact|input type=textarea}}}
|-
|-


! Notes
! Notes
| {{{field|notes|input type=textarea}}}
| {{{field|Notes|input type=textarea}}}


|}
|}
Line 97: Line 150:


{{{end template}}}
{{{end template}}}
</pre>
</pre>


The first section is important to avoid clutter.
The first section avoids MediaWiki edit clutter.
<pre>
<pre>
{{{info
{{{info
Line 110: Line 162:
}}}
}}}
</pre>
</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 page =
Line 119: Line 178:


{| class="wikitable sortable"
{| class="wikitable sortable"
! Code !! Name !! Place
! Code !! Name !! Parent !! Place
{{#cargo_query:
{{#cargo_query:
  tables=Organisations
  tables=Organisations
  |fields=_pageName,code,name,place_id
  |fields=_pageName,_pageTitle,Label,Parent,Place
  |where=_pageNamespace=3008
  |where=_pageNamespace=3008
  |order by=code
  |order by=_pageTitle
  |format=template
  |format=template
  |template=OrganisationRow
  |template=OrganisationRow
Line 144: Line 203:
Last updated: {{CURRENTDAY}} {{CURRENTMONTHNAME}} {{CURRENTYEAR}} – {{CURRENTTIME}} UTC
Last updated: {{CURRENTDAY}} {{CURRENTMONTHNAME}} {{CURRENTYEAR}} – {{CURRENTTIME}} UTC
</div>
</div>
</pre>
</pre>


Different measures are taken to deal with caching data in MediaWiki, Cargo and what happens in a browser.
IMPORTANT:
<pre>
Dashboard tables are positional.
|cache=no
The number and order of:
</pre>
- table headers
This is needed on the Cargo side to avoid caching and the following puts a new datetime on the page making it different from the previous version with the result that the page is renewed and the cached version is dropped.
- Cargo query fields
<pre>
- row template cells
<div style="text-align:right; font-size:90%;">
MUST match exactly.
Last updated: {{CURRENTDAY}} {{CURRENTMONTHNAME}} {{CURRENTYEAR}} – {{CURRENTTIME}} UTC
</div>
</pre>


The layout of the dashboard makes use of a Template:OrganisationRow as described below.
Only the first column (Code) is clickable and leads to the edit form.
It makes the first column of the table clickable to go back to the Form and edit the record.
All other columns are displayed as plain text to prevent navigation to record pages.


= Row transclusion Template =
= Row transclusion Template =
Line 166: Line 221:
<includeonly>
<includeonly>
|-
|-
| {{#formlink:form=Organisation|target={{{_pageName}}}|link text={{{code}}}|returnto=Dashboard:Organisation}}
| {{#formlink:
| {{{name}}}
  form=Organisation
| {{{place_id}}}
  |target={{{_pageName}}}
  |link text={{{_pageTitle}}}
  |returnto=Dashboard:Organisation
}}
| {{{Label}}}
| {{#if:{{{Parent|}}}|{{#titleparts:{{{Parent}}}|1}}|—}}
| {{#if:{{{Place|}}}|{{#titleparts:{{{Place}}}|1}}|—}}
</includeonly>
</includeonly>
</pre>
Parent and Place 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 Organisation entity reuses the same shared JavaScript infrastructure as Place:
- dashboard auto-purge
- save-time mandatory field enforcement (Label)
- no Page Forms |mandatory usage


</pre>
No Organisation-specific JavaScript is required.
 
All Organisation pages are stored in the Organisation namespace with the page name acting as the Code.


All this creates pages in the namespace Organisation with the name being the code. The page is a configuration to serve in Page Forms extension. Below is an example of such a page.
Example:
<pre>
<pre>
{{Organisation
{{Organisation
|name=Archives Départementales du Pas-de-Calais
|Label=Archives Départementales du Pas-de-Calais
|description=Regional archive authority for the Pas-de-Calais department.
|Parent=
|place_id=Place:ARRAS
|Place=Place:ARRAS
|contact_information=Rue Ferdinand Buisson, 62000 Arras
|Description=Regional archive authority for the Pas-de-Calais department.
|notes=Primary source repository for Costa Sano research.
|Contact=Rue Ferdinand Buisson, 62000 Arras
|Notes=Primary source repository for Costa Sano research.
}}
}}
</pre>
</pre>


As you can see the page as is cannot be used as such and should be read via the dashboard page.
Such pages are configuration pages and must be accessed via the dashboard, not directly.


== References: ==
== References: ==

Latest revision as of 11:11, 17 February 2026

Final Configuration for the Organisation 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 entity Place.

The Organisation entity is the first entity combining: - recursiveness (parent organisation) - a foreign key to another entity (Place)

This configuration validates that recursion and foreign keys can safely coexist within the same entity model.

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:Organisation

<noinclude>
Organisation data template
</noinclude>

{{#cargo_declare:
 |_table=Organisations
 |Code=Page
 |Label=String
 |Parent=Page
 |Place=Page
 |Description=Text
 |Contact=Text
 |Notes=Text
}}

{{#cargo_store:
 |Code={{FULLPAGENAME}}
 |Label={{{Label|}}}
 |Parent={{{Parent|}}}
 |Place={{{Place|}}}
 |Description={{{Description|}}}
 |Contact={{{Contact|}}}
 |Notes={{{Notes|}}}
}}

== {{{Label|}}} ==
{{DISPLAYTITLE:{{{Label}}}}}

{{#if:{{{Parent|}}}|
'''Parent organisation:''' [[{{{Parent}}}]]
}}

{{#if:{{{Place|}}}|
'''Located in:''' [[{{{Place}}}]]
}}

'''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 and safe use as a foreign key across entities.

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 and Place are stored as Page fields - 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 organisation:''' [[{{{Parent}}}]]
}}

{{#if:{{{Place|}}}|
'''Located in:''' [[{{{Place}}}]]
}}

'''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, dashboards, or foreign keys.

Page Form:

Form:Organisation

<noinclude>
Form for creating and editing Organisation pages.
</noinclude>

{{{info
|no summary
|no preview
|no minor edit
|no watch
|no footer
}}}
''Fields marked with (*) are required.''

{{{for template|Organisation}}}

{| class="formtable"

! Code
| {{PAGENAME}}
|-

! Name (*)
| {{{field|Label}}}
|-

! Parent organisation
| {{{field|Parent
 |input type=combobox
 |values from namespace=Organisation
 |placeholder=Top level (no parent)
}}}
|-

! Located in (Place)
| {{{field|Place
 |input type=combobox
 |values from namespace=Place
 |placeholder=Select a place
}}}
|-

! Description
| {{{field|Description|input type=textarea}}}
|-

! Contact information
| {{{field|Contact|input type=textarea}}}
|-

! 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:Organisation

= 🏛️ Costa Sano Research ORGANISATION Dashboard =

📖 [[Dashboard:Organisation/Help|Need Help?]]

{| class="wikitable sortable"
! Code !! Name !! Parent !! Place
{{#cargo_query:
 tables=Organisations
 |fields=_pageName,_pageTitle,Label,Parent,Place
 |where=_pageNamespace=3008
 |order by=_pageTitle
 |format=template
 |template=OrganisationRow
 |named args=yes
 |cache=no
}}
|}

Choose your organisation code corresponding to above table and respecting the naming conventions.

{{#forminput:
 form=Organisation
 |namespace=Organisation
 |button text=➕ New organisation
 |returnto=Dashboard:Organisation
}}

<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:OrganisationRow

<includeonly>
|-
| {{#formlink:
   form=Organisation
   |target={{{_pageName}}}
   |link text={{{_pageTitle}}}
   |returnto=Dashboard:Organisation
 }}
| {{{Label}}}
| {{#if:{{{Parent|}}}|{{#titleparts:{{{Parent}}}|1}}|—}}
| {{#if:{{{Place|}}}|{{#titleparts:{{{Place}}}|1}}|—}}
</includeonly>

Parent and Place 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 Organisation entity reuses the same shared JavaScript infrastructure as Place: - dashboard auto-purge - save-time mandatory field enforcement (Label) - no Page Forms |mandatory usage

No Organisation-specific JavaScript is required.

All Organisation pages are stored in the Organisation namespace with the page name acting as the Code.

Example:

{{Organisation
|Label=Archives Départementales du Pas-de-Calais
|Parent=
|Place=Place:ARRAS
|Description=Regional archive authority for the Pas-de-Calais department.
|Contact=Rue Ferdinand Buisson, 62000 Arras
|Notes=Primary source repository for Costa Sano research.
}}

Such pages are configuration pages and must be accessed via the dashboard, not directly.

References: