Jump to content

ICT:FinalConfig - Asset - v1

From Costa Sano MediaWiki

Final Configuration for the Asset Entity (v1 – No Numbering)

Document revision: 2026-02-20 by Mngr

This document defines the first stable implementation of the Asset entity. This version deliberately excludes automatic numbering, Lua modules, and JavaScript.

The objective of Asset v1 is to validate: - entity structure - foreign keys - recursion - dashboard interaction - strict alignment with Chapter, Place, and Organisation

Automatic numbering and deterministic identifiers will be introduced in a later version once the structural baseline is validated.


Design Principles

The Asset entity follows the same non-negotiable rules as other core entities:

  • The page name is the immutable technical identifier (**Code**)
  • All relations use the page name as foreign key
  • Label is the human-readable name and may change
  • All interaction happens via dashboards and forms
  • Pages are configuration records and must not be browsed directly
  • Explicit configuration is preferred over implicit automation

Cargo Table

Template:Asset

<noinclude>
Asset data template (v1 – no numbering)

{{#cargo_declare:
 |_table=Assets
 |Code=Page
 |Label=String
 |Chapter=Page
 |Place=Page
 |Organisation=Page
 |Parent=Page
 |AssetSourceType=Page
 |AssetType=Page
 |File=String
 |Language=String
 |Description=Text
 |Notes=Text
 |AIProcessed=Boolean
 |CitationText=Text
 |Permalink=String
 |Repository=String
 |Rights=String
 |IsPublishable=Boolean
}}
</noinclude>

{{#cargo_store:
 |Code={{FULLPAGENAME}}
 |Label={{{Label|}}}
 |Chapter={{{Chapter|}}}
 |Place={{{Place|}}}
 |Organisation={{{Organisation|}}}
 |Parent={{{Parent|}}}
 |AssetSourceType={{{AssetSourceType|}}}
 |AssetType={{{AssetType|}}}
 |File={{{File|}}}
 |Language={{{Language|}}}
 |Description={{{Description|}}}
 |Notes={{{Notes|}}}
 |AIProcessed={{{AIProcessed|}}}
 |CitationText={{{CitationText|}}}
 |Permalink={{{Permalink|}}}
 |Repository={{{Repository|}}}
 |Rights={{{Rights|}}}
 |IsPublishable={{{IsPublishable|}}}
}}

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

Once the template is created, the Cargo table must be created manually. If the table structure is modified, the table must be recreated and swapped via the Cargo administration interface.

The field Code stores the full page name (including namespace) and acts as the stable technical identifier used for all relations.


Page Form

Form:Asset

<noinclude>
Form for creating and editing Asset pages (v1).
</noinclude>

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

''Fields marked with (*) are required.''

{{{for template|Asset}}}

{| class="formtable"

! Code
| {{PAGENAME}}
|-

! Label
| {{{field|Label}}}
|-

! Chapter (*)
| {{{field|Chapter
   |input type=combobox
   |values from namespace=Chapter
   |existing values only
}}}
|-

! Place
| {{{field|Place
   |input type=combobox
   |values from namespace=Place
   |existing values only
   |placeholder=Optional – leave empty if using Organisation
}}}
|-

! Organisation
| {{{field|Organisation
   |input type=combobox
   |values from namespace=Organisation
   |existing values only
   |placeholder=Optional – leave empty if using Place
}}}
|-

! Parent asset
| {{{field|Parent
   |input type=combobox
   |values from namespace=Asset
   |existing values only
   |placeholder=Top level (no parent)
}}}
|-

! Asset source type
| {{{field|AssetSourceType
   |input type=combobox
   |values from namespace=AssetSourceType
   |existing values only
}}}
|-

! Asset type
| {{{field|AssetType
   |input type=combobox
   |values from namespace=AssetType
   |existing values only
}}}
|-

! File
| {{{field|File
   |input type=page
   |namespace=File
   |uploadable=yes
   |placeholder=Click “Upload file” to select a file
}}}
|-

! Language
| {{{field|Language|input type=text|size=20}}}
|-

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

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

! AI processed
| {{{field|AIProcessed|input type=checkbox}}}
|-

! Citation text
| {{{field|CitationText|input type=textarea}}}
|-

! Permalink
| {{{field|Permalink|input type=text|size=60}}}
|-

! Repository
| {{{field|Repository|input type=text|size=60}}}
|-

! Rights
| {{{field|Rights|input type=text|size=60}}}
|-

! Publishable
| {{{field|IsPublishable|input type=checkbox}}}

|}

{{{standard input|save}}}

{{{end template}}}

The Page Form deliberately avoids: - automatic page name generation - JavaScript logic - automatic validation

Mandatory requirements are communicated via text and user discipline in v1.


Dashboard Page

Dashboard:Asset

= 🗂️ Costa Sano Research ASSET Dashboard =

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

{| class="wikitable sortable"
! Code !! Label !! Chapter !! Place !! Organisation !! Type
{{#cargo_query:
 tables=Assets
 |fields=_pageName,_pageTitle,Label,Chapter,Place,Organisation,AssetType
 |where=_pageNamespace=3014
 |order by=_pageTitle
 |format=template
 |template=AssetRow
 |named args=yes
 |cache=no
}}
|}

Choose an asset code corresponding to the table above and respecting the naming conventions.

{{#forminput:
 form=Asset
 |namespace=Asset
 |button text=➕ New asset
 |returnto=Dashboard:Asset
}}

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

Replace **ASSET_NAMESPACE_ID** with the actual numeric namespace ID of Asset.


Row Transclusion Template

Template:AssetRow

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

Only the first column (Code) is clickable. All other values are displayed as plain text to prevent navigation to record pages.


Example Asset Page (v1)

{{Asset
|Label=Asset-1007
|File=Hydro-1-B-515-ai.jpg
|AIProcessed=No
|IsPublishable=No
}}

This page is a configuration record and must be accessed via the dashboard.


Status

This document defines **Asset v1**.

Automatic numbering, deterministic identifiers, Lua modules, and JavaScript will be introduced in a future version after structural validation.

MediaWiki Architecture Note

In MediaWiki, file uploads, form inputs, and structured storage are handled by different subsystems that are not transactionally coupled.

Key implications for the Asset entity (v1):

  • Page Forms file uploads are page-based.
 The reliable upload mechanism is a page selector
 in the File namespace with upload enabled.
  • Cargo fields of type Page assume that the referenced page
 already exists at the time of storage.
 This assumption does not hold for newly uploaded files.
  • Using a Cargo field of type Page for files may therefore lead to
 non-deterministic storage (race conditions) when creating records
 and uploading files in a single form submission.
  • To guarantee deterministic behavior in v1, file references are:
 - selected and uploaded via Page Forms as File namespace pages
 - stored in Cargo as plain strings (file page titles)

This separation avoids race conditions while preserving a clean upgrade path for future normalization or automation.