Docstoc

AWESOME ADE Installation _ Configuration Guide

Document Sample
AWESOME ADE Installation _ Configuration Guide Powered By Docstoc
					AWESOME - Computing Installation & Configuration Guide

This document is a guide to creating new AWESOME Instances, primarily based at the University of Leeds, but may also be used to create the AWESOME ADE at other locations.

Contents
Overview .................................................................................................. 4 Step 1: Set up access to the server .............................................................. 4 Step 2a: Instructions to create a new instance when based at a new location . 4 Step 2b: Instruction to an instance from the existing instance (Create the MediaWiki Tables) ...................................................................................... 5 AWESOME ADE based at the University of Leeds ......................................... 6 AWESOME-Computing instance details ....................................................... 6 Create the new Instance tables (these coexist on the same database) ........... 6 Create symbolic links to share source code ................................................. 8 Initialising Semantic MediaWiki ................................................................. 9 Step 3 : Customize the AWESOME Instance User Interface ............................ 10 The Main Navigation ........................................................................... 10 Changing ‘Log in/create account’ to ‘Sign in’ .......................................... 11 Changing the search button ‘Go’ and ‘Search’ labels ............................... 11 Setting up the Blog pages.................................................................... 11 Setting up Tag Cloud Pages ................................................................. 11 Step 4 : Semantic MediaWiki Installation .................................................... 11 Step 5 : Setting up WikiChat ..................................................................... 11 Step 6 : Core AWESOME Instance Pages ..................................................... 12 Export Forms ..................................................................................... 13 Export Templates ............................................................................... 13 Export Properties ................................................................................ 13 Export Categories ............................................................................... 13 Export Help ....................................................................................... 13 Export Widget .................................................................................... 14 Maintenance scripts to run after import ................................................. 14 Step 7 : AWESOME Core Pedagogy Pages ................................................... 14 Import AWESOME Instance Images ......................................................... 16 Minor hand editing .............................................................................. 16 Uploading media ................................................................................ 16 Creating user accounts .......................................................................... 17 2

Securing the site ................................................................................... 17 Appendices.............................................................................................. 18 Reference URLs .................................................................................. 18 MediaWiki .......................................................................................... 18 Appendix 1: Example Leeds MediaWiki Installation Report .......................... 19 Appendix 2 :Installed Software & Extensions ............................................ 20 Installed extensions ............................................................................ 20 Hooks ............................................................................................... 23 AWESOME-Computing instance details ........................................................ 24 Creating new semantic forms .................................................................... 25 Hack for User Page ................................................................................... 29 Code to remove edit with form tab………………………………………………………………………29 Uploading previous dissertations into AWESOME-Computing instance………………33

3

Overview
The AWESOME ADE is underpinned by MediaWiki1 and its semantic extensions2. The AWESOME Instance website architecture described here provides a flexible structure to minimise the effort required to upgrade this software across all instances.

Step 1: Set up access to the server
1. Arrange hosting with your provider. 2. Ensure you have a server running recent versions of Apache, PHP and MySql 3. Ask your server administrator for a username/password for the server and a username and password for the database. 4. Download WinScp(free) installation package for uploading to the server (see http://winscp.net/eng/download.php) and Putty (see http://www.putty.org ) 5. Acquire the URL through which you will access the site e.g. http://awesome.leeds.ac.uk and ensure this points to the directory where you will install the AWESOME ADE. (The AWESOME Instances are created in other folders later).

Step 2a: Instructions to create a new instance when based at a new location
This installation seeks to mirror the Leeds installation and to facilitate running more than one AWESOME Instance from the same set of installation source code and the same database. These instructions are only intended as a brief summary of the more detailed instructions at http://www.MediaWiki.org/wiki/Installation. 1. Log on to your server and navigate to the location for the new Instance 2. Create a /wiki directory 3. Download the MediaWiki-1.12.0 (follow instructions at http://www.MediaWiki.org/wiki/Download) , unzip the file and then upload the entire directory to the /wiki directory on the server. 4. Follow the instructions there for installing MW(http://www.MediaWiki.org/wiki/Installation) being sure to fill in the configuration fields as in the Leeds instructions. 5. Move, as instructed, the LocalSettings.php file into the installation directory and follow the link to check that the installation is working.
1 2

http://www.mediawiki.org/wiki/MediaWiki http://semantic-mediawiki.org/wiki/Semantic_MediaWiki

4

6. Take a copy of the SharedLocalSettings.php file in the Leeds installation and edit the settings specific to your configuration such as the database information and place it in your remote MW directory. Rename LocalSettings.php to LocalSettings.notused.php. 7. If you are running the same version of MW as at AWESOME Leeds(strongly recommended) take a copy of the Leeds extensions directory and upload to your MW/extensions directory. 8. Take a copy of the Leeds MW /skins directory. Follow the instructions as for the Leeds installation below (creates separate AWESOME Instance directories which share the MW source code) and then use the following instructions to complete the installation

Step 2b: Instruction to an instance from the existing instance (Create the MediaWiki Tables)
The following is loosely based on the method described at http://www.steverumberg.com/wiki/index.php?title=WikiHelp_-_Method_Two This is a customised MW installation that enables AWESOME Instances to share one set of source code. This is essential to minimise the effort required to update the underlying software across all Instances. The Leeds based AWESOME Instances all run off the same database but with a separate set of MW and SMW tables (these tables are uniquely prefixed for each Instance). The instructions here are specific to that architecture and are recommended for both adding an Instance to the Leeds AWESOME hub and for completely new installations elsewhere. Each Instance has its own upload area for images and documents but shares a common configuration file which is tuned to each Instance by an additional local configuration file also.

5

AWESOME ADE based at the University of Leeds
All the code is located in the WWW/ directory which is pointed to by the http://awesome.leeds.ac.uk url. The structure of the /WWW directory: /wiki Sub folder /home /MediaWiki1.12.0 /publicinstance Configuration index.htm (links to Instances) The home folder for AWESOME launched by http://awesome.leeds.ac.uk SharedLocalSettings.php The main MediaWiki source code installation including extensions LocalSettings.php The University of Leeds (Includes AWESOME Public Instance SharedLocalSettings.php specific configuration PubLocalSettings.php)

The SharedLocalSettings.php file contains shared configuration information, including the shared extensions (these are listed in Appendix 2) and common access privileges. In a standard MW installation this would be called LocalSettings.php.

AWESOME-Computing instance details
The AWESOME-Computing instance is at the location http://awesome-comp.leeds.ac.uk/wiki/mediawiki-1.12.0 The structure AWESOME-Computing instance /WWW directory is /wiki/mediawiki- 1.12.0 and configuration files is LocalSettings.php

Create the new Instance tables (these coexist on the same database)
1. Browse to the remote directory http://your url /wiki/MediaWiki1.12.0 and change the access permissions on the config directory to 777 (rename the file LocalSettings.php, if it exists in this directory, as the installation will create a new one). 2. Type ‘http://your url /wiki/MediaWiki-1.12.0/config’ into your browser eg http://awesome.leeds.ac.uk/wiki/ MediaWiki1.12.0/config 3. You will see a form for the installation. In addition to the information here refer to http://www.mediawiki.org/wiki/Manual:Config_script for detailed information about the configuration. 4. You need to know your database username and password and you *must* set a unique prefix for the new MediaWiki tables. The existing Instances use the prefixed edu_, fd_ and sc_, caw_. The prefix should be short and 6

unique eg soc_ (School of computing acronym ). Be sure to record the administrator (WikiSysop) password and keep it secure. Configuration values a. Wiki name: AWESOME b. Contact e-mail: administrator’s email address eg. s.bajanki@leeds.ac.uk c. Language:English (no multi language support yet) d. Copyright – leave as default e. Admin username: WikiSysop f. Password: your very secure password g. Object caching – leave as default h. Email – leave defaults i. Database config: as given by your service provider j. Database table prefix eg soc_

5. When you click install you will receive a page of messages confirming that the setup ran successfully. Please keep a record of this for future reference. (see Appendix 1 for example). Rename the LocalSettings.php file in the config directory to reflect the Instance (eg LocalSettings. UOLSoc.php). Do not move it as instructed to the MW installation directory as this step is only needed to create the AWESOME Instance’s database tables. If you are creating a new AWESOME hub at another site please move this file to the MW directory as instructed and rename it SharedLocalSettings.php.

6. Do not navigate(as instructed) to the wiki Instance until you have done this: a. Created a local directory eg /UOLSoc b. Created a new remote directory under /wiki for the Instance (eg. /UOLSoc - University of Leeds, School of Computing). You are strongly advised to use a name with the institution acronym (eg UOL for University of Leeds) followed by the database prefix used earlier (without the underscore). c. Copy LocalSettings.php from one of the other Instance configuration directories (eg /publicinstance/LocalSettings.php) to your local Instance directory (eg /UOLSoc/ LocalSettings.php). d. Edit the line in LocalSettings.php
# initialise the particular AWESOME Instance require_once('PubLocalSettings.php');

7

replacing the file name to reflect the new Instance eg UOLSocLocalSettings.php e. Upload to the new Instance directory eg /UOLSoc f. Now download the Instance specific configuration to your local machine eg. Copy /publicinstance/PubLocalSettings.php to your local /UOLSoc directory. g. Rename the copy to reflect the Instance specific configuration (eg UOLSocLocalSettings.php) h. Open the file and change the values: IMPORTANT! Change the database table prefix Location of script files Path to Instance specific chat room (you will create this file later) Branding information for this Instance $agInstanceTitle $agInstanceUrl $agInstitutionLogo $agInstitutionUrl $wgDBprefix $wgScriptPath eg soc_

/wiki/UOLSoc require_once( "extensions/WikiChat/WikiChatUOL Soc.php" ); "The School of Computing"; the main page title "http://www.comp.leeds.ac.uk"; link to institution department/school "{$wgStylePath}/common/images/ UOLlogo.jpg"; institution logo "http://www.leeds.ac.uk"; link to institution

i. Edit the Group permissions, replacing the group name eg ‘UOLSoc’ with the Instance’s AWESOME acronym eg ‘UOLSoc’ j. Upload the file to the Instance directory eg /UOLSoc/UOLSocLocalSettings.php

Create symbolic links to share source code
Each Instance shares the same MediaWiki source code to facilitate management of new releases and bug fixes to existing extensions. You now need to create symbolic links in your new Instance directory to the MediaWiki installation directory to make it look as though the code exists locally. To do this: 8

Open a shell in WinScp (Commands->Open terminal in WinSCP) and navigate to the AWESOME Instance installation directory (eg cd /wiki/UOLSoc)) You need to be sure that your library include path is set correctly. Type: setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:/PathtoBeAdded where PathtoBeAdded in the Leeds case is: usr/local/ldap/lib Check you are in the directory of the new AWESOME Instance Then create the symbolic links to the MediaWiki source directory:
ln -s /export/home/webhost2_b/awesome-comp.leeds.ac.uk/WWW/wiki/MediaWiki-1.12.0/* .

Check the links have been created by refreshing the remote Instance’s directory. You should see the links to the MediaWiki files and directories. Now you need to remove some of the symbolic links.       Delete the /images directory symbolic link (this will be local to the Instance’s configuration) Create the /images directory under your Instance directory eg /UOLSoc /images and set its access properties to 777 Delete the symbolic link to the /maintenance directory Create a /maintenance directory (we will set this up later) Navigate to the MediaWiki installation /config directory. Download the LocalSettings.<instance acronym>.php file to your local machine into the Instance’s configuration area (name it LocalSettings.generated.php This is for your records – it is not used.

You are now ready to launch the new Instance(although it is only partially configured) by browsing to your new Instance’s directory  Eg In your browser type http://awesome-comp.leeds.ac.uk/wiki/UOLSoc

If the AWESOME Instance does not come up please check the steps above.

Initialising Semantic MediaWiki
To initialise Semantic MediaWiki     Log in as the systems administrator(the username WikiSysop and password used during configuration) Click on ‘special pages’ (link at bottom of site) Scroll down to Admin functions for Semantic MediaWiki Click on ‘Initialise or upgrade tables’ 9



You should get the message The storage engine was set up successfully

There are now various customisations that need to be done before you can start importing page content.

Step 3 : Customize the AWESOME Instance User Interface
Many of the UI words and some of the navigation you see at the interface of MW are defined in actual pages within the wiki. The most important is the main navigation which is used in AWESOME to reflect the pedagogy of the dissertation writing process. The easiest way to reproduce this content is to visit the AWESOME Computing instance at The University of Leeds (http://awesomecomp.leeds.ac.uk/wiki/mediawiki-1.12.0) Most of the interface customisation happens in a special ‘awesome’ skin. That skin is loosely based on that developed by Paul Gu (see http://paulgu.com/wiki/GuMax) . New AWESOME hubs should copy the Leeds MW/skins folder. New AWESOME Instances at Leeds automatically load the AWESOME skin. The customisations not available through the skin are listed here and must be followed wherever your AWESOME Instance installation is. The Main Navigation At http://awesome-comp.leeds.ac.uk/wiki/mediawiki-1.12.0 go to the page MediaWiki:Sidebar This is the page which MW reads for the main navigation.    Click ‘view source’. ‘Copy’ the entire contents. Browse to your new Instance (in another browser window as you will be going back and forth between the two Instances) eg http://awesomecomp.leeds.ac.uk/wiki/UOLSoc Log in to the new Instance as systems administrator (WikiSysop/password as used during the initial installation) Using the ‘search’ facility browse to MediaWiki:Sidebar Click ‘edit’ and paste the contents in (replacing the existing content) Click ‘Save’

   

The links in the navigation won’t work yet as you still need to import the AWESOME Instance pages which we will do later. Navigate to the pages listed here and replace the text as directed.

10

Changing ‘Log in/create account’ to ‘Sign in’  MediaWiki:Userlogin Simply replace the text with Sign in Changing the search button ‘Go’ and ‘Search’ labels  MediaWiki:Searcharticle : Simply replace the text with Search for an article  MediaWiki:Searchbutton : Simply replace the text with Search for words Setting up the Blog pages  MediaWiki:recentblog-url : insert text Special:ListAllBlogs/ and Save  MediaWiki:recentblog : insert text Most Recent Blogs and Save Blog extension reference: http://www.chekmate.org/wiki/index.php/MW:_my_blog If you are creating a new hub you must be sure to take the Blog extension code from Leeds which fixes some bugs (both mentioned on the above site). Setting up Tag Cloud Pages  MediaWiki:Tagcloudpages : insert text Main Page and Save Tag Cloud extension reference: http://wikitools.com/wiki/Wiki_Category_Tag_Cloud

Step 4 : Semantic MediaWiki Installation
Semantic MediaWiki(SMW) is an extension of MediaWiki and a core component of AWESOME. SMW uses its own tables which you initialise by:     Sign in as systems administrator Go to Special pages (link at bottom of the page) Scroll to ‘Admin functions for Semantic MediaWiki’ Click on ‘Initialise or Upgrade Tables’

That is all you need to do to install SMW.

Step 5 : Setting up WikiChat

11

The Chat rooms use the same Chat extension source code (this extension interfaces to http://www.phpfreechat.net ) but have a separate configuration file to create chat rooms specific to each Instance.   Download /Publicinstance/extensions/WikiChat/WikiChatPublicinstance.php Edit and change $params["channels"] = array("Centre for Academic Writing Chat"); to set up a chat room for the Instance. (you can set up several) Rename the file (eg to WikiChatUOBCed.php) and upload to the MW/extensions/WikiChat directory. Download the new Instance’s configuration file (eg UOBCedLocalSettings.php) and change the name of the included WikiChat file. Upload the configuration file. Now, Navigate, via the Instance’s main menu, to ‘Chat with others’ in the Leeds AWESOME Education Instance and copy the contents of the page (with ‘view source’). Go to the new Instance, log in, and click on ‘Chat with others’. The page doesn’t yet exist so select ‘edit’ and Paste the contents. Change the pasted link to refer to the new Instance and change the text for the link. Save Click on the chat link to check it works and reflects the name you gave to the chat room.

 

 

   

Step 6 : Core AWESOME Instance Pages
Each AWESOME Instance makes use of templates, forms, categories and properties. These are largely determined by the initial core ontology. These pages exist in special areas of the wiki’s pages called ‘namespaces’. To refer to these pages they are prefixed with a namespace name such as Form:<form name> or Template:<template name>. The export facility used is not part of the vanilla MW installation and has been upgraded as at http://www.MediaWiki.org/wiki/Export_entire_Namespaces to enable export by namespace. To perform the imports you must be logged in as the administrator in the new Instance. Each export produces an xml file which you subsequently import into the new AWESOME Instance. Alternatively, snapshots of these xml exports are available on the remote server in the folder /wiki/new Instance/xml exports . These can be downloaded and then imported directly into the new Instance. Please note that these exports 12

may not be up to date with the existing AWESOME Instances – for example, the templates or forms may have changed. To create fresh exports follow these instructions. Export Forms In the AWESOME Leeds Instance navigate to Special: Export page and type Form:* and click export. In the new Instance navigate to Special:Import and upload the xml file. This creates the pages. Export Templates In the Special: Export page type Template:* and click export. In the new Instance navigate to Special:Import and upload the xml file. This creates the pages. Export Properties In the Special: Export page type Property:* and click export. In the new Instance navigate to Special:Import and upload the xml file. This creates the properties. Export Categories In the Special: Export page type Category:* and click export. In the new Instance navigate to Special:Import and upload the xml file. This creates the categories. Export Help In the Special: Export page type Help:* and click export.

13

In the new Instance navigate to Special:Import and upload the xml file. This creates the help pages. Export Widget In the Special: Export page type Widget:* and click export. In the new Instance navigate to Special:Import and upload the xml file. This creates the pages. Maintenance scripts to run after import It is now essential to run a maintenance script to update the imported pages containing semantic mark-up. It is necessary to run this when you have ‘imported’ semantic content rather than creating it through the site itself.   Create a /maintenance directory under the new Instance (deleting the symbolic link) Copy the following files from the MW/maintenance installation here. The required scripts are: o commandLine.inc o counter.php o SMW_refreshData.php Download the AdminSettings.php file from one of the other Instances and change the database prefix to that of the new Instance (eg ‘Ced_’). Upload AdminSettings.php to the new Instance directory (eg /UOBCed). Using a secure shell for running scripts (eg Putty http://www.putty.org/ ) o setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:/PathtoBeAdded Navigate to the new Instance’s directory and type o php SMW_refreshData.php -v This will update the semantic data on the database. If you subsequently notice problems with the Instance’s semantic data you can rerun this script which will often resolve problems.







Step 7 : AWESOME Core Pedagogy Pages
You are now ready to create the pages relating to the main navigation and pedagogy. This is the navigation created earlier on the page MediaWiki:Sidebar. The existing AWESOME Instances contain community contributions which also exist in the Main namespace3.

3

Should further funding become available this should be changed so as there is a clear demarcation between core AWESOME ADE pages and content contributed through the

14

Before importing, navigate to the new Instance Main Page and delete it – this will allow the imported page to be created.

community. This could be achieved via a separate namespace but would require modification of the forms and templates which is beyond the scope of the current development.

15

In the Leeds Education Instance navigate to Special:Export and type: Main Page What is a dissertation? Critical study How to choose a topic How to choose a methodology How to develop your literature How to write clearly Project Management All Dissertation FAQs Previous Dissertations Shared bookmarks Then click Export (check ‘include only current version’ and ‘save to file’ selected). In the new Instance go to Special:Import and import the xml file. The main navigation should now work.

Import AWESOME Instance Images
Images common to the AWESOME ADE are located at the (Leeds installation) /wiki/new Instance/images. Download the files. Log in as administrator in the new Instance and navigate to Special:Upload and upload each of these images, keeping the names with an initial capital letter4. Minor hand editing ‘Edit’ the AWESOME Home page and change the welcome message to reflect this Instance. eg Welcome to [http://www.comp.leeds.ac.uk The Centre for Academic Writing ] Uploading media Although users can specify media files (such as mp3 podcasts) these can only be uploaded by the systems administrator (to the /wiki/media folder). If you wish to add such content from the start simply upload to this area and refer to the media via the usual http (or mms) protocol(s). Media already published via YouTube can be easily included using the mark-up exemplified on the AWESOME Home page (use ‘view source’ to copy and paste).

4

Should further funding become available a shared upload area should be created for shared images and documents. There is some investigation needed into how it would be possible to choose between different upload areas at the point of upload at how this would impact on users.

16

Creating user accounts
To create user accounts sign in as administrator and click on Special pages. Go to Sign in and click on create account. Enter details and Save. Return to Special pages and click on User rights management and select the user group for this Instance (you should see the group name entered earlier in this Instance’s configuration file (eg ‘UOBCed’ in the associated /UOBCed/UOBCedLocalSettings.php file). Click Save user groups. The new user will now have the appropriate rights in that Instance.

Securing the site
 Delete LocalSettings.php (if it exists) from the MW/config directory and make the /config directory read only (chmod 600)

17

Appendices
Reference URLs MediaWiki Extensive documentation is available at http://www.MediaWiki.org/wiki/MediaWiki Semantic MediaWiki Semantic MediaWiki and related extensions are located at http://semanticMediaWiki.org/wiki/Semantic_MediaWiki Other MediaWiki Extensions A full list of available MW extensions is available at: http://www.MediaWiki.org/wiki/Category:Extensions To find out more about each of the MW extensions used by the AWESOME ADE please refer to their links in the table below. Further comments can be found in the MW installation directory in SharedLocalSettings.php.

18

Appendix 1: Example Leeds MediaWiki Installation Report
For up to date information on software versions used in the AWESOME Installation at The University of Leeds please open http://awesome.leeds.ac.uk/wiki/Publicinstance click on ‘Special pages’ (link at the bottom of the page) and click on ‘Versions’. That information, at the time of writing, is also included here.

    

           

PHP 5.1.2 installed Found database drivers for: MySQL PHP server API is apache2handler; ok, using pretty URLs (index.php/Page_Title) Have XML / Latin1-UTF-8 conversion support. Warning: A value for session.save_path has not been set in PHP.ini. If the default value causes problems with saving session data, set it to a valid path which is read/write/execute for the user your web server is running under. PHP is configured with no memory_limit. Couldn't find Turck MMCache, eAccelerator, APC or XCache; cannot use these for object caching. Found GNU diff3: /usr/local/bin/diff3. Found GD graphics library built-in, image thumbnailing will be enabled if you enable uploads. Installation directory:
/export/home/webhost2_b/awesome.leeds.ac.uk/WWW/wiki/MediaWiki1.12.0 Script URI path: /wiki/MediaWiki-1.12.0 Installing MediaWiki with php file extensions

Environment checked. You can install MediaWiki.
Generating configuration file...
Database type: MySQL Loading class: DatabaseMysql PHP is linked with old MySQL client libraries. If you are using a MySQL 4.1 server and have problems connecting to the database, see http://dev.mysql.com/doc/mysql/en/old-client.html for help. Attempting to connect to database server as awesqladmin...success. Connected to 5.0.45-log; You are using MySQL 4.1 server, but PHP is linked to old client libraries; if you have trouble with authentication, see http://dev.mysql.com/doc/mysql/en/oldclient.html for help. Database awesome exists Creating tables... done. Initializing statistics... Created sysop account WikiSysop.

 

    

Creating LocalSettings.php...
19

Appendix 2 :Installed Software & Extensions
Product MediaWiki 1.12.0 PHP MySQL 5.1.2 (apache2handler) 5.0.45-log Version

Installed extensions Special pages A drilldown interface for Semantic Drilldown navigating (Version 0.4.3) through semantic data Forms for adding and editing semantic data

Yaron Koren

Semantic Forms (Version 1.2.3)

Yaron Koren and others

Parser hooks Adds tabs to the page separating topSergey Chernyshev (for Semantic level sections. Communities LLC.) Originally developed for Ardorado.com Enhance parser with logical Tim Starling functions Klaus Lassleben, Markus Krötzsch, 20

Header Tabs (Version 0.6.1)

ParserFunctions (Version 1.1.1)

Semantic MediaWiki Making your

(Version 1.1.1)

wiki more Denny Vrandecic, S Page, and others. accessible – for Maintained by AIFB Karlsruhe. machines and humans. View online documentation. Allows wiki administrators to add freeform widgets to wiki by just Sergey Chernyshev (for Semantic editing pages Communities LLC.) within Widget namespace. Originally developed for Ardorado.com A Category Tag Cloud derived, improved, and fixed from the Daniel Friesen <dan_the_man@telus.net> YetAnotherTag Cloud Extension

Widgets (Version 0.8)

Wiki Category Tag Cloud

Other Prevents users KeepYourHandsToY from editing ourself (Version Jim R. Wilson (wilson.jim.r<at>gmail.com) other users 0.2) pages. This Extension provides "folksonomy"type tagging to Molecular articles, using Categories as the underlying functionality

TagAsCategory

21

Adds a tab to WikiChat (Version each article 0.2.2, 2007-07-25) that switches to a chatroom

User:Firebreather

ProtectText

Allows authorised Loosely based on ProtectSection by users, and sole ThomasV; modified by John Erling Blad contributors, to protect parts of a text To upload the previous dissertation in csv format Yaron Karen http://www.mediawiki.org/wiki/Extension: Data_Transfer

Data Transfer(version 0.3.4)

Extension functions headerTabsParserFunctions, htSetupExtension, loadSpecialListAllBlogs, loadSpecialListSubpages, registerTagCloudExtension, sdgSetupExtension, setupForKeepYourHandsToYourself, sfgParserFunctions, sfgSetupExtension, smwfSetupExtension, wfDynamicArticleList, wfSetupParserFunctions, wfSetupWikiChat and widgetParserFunctions

Parser extension tags <dynamicarticlelist>, <headertabs>, <pre> and <tagcloud>

Parser function hooks anchorencode, arraymap, arraymaptemplate, defaultsort, displaytitle, expr, filepath, formatnum, forminput, formlink, fullurl, fullurle, grammar, if, ifeq, iferror, ifexist, ifexpr, int, language, lc, lcfirst, localurl, localurle, ns, numberofadmins, numberofarticles, numberofedits, numberoffiles, numberofpages, numberofusers, padleft, padright, plural, rel2abs, special, switch, switchtablink, tag, time, timel, titleparts, uc, ucfirst, urlencode and widget

22

Hooks Hook name AbortNewAccount ArticleDelete ArticleFromTitle ArticleSave ArticleSaveComplete ArticleUndelete ArticleViewHeader BeforePageDisplay BrokenLink InternalParseBeforeLinks Subscribed by rejectUsernamesWithConsecutiveDashes smwfDeleteHook smwfShowListPage smwfPreSaveHook smwfSaveHook smwfUndeleteHook articleShowTagForm htAddHTMLHeader and smwfAddHTMLHeadersOutput sffSetBrokenLink smwfParserHook headerTabsLanguageGetMagic, sffLanguageGetMagic, smwfAddMagicWords, wfAddCustomVariableLang, wfParserFunctionsLanguageGetMagic and widgetLanguageGetMagic wfAddCustomVariable wfAddCustomVariableID htReplaceFirstLevelHeaders and smwfAddHTMLHeadersParser smwfRegisterInlineQueries (ExtParserFunctions, clearState) (ExtParserFunctions, registerParser)

LanguageGetMagic

MagicWordMagicWords MagicWordwgVariableIDs ParserAfterTidy ParserBeforeStrip ParserClearState ParserFirstCallInit

ParserGetVariableValueSwitch wfGetCustomVariable SkinTemplateTabs sffFormEditTab, smwfAddRefreshTab and 23

(WikiChat) TitleMoveComplete UnknownAction userCan smwfMoveHook sffEmbeddedEditForm, tagAction and (WikiChat) keepYourHandsToYourself

AWESOME-Computing instance details
URL: http://awesome-comp.leeds.ac.uk/wiki/mediawiki-1.12.0 Usernames and passwords for ISS server To upload information by FTP to the site use the following details: Domain: awesome-comp.leeds.ac.uk Username: awe02www Password: nw$jE8jR Access path: www/wiki/mediawiki-1.12.0

A MySQL database awe2db Two local user names and passwords for this database: 1) The administration user Username: awe02dbsqladmin Password: sm$jmRjoH8E 2) The web user (RW access) Username: awe02sqlweb Password: N9Fw$s7Q$ You can access a web administration interface for this database at http://webhost2.leeds.ac.uk/phpmyadmin

Username and passwords for the AWSOME-computing instance URL: http://awesome-comp.leeds.ac.uk/wiki/mediawiki-1.12.0 Admin username: AWESysop Password: %vdllkk7 24

Users usernames and password Admin:AWESysop Password: %vdllkk7

Username1: Catherine Password: awesome Username2: peter Password:awesome Username3:Harriet Password:awesome

Creating new semantic forms



Figure out your data structure. What types of pages will the site have? What data will be contained on each one? You can change all of this around later, but it's good to have a starting plan. Create properties. The basic building blocks of any semantic site are the connections between data, which in Semantic MediaWiki are known as properties. A property is used to specify a single piece of information about the topic of this page; the value of a property can either be a standalone value, or the name of a page on the wiki. Every property should be defined on your wiki, with a page in the "Property:" namespace. The easiest way to do that is using the 'CreateProperty' special page in special pages. Create templates. A template sets the display of the data on a page, holds the markup to turn the data into actual semantic information, and (often) defines the page as being of a certain category, and thus of a certain page type. There will generally be one template per page type, although sometimes a single page type will contain more than one template. A template can also be used for aggregation, by displaying a list of all other pages that have a certain relationship to this page (see the inline queries documentation for much more information on this). The easiest way to create templates is using the 'CreateTemplate' special page in special page.





25



Create forms. Now you can create forms to allow users to easily add and edit pages of various types. There should be one form per page type; a form should populate the template or templates that this page type contains. As before, there's a special page to create new forms: 'CreateForm' . One common request is for these three special pages ('CreateProperty', 'CreateTemplate' and 'CreateForm') to be able to edit existing property/template/form pages, and not just create new ones. However, this is programatically much harder to implement than creating new pages, because it requires parsing. For the foreseeable future, modifying existing properties, templates and forms will have to be done by hand. Create categories. One template in each form should define each article that the form creates as being part of a certain category. You should create a page for each such category, and specify a default form for it so that every article is automatically editable with the same form that created it. The easiest way to do that is using the 'CreateCategory' special page (see above).











Enable links to forms. Besides creating categories that have a default form, there are other steps you should take to enable users to access the forms that you have created. These include adding links to add data in the sidebar and elsewhere, and setting default forms and alternate forms on properties, to have red-links to nonexistent pages point to a form for creating them. These actions are all explained further below. Add data. You should also add data to the site, using your new forms, to make sure that forms, templates and categories are working the way you want them to. Add links on sidebar and elsewhere. The sidebar (which, for Englishlanguage wikis, can be edited at the page "MediaWiki:Sidebar") should hold links to add each of the data types, and to the categories for each of these data types as well. You can also include such links on the main page and elsewhere. Customize. Once the structure is in place, you can customize all you want - changing the look-and-feel of the entire wiki, of the various templates, and of the forms, adding and changing fields and adding and changing inline queries for queries Please follow the link to know more about creating new semantic forms http://www.mediawiki.org/wiki/Extension:Semantic_Forms

Example of the Form, Template and Properties

The form on page Form:Bugs and Feedback contains {{{info|page name=BF-<unique number;start=1>}}} {{{for template|Bugs and Feedback|label=Bugs and feedback}}}
26

{| |'''Feedback ''' (one phrase) || {{{field|Feedback|mandatory|class=aweField|}}} ||'''Date''' {{{field|StartDate|default=now|class=aweField|}}} ||'''Type of report entry''' ||{{{field|Type|list|input type=checkboxes|class=aweField|}}} ||'''Description''' (time, where it happened, who reported) ||{{{field|Desc|rows=5|class=aweField|}}} ||'''Priority''' ||{{{field|Priority|class=aweField|}}} ||'''Action''' (Describe action here) ||{{{field|Action|rows=5|class=aweField|}}} ||'''Status''' ||{{{field|Status|rows=5|class=aweField|}}} |} {{{end template}}} YOu can see the filed has an 'input type=checkboxes' In addition the underlying semantic template is: <noinclude> This is the 'Bugs and Feedback' template. It should be called in the following format: <pre> {{Bugs and Feedback |Feedback= |Desc= |Action= |Status= |Priority= }} </pre> Edit the page to see the template text. </noinclude><includeonly> {| border="0" cellpadding="4" cellspacing="4" ! Bug or Feedback | [[Is feedback::{{{Feedback|}}}]] <br />created on [[Has start date::{{{StartDate}}}]]
27

|! Type of report | class="aweTValue"| {{#if:{{{Type|}}} | {{#arraymap:{{{Type}}}|,|x|[[Has report type::x]]}} }} |! Describe the bug or feedback | [[Is feedback description::{{{Desc|}}}]] |! Describe action | [[Has feedback action::{{{Action|}}}]] |! Current status | [[Has feedback status::{{{Status|}}}]] |! Priority | [[Has priority::{{{Priority|}}}]] |} [[REPORT BUGS AND FEEDBACK | Return to Bugs and Feedback Page]] [[Category:Feedback]] </includeonly>

This is a property of type [[Has type::Page|Page]]. The allowed values for this property are: * [[Allows value:=Bug]] * [[Allows value:=Feedback]] * [[Allows value:=Deployment issue]] * [[Allows value:=AWESOME V2]]

28

Hack for User Page
A hack to add to Semantic Forms to force the load of the user page form when users click on their personal user link for the first time. Anyone making a new SF installation will need to add these lines to the file SF_AddData.php in SemanticForms/Specials extension directory. 1. Search for the function printAddForm 2. Insert the lines as indicated here between the START CODE, END CODE comments. function printAddForm($form_name, $target_name, $alt_forms) { global $wgOut, $wgRequest, $wgScriptPath, $sfgScriptPath, $sfgFormPrinter, $sfgYUIBase; wfLoadExtensionMessages('SemanticForms'); // initialize some variables $page_title = NULL; $target_title = NULL; $page_name_formula = NULL; // START CODE // DEBUG: $text="FORM:".$form_name."PAGE".$target_name; $wgOut>addHTML($text); // Use AddData to load a page if it exists - otherwise launch form // Load the page if it exists $mytarget_name = Title::newFromText($target_name); if ($mytarget_name && $mytarget_name->exists()) { $wgOut->redirect( $mytarget_name->getLocalURL( ) ); return; } //END CODE ....

Code to remove edit with form tab
1. Search for SF_FormEditTab.php in the extension semantic forms and paste the following code. Paste the code before retrun true in static function displayTab($obj, &$content_actions) //To hide edit with form tab for AWESOME 29

if (! $wgUser->isAllowed('vieweditwithformtab')) { // the tab can have either of those two action unset($content_actions['form_edit']); } 2. Change the group permissions for edit with form tab $wgGroupPermissions['*' ]['vieweditwithformtab'] = false;

$wgAvailableRights[] = 'vieweditwithformtab'; In SF_Setting.php

Code to convert HTML file to CSV file for previous dissertations
This is a PHP program to convert previous dissertations which are in HTML format to CSV format. Using this CSV format file the dissertations are uploaded into the AWESOMEComputing instance using the Data Transfer extension To run this program : Php HtmltoCSV.php

HtmltoCSV.php <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Open a remote file of final year projects</title> </head> <body> <?php ini_set('display_errors', 0); #####OPEN A CSV FILE

30

$year="2005-2006"; //Please give here the year of the dissertation $degree="MSc";// Please give the degree details $fp = @fopen('dissertations.csv', 'w'); if (!$fp) { echo "<p>Unable to open remote file.\n"; } ####Template name and titles $data=array("Title","Previous Dissertations[title]","Previous Dissertations[URL]","Previous Dissertations[author]","Previous Dissertations[program]","Previous Dissertations[grade]","Previous Dissertations[year]","Previous Dissertations[degree]"); fputcsv($fp, $data); #####OPEN A REMOTE FILE $file = fopen ("http://www.comp.leeds.ac.uk/mscproj/previoustitles/msc2005.html", "r"); //Please enter the URL, which you want to convert if (!$file) { exit; } while (!feof ($file)) { $line = fgets($file, 1024); print "line=$line"; print "<br>"; $explodetable=@explode('<table', $line); if(isset($explodetable)) echo "<p>Unable to open remote file.\n";

$explodetd=@explode('</td>',$explodetable[0]); print "number=$explodetd[0]"; //number if(!($explodetd[1]=="<br>")) if (!(empty($explodetd[1]))) { $ftd= @explode('<A HREF="',$explodetd[1]); $ftd1=@explode('">',$ftd[1]); //URL 31

print "URL=$ftd1[0]"; $ftd22=@explode('</A>',$ftd1[1]); //for name $name=strip_tags($ftd22[0]); print "name=$name"; } if (isset($explodetd[2])) { $explodetd2=@explode('<td>',$explodetd[2]); @print "explodetd2=$explodetd2[1]";

} if (isset($explodetd[3])) { $explodetd3=@explode('<td>',$explodetd[3]); @print "explodetd3=$explodetd3[1]"; //title } if (isset($explodetd[4])) { $explodetd4=@explode('<td>',$explodetd[4]); @print "explodetd4=$explodetd4[1]"; } if (isset($explodetd[5])) { $explodetd5=@explode('<td>',$explodetd[5]); $explodetd55=@explode('<BR>',$explodetd5[1]); @print "explodetd55=$explodetd55[0]"; } /* if (isset($explodetd[6])) { $explodetd2=@explode('<td>',$explodetd[6]); 32

@print "explodetd6=$explodetd6[1]"; } */ $title=trim($explodetd3[1]); $title1=$title.$year.$degree; $data=array($title1,$title,$ftd1[0],$name,trim($explodetd2[1]),$explodetd4[1]) ; if($data1!=$data) { { $data[]=$year; $data[]=$degree; $data1=$data; fputcsv($fp, $data1); }

} } fclose($file); fclose($fp); ?>

Uploading previous dissertations into AWESOME-Computing instance
After converting the HTML file to CSV file , use Data Transfer extension which in the special pages Please follow the below link for the details to upload the dissertations which are in the CSV format http://www.mediawiki.org/wiki/Extension:Data_Transfer

33


				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:233
posted:10/30/2009
language:English
pages:33