The owner or authorized user of a valid copy of
Mac OS X Server software may reproduce this
publication for the purpose of learning to use such
software. No part of this publication may be reproduced
or transmitted for commercial purposes, such as selling
copies of this publication or for providing paid-for
support services.
Every eort has been made to ensure that the
information in this manual is accurate. Apple Inc. is not
responsible for printing or clerical errors.
Because Apple periodically releases new versions and
updates to its software, images shown in this book may
be dierent from what you see on your screen.
Apple
1 Innite Loop
Cupertino, CA 95014-2084
408-996-1010
www.apple.com
The Apple logo is a trademark of Apple Inc., registered
in the U.S. and other countries. Use of the “keyboard”
Apple logo (Option-Shift-K) for commercial purposes
without the prior written consent of Apple may
constitute trademark infringement and unfair
competition in violation of federal and state laws.
Apple, the Apple logo, iCal, iTunes, Leopard, Mac,
Mac OS, and Macintosh are trademarks of Apple Inc.,
registered in the U.S. and other countries. Finder, Safari,
and Time Machine are trademarks of Apple Inc.
UNIX is a registered trademark of The Open Group.
Other company and product names mentioned herein
are trademarks of their respective companies. Mention
of third-party products is for informational purposes
only and constitutes neither an endorsement nor a
recommendation. Apple assumes no responsibility with
regard to the performance or use of these products.
019-1252/2008-04-24
Page 3
Contents
5 Preface: About This Guide
5 Getting Additional Information
7 Chapter 1: Customizing How the Wiki Looks
7 Theme File Structure Overview
9 Variant Theme File Structure Overview
10 Wireframe Theme File Structure Overview
12 Creating a Theme
13 Editing CSS Files
14 Editing Property List Files
14 About Property List Editor
15 About Property List Files
17 Changing General Theme Settings
18 Creating Sidebars
22 Overview of the Example Sidebars
23 Using the Example Sidebars
25 Adding JavaScript and XSL Files
26 About JavaScript
27 About XSL
30 Chapter 2: Allowing Specic Protocols, CSS Styles, and HTML Tags
and Attributes
31 Creating a Custom Whitelist
32 About the Custom Whitelist’s Structure
32 Allowing Specic URL Protocols
32 Allowing Specic CSS Styles
33 Allowing Specic HTML Tags and Attributes
34 About the Built-in Whitelist
34 Protocols Allowed in the Built-in Whitelist
35 CSS Styles Allowed in the Built-in Whitelist
35 HTML Tags and Attributes Allowed in the Built-in Whitelist
3
Page 4
37 Chapter 3: Managing Wiki Content
37 Migrating Wiki Content From Other Websites
37 Backing Up the Wiki Server
39 Wiki File Structure Overview
40 Manually Editing Raw Content
41 Viewing a Wiki’s Administration Settings
44 Viewing a Page’s Metainformation
45 Managing Attachments
4 Contents
Page 5
About This Guide
This guide explains how to create custom themes, allow
specic protocols, CSS styles, and HTML tags and attributes,
and manage wiki content.
The default Wiki Server conguration makes it easy for groups to collaborate and
communicate. Users can create and edit wiki pages, tag and cross-reference material,
upload les and images, add comments, and search content.
This guide shows you how to customize and extend the wiki to suit your needs. For
example, you’ll learn how to:
Create custom themesÂ
Enable JavaScript, YouTube, and FlashÂ
Automate migration from other sources, such as wikis and non-wiki websitesÂ
Preface
The tasks described in this guide can be used on standard, workgroup, and advanced
congurations of Leopard Server. These tasks require administrator access and in
some cases programming skill. You must be able to edit les on the server, which
aren’t accessible to most users. Be careful when editing these les, as an incorrect or
untested change could cause problems.
Getting Additional Information
Information about setting up, administering, and using Wiki Server is covered in detail
in several places.
For information about setting up web service, see:
 Getting Started—if you’re using Server Preferences
 Web Technologies Administration—if you’re using Server Admin
You can nd both guides at the Mac OS X Server Resources website:
www.apple.com/server/macosx/resources
5
Page 6
For information about administering wikis, see Directory Help. You can view Directory
Help by opening Directory (located in /Applications/Utilities/) and choosing Help >
Directory Help.
For information about using the wiki, see Wiki help. You can view Wiki help by clicking
the Help link located at the bottom of any Apple Wiki page.
6 Preface About This Guide
Page 7
Customizing How the Wiki Looks
1
This chapter describes how to customize a wiki’s appearance.
You can use a wiki’s admin settings to do the following:
Change the wiki’s titleÂ
Change the wiki’s themeÂ
Add a custom tag-search sidebar to the main pageÂ
Choose who can make comments and which comments are moderatedÂ
Create a podcast and integrate it with iTunesÂ
These settings are sucient for most wikis. However, if you have special needs—for
example, if you want to use a specic organization’s style, or if you want to change the
appearance and names of the default sidebars on the front page—you must edit les
located on the server.
Theme File Structure Overview
A theme is composed of Cascading Style Sheet (.css) les, property list (.plist) les,
image les (usually .png and .jpg), and sometimes JavaScript (.js) and Extensible
Stylesheet Language (.xsl) les.
All themes use the CSS les located at:
/usr/share/collaboration/css/required/
7
Page 8
However, CSS les located in individual theme folders take precedence and override
If the theme has a /compressed subfolder, it imports the CSS les located at:
/usr/share/collaboration/themes/theme_name/screen_compressed.css
The screen_compressed.css le combines the many individual CSS les located in the
theme_name/screen/ folder. These are provided in the prebuilt themes to improve
overall performance. The screen_compressed.css le isn’t created automatically or
dynamically, so any changes to .css les located in the theme_name/screen/ folder
don’t aect the screen_compressed.css le.
8 Chapter 1 Customizing How the Wiki Looks
Page 9
Variant Theme File Structure Overview
/usr/share/collaboration/themes/
screen/
theme_name.variant/
CSS file
screen.css
Imports
Imports
screen/
CSS files
screen.css
Imports
theme_name/
Prebuilt themes have several variants, which all share the same layout but might have
dierent banners or color schemes. Shared CSS les are in the main theme’s folder,
while variants have separate CSS les located in other folders.
For example, the block theme has its shared CSS les located in:
/usr/share/collaboration/themes/block/screen/
Variants of the block theme all use these shared CSS les. Each variant also uses CSS
les located in another folder such the following:
If prompted, enter your administrator account password.
Restarting the server and restarting web service can disrupt users, so send out a
notication that the server will be temporarily down before doing this.
Editing CSS Files
Cascading Style Sheet (.css) les control how the wiki looks. By editing these CSS les,
you can easily change display attributes for specic page elements. For example, you
can change:
ColorÂ
Background colorÂ
MarginÂ
PaddingÂ
Font sizeÂ
If you’re skilled at editing CSS les, you can completely overhaul the look of the wiki by
changing its layout, removing unwanted visual elements, and adding your own visual
elements.
When you edit a CSS le, your changes occur immediately; you don’t have to restart
the server or web service after editing. Because you might disrupt users by changing
CSS les, you should create, edit, and test them with a theme that isn’t currently in use.
There are many online sources of information about Cascading Style Sheets. These
websites should help you get started:
WebsiteURL
World Wide Web Consortiumw3.org
CSS3css3.info
QuirksModequirksmode.org
Position is Everythingpositioniseverything.net
The WebKit OpenSource Projectwebkit.org
A List Apartalistapart.com
CSS Zen Gardencsszengarden.com
Chapter 1 Customizing How the Wiki Looks 13
Page 14
Here are some published CSS guides:
 CSS: The Denitive Guide, 3rd Edition, by Eric Meyer. O’Reilly Media, Inc. 2006.
 CSS Mastery: Advanced Web Standards Solutions, by Andy Budd, Simon Collison, and
Cameron Moll. Friends of ED. 2006.
Editing Property List Files
Every theme has a theme.plist le, which controls:
The name of the themeÂ
Whether the theme is publicly availableÂ
The height and width of the bannerÂ
Sidebar properties such as the name, type and number of links, and sort orderÂ
After making changes to the theme.plist le, you must restart the web service or
restart the server. Because this can disrupt users, you should create, edit, and test
themes on a test computer and then copy them over to the server.
About Property List Editor
Property List Editor is a specialized editor for property list les.
In order to edit a theme.plist le using Property List Editor, you must copy it to your
Documents folder. When you nish editing the theme.plist le, you must copy it back
to /Library/Application Support/Apple/WikiServer/Themes/theme_name.wikitheme/.
Property List Editor is located on the Mac OS X Server v10.5 Administration Tools CD, in
/Utilities/. You can run it from the CD or copy it to a dierent location.
14 Chapter 1 Customizing How the Wiki Looks
Page 15
Property List Editor doesn’t show comments, so if you want to see the example
sidebars provided in the wireframe’s theme.plist, you’ll need to open the
theme.plist le in a text editor and remove the comment markers surrounding
the example sidebars.
About Property List Files
The theme.plist le is structured like an XML le. If you understand XML, editing the
theme.plist is straightforward. If not, read the following sections for basic editing
information.
About Property List Keys and Values
Every setting controlled by the theme.plist le has a key, and an associated value or an
array (a collection) of associated values. To change the setting, you change the value or
values, not the key.
For example, to halve the height of the banner image in Property List Editor, double-
click the value 99 next to bannerImageHeight and replace it with 50.
To halve the height of the banner image in a text editor, change the following lines in
the theme.plist:
<key>bannerImageHeight</key>
<real>99</real>
to:
<key>bannerImageHeight</key>
<real>50</real>
About Strings
Most of the values in the theme.plist le are character sequences called strings.
About Dictionaries
A dictionary, or dict when viewed in a text editor, is an assortment of values of dierent
classes. In the theme.plist le, a sidebar is represented by a dictionary.
Because a dictionary can contain several values, Property List Editor provides a
disclosure triangle that allows you to view or hide the contents of the dictionary.
About Arrays
Arrays are collections or lists of similar classes. The theme.plist le includes two types
of arrays: a list of dictionaries and a list of strings.
The sidebars array is an example of a dictionary array. Because the sidebars array is
commented out by default, you won’t be able to see it in Property List Editor without
rst removing the comment markers in a text editor.
Because an array can contain several values, Property List Editor provides a disclosure
triangle that allows you to view or hide the contents of the array.
Chapter 1 Customizing How the Wiki Looks 15
Page 16
Here is the sidebars array in a plain text editor:
<key>sidebars</key>
<array>
<dict>
sidebar keys and values
</dict>
<dict>
sidebar keys and values
</dict>
</array>
Here is an example of an array with a single string:
<array>
<string>value</string>
</array>
Here is an example of an array with multiple strings:
<array>
<string>value</string>
<string>value 2</string>
</array>
About Comments
The theme.plist le includes comments to help provide editing instructions and
example keys and values. Comments are ignored when the theme.plist le is read by
the wiki server.
Comments start with “<!--” and end with “-->.” Everything in between is ignored, even if
the comment contains many lines of keys and values.
For example, the wireframe theme’s theme.plist le includes the following comment to
indicate where the example sidebars section starts:
<!-- example (non-default) sidebars -->
The sidebars array is preceded by a <!-- comment marker. The end comment marker
doesn’t appear until after the array. Because the comment markers surround the array,
the code for these sidebars in the array is ignored unless the comment markers are
removed.
About Errors
Make sure all required values are present. If you don’t include required keys and values
in the theme.plist le (for example, a displayName or a uid for a sidebar), loading the
wiki’s main page will display an “Internal Server Error” page. Wiki pages that don’t have
sidebars won’t display this error.
16 Chapter 1 Customizing How the Wiki Looks
Page 17
Changing General Theme Settings
The wireframe theme’s theme.plist includes keys and values for the following general
settings:
KeyDefault ValuePossible ValuesOptional or Required Description
bannerImageHeight99Any number, 0 or
more
bannerImageWidth950Any number, 0 or
more
displayNameWireframe ThemeAny string (such as a
word or phrase)
namecom.apple.wireframeAny string with no
spaces
selectable<false/><false/>OptionalDisplays a theme in the theme chooser,
version1A numberRequiredDon’t change this value.
OptionalThe amount in pixels alloted to the
height of the banner image. Images you
upload are scaled to this size.
If you dene bannerImageHeight but
not bannerImageWidth, the width scales
proportionally.
This value aects the banner image’s
height, not the banner’s height. To
change the banner’s height, edit the
wireframe theme’s layout.css le.
OptionalThe amount in pixels alloted to the
width of the banner image. Images you
upload are scaled to this size.
If you dene bannerImageWidth but not
bannerImageHeight, the height scales
proportionally.
This value aects the banner image’s
width, not the banner’s width. To change
the banner’s width, edit the wireframe
theme’s layout.css le.
RequiredThe name of the theme as shown in the
theme chooser accessed from a wiki’s
admin settings.
RequiredUniquely identies the theme.
if the selectable key and <false/> value
are both removed.
Chapter 1 Customizing How the Wiki Looks 17
Page 18
Creating Sidebars
If you haven’t created a sidebar before, it might be easier to customize an example
sidebar to suit your needs.
In the wireframe theme’s theme.plist le, there is a sidebars section that contains an
array of sidebars you can customize:
<key>sidebars</key>
<array>
<dict>
sidebar keys and values
</dict>
<dict>
sidebar keys and values
</dict>
</array>
Understanding the Types of Sidebars
There are several types of sidebars, each with a specic purpose and set of keys:
Sidebar TypeDescriptionRelated Section
staticA list of URLs.“Static Unique Keys,” on page 19
searchA list of search results using tag-
based or text-based searching.
calendarA list of upcoming events.“Calendar Unique Keys,” on page 21
tagA list of search results using tag-
based searching.
recentActivityA list of pages sorted by recent
viewing frequency. Based on the
last 100 page views in a wiki, this list
displays the most-viewed page rst,
followed by the next most-viewed,
and so on.
adminA sidebar that appears automatically
if someone logs in as an admin. This
sidebar isn’t customizable.
“Search Unique Keys,” on page 20
“Tag Unique Keys,” on page 22
“Recent Activity Unique Keys,” on page 22
Not applicable
Shared Keys
All sidebars require the following keys:
KeyExample ValuesPossible ValuesOptional or RequiredDescription
displayNameWhat’s Hot, What’s New,
Useful Links, Upcoming
Events
typesearch, static, calendarstatic, search, calendar, tag,
uidHotList, RecentAddsList,
UsefulLinks
18 Chapter 1 Customizing How the Wiki Looks
Any stringRequiredName of the sidebar.
recentActivity, admin
Any stringRequiredIdentier for the sidebar.
RequiredType of sidebar used.
This value must be unique.
Page 19
Static Unique Keys
Static sidebars list predened URLs. “Useful Links” is an example static sidebar.
Static sidebars have the following keys:
KeyExample ValuePossible ValuesOptional or RequiredDescription
Fully qualied URLOptionalAn RSS or Atom feed that
RequiredBecause links include
several values, such as
the name of the link
and the URL itself, every
link is represented by a
dictionary entry.
from the sidebar’s header.
is associated with the
sidebar.
Each dictionary entry has the following keys:
KeyExample ValuePossible ValuesOptional or RequiredDescription
kindurlurl, wiki, weblog,
subtitleYour server’s homepage,
List of groups with wikis
on this server
titleServer Home, GroupsAny stringRequiredName of the link.
uidserverhome, groupsAny stringRequiredIdentier for the URL. This
url/, /groups/A relative or absolute path
mailinglist, calendar
Any stringRequiredAppears under the name
to a web page
RequiredNot used in any themes.
Use this to assign a class to
a sidebar.
You can then use the
class selector in CSS
to customize sidebars,
such as by adding small
calendar icons next to
calendar sidebar links or
small Safari icons next to
URL links.
of the link.
value must be unique.
RequiredContents of the link.
Chapter 1 Customizing How the Wiki Looks 19
Page 20
KeyExample ValuePossible ValuesOptional or RequiredDescription
snippetClick here to see your
server’s homepage.
Any stringOptionalUsed for the link’s tool tip.
To enable tool tips,
comment out the
following block in the
theme’s grouphome.
css le:
.grouphome .snippet{
display:none;
}
Search Unique Keys
Search sidebars list search results using tag-based or text-based searching. “What’s
Hot” and “What’s New” are examples of search sidebars.
Search sidebars have the following unique keys:
KeyExample ValuePossible ValuesOptional or RequiredDescription
howMany5Any number, 1 or moreRequiredMaximum number of
taghotOne or more strings all in
kindwiki, weblog, mailinglistOne or more of the
qannejohnson, wiki,
2008-03-17
eldstitle, content, authorOne or more of the
the same array
following in the same
array:
 all wiki weblog mailinglist calendar
One or more strings all in
the same array
following in the same
array:
 title author authorLongName lastModiedAuthor lastModiedAuthor
LongName
 createdDate modiedDate content strippedContent kind
OptionalThe tags associated with
OptionalThe kinds of pages
OptionalThe text query used to
OptionalThe elds the text query
entries in the sidebar.
this sidebar. Pages using all
of these tags are added to
this sidebar.
associated with this
sidebar. A search only lists
pages of these types.
If this key isn’t provided,
all types of pages can be
shown in the sidebar.
search for entries.
is applied to. If the query
matches any of these
elds, the entry appears in
the sidebar.
20 Chapter 1 Customizing How the Wiki Looks
Page 21
KeyExample ValuePossible ValuesOptional or RequiredDescription
sortmodiedDate, createdDate,
title, author
sortDirectionreverseforward or reverseOptionalSorting order of entries.
emptyListStringThere are no matches.Any stringOptionalShown when there are no
One or more of the
following in the same
array:
 title author authorLongName lastModiedAuthor lastModiedAuthor
LongName
 createdDate modiedDate content strippedContent kind
OptionalEntries are sorted based
on these elds.
The rst eld listed is
sorted rst, then the
entries are resorted by
subsequent elds. The
last eld listed takes
precedence over all
previously listed elds.
reverse—most recently
modied page is listed rst
forward—least recently
modied page is listed rst
matching search results.
Calendar Unique Keys
Calendar sidebars list upcoming events. “Upcoming Events” is an example calendar
sidebar.
Calendar sidebars have the following unique keys:
KeyExample ValuePossible ValuesOptional or RequiredDescription
howManyDays5Any number, 1 or moreRequiredMaximum number of
emptyListStringThere are no matches.Any stringOptionalShown when there are no
days until an event for it
to be listed in the sidebar.
Events occurring after this
number of days aren’t
shown in the sidebar.
matching calendar events.
Chapter 1 Customizing How the Wiki Looks 21
Page 22
Tag Unique Keys
Tag sidebars list wiki, blog, and mailing list entries that use a specic tag or set of tags.
The most recently modied entries are listed rst.
Tag sidebars have the following unique keys:
KeyExample ValuePossible ValuesOptional or RequiredDescription
taghotA single string or several
strings all in the same
array
howMany5Any number, 1 or moreRequiredMaximum number of
emptyListStringThere are no matches.Any stringOptionalShown when there are no
RequiredTags associated with the
sidebar. Pages using all of
these tags are added to
the sidebar.
entries in the sidebar.
matching search results.
Recent Activity Unique Keys
Recent activity sidebars list pages that have had the most readers recently.
Recent activity sidebars have the following unique keys:
KeyExample ValuePossible ValuesOptional or RequiredDescription
howMany5Any number, 1 or moreRequiredMaximum number of
emptyListStringThere are no matches.Any stringOptionalShown when there are no
entries in the sidebar.
matching search results.
Overview of the Example Sidebars
The wireframe theme’s theme.plist provides several example sidebars:
Sidebar NameDescription
What’s HotLists the ve most recently modied pages tagged with
What’s NewLists the ve most recently created pages. This includes
Useful LinksLists several predened links.
Upcoming EventsLists all events occurring within the next ve days.
22 Chapter 1 Customizing How the Wiki Looks
“hot.”
wiki, weblog, and mailing list pages.
Page 23
Using the Example Sidebars
The wireframe theme’s theme.plist le includes several sidebar examples. All of these
examples are commented out by default. You’ll need to remove the comments marks if
you want to use the example sidebars as custom sidebars. If you don’t add any custom
sidebars, the default sidebars are used. If you use at least one custom sidebar, the
default sidebars don’t appear.
Consider commenting out all sidebars you don’t want to use, and leaving
uncommented all sidebars you want to use. Doing this allows you to choose which
sidebars you want and allows you to easily change sidebar settings later on. To do this,
you must start a comment before the <dict> tag for a sidebar, and end the comment
after the </dict> tag for that sidebar.
To comment out specic sidebars:
1 In Terminal, enter the following command:
$ cd /Library/Application\ Support/Apple/WikiServer/Themes/
2 If you want to use a non–command-line tool, copy the theme.plist le to your
Replace theme_name with the name of the theme. Replace user_name with the short
name of the user you’re logged in as.
3 Open theme.plist in a text editor.
To open this le in a command-line text editor, enter:
$ sudo nano theme_name.wikitheme/theme.plist
If prompted, enter your administrator account password.
You can use any command-line text editor, as long as you precede the command to
run the text editor with sudo.
If you’re using a non–command-line tool, open the theme.plist located in your
Documents folder.
4 If there is a <!-- comment marker before <keys>sidebars</key>, remove it and the -->
comment marker before <key>version</key>.
Chapter 1 Customizing How the Wiki Looks 23
Page 24
5 For each sidebar that you want to comment out, do the following:
a Add <!-- before the <dict> tag of the sidebar you want to comment out.
For sidebars, <dict> tags are followed by the displayName key.
For example, to comment out the “What’s Hot” sidebar, you’d change this:
<dict>
<key>displayName</key>
<string>What’s Hot</string>
to this:
<!--
<dict>
<key>displayName</key>
<string>What’s Hot</string>
b Add --> after the </dict> tag of the sidebar you want to comment out.
The corresponding </dict> tag is the rst one found at the same indentation level
of the sidebar’s <dict> tag.
For example, to nish commenting out the “What’s Hot” sidebar, you’d look for the
rst </dict> tag at the same indentation level as the What’s Hot <dict> tag level,
and then you’d change this:
</dict>
to this:
</dict>
-->
6 If you copied theme.plist to your Documents folder, copy it back to the theme folder.
If prompted, enter your administrator account password.
Restarting the server and stopping and starting web service can disrupt users, so send
out a notication that the server will be temporarily down before doing this.
The wiki server supports the use of custom JavaScript and Extensible Stylesheet
Language (XSL) les. JavaScript and XSL change the content you’re displaying, whereas
CSS controls the presentation of content. For example, you use could use JavaScript or
XSL to add a “digg it” link to your blog entries, which would then tie the blog entries to
digg.com.
Carefully choose whether you want to use JavaScript, XSL, or both.
JavaScript has these advantages:
Unlike custom XSL les, JavaScript les continue to work after doing a software Â
update. The wiki server includes XSL les, which can be changed during a software
update. If these les change, then an error occurs because the le versions of
included les no longer match the le versions of custom XSL les.
JavaScript can allow you more control over a document than XSL if you have access Â
to information on the server that isn’t provided in the XSL context.
XSL has this advantage:
XSL transformations are performed on the wiki server, so the user’s browser isn’t Â
required to support and run it.
To add JavaScript les or XSL les to a theme:
1 Put JavaScript (.js) les or XSL (.xsl) les in this folder:
If prompted, enter your administrator account password.
Restarting the server and restarting web service can disrupt users, so send out a
notication that the server will be temporarily down before doing this.
About JavaScript
JavaScript is a lightweight, object-oriented, cross-platform scripting language.
All wiki server pages automatically include the frameworks prototype.js and script.
aculo.us, which enhance and streamline the use of JavaScript.
XSL les in this location override XSL les in /usr/share/wikid/lib/apple_templates/.
If a software update overwrites the les in /usr/share/wikid/lib/apple_templates/, you’ll
need to manually merge the changed contents of your customized XSL les with the
updated XSL les. If you don’t merge the contents, the versions won’t match and an
error will occur.
Chapter 1 Customizing How the Wiki Looks 27
Page 28
If you edit a copy of the default.xsl le, you must also make copies of all of the XSL les
that include the original default.xsl le, and then change them to include the edited
default.xsl le.
Viewing Dynamic XML
The wiki server dynamically generates XML content, which is called context. Context is
transformed by XSL les into HTML.
Before you view context, familiarize yourself with the XSL les located in:
/usr/share/wikid/lib/apple_templates/
The XSL les correspond to specic pages in the wiki. For example, a group’s wiki
homepage uses grouphome.xsl, while a typical wiki page uses content_entry.xsl. To
view context, create an XSL le that displays context and put it in your theme’s folder.
This overrides the XSL les in /usr/share/wikid/lib/apple_templates/ and changes the
output for the pages that they correspond to.
To view context:
1 Create a plain text le with the following content:
Use the same lename as any of the XSL les located in:
/usr/share/wikid/lib/apple_templates/
Choose a lename based on the page with the context you want to view. For
example, to view the context for the group’s wiki homepage, change the lename to
grouphome.xsl.
28 Chapter 1 Customizing How the Wiki Looks
Page 29
3 Restart the web service by doing one of the following:
Restart the server. Â
In Server Preferences, click Web, move the slider to O, and then to On. Â
In Server Admin, open the disclosure triangle for your server, select Web, click Stop Â
Web, and then click Start Web.
If prompted, enter your administrator account password.
Restarting the server and restarting web service can disrupt users so send out a
notication that the server will be temporarily down before doing this.
4 In a web browser, load a page that uses the XSL le, and then view the page’s source.
To view a page’s source in Safari, load the page and choose View > View Source.
Chapter 1 Customizing How the Wiki Looks 29
Page 30
Allowing Specic Protocols,
CSS Styles, and HTML Tags
2
and Attributes
This chapter describes how to enable specic protocols, CSS
styles, and HTML tags and attributes.
The default wiki server setup simplies administration by automatically removing
potentially harmful protocols, CSS styles, and HTML tags and attributes. The wiki server
is capable of allowing all protocols, CSS styles, and HTML tags and attributes.
The wiki server uses two whitelist les (a built-in whitelist and a custom whitelist) to
determine allowed protocols, CSS styles, and HTML tags and attributes. Elements that
appear in either of these whitelists are allowed, and all other elements are disallowed.
The built-in whitelist includes common, usually harmless, elements. It doesn’t include
potentially harmful tags like embed, param, object, and script. To embed Flash or
YouTube in your site, you’ll need to include some of these tags. If you create a custom
whitelist, you can allow these elements, along with new styles (such as font-size) and
protocols (such as irc and scp).
These whitelists aect all wikis on the server.
WARNING: Some protocols, HTML tags and attributes can compromise your
server’s security and integrity, or harm users who connect to your server. Make
sure you understand the implications of whatever you enable. For example,
allowing JavaScript introduces security vulnerabilities such as cross-site scripting.
For information about cross-site scripting, see
http://en.wikipedia.org/wiki/Cross-site_scripting.
30
Page 31
Creating a Custom Whitelist
To create a custom whitelist, create a plain text le named whitelist.plist in:
/Library/Application Support/Apple/WikiServer/
The following sections describe this example whitelist.plist in detail:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.
com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>protocols</key>
<array>
<string>irc</string>
<string>scp</string>
</array>
<key>styles</key>
<array>
<string>font-size</string>
</array>
<key>tags</key>
<dict>
<key>object</key>
<array>
<string>width</string>
<string>height</string>
</array>
<key>param</key>
<array>
<string>name</string>
<string>value</string>
</array>
<key>embed</key>
<array>
<string>src</string>
<string>type</string>
<string>width</string>
<string>height</string>
</array>
</dict>
</dict>
</plist>
Chapter 2 Allowing Specic Protocols, CSS Styles, and HTML Tags and Attributes 31
Page 32
About the Custom Whitelist’s Structure
The following lines are required in the custom whitelist:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.
com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>protocols</key>
<array>
allowed protocols
</array>
<key>styles</key>
<array>
allowed CSS styles
</array>
<key>tags</key>
<dict>
allowed HTML tags and attributes
</dict>
</dict>
</plist>
The dict contains several key/value blocks that allow specic protocols, styles, tags, or
attributes.
Allowing Specic URL Protocols
To allow specic URL protocols, add strings with the protocols’ names to the protocols
block.
For example, to allow entry of URLs that start with “irc://” and “scp://”, create the
following block:
<key>protocols</key>
<array>
<string>irc</string>
<string>scp</string>
</array>
Allowing Specic CSS Styles
To allow specic CSS style attributes, add strings with the style attributes’ names to the
styles block.
32 Chapter 2 Allowing Specic Protocols, CSS Styles, and HTML Tags and Attributes
Page 33
For example, to allow the use of the font-size style attribute, create the following block:
<key>styles</key>
<array>
<string>font-size</string>
</array>
To allow the HTML “style” attribute, add the “style” attribute to the “_all_” tag, which is
described in the following section.
Allowing Specic HTML Tags and Attributes
YouTube, Flash, and other advanced web formats usually require HTML tags and
attributes that aren’t allowed by default. For example, YouTube requires the following
tags and attributes:
TagAttributes
objectwidth, height
paramname, value
embedsrc, type, width, height
Because these HTML tags or attributes aren’t included in the built-in whitelist, you
must add them to the custom whitelist.
To allow specic HTML tags and attributes:
1 Create a tags key and follow it with a dict.
2 In the dict, create keys named after the HTML tags.
To allow a specic attribute for all HTML tags, create a key named “_all_”.
3 After each key, create string arrays listing allowed tag attributes.
For example, to support YouTube, create the following block:
<key>tags</key>
<dict>
<key>object</key>
<array>
<string>width</string>
<string>height</string>
</array>
<key>param</key>
<array>
<string>name</string>
<string>value</string>
</array>
<key>embed</key>
Chapter 2 Allowing Specic Protocols, CSS Styles, and HTML Tags and Attributes 33
Page 34
<array>
<string>src</string>
<string>type</string>
<string>width</string>
<string>height</string>
</array>
</dict>
About the Built-in Whitelist
You can’t change the built-in whitelist. However, a software update could change the
allowed elements in the built-in whitelist.
Protocols Allowed in the Built-in Whitelist
The built-in whitelist allows these protocols:
Protocol
afp
feed
feeds
fax
ftp
gopher
http
https
itms
itpc
ldap
mailto
news
nfs
nntp
rdar
rtsp
sip
sips
sftp
smb
ssh
svn
svn+ssh
34 Chapter 2 Allowing Specic Protocols, CSS Styles, and HTML Tags and Attributes
Page 35
Protocol
tel
telnet
vnc
webcal
xmpp
CSS Styles Allowed in the Built-in Whitelist
The built-in whitelist allows these CSS styles:
Style
text-decoration
font-weight
font-style
HTML Tags and Attributes Allowed in the Built-in Whitelist
The built-in whitelist allows these HTML tags and attributes:
TagAttributes
_all_class, title
ahref, name, ref
b
blockquotecite
body
br
caption
dd
div
dl
dt
em
h1
h2
h3
h4
h5
h6
html
i
imgsrc, alt, name, width, height, longdesc
li
Chapter 2 Allowing Specic Protocols, CSS Styles, and HTML Tags and Attributes 35
Page 36
TagAttributes
node
ol
p
pre
qcite
span
strong
table
tbody
tfoot
thcolspan, rowspan
thead
tdcolspan, rowspan
tr
u
ul
36 Chapter 2 Allowing Specic Protocols, CSS Styles, and HTML Tags and Attributes
Page 37
Managing Wiki Content
3
This chapter describes how to manage wiki content using
tools and the command-line.
Using tools and the command line allows you to migrate, back up, and edit raw wiki
content.
Migrating Wiki Content From Other Websites
AppleWikiImporter is a tool that can traverse a website that has a page listing all other
pages in the site, and create wiki pages based on the website contents. If the website
uses tags, AppleWikiImporter can import those tags.
To use this tool, you’ll need some knowledge of CSS selectors, and, depending on the
website you’re importing, some knowledge of JavaScript.
AppleWikiImporter is located at:
https://connect.apple.com/cgi-bin/WebObjects/MemberSite.woa/wa/
getSoftware?bundleID=19994
For information about using AppleWikiImporter, see its readme le.
Backing Up the Wiki Server
If you installed Mac OS X Server using a standard or workgroup conguration, you
can use Time Machine to automatically back up the wiki server. If you installed Mac
OS X Server using an advanced conguration and haven’t changed the default wiki
and calendar data store locations, Time Machine also automatically backs up your wiki
server.
If you don’t use Time Machine, the following information describes how you can
manually back up the wiki server.
All wiki content is stored in a data store. The default location is /Library/Collaboration/.
This location can be changed using Server Admin (in Web service).
37
Page 38
To manually back up the wiki, copy the wiki data store with its permissions intact.
For example, to copy the wiki data store to a folder on a dierent volume, enter the
following in Terminal and then authenticate as an administrator when requested:
If you’re using the web calendar, you must back up the calendar data store. The default
location is /Library/CalendarServer/Documents/. This location can be changed using
Server Admin (in iCal service).
To manually back up the calendar, copy the calendar data store with its permissions
intact. For example, to copy the calendar data store to a folder on a dierent volume,
enter the following in Terminal and then authenticate as an administrator when
When you use the wiki to edit wiki pages, the wiki server automatically indexes your
content. If you manually edit raw content, the wiki server doesn’t automatically index.
You must delete the index.db le so that the le is regenerated based on the changed
raw content; otherwise, an error occurs.
You can avoid this problem by using the Atom Publishing Protocol, also known as
AtomPub. You can use an AtomPub-enabled client to log in, publish, update, or delete
wiki and blog entries. Congure AtomPub clients to use this service address:
http://domain_name/groups/group_name/atompub
40 Chapter 3 Managing Wiki Content
Page 41
For more information about AtomPub, see:
WebsiteURL
RFC 4287: The Atom Syndication Formatatompub.org/rfc4287.html
RFC 5023: The Atom Publishing Protocoltools.ietf.org/html/rfc5023
To regenerate the index after editing raw wiki content:
If prompted, enter your administrator account password.
Restarting the server and restarting web service can disrupt users, so send out a
notication that the server will be temporarily down before doing this.
Replace group_name with the group’s short name. Replace page_uid with the unique
identier of your page.
Blog and mailing list archive pages also each have their own page.plist le.
For information about viewing or editing property list les, see “Editing Property List
Files,” on page 14 .
The page.plist le includes the following keys:
KeyExample ValueDescription
authorannejohnsonShort user name of the original
commentUIDgroups/group_name/discussion/
createdDate2008-02-19T18:58:47ZOriginal page creation date and
edited<true/>, <false/>Originally set to false, this is set to
kindwiki, weblog, mailinglistType of page.
lastModiedAuthorravipatelShort user name of the last person
modiedDate2008-03-20T23:49:19ZLast page modication date and
titleWelcomeTitle of the page.
44 Chapter 3 Managing Wiki Content
page_uid
author.
Unique identier for the comments
page and its location.
time.
true the rst time the page is saved.
to edit the page.
time.
Page 45
KeyExample ValueDescription
tombstoned<true/>, <false/>Originally set to false, this is set to
uidgroups/group_name/wiki/page_uid/ Unique identier for the wiki page
versioned<true/>, <false/>Wiki pages are versioned; blog and
true when a page is temporarily
deleted.
If a page is permanently deleted,
the entire page_uid.page/ folder is
removed.
and its location.
mailing list entries aren’t.
After manually editing this le, delete the group’s index.db le and restart the server.
For more information, see “Manually Editing Raw Content,” on page 40.
Managing Attachments
When a user attaches a le to a wiki page, that le is stored in:
If someone deletes or replaces an attachment in the wiki, the old attachment remains
on the server. This allows use of the wiki’s history feature to restore old versions of
attached les.
If you delete the folder containing the attachment on the server, users won’t be able to
restore the attachment.
Chapter 3 Managing Wiki Content 45
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.