Apple Computer Hardware manual Viewing Dynamic XML, To view context

Page 28

If you edit a copy of the default.xsl file, you must also make copies of all of the XSL files that include the original default.xsl file, and then change them to include the edited default.xsl file.

Viewing Dynamic XML

The wiki server dynamically generates XML content, which is called context. Context is transformed by XSL files into HTML.

Before you view context, familiarize yourself with the XSL files located in:

/usr/share/wikid/lib/apple_templates/

The XSL files correspond to specific 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 file that displays context and put it in your theme’s folder. This overrides the XSL files in /usr/share/wikid/lib/apple_templates/ and changes the output for the pages that they correspond to.

To view context:

1Create a plain text file with the following content:

<?xml version="1.0" encoding="UTF-8" ?> <xsl:stylesheet version="1.0"

xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output

method="html"

version="1.0" encoding="UTF-8" indent="yes"

doctype-public="-//W3C//DTD HTML 4.01//EN" doctype-system="http://www.w3.org/TR/html4/strict.dtd"/>

<xsl:template match="page"> <xsl:copy-of select="context"/>

</xsl:template>

</xsl:stylesheet>

2Save the file in this location:

/Library/Application Support/Apple/WikiServer/Themes/theme_name/

Use the same filename as any of the XSL files located in:

/usr/share/wikid/lib/apple_templates/

Choose a filename 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 filename to grouphome.xsl.

28

Chapter 1    Customizing How the Wiki Looks

Image 28
Contents Mac OS X Server 019-1252/2008-04-24 Contents Managing Wiki Content Getting Additional Information PrefacePreface About This Guide This chapter describes how to customize a wiki’s appearance Theme File Structure OverviewCustomizing How the Wiki Looks Variant Theme File Structure Overview Wireframe Theme File Structure Overview File or Folder Name PurposeBorders, and positioning for comment entry Terminal, enter the following commands Creating a ThemeEditing CSS Files WebsiteEditing Property List Files About Property List EditorAbout Property List Files About Property List Keys and ValuesAbout Strings About DictionariesAbout Errors Here is the sidebars array in a plain text editorHere is an example of an array with a single string Here is an example of an array with multiple stringsKey Default Value Possible Values Changing General Theme SettingsDescription Creating Sidebars Understanding the Types of SidebarsShared Keys All sidebars require the following keysEach dictionary entry has the following keys Static Unique KeysKey Example Value Possible Values Optional or Required Search Unique Keys Calendar Unique Keys Overview of the Example Sidebars Tag Unique KeysRecent Activity Unique Keys Sidebar Name DescriptionTerminal, enter the following command Using the Example SidebarsTo comment out specific sidebars To this To add JavaScript files or XSL files to a theme Adding JavaScript and XSL FilesPut JavaScript .js files or XSL .xsl files in this folder Here are some published JavaScript guides About JavaScriptTopic About XSL JavaScript ExampleViewing Dynamic XML Create a plain text file with the following contentTo view context $ sudo serveradmin stop teams sudo serveradmin start teams Attributes Creating a Custom Whitelist Allowing Specific URL Protocols About the Custom Whitelist’s StructureAllowing Specific CSS Styles To allow specific Html tags and attributes Allowing Specific Html Tags and AttributesTag Attributes About the Built-in Whitelist Protocols Allowed in the Built-in WhitelistBuilt-in whitelist allows these protocols ProtocolCSS Styles Allowed in the Built-in Whitelist Html Tags and Attributes Allowed in the Built-in WhitelistBuilt-in whitelist allows these CSS styles Built-in whitelist allows these Html tags and attributesNode Pre Cite Span Strong Tbody Tfoot Colspan, rowspan Thead Migrating Wiki Content From Other Websites Backing Up the Wiki ServerManaging Wiki Content Wiki File Structure Overview Manually Editing Raw Content File or Folder Name PurposeTo regenerate the index after editing raw wiki content Viewing a Wiki’s Administration SettingsFor more information about AtomPub, see Metadata.plist file includes the following keys Key Example Value DescriptionTo manually edit wiki administration settings Viewing a Page’s Metainformation PageuidManaging Attachments