How this term wiki was setup

From TermWiki
Jump to: navigation, search

Setup a database

mysql -u root -p
mysql> create database <name of database>;
mysql> grant index, create, select, insert, update, delete, alter, drop, 
mysql> lock tables on <name of database>.* to '<termwiki db admin>'@'localhost' 
mysql> identified by 'SecretPassword';

Install Mediawiki

wget http://download.wikimedia.org/mediawiki/1.21/mediawiki-1.21.1.tar.gz

Unpack mediawiki
tar zxf mediawiki-1.21.1.tar.gz

mv mediawiki-1.21.1 /var/www/termwiki
chown -R apache:apache /var/www/termwiki/

Apache setup

Alias /termwiki /var/www/termwiki

<Directory /var/www/termwiki/>
        Options +FollowSymLinks
        AllowOverride All
        order allow,deny
        allow from all
</Directory>

# some directories must be protected
<Directory /var/www/termwiki/config>
        Options -FollowSymLinks
        AllowOverride None
</Directory>
<Directory /var/www/termwiki/upload>
        Options -FollowSymLinks
        AllowOverride None
</Directory>

MediaWiki included bundles

  • Cite
  • CiteThisPage
  • ConfirmEdit
  • Gadgets
  • ImageMap
  • InputBox
  • Interwiki
  • LocalisationUpdate
  • Nuke
  • ParserFunctions
  • PdfHandler
  • Poem
  • Renameuser
  • SpamBlacklist
  • SyntaxHighlight_GeSHi
  • TitleBlacklist
  • WikiEditor

Further extensions

Semantic Bundle

https://www.mediawiki.org/wiki/Semantic_Bundle

  • AdminLinks
  • ApprovedRevs
  • Arrays
  • DataTransfer
  • ExternalData
  • HeaderTabs
  • Maps
  • PageSchemas
  • ReplaceText
  • SemanticBundle
  • SemanticCompoundQueries
  • SemanticDrilldown
  • SemanticExtraSpecialProperties
  • SemanticForms
  • SemanticFormsInputs
  • SemanticImageInput
  • SemanticInternalObjects
  • SemanticMaps
  • SemanticMediaWiki
  • SemanticResultFormats
  • SemanticWatchlist
  • Validator
  • Widgets

CategoryTree

https://www.mediawiki.org/wiki/Extension:CategoryTree

MediaWiki Language Extension Bundle

https://www.mediawiki.org/wiki/MediaWiki_Language_Extension_Bundle

Contains these extensions:

  • Babel
  • cldr
  • CleanChanges
  • LocalisationUpdate
  • Translate
  • UniversalLanguageSelector

Setting up translation of concept-page and concept-form

$wgTranslateAC = $wgTranslateEC = array();
$wgTranslateCC['wiki-sidebar'] = 'addMessageGroup';
$wgTranslateCC['wiki-form-concept'] = 'addMessageGroup';
$wgTranslateCC['wiki-page-concept'] = 'addMessageGroup';
function addMessageGroup( $id ) {
    if ( $id == 'wiki-sidebar' ) {
        $mg = new WikiMessageGroup( $id, 'project' );
        $mg->setLabel( 'Termipankin käyttöliittymä' );
        $mg->setDescription( 'Termipankin omat käyttöliittymäviestit' );
        return $mg;
    } elseif ( $id == 'wiki-form-concept' ) {
        $mg = new WikiMessageGroup( $id, 'project-form-concept' );
        $mg->setLabel( 'Concept form' );
        return $mg;
    } elseif ($id == 'wiki-page-concept') {
        $mg = new WikiMessageGroup( $id, 'project-page-concept' );
        $mg -> setLabel( 'Concept page' );
        return $mg;
    }
}

NoTitle

https://www.mediawiki.org/wiki/Extension:NoTitle

CodeEditor

https://www.mediawiki.org/wiki/Extension:CodeEditor

SemanticExtraSpecialProperties

https://www.mediawiki.org/wiki/Extension:Semantic_Extra_Special_Properties

SemanticFormsSelect

https://www.mediawiki.org/wiki/Extension:SemanticFormsSelect

SemanticTasks

https://www.mediawiki.org/wiki/Extension:Semantic_Tasks

ShortUrl

https://www.mediawiki.org/wiki/Extension:ShortUrl

TitleKey

https://www.mediawiki.org/wiki/Extension:TitleKey

TermBank

https://github.com/Kantti/TermBank

In /var/www/termwiki/extensions git clone https://github.com/Kantti/TermBank.git

require_once( '$IP/extensions/TermBank/Termbank.php' );

Tabs

Tabs is used in Form:Content to make the editing of a Concept more comfortable

Flow

https://www.mediawiki.org/wiki/Extension:Flow

Flows dependencies

Custom settings for TermWiki

Work groups

// Työryhmät
/**
 * Helper function for adding namespace for message groups.
 *
 * It defines constants for the namespace (and talk namespace) and sets up
 * restrictions and some other configuration.
 * @param $id \int Namespace number
 * @param $name \string Name of the namespace
 */
function wfAddTermNamespace( $id, $name ) {
    global $wgExtraNamespaces, $wgContentNamespaces,
        $wgNamespaceProtection,  $wgNamespacesToBeSearchedDefault,
        $wgGroupPermissions, $smwgNamespacesWithSemanticLinks,
        $wgCapitalLinkOverrides;

    $constant = strtoupper( "NS_$name" );
    define( $constant, $id );
    define( $constant . '_TALK', $id + 1 );
    $wgExtraNamespaces[$id] = $name;
    $wgExtraNamespaces[$id + 1] = "Keskustelu_$name";
    $wgContentNamespaces[] = $id;
    $wgNamespacesToBeSearchedDefault[$id] = true;
    $wgCapitalLinkOverrides[$id] = false;

    $right = strtolower( $name );
    $wgNamespaceProtection[$id] = array( $right );
    $wgGroupPermissions['sysop'][$right] = true;

    $wgGroupPermissions[$right][$right] = true;
    $wgGroupPermissions[$right]['delete'] = true;
    $smwgNamespacesWithSemanticLinks[$id] = true;
}

// Nimitys
define( "NS_NIMITYS", 1098 );
define( "NS_NIMITYS_TALK", 1099 );
$wgExtraNamespaces[NS_NIMITYS] = "Nimitys";
$wgExtraNamespaces[NS_NIMITYS_TALK] = "Keskustelu_nimityksestä";

// Lähde
define( "NS_LAHDE", 1118 );
define( "NS_LAHDE_TALK", 1119 );
$wgExtraNamespaces[NS_LAHDE] = "Lähde";
$wgExtraNamespaces[NS_LAHDE_TALK] = "Keskustelu_lähteestä";

$wgCapitalLinkOverrides[NS_NIMITYS] = false;
$smwgNamespacesWithSemanticLinks[NS_NIMITYS] = true;

$wgCapitalLinkOverrides[NS_LAHDE] = false;
$smwgNamespacesWithSemanticLinks[NS_LAHDE] = true;

wfAddTermNamespace( 1100, 'Kasvitiede' );
wfAddTermNamespace( 1102, 'Kielitiede' );
wfAddTermNamespace( 1104, 'Oikeustiede' );
wfAddTermNamespace( 1106, 'Kieliteknologia' );
wfAddTermNamespace( 1108, 'Epidemiologia' );
wfAddTermNamespace( 1110, 'Sienitiede' );
wfAddTermNamespace( 1112, 'Biologia' );
wfAddTermNamespace( 1114, 'Mikrobiologia' );
wfAddTermNamespace( 1116, 'Geofysiikka' );
wfAddTermNamespace( 1120, 'Käännöstiede' );
wfAddTermNamespace( 1122, 'Terminologiaoppi' );
wfAddTermNamespace( 1124, 'Eläintiede' );
wfAddTermNamespace( 1126, 'Politologi' );
wfAddTermNamespace( 1128, 'Arkeologia' );
wfAddTermNamespace( 1130, 'Eläinlääketiede' );
wfAddTermNamespace( 1132, 'Språkvetenskap' );
wfAddTermNamespace( 1134, 'Sähkötekniikka' );
wfAddTermNamespace( 1136, 'Kirjallisuudentutkimus' );
wfAddTermNamespace( 1138, 'Taiteentutkimus' );
wfAddTermNamespace( 1140, 'Language_Technology' );
wfAddTermNamespace( 1141, 'Giellateknologija' );
wfAddTermNamespace( 1142, 'Sosiaalipsykologia' );

$wgTermbankColors = array(
    'Kasvitiede'        => '#27B600',
    'Kielitiede'        => '#3E7FDB',
    'Oikeustiede'       => '#711E4A',
    'Kieliteknologia'   => '#4C00BF',
    'Language_Technology'   => '#4C00BF',
    'Epidemiologia'     => '#408080',
    'Biologia'      => '#008000',
    'Sienitiede'        => '#55641C',
    'Mikrobiologia'     => '#656096',
    'Geofysiikka'       => '#025B5B',
    'Käännöstiede'      => '#4F7E8F',
    'Terminologiaoppi'  => '#0000DF',
    'Eläintiede'        => '#8B4513',
    'Arkeologia'        => '#64261B',
    'Eläinlääketiede'   => '#D1AB4D',
    'Kirjallisuudentutkimus' => '#990033 ',
    'Sosiaalipsykologia' => '#DC143C',
);

$wgProfileToDatabase = true;
$wgEnableProfileInfo = true;