Help:Vehicle Database/Documentation

From Disney•Pixar CARS Wiki
Jump to navigation Jump to search
This article or section is under construction.
Some or all info on this page is unfinished or inaccurate; Please help contribute by improving and proofreading the article.

The Vehicle Database is a set of interlinked Cargo tables built from our Mattel content pages.

Tables

  • Releases - Main item table. Distinct assortments and products are stored into here, along with rows for individual vehicles contained in the latter (in the case of multipacks). Query settings select each type as needed.
  • Case_Contents - Store info for cases and their respective contents, the former achieved by applying group by to the latter. Joined to main table via Releases.Case_str=Case_Contents.Namestring.
  • Vehicles - Cumulative/global info for a character. See list of vehicles by appearance.

Interface

Our custom search interface is built off the Cargo extension.

  • /extensions/Cargo/
    • extension.json - Page registered to 'Special Pages' and 'Autoload Classes'. More convenient to keep here.
    • /includes/specials/
      • CargoQueryDisplayer.php - Lines 198-203 amended to accommodate the PageImages extension when merge similar cells is used. See here for explanation.
      • CargoQueryPage.php - Various points changed to adjust if a searchkey= request value is null.
      • SpecialVehicleDatabase.php - New file/original class extending CargoQueryPage.php. Modeled after and lifts a couple elements from SpecialCargoQuery.php.
  • /extensions/VehicleDatabase - Separate extension folder to handle the remaining stuff, including preference definitions and ResourceLoader system messages & stylesheets. See:
Sheet/Script Scope
Gadget-DiecastTables.css Global
VehicleDatabasePage.css Special:VehicleDatabase
Gadget-VehicleTable.css
Vehicle: namespace
Gadget-VehiclePage.css
Gadget-Cases.css /Case assortments
MediaWiki:Common.js To be added (split)

Messages:
Landing: topbottom (year nav)
Search: Maintenance noticeresults

  • /includes/specialpage/QueryPage.php - Both output pages extend this class, which defines the basic "query" system used all over MW, including reports, categories, and so on.
  • /includes/skins/Skin.php - Having obstructed the original logic, amend a few str_replace() rules to clean up whitespace within "nested query" text.

The actual storing and output systems are written entirely in wikitext, but are in the process of being converted to Lua.

Flow

Vehicles

Outer Inner Description(s)
{{vehicle infobox}} Global declarations:
  • {{#var:pagename}} = {{PAGENAME}})
  • {{#var:escape_namestring}} = {{code|{{vehicle escape|{{#var:pagename}}}}

{{title icon}}
WikiSEO data
{{origin index}}

Output the leading "block" with initial vehicle info, and calculate some stats to eventually store into Vehicle_stats.
== Releases ==
{{vehicle table}}
  • Prepare variables before we start looping. These will track things like total # of releases, and how many of those are truly released (as opposed to unreleased).
  • Import the table masthead and user filters.
{{vehicle row}} {{default variables}}
{{series index}}
{{exclusive index}}
{{segment index}}
{{m-country}}
{{m-series}}
{{m-segment}}
{{vrow format/master}}
{{table end}} {{vehicle stats}}
{{related models}}

Once stored into Releases, the VDB interface simply prints its own instance of {{vrow format/master}} via the template query format.

Cases

Integration