Jump to content

ICT:FinalConfig - ORGANISATION: Difference between revisions

From Costa Sano MediaWiki
m Mngr moved page ICT:FinalConfig - ORGANIZATION to ICT:FinalConfig - ORGANISATION without leaving a redirect
No edit summary
Line 11: Line 11:
<noinclude>
<noinclude>
Organisation data template
Organisation data template
{{#cargo_declare:= Final Configuration for the Organisation 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 aligns fully with the reference entity Place.
The Organisation entity is the first entity combining:
- recursiveness (parent organisation)
- a foreign key to another entity (Place)
This entity is used to validate that recursion and foreign keys work correctly together.
= Cargo Table: =
Template:Organisation
<pre>
<noinclude>
Organisation data template
</noinclude>


{{#cargo_declare:
{{#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|}}}
</pre>
Once the template is created, do not forget to manually force the creation of the Cargo table.
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.
Important conventions:
- Field names start with a capital letter
- Page name is used as the technical identifier (Code)
- Label is the mandatory human-readable name for all entities
- Relationships (Parent, Place) are stored as Page fields
= Page Form: =
Form:Organisation
<pre>
<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}}}
</pre>
The first section is important to avoid clutter.
<pre>
{{{info
|no summary
|no preview
|no minor edit
|no watch
|no footer
}}}
</pre>
Convention: The field Label (displayed as “Name”) is mandatory for all entities.
This requirement is not implemented using the Page Forms |mandatory option, as this generates unusable white error boxes in the dark Vector-2022 environment.
Instead, enforcement is done via JavaScript triggered on the Save button.
= Dashboard page =
Dashboard:Organisation
<pre>
= 🏛️ Costa Sano Research ORGANISATION Dashboard =
📖 [[Dashboard:Organisation/Help|Need Help?]]
{| class="wikitable sortable"
! Code !! Name !! Place
{{#cargo_query:
tables=Organisations
|fields=_pageName,_pageTitle,Label,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>
</pre>
Different measures are taken to deal with caching data in MediaWiki, Cargo and the browser.
<pre>
|cache=no
</pre>
This is needed on the Cargo side to avoid caching. The timestamp below forces the page to change, helping invalidate cached versions.
<pre>
<div style="text-align:right; font-size:90%;">
Last updated: {{CURRENTDAY}} {{CURRENTMONTHNAME}} {{CURRENTYEAR}} – {{CURRENTTIME}} UTC
</div>
</pre>
The layout of the dashboard makes use of a Template:OrganisationRow as described below.
It makes the first column of the table clickable to go back to the Form and edit the record.
= Row transclusion Template =
Template:OrganisationRow
<pre>
<includeonly>
|-
| {{#formlink:
  form=Organisation
  |target={{{_pageName}}}
  |link text={{{_pageTitle}}}
  |returnto=Dashboard:Organisation
}}
| {{{Label}}}
| {{#if:{{{Place|}}}|[[{{{Place}}}]]|—}}
</includeonly>
</pre>
All this creates pages in the namespace Organisation with the page name being the code.
The page itself is a configuration page used by the Page Forms extension.
Below is an example of such a page.
<pre>
{{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.
}}
</pre>
As you can see, the page as such is not intended to be read directly and should be accessed via the dashboard page.
== References: ==
* [[mediawikiwiki:Extension:Cargo/Storing_data|Cargo table explanation]]
* [[mediawikiwiki:Extension:Page_Forms|Page Forms explained]]
[[Category:FinalConfig]]
  _table=Organisations
  _table=Organisations
  |name=String
  |name=String

Revision as of 10:13, 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. It is the third implementation of an entity in order to finetune a final dashboard layout.

Cargo Table:

Template:Organisation

<noinclude>
Organisation data template

{{#cargo_declare:= Final Configuration for the Organisation 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 aligns fully with the reference entity Place.

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

This entity is used to validate that recursion and foreign keys work correctly together.

= Cargo Table: =
Template:Organisation
<pre>
<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, do not forget to manually force the creation of the Cargo table. 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.

Important conventions: - Field names start with a capital letter - Page name is used as the technical identifier (Code) - Label is the mandatory human-readable name for all entities - Relationships (Parent, Place) are stored as Page fields

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 is important to avoid clutter.

{{{info
|no summary
|no preview
|no minor edit
|no watch
|no footer
}}}

Convention: The field Label (displayed as “Name”) is mandatory for all entities. This requirement is not implemented using the Page Forms |mandatory option, as this generates unusable white error boxes in the dark Vector-2022 environment. Instead, enforcement is done via JavaScript triggered on the Save button.

Dashboard page

Dashboard:Organisation

= 🏛️ Costa Sano Research ORGANISATION Dashboard =

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

{| class="wikitable sortable"
! Code !! Name !! Place
{{#cargo_query:
 tables=Organisations
 |fields=_pageName,_pageTitle,Label,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>

Different measures are taken to deal with caching data in MediaWiki, Cargo and the browser.

 |cache=no

This is needed on the Cargo side to avoid caching. The timestamp below forces the page to change, helping invalidate cached versions.

<div style="text-align:right; font-size:90%;">
Last updated: {{CURRENTDAY}} {{CURRENTMONTHNAME}} {{CURRENTYEAR}} – {{CURRENTTIME}} UTC
</div>

The layout of the dashboard makes use of a Template:OrganisationRow as described below. It makes the first column of the table clickable to go back to the Form and edit the record.

Row transclusion Template

Template:OrganisationRow

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

All this creates pages in the namespace Organisation with the page name being the code. The page itself is a configuration page used by the Page Forms extension.

Below is an example of such a page.

{{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.
}}

As you can see, the page as such is not intended to be read directly and should be accessed via the dashboard page.

References:

_table=Organisations
|name=String
|code=String
|description=Text
|place_id=Page
|contact_information=Text
|notes=Text

}}



Once the template is created don't forget to manually force the creation of the Cargo table. 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

<noinclude>

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
}}}

{{{for template|Organisation}}}

{| class="formtable"

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

! Code
| {{PAGENAME}}
|-

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

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

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

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

|}

{{{standard input|save}}}

{{{end template}}}

The first section is important to avoid clutter.

{{{info
|no summary
|no preview
|no minor edit
|no watch
|no footer
}}}

Dashboard page

Dashboard:Organisation

= 🏛️ Costa Sano Research ORGANISATION Dashboard =

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

{| class="wikitable sortable"
! Code !! Name !! Place
{{#cargo_query:
 tables=Organisations
 |fields=_pageName,code,name,place_id
 |where=_pageNamespace=3008
 |order by=code
 |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>

Different measures are taken to deal with caching data in MediaWiki, Cargo and what happens in a browser.

 |cache=no

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.

<div style="text-align:right; font-size:90%;">
Last updated: {{CURRENTDAY}} {{CURRENTMONTHNAME}} {{CURRENTYEAR}} – {{CURRENTTIME}} UTC
</div>

The layout of the dashboard makes use of a Template:OrganisationRow as described below. It makes the first column of the table clickable to go back to the Form and edit the record.

Row transclusion Template

Template:OrganisationRow

<includeonly>
|-
| {{#formlink:form=Organisation|target={{{_pageName}}}|link text={{{code}}}|returnto=Dashboard:Organisation}}
| {{{name}}}
| {{{place_id}}}
</includeonly>

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.

{{Organisation
|name=Archives Départementales du Pas-de-Calais
|description=Regional archive authority for the Pas-de-Calais department.
|place_id=Place:ARRAS
|contact_information=Rue Ferdinand Buisson, 62000 Arras
|notes=Primary source repository for Costa Sano research.
}}

As you can see the page as is cannot be used as such and should be read via the dashboard page.

References: