Jump to content

ICT:FinaLConfig - ASSET: Difference between revisions

From Costa Sano MediaWiki
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..."
 
No edit summary
 
Line 15: Line 15:
  _table=DigitalAssets
  _table=DigitalAssets
  |chapter_id=Page
  |chapter_id=Page
  |context_code=String
  |place_id=Page
|organisation_id=Page
  |sequence_number=Integer
  |sequence_number=Integer
  |identifier=String
  |identifier=String
Line 22: Line 23:
  |asset_source_type_id=Page
  |asset_source_type_id=Page
  |asset_type_id=Page
  |asset_type_id=Page
|place_id=Page
  |asset_source_reference=String
  |asset_source_reference=String
  |language=String
  |language=String
Line 40: Line 40:
{{#cargo_store:
{{#cargo_store:
  chapter_id={{{chapter_id|}}}
  chapter_id={{{chapter_id|}}}
  |context_code={{{context_code|}}}
  |place_id={{{place_id|}}}
|organisation_id={{{organisation_id|}}}
  |sequence_number={{{sequence_number|}}}
  |sequence_number={{{sequence_number|}}}
  |identifier={{{identifier|}}}
  |identifier={{{identifier|}}}
Line 47: Line 48:
  |asset_source_type_id={{{asset_source_type_id|}}}
  |asset_source_type_id={{{asset_source_type_id|}}}
  |asset_type_id={{{asset_type_id|}}}
  |asset_type_id={{{asset_type_id|}}}
|place_id={{{place_id|}}}
  |asset_source_reference={{{asset_source_reference|}}}
  |asset_source_reference={{{asset_source_reference|}}}
  |language={{{language|}}}
  |language={{{language|}}}
Line 97: Line 97:
|-
|-


! Context code
! Place
| {{{field|context_code|input type=text|size=20}}}
| {{{field|place_id
  |input type=combobox
  |values from namespace=Place
  |existing values only
  |placeholder=Select a place (or leave empty if using organisation)
}}}
|-
 
! Organisation
| {{{field|organisation_id
  |input type=combobox
  |values from namespace=Organisation
  |existing values only
  |placeholder=Select an organisation (or leave empty if using place)
}}}
|-
|-


Line 137: Line 151:
   |input type=combobox
   |input type=combobox
   |values from namespace=AssetType
   |values from namespace=AssetType
  |existing values only
}}}
|-
! Place
| {{{field|place_id
  |input type=combobox
  |values from namespace=Place
   |existing values only
   |existing values only
}}}
}}}
Line 215: Line 221:


{| class="wikitable sortable"
{| class="wikitable sortable"
! Identifier !! Chapter !! Context !! File !! Type
! Identifier !! Chapter !! Place !! Organisation !! File !! Type
{{#cargo_query:
{{#cargo_query:
  tables=DigitalAssets
  tables=DigitalAssets
  |fields=_pageName,identifier,chapter_id,context_code,file_id,asset_type_id
  |fields=_pageName,identifier,chapter_id,place_id,organisation_id,file_id,asset_type_id
  |where=_pageNamespace=3014
  |where=_pageNamespace=3014
  |order by=identifier
  |order by=identifier
Line 264: Line 270:
| {{#formlink:form=DigitalAsset|target={{{_pageName}}}|link text={{{identifier}}}|returnto=Dashboard:DigitalAsset}}
| {{#formlink:form=DigitalAsset|target={{{_pageName}}}|link text={{{identifier}}}|returnto=Dashboard:DigitalAsset}}
| {{{chapter_id}}}
| {{{chapter_id}}}
| {{{context_code}}}
| {{{place_id}}}
| {{{organisation_id}}}
| {{{file_id}}}
| {{{file_id}}}
| {{{asset_type_id}}}
| {{{asset_type_id}}}
Line 275: Line 282:
{{DigitalAsset
{{DigitalAsset
|chapter_id=Chapter:CH03
|chapter_id=Chapter:CH03
|context_code=ROM
|place_id=Place:BERCK
|organisation_id=
|sequence_number=7
|sequence_number=7
|identifier=CH03-ROM-0007
|identifier=CH03-BER-0007
|file_id=File:Document_1849.jpg
|file_id=File:CH03-BER-0007.jpg
|asset_type_id=AssetType:Photo
|asset_type_id=AssetType:Photo
|place_id=Place:BERCK
|description=Photograph of early Costa Sano activities.
|description=Photograph of early Costa Sano activities.
|notes=Scanned from original.
|notes=Scanned from original.

Latest revision as of 21:22, 13 February 2026

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
 |place_id=Page
 |organisation_id=Page
 |sequence_number=Integer
 |identifier=String
 |file_id=Page
 |parent_id=Page
 |asset_source_type_id=Page
 |asset_type_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|}}}
 |place_id={{{place_id|}}}
 |organisation_id={{{organisation_id|}}}
 |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|}}}
 |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
}}}
|-

! Place
| {{{field|place_id
   |input type=combobox
   |values from namespace=Place
   |existing values only
   |placeholder=Select a place (or leave empty if using organisation)
}}}
|-

! Organisation
| {{{field|organisation_id
   |input type=combobox
   |values from namespace=Organisation
   |existing values only
   |placeholder=Select an organisation (or leave empty if using place)
}}}
|-

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

! 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 !! Place !! Organisation !! File !! Type
{{#cargo_query:
 tables=DigitalAssets
 |fields=_pageName,identifier,chapter_id,place_id,organisation_id,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}}}
| {{{place_id}}}
| {{{organisation_id}}}
| {{{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
|place_id=Place:BERCK
|organisation_id=
|sequence_number=7
|identifier=CH03-BER-0007
|file_id=File:CH03-BER-0007.jpg
|asset_type_id=AssetType:Photo
|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: