Jump to content

ICT:FinaLConfig - ASSET

From Costa Sano MediaWiki
Revision as of 20:39, 13 February 2026 by Mngr (talk | contribs) (Created page with "= Final Configuration for the DigitalAsset 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. It is the fourth implementation of an entity in order to finetune a final dashboard layout. This entity introduces automatic numbering and...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Final Configuration for the DigitalAsset Entity

Document revision: 2026-02-13 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 fourth implementation of an entity in order to finetune a final dashboard layout. This entity introduces automatic numbering and file upload, which will be implemented after the structural baseline is validated.

Cargo Table:

Template:DigitalAsset

<noinclude>
DigitalAsset data template

{{#cargo_declare:
 _table=DigitalAssets
 |chapter_id=Page
 |context_code=String
 |sequence_number=Integer
 |identifier=String
 |file_id=Page
 |parent_id=Page
 |asset_source_type_id=Page
 |asset_type_id=Page
 |place_id=Page
 |asset_source_reference=String
 |language=String
 |description=Text
 |notes=Text
 |ai_processed=Boolean
 |citation_text=Text
 |permalink=String
 |repository=String
 |rights=String
 |is_publishable=Boolean
}}

{{#forminput:form=DigitalAsset}}
</noinclude>

{{#cargo_store:
 chapter_id={{{chapter_id|}}}
 |context_code={{{context_code|}}}
 |sequence_number={{{sequence_number|}}}
 |identifier={{{identifier|}}}
 |file_id={{{file_id|}}}
 |parent_id={{{parent_id|}}}
 |asset_source_type_id={{{asset_source_type_id|}}}
 |asset_type_id={{{asset_type_id|}}}
 |place_id={{{place_id|}}}
 |asset_source_reference={{{asset_source_reference|}}}
 |language={{{language|}}}
 |description={{{description|}}}
 |notes={{{notes|}}}
 |ai_processed={{{ai_processed|}}}
 |citation_text={{{citation_text|}}}
 |permalink={{{permalink|}}}
 |repository={{{repository|}}}
 |rights={{{rights|}}}
 |is_publishable={{{is_publishable|}}}
}}

== {{{identifier|}}} ==

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

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

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

{{{for template|DigitalAsset}}}

{| class="formtable"

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

! Context code
| {{{field|context_code|input type=text|size=20}}}
|-

! Sequence number
| {{{field|sequence_number|input type=number|size=10}}}
|-

! Identifier
| {{{field|identifier|input type=text|size=40}}}
|-

! File
| {{{field|file_id
   |input type=upload
   |mandatory
}}}
|-

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

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

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

! Place
| {{{field|place_id
   |input type=combobox
   |values from namespace=Place
   |existing values only
}}}
|-

! Source reference
| {{{field|asset_source_reference|input type=text|size=60}}}
|-

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

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

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

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

! Citation text
| {{{field|citation_text|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|is_publishable|input type=checkbox}}}

|}

{{{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:DigitalAsset

= 🗂️ Costa Sano Research DIGITAL ASSET Dashboard =

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

{| class="wikitable sortable"
! Identifier !! Chapter !! Context !! File !! Type
{{#cargo_query:
 tables=DigitalAssets
 |fields=_pageName,identifier,chapter_id,context_code,file_id,asset_type_id
 |where=_pageNamespace=3014
 |order by=identifier
 |format=template
 |template=DigitalAssetRow
 |named args=yes
 |cache=no
}}
|}

Choose your asset identifier corresponding to above table and respecting the naming conventions.

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

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

<includeonly>
|-
| {{#formlink:form=DigitalAsset|target={{{_pageName}}}|link text={{{identifier}}}|returnto=Dashboard:DigitalAsset}}
| {{{chapter_id}}}
| {{{context_code}}}
| {{{file_id}}}
| {{{asset_type_id}}}
</includeonly>

All this creates pages in the namespace DigitalAsset with the name being the identifier. The page is a configuration to serve in Page Forms extension. Below is an example of such a page.

{{DigitalAsset
|chapter_id=Chapter:CH03
|context_code=ROM
|sequence_number=7
|identifier=CH03-ROM-0007
|file_id=File:Document_1849.jpg
|asset_type_id=AssetType:Photo
|place_id=Place:BERCK
|description=Photograph of early Costa Sano activities.
|notes=Scanned from original.
|ai_processed=true
|is_publishable=true
}}

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

References: