AWESOME - Computing Installation & Configuration Guide

goldbashedAI and Robotics

Nov 15, 2013 (3 years and 8 months ago)

63 views




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.

2



Contents

Overview

................................
................................
................................
..

4

Step 1: Set up access to the server

................................
..............................

4

Step 2a: Instruction
s 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 Inst
ance 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

Setti
ng 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

3


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
………………3
3





4



Overview

The AWESOME ADE is underpinned by MediaWiki
1

and its semantic extensions
2
.
The AWESOME Instance website architecture described here provides a f
lexible
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 ser
ver 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/downlo
ad.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
m
ore 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://w
ww.
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.
Medi
aWiki
.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/Inst
allation
) 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

http://www.mediawiki.org/wiki/MediaWiki

2

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

5


6.

Take a copy of the
Sha
redLocalSettings.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 th
e 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
be
low

(creates separate
AWESOME Instance directories which share the MW source code) and then use
the following instructions to complete the installatio
n

Step
2
b
:
Instruction to an instance from the existing instance (
Create
the
MediaWiki

Tables
)

The followi
ng 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 AWE
SOME
Instance
s to share
one set of source code. This is
essential to minimise the effort required to
update the underlying software across all
Instance
s.

The
Leeds based
AWESOME
Instance
s all run off the same database but with a
separate set of M
W and SM
W 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.

6


AWESOME ADE

b
ased at the University of Leeds

All the code is located in the WWW/ direct
ory which is pointed to by the
http://awesome.leeds.ac.uk

url.

The structure of the

/WWW
directory:

/wiki

Sub folder

Configuration



/home

index.htm

(links to
Instance
s)

The home fold
er for
AWESOME launched by
http://awesome.leeds.ac.uk


/
MediaWiki
-
1.12.0

SharedLocalSettings.php

The main
MediaWiki

source
code installation including
extensions


/publicinstance

LocalSettings.php

(Includes

Share
dLocalSettings.php

PubLocalSettings.php)

The University of Leeds

AWESOME Public Instance
specific configuration


The
SharedLocalSettings.php

file contains shar
ed 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 AWE
SOME
-
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/MediaWiki
-
1.12.0

and ch
ange 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://aw
esome.leeds.ac.uk/wiki/
MediaWiki
-
1.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 d
etailed
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
Instance
s
use the prefixed edu_, fd_ and sc_
,

caw
_
. The pr
efix should be short a
nd
7


unique eg
soc
_ (
School of computing

acronym )
.
Be sure to record the
a
dministrator (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 A
ppendix

1

for example)
. Rename the LocalSe
ttings.php
file in the config directory to reflect the
Instance

(eg LocalSettings.

UOL
Soc
.
php). Do not move it as instructed to the MW installation
directory as this step is only needed to create the AWES
O
ME
Instance
’s
database tables.

If you are creating

a new AWESOME hub at another site
please move this file to the MW director
y as instructed and rename it

SharedLocalSettings.php
.


6.

Do not navigate
(as instructed)

to the wiki
Instance

until you have done
this:

a.

Create
d

a local directory eg /UO
LSoc


b.

Create
d

a new
remote
directory under /wiki for the
Instance

(eg.

/UO
LSoc

-

University of
Leeds
,
School of Computing
). You are
strongly advised to use a name with the in
stitution acronym (eg

UOL for University of Leeds) followed by the database prefix used
earl
ier (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 /UO
LSoc
/

LocalSettings.php)
.


d.

Edit the line

in LocalSettings.php


# i
nitialise the particular AWESOME
Instance

require_once('
Pub
LocalSettings.php');

8


replacing the file name to reflect the new
Instance

eg

UO
LSoc
LocalSettings.php

e.

Upload to the new
Instance

directory eg /
UO
LSoc

f.

Now download

the
Instance

spec
ific configuration to your local
machine eg. Copy /
publicinstance
/
Pub
LocalSettings.php to your
local /
UO
LSoc

directory.

g.

Rename the copy to reflect
the
Instance

specific configurati
on (eg
UO
LSoc
LocalSettings.php
)


h.

Open the file and chan
ge the
values:

IMPORT
ANT! Change
the database table
prefix

$wgDBprefix

eg
soc
_

Location of script files


$wgScriptPath

/wiki/UO
LSoc

Path to
Instance

specific chat room (you
will create this file
later)



require_once(
"extensions/WikiChat/WikiChatUO
L
Soc
.php" );

Branding information
for this
Instance


$ag
Instance
Title

"The School of
Computing
";


the main page title

$ag
Instance
Url

"http:/
/www.
comp
.leeds.ac.uk";
link to institution department/school


$agInstitutionLogo

"{$wgStylePath
}/common/images/
UOLlogo.jpg"
;


institution logo

$agInstitutionUrl

"http://www.leeds.ac.uk";

link to institution


i.

Edit the Group permissions, replacing the group name eg ‘UOL
Soc

with the
Instance
’s AWESOME acronym eg ‘
UO
LSoc


j.

Upload the file to the
Instance

directory eg
/
UO
LSoc
/
UO
LSoc
LocalSettings.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
Insta
nce

directory to
the MediaWiki

installation
directory to make it look as though the code
exists locally.


To do this:

9


Open a shell

in WinScp

(
Commands
-
>Open terminal in WinSCP
)
and navigate to the
AWESOME
Instance


installation

directory
(eg cd
/wiki/UO
LSo
c
)
)

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 lin
ks 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
/
U
O
LSoc

/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.
<in
stance 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 AWE
SOME
Instance

does not come up
please check the steps above.


Initialisin
g 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
MediaWik
i



Click on ‘
Initialise or upgrade tables


10




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 s
ome 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
writi
ng process.

The easiest way to
reproduce this

content is to visit the
AWESOME
Computing instance

at The University of Leeds

(
http://awesome
-
comp.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

fo
lder. N
ew AWESOME
Instance
s

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 you
r new
Instance

(in another browser window as you will be
going back and forth between the two
Instance
s)

eg
http://awesome
-
comp.leeds.ac.uk/wiki/UOLSoc




Log in to the new
Instance

as systems admi
nistrator (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
a
s 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.

11


Changing ‘Log in/create account’ to ‘Sign in’



MediaWiki
:Userlogin


Simply replace the text with
Sign in

Chang
ing 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

: i
nsert text
Special:ListAllBlogs/


and
Save



MediaWiki
:recentblog

: insert text
Most Recent Blogs

and
Save

Blog extension r
eference:
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 r
efere
nce:
http://wiki
-
tools.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 us
es 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


12


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/WikiChat
Publicinstance
.php




Edit and change
$params["channels"] = array("Centre for Acad
emic
Writing Chat");

to set up a chat room for the
Instance
.

(you can set up
several)



Rename
the file

(eg to WikiChat
UOBCed
.php) and upload to the
MW
/extensions/WikiChat

directory.



Download the new
Instance
’s configuration file (eg
UOBCed
LocalSettings.ph
p) 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 t
he new
Instance
, log in,

and click on ‘
Chat with others
’. The page
doesn’t yet exist s
o 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 wor
ks 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 specia
l areas of the wiki’s pages called ‘namespaces’. To r
efer 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
upgrad
ed 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 imp
orted directly into the new
Instance
. Please note that these exports
13


may not be up to date with the existing AWESOME
Instance
s


for example, the
templates or forms may have changed.

To create
fresh exports follow

these instructions.

Export
Forms

In the
A
WESOME 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

H
elp:*

and click
export
.

14


In the new
Instance

navigate to
Special:Import

and upload the xml file. This
creates the
help
pages.

Export
Widget

In the

S
pecial: 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 r
ather 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
Instance
s
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 naviga
tion and
pedagogy. This is the navigation created earlier on the page
MediaWiki
:Sidebar
. The existing AWESOME
Instance
s contain community
contributions which also exist in the Main namespace
3
.



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
15


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 beyon
d the scope of the current
development.

16



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 lite
rature

How to write clearly

Project Management

All Dissertation FAQs

Previous Dissertations

Shared bookmarks


T
hen 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. D
ownload the f
iles. Log in as administrator in

the
new
Instance

and navigate to
Sp
ecial:Upload

and upload each of these images,
keeping the names with an initial capital letter
4
.


Minor hand editing


Edit’

the
AWESOME Home

page and change the welcome message to reflect
this
Instance
.

e
g

Welcome to

[
http://www.
comp.leeds.ac.uk

The Cen
tre 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 t
his 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 ar
eas at the point of upload at how this
would impact on users.

17


Creating user accounts

To cre
ate 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 se
e 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



D
elete LocalSettings.php (if it exists) from the MW/config directory and
make the /config directory read onl
y (chmod 600)

18



Appendices


Reference

URLs

MediaWiki

Extensive documentation is available at
htt
p://www.
MediaWiki
.org/wiki/
MediaWiki

Semantic
MediaWiki

Semantic
MediaWiki

and related extensions are located at
http://semantic
-
MediaWiki
.org/wiki/Semantic_
MediaWiki

Other
MediaWiki

Exte
nsions

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.

19



Appendix

1: Example
Leeds
MediaWiki

Installation

Report

For up to date information on software versions used in the AWESO
ME
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.sa
ve_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 cac
hing.



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/
MediaWiki
-
1.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 usin
g 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...suc
cess.



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/old
-
clie
nt.html

for help.



Database
awesome

exists



Creating tables... done.



Initializing statistics...



Created sysop account
WikiSysop
.



Creating LocalSettings.php...

20





Appendix

2

:
Installed S
oftware
& Extensions

Product

Version

MediaWiki

1.12.0

PHP

5.1.2 (apache2handler)

MySQL

5.0.45
-
log

Installed extensions

Special page
s

Semantic Drilldown

(Version 0.4.3)

A drilldown
interface for
navigating
through
semantic data

Yaron Koren

Semantic Forms

(Version 1.2.3)

Forms for
adding and
editing
semantic data

Yaron Koren and others


Parser hooks

Header Tabs

(Version 0.6.1)

Adds tabs to
the page
separating top
-
level sections.
Originally
developed for
Ardorado.com

Sergey Chernyshev

(for
Semantic
Communities LLC.
)

ParserFunctions

(Version 1.1.1)

Enhance parser
with logical
functions

Tim Starling

Semantic

MediaWiki

Making your
Klaus

Lassleben,
Markus

Krötzsch
,
21


(Version 1.1.1)

wiki more
accessible



f潲o
ma捨c湥猠
and

humans.
View
online
documenta
tion.

Denny

Vrandecic
, S

Page, and others.
Maintained by
AIFB Karlsruhe
.

Widgets

(Version
0.8)

Allows wiki

administrators
to add free
-
form widgets to
wiki by just
editing pages
within Widget
namespace.
Originally
developed for
Ardorado.com

Sergey Chernyshev

(for
Semantic
Communities LLC.
)

Wiki Category Tag
Cloud


A Category Tag
Cloud derived,
improved, and
fixed from the
YetAnotherTag
Cloud
Extension

Daniel Friesen <dan_the_man@telus.net>


Other

KeepYourHandsToY
ourself

(Version
0.2)

Prevents users
from editing
other users
pages.

Jim R. Wilson (wilson.jim.r<at>gmail.com)

TagAsCategory


This Extension
provides
"folksonomy"
-
type tagging to
articles, using
Categories as
the underlying
functionality

Molecular

22


WikiChat

(Version
0.2.2, 2007
-
07
-
25)

Adds a tab to
each article
that switches
to a chatroom

User:Firebreather

ProtectText

Allows
authorised
users, and sole
contributors, to
protect parts of
a text

Loosely based on

ProtectSection by

T
homasV; modified by
John Erling Blad


Data
Transfer
(version
0.3.4)

To upload the
previ
ous
dissertation in
csv format

Yaron Karen

http://www.mediawiki.org/wiki/Extension:
Data_Transfer


Extension functions

headerTabsParserFunctions, htSetupExtension, loadSpecialListAllB
logs,
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, i
f, 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, t
ime, timel, titleparts, uc, ucfirst, urlencode and
widget

23


Hooks

Hook name

Subscribed by

AbortNewAccount

rejectUsernamesWithConsecutiveDashes

ArticleDelete

smwfDeleteHook

ArticleFromTitle

smwfShowListPage

ArticleSave

smwfPreSaveHook

ArticleSaveComplet
e

smwfSaveHook

ArticleUndelete

smwfUndeleteHook

ArticleViewHeader

articleShowTagForm

BeforePageDisplay

htAddHTMLHeader and
smwfAddHTMLHeadersOutput

BrokenLink

sffSetBrokenLink

InternalParseBeforeLinks

smwfParserHook

LanguageGetMagic

headerTabsLanguag
eGetMagic,
sffLanguageGetMagic, smwfAddMagicWords,
wfAddCustomVariableLang,
wfParserFunctionsLanguageGetMagic and
widgetLanguageGetMagic

MagicWordMagicWords

wfAddCustomVariable

MagicWordwgVariableIDs

wfAddCustomVariableID

ParserAfterTidy

htReplaceFirstL
evelHeaders and
smwfAddHTMLHeadersParser

ParserBeforeStrip

smwfRegisterInlineQueries

ParserClearState

(ExtParserFunctions, clearState)

ParserFirstCallInit

(ExtParserFunctions, registerParser)

ParserGetVariableValueSwitch

wfGetCustomVariable

SkinTempla
teTabs

sffFormEditTab, smwfAddRefreshTab and
24


(WikiChat)

TitleMoveComplete

smwfMoveHook

UnknownAction

sffEmbeddedEditForm, tagAction and (WikiChat)

userCan

keepYourHandsToYourself

AWESOME
-
Computing instance details

URL: http://awesome
-
comp.leeds.ac.uk/w
iki/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 f
or 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://awes
ome
-
comp.leeds.ac.uk/wiki/mediawiki
-
1.12.0

Admin username: AWESysop

Password: %vdllkk7

25



Users usernames and password

Admin:AWESysop


Password: %vdllkk7


Username
1
: Catherine

Password: awesome

Username
2
: peter

Password:awesome

Username3:Harriet

Password:aw
esome

Creat
ing

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 bas
ic 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 temp
late 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 typ
e,
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.

26




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, b
ecause 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 certa
in 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 a
bove).





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 English
-
language wikis, can be edited at the page "MediaWiki:Sidebar") should
hold links to add each of the data t
ypes, 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 an
d feedback}}}

27


{|

|'''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 shoul
d 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}}}]]

28


|
-

! Type of report

| class="aweTValue"| {{#if:{{{Type|}}} | {{#arraymap:{{{Type}}}|,|x|[[Has report
type::x]]}} }}

|
-

! Describe the bug or feedback

| [[Is feedback descript
ion::{{{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
]]



29


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 i
n
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, $wgRe
quest, $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_n
ame && $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

30




if (! $wgUser
-
>isAllowed('vieweditwithformtab')) {


// the tab can
have either of those two actio
n


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 AWESOME
-
Computing instance using th
e Data Tran
s
fer 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

31



$year="2005
-
2006";

//Please give here the year of the di
ssertation



$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
Disse
rtations[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.com
p.leeds.ac.uk/mscproj/previous
-
titles/msc2005.html", "r");
//Please enter the URL, which you want to convert

if (!$file) { echo "<p>Unable to open remote file.
\
n";


exit;

}

while (!feof ($file)) {


$line = fgets($file, 1024);


print "line=$line";


print "<br>";



$explodetable=@explode('<table', $line);



if(isset($explodetable))






$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

32





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 (is
set($explodetd[4]))



{



$explodetd4=@explode('<td>',$explodetd[4]);






@print "explodetd4=$explodetd4[1]";



}



if (isset($explodetd[5]))



{



$explodetd5=@explode('<td>',$explodetd[5]);




$explodetd55=@explode('<BR>',$explodetd
5[1]);



@print "explodetd55=$explodetd55[0]";



}



/* if (isset($explodetd[6]))



{



$explodetd2=@explode('<td>',$explodetd[6]);

33




@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 d
issertations into AWESOME
-
C
omputing

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