From d8ac0746c10e881a7c70ca04f67fdce0db961221 Mon Sep 17 00:00:00 2001 From: Deniz Erdogan Date: Tue, 9 Apr 2024 13:53:54 +0200 Subject: [PATCH] load default main page content from class --- .../wbstack/src/Internal/ApiWbStackInit.php | 121 +----------------- dist/wbstack/src/Internal/ApiWbStackInit.php | 121 +----------------- 2 files changed, 4 insertions(+), 238 deletions(-) diff --git a/dist-persist/wbstack/src/Internal/ApiWbStackInit.php b/dist-persist/wbstack/src/Internal/ApiWbStackInit.php index bb7525890..7838d3f61 100644 --- a/dist-persist/wbstack/src/Internal/ApiWbStackInit.php +++ b/dist-persist/wbstack/src/Internal/ApiWbStackInit.php @@ -147,130 +147,13 @@ public function initMainPage() { $title = \Title::newMainPage(); $page = new \WikiPage($title); - - $text = << links to help - This is a lot of information and possibilities and might seem daunting. Don’t panic. There’s a lot of documentation for you to read, many other Wikibases you can look at to get inspired, a community that is happy to help out with any questions, and the development team who’s happy to support you where needed. - - - - - - == What do i need to know to prepare my data? == - === Data Import === - Instead of inserting your data manually you can make use of more efficient ways to integrate it in bulk. - API - The Wikibase API allows querying, adding, removing and editing information on Wikidata or any other Wikibase instance. A new version of the API is in the works with theREST API. - Tools - A variety of tools exist to fill your Wikibase with data and use the API: - https://www.mediawiki.org/wiki/Wikibase/Importing - QuickStatements - WikibaseImport - WikibaseIntegrator - OpenRefine - Wikibase seed data - Native MediaWiki export/import - RaiseWikibase - wikibase-cli - Examples - Your choice of properties depends on the use case for your Wikibase. An art museum might want to index all exhibits and put the data in relation to each other. - Example properties -> templates e.g.[ADD LINK] - https://prop-explorer.toolforge.org/ - Example: Museum - Instance of (type: Item) - Title (type: String) - Created by (type: Item) - Depicts (type: item) - Located at (type: item) - Movement (type: item) - Exhibited since (type: date) - Example triples - - Item - Property - Value - Mona Lisa - Instance of - painting - Mona Lisa - Title - La Gioconda - Mona Lisa - Created by - Leaonardo da Vinci - Mona Lisa - Depicts - Lisa del giocondo, sky, body of water, bridge, … - Mona Lisa - Located at - Louvre - Mona Lisa - Movement - High renaissance - Mona Lisa - Exhibited since - 1797 - - - Example conversion of imaginary DB to triplets - Exhibition object 24: - Painting, Name: Mona lisa, Painter: Leonardo da vinci, pained in 1500, hangs in louvre, uses oil paints - - (if you have your data in rows, maybe your columns could be your properties, and your row header is your item) - - - - - - source - - EOF; + $text = ApiWbStackInitMainPage::TEXT; $content = \ContentHandler::makeContent( $text, $title ); $updater = $page->newPageUpdater( $user ); $updater->setContent( SlotRecord::MAIN, $content ); $updater->setRcPatrolStatus( \RecentChange::PRC_PATROLLED ); - $newRev = $updater->saveRevision( $comment, EDIT_NEW); + $updater->saveRevision( $comment, EDIT_NEW ); } } diff --git a/dist/wbstack/src/Internal/ApiWbStackInit.php b/dist/wbstack/src/Internal/ApiWbStackInit.php index bb7525890..7838d3f61 100644 --- a/dist/wbstack/src/Internal/ApiWbStackInit.php +++ b/dist/wbstack/src/Internal/ApiWbStackInit.php @@ -147,130 +147,13 @@ public function initMainPage() { $title = \Title::newMainPage(); $page = new \WikiPage($title); - - $text = << links to help - This is a lot of information and possibilities and might seem daunting. Don’t panic. There’s a lot of documentation for you to read, many other Wikibases you can look at to get inspired, a community that is happy to help out with any questions, and the development team who’s happy to support you where needed. - - - - - - == What do i need to know to prepare my data? == - === Data Import === - Instead of inserting your data manually you can make use of more efficient ways to integrate it in bulk. - API - The Wikibase API allows querying, adding, removing and editing information on Wikidata or any other Wikibase instance. A new version of the API is in the works with theREST API. - Tools - A variety of tools exist to fill your Wikibase with data and use the API: - https://www.mediawiki.org/wiki/Wikibase/Importing - QuickStatements - WikibaseImport - WikibaseIntegrator - OpenRefine - Wikibase seed data - Native MediaWiki export/import - RaiseWikibase - wikibase-cli - Examples - Your choice of properties depends on the use case for your Wikibase. An art museum might want to index all exhibits and put the data in relation to each other. - Example properties -> templates e.g.[ADD LINK] - https://prop-explorer.toolforge.org/ - Example: Museum - Instance of (type: Item) - Title (type: String) - Created by (type: Item) - Depicts (type: item) - Located at (type: item) - Movement (type: item) - Exhibited since (type: date) - Example triples - - Item - Property - Value - Mona Lisa - Instance of - painting - Mona Lisa - Title - La Gioconda - Mona Lisa - Created by - Leaonardo da Vinci - Mona Lisa - Depicts - Lisa del giocondo, sky, body of water, bridge, … - Mona Lisa - Located at - Louvre - Mona Lisa - Movement - High renaissance - Mona Lisa - Exhibited since - 1797 - - - Example conversion of imaginary DB to triplets - Exhibition object 24: - Painting, Name: Mona lisa, Painter: Leonardo da vinci, pained in 1500, hangs in louvre, uses oil paints - - (if you have your data in rows, maybe your columns could be your properties, and your row header is your item) - - - - - - source - - EOF; + $text = ApiWbStackInitMainPage::TEXT; $content = \ContentHandler::makeContent( $text, $title ); $updater = $page->newPageUpdater( $user ); $updater->setContent( SlotRecord::MAIN, $content ); $updater->setRcPatrolStatus( \RecentChange::PRC_PATROLLED ); - $newRev = $updater->saveRevision( $comment, EDIT_NEW); + $updater->saveRevision( $comment, EDIT_NEW ); } }