# This YAML file can be validated at https://www.yamllint.com/
# Useful YAML pages
# https://yaml-multiline.info/
# https://www.codeproject.com/Articles/1214409/Learn-YAML-in-five-minutes
# https://www.redhat.com/en/topics/automation/what-is-yaml
# (Java processing: https://www.baeldung.com/java-snake-yaml)
---
tutorial: documentEditing
edits:
  - num: 1
    description: Enabling user comments
    type: INSERT_BEFORE
    find: |-
      <gsf:option name="TOC" value="true"/>
    text: |-
      <gsf:option name="allowUserComments" value="true"/>
---
tutorial: backdrop
edits:
  - num: 1
    description: Checking for required browse format statement
    type: MATCH
    find: |-
      <td valign="top">
      <gsf:displayText name="ImageName"/>:<gsf:metadata name="Image"/><br/>
      <gsf:displayText name="Width"/>:<gsf:metadata name="ImageWidth"/><br/>
      <gsf:displayText name="Height"/>:<gsf:metadata name="ImageHeight"/><br/>
      <gsf:displayText name="Size"/>:<gsf:metadata name="ImageSize"/>
      </td>
  - num: 2
    description: Rewrite ImageName to Title metadata
    type: REPLACE
    find: |-
      <gsf:displayText name="ImageName"/>:<gsf:metadata name="Image"/><br/>
    text: |-
      Title: <gsf:metadata name="dc.Title"/><br/>
  - num: 3
    description: Insert Description metadata
    type: INSERT_AFTER
    find: |-
      Title: <gsf:metadata name="dc.Title"/><br/>
    text: |-
      Description: <gsf:metadata name="dc.Description"/><br/>
---
tutorial: imagesGPS
edits:
  - num: 1
    description: Add mapEnabled element at the top of the browse format
    type: ADD_AT_START
    text: |-
      <gsf:option name="mapEnabled" value="true" />
  - num: 2
    description: Insert mapEnabled element into the display format feature
    type: INSERT_AFTER
    find: |-
      <gsf:option name="TOC" value="true"/>
    text: |-
      <gsf:option name="mapEnabled" value="true" />
  - num: 3
    description: Add mapEnabled element at the top of the search format
    type: ADD_AT_START
    text: |-
      <gsf:option name="mapEnabled" value="true" />
---
tutorial: formattingReports
edits:
  - num: 1
    description: Simplyifying browse stmt
    type: REPLACE
    find: |-
      <td valign="top">
      <gsf:link type="source">
      <gsf:choose-metadata>
      <gsf:metadata name="thumbicon"/>
      <gsf:metadata name="srcicon"/>
      </gsf:choose-metadata>
      </gsf:link>
      </td>
    text: |-
      <td valign="top">
      <gsf:link type="source">
      <gsf:metadata name="srcicon"/>
      </gsf:link>
      </td>
  - num: 2
    description: Simplifying global stmt
    type: REPLACE
    find: |-
      <gsf:choose-metadata>
      <gsf:metadata name="dc.Title"/>
      <gsf:metadata name="exp.Title"/>
      <gsf:metadata name="ex.dc.Title"/>
      <gsf:metadata name="Title"/>
      <gsf:default>Untitled</gsf:default>
      </gsf:choose-metadata>
    text: |-
      <gsf:choose-metadata>
      <gsf:metadata name="dc.Title"/>
      <gsf:metadata name="ex.dc.Title"/>
      <gsf:metadata name="Title"/>
      <gsf:default>Untitled</gsf:default>
      </gsf:choose-metadata>
  - num: 3
    description: Adding source icon to search statement
    type: INSERT_AFTER
    find: |-
      <gsf:template match="documentNode">
    text: |-
      <td valign="top">
      <gsf:link type="source">
      <gsf:metadata name="srcicon"/>
      </gsf:link>
      </td>
  - num: 4
    description: Removing doc icon from search statement
    type: REMOVE
    find: |-
      <td valign="top">
      <gsf:link type="document">
      <gsf:icon type="document"/>
      </gsf:link>
      </td>
  - num: 5
    type: INSERT_AFTER
    description: Adding back doc icon to search stmt
    find: |-
      <td valign="top">
      <gsf:link type="source">
      <gsf:metadata name="srcicon"/>
      </gsf:link>
      </td>
    text: |-
      <td valign="top">
      <gsf:link type="document">
      <gsf:icon type="document"/>
      </gsf:link>
      </td>
  - num: 6
    description: Indicating number of leaf nodes
    type: INSERT_BEFORE
    find: |-
      </gsf:template>
      <gsf:template match="classifierNode[@classifierStyle = 'HList']">
      <gsf:link type="classifier">
      <gsf:metadata name="Title"/>
      </gsf:link>
      </gsf:template>
    text: |-
      <td valign="top">(<gsf:metadata name="numleafdocs"/>)</td>
  - num: 7
    description: Displaying creators, comma separated
    type: INSERT_AFTER
    find: |-      
      <xsl:call-template name="choose-title"/>
      <gsf:switch>
      <gsf:metadata name="Source"/>
      <gsf:when test="exists">
      <br/>
      <i>(<gsf:metadata name="Source"/>)</i>
      </gsf:when>
      </gsf:switch>
      </gsf:link>
    text: |-
      <br/>
      <gsf:metadata name="dc.Creator"/>
  - num: 8
    description: Creators separated by space
    type: REPLACE
    find: |-
      <gsf:metadata name="dc.Creator"/>
    text: |-
      <gsf:metadata name="dc.Creator" separator=" "/>
  - num: 9
    description: Creators separated by newline      
    type: REPLACE
    find: |-
      <gsf:metadata name="dc.Creator" separator=" "/>
    text: |-
      <gsf:metadata name="dc.Creator"><separator><br/></separator></gsf:metadata>
---
tutorial: pdfCollection
edits:
  - num: 1
    description: "Hide section numbers in display format"
    type: ADD_AT_START
    text: |-
      <gsf:template name="additionalHeaderContent-collection">
      <style>span.tocSectionNumber { display: none; }</style>
      </gsf:template>
  - num: 2
    description: "Hide section titles in display format"
    type: REPLACE
    find: |-
      <gsf:template name="additionalHeaderContent-collection">
      <style>span.tocSectionNumber { display: none; }</style>
      </gsf:template>
    text: |-
      <gsf:template name="additionalHeaderContent-collection">
      <style>span.tocSectionTitle { display: none; }</style>
      </gsf:template>
  - num: 3
    description: Highlighting the query terms in a PDF document
    type: INSERT_AFTER
    find: |-
      <td valign="top">
      <gsf:link type="document">
      <gsf:icon type="document"/>
      </gsf:link>
      </td>
    text: |-
      <td valign="top">
      <gsf:switch>
      <gsf:metadata name="FileFormat"/>
      <gsf:when test="equals" test-value="PDF">
      <a><xsl:attribute name="href"><gsf:metadata name="httpPath" type="collection"/>/index/assoc/<gsf:metadata name="archivedir"/>/<gsf:metadata name="srclinkFile"/>#search=&amp;quot;<gsf:cgi-param name="query"/>&amp;quot;</xsl:attribute>
      <gsf:choose-metadata>
      <gsf:metadata name="thumbicon"/>
      <gsf:metadata name="srcicon"/>
      </gsf:choose-metadata>
      </a>
      </gsf:when>
      <gsf:otherwise>
      <gsf:link type="source">
      <gsf:choose-metadata>
      <gsf:metadata name="thumbicon"/>
      <gsf:metadata name="srcicon"/>
      </gsf:choose-metadata>
      </gsf:link>
      </gsf:otherwise>
      </gsf:switch>
      </td>
---
tutorial: associatedFiles
edits:
  - num: 1
    description: Adding the equivDoc elements to the browse format statement
    type: INSERT_AFTER
    find: |-
      <gsf:template match="documentNode">
      <td valign="top">
      <gsf:link type="document">
      <gsf:icon type="document"/>
      </gsf:link>
      </td>
      <td valign="top">
      <gsf:link type="source">
      <gsf:choose-metadata>
      <gsf:metadata name="thumbicon"/>
      <gsf:metadata name="srcicon"/>
      </gsf:choose-metadata>
      </gsf:link>
      </td>
    text: |-
      <td valign="top">
      <gsf:metadata name="equivDocLink"/>
      <gsf:metadata name="equivDocIcon"/>
      <gsf:metadata name="/equivDocLink"/>
      </td>
  - num: 2
    description: Adding the equivDoc elements to the search format statement
    type: REPLACE
    find: |-
      <gsf:template match="documentNode">
      <td valign="top">
      <gsf:link type="document">
      <gsf:icon type="document"/>
      </gsf:link>
      </td>
      <td>
      <gsf:link type="document">
      <xsl:call-template name="choose-title"/>
      </gsf:link>
      </td>
      </gsf:template>
    text: |-
      <gsf:template match="documentNode">
      <td valign="top">
      <gsf:link type="document">
      <gsf:icon type="document"/>
      </gsf:link>
      </td>
      
      <td valign="top">
      <gsf:link type="source">
      <gsf:choose-metadata>
      <gsf:metadata name="thumbicon"/>
      <gsf:metadata name="srcicon"/>
      </gsf:choose-metadata>
      </gsf:link>
      </td>
      <td valign="top">
      <gsf:metadata name="equivDocLink"/>
      <gsf:metadata name="equivDocIcon"/>
      <gsf:metadata name="/equivDocLink"/>
      </td>
      
      <td>
      <gsf:link type="document">
      <xsl:call-template name="choose-title"/>
      </gsf:link>
      </td>
      </gsf:template>
---
tutorial: tudor3_formatting
edits:
  - num: 1
    description: Simplified equivalent browse statement
    type: REPLACE
    find: |-
      <gsf:template match="documentNode">
      <td valign="top">
      <gsf:link type="document">
      <gsf:icon type="document"/>
      </gsf:link>
      </td>
      <td valign="top">
      <gsf:link type="source">
      <gsf:choose-metadata>
      <gsf:metadata name="thumbicon"/>
      <gsf:metadata name="srcicon"/>
      </gsf:choose-metadata>
      </gsf:link>
      </td>
      <td valign="top">
      <gsf:link type="document">
      <!--
      Defined in the global format statement
      -->
      <xsl:call-template name="choose-title"/>
      <gsf:switch>
      <gsf:metadata name="Source"/>
      <gsf:when test="exists">
      <br/>
      <i>(<gsf:metadata name="Source"/>)</i>
      </gsf:when>
      </gsf:switch>
      </gsf:link>
      </td>
      </gsf:template>
    text: |-
      <gsf:template match="documentNode">
      <td valign="top">
      <gsf:link type="document">
      <gsf:icon type="document"/>
      </gsf:link>
      </td>
      <td valign="top">
      <gsf:link type="document">
      <gsf:metadata name="Title"/>
      <br/>
      <i>(<gsf:metadata name="Source"/>)</i>
      </gsf:link>
      </td>
      </gsf:template>
  - num: 2
    description: Making CL2 dc.Subject not display source filename
    type: REPLACE
    find: |-
      <gsf:template match="documentNode">
      <td valign="top">
      <gsf:link type="document">
      <gsf:icon type="document"/>
      </gsf:link>
      </td>
      <td valign="top">
      <gsf:link type="source">
      <gsf:choose-metadata>
      <gsf:metadata name="thumbicon"/>
      <gsf:metadata name="srcicon"/>
      </gsf:choose-metadata>
      </gsf:link>
      </td>
      <td valign="top">
      <gsf:link type="document">
      <xsl:call-template name="choose-title"/>
      </gsf:link>
      <gsf:switch>
      <gsf:metadata name="Source"/>
      <gsf:when test="exists">
      <br/>
      <i>(<gsf:metadata name="Source"/>)</i>
      </gsf:when>
      </gsf:switch>
      </td>
      </gsf:template>
    text: |-
      <gsf:template match="documentNode">
      <td valign="top">
      <gsf:link type="document">
      <gsf:icon type="document"/>
      </gsf:link>
      </td>
      <td valign="top">
      <gsf:link type="document">
      <gsf:metadata name="Title"/>
      </gsf:link>
      </td>
      </gsf:template>
  - num: 3
    description: Search format statement to display dc.Subject
    type: INSERT_AFTER
    find: |-
      <gsf:template match="documentNode">
      <td valign="top">
      <gsf:link type="document">
      <gsf:icon type="document"/>
      </gsf:link>
      </td>
      <td>
      <gsf:link type="document">
      <xsl:call-template name="choose-title"/>
      </gsf:link>
    text: |-
      <br /><gsf:metadata name="dc.Subject"/>
  - num: 4
    description: Modifying the bookshelf display for CL2 dc.Subject by adding Title
    type: REPLACE
    find: |-
      <td valign="top">
      <gsf:link type="document">
      <gsf:metadata name="Title"/>
      </gsf:link>
      </td>
    text: |-
      <td valign="top">
      <b>Title:</b>
      <gsf:metadata name="Title"/>
      </td>
  - num: 5
    description: Modifying the bookshelf display for CL2 dc.Subject with heading
    type: INSERT_AFTER
    find: |-
      <gsf:template match="classifierNode[@classifierStyle = 'VList']">
      <td valign="top">
      <gsf:link style="static" type="classifier">
      <gsf:icon type="classifier"/>
      </gsf:link>
      </td>
      <td valign="top">
    text: |-
      <b>Bookshelf title:</b>
---
tutorial: tudor4_webLink
edits:
  - num: 1
    description: Changing doc icon link to serve up the original web URL
    type: REPLACE
    find: |-
      <gsf:link type="document">
      <gsf:icon type="document"/>
      </gsf:link>
    text: |-
      <gsf:link type="web">
      <gsf:icon type="web"/>
      </gsf:link>
---
tutorial: bibliographicColl_MARC
edits:
  - num: 1
    description: Checking the default global format statement is as expected
    type: REPLACE
    find: |-
      <gsf:template name="choose-title">
      <gsf:choose-metadata>
      <gsf:metadata name="dc.Title"/>
      <gsf:metadata name="exp.Title"/>
      <gsf:metadata name="ex.dc.Title"/>
      <gsf:metadata name="Title"/>
      <gsf:default>Untitled</gsf:default>
      </gsf:choose-metadata>
      </gsf:template>
    text: |-
      <gsf:choose-metadata>
      <gsf:metadata name="exp.Title"/>
      <gsf:metadata name="Title"/>
      <gsf:default>Untitled</gsf:default>
      </gsf:choose-metadata>
  - num: 2
    description: There are no source or thumb icons, so remove them from format statement
    type: REMOVE
    find: |-
      <td valign="top">
      <gsf:link type="source">
      <gsf:choose-metadata>
      <gsf:metadata name="thumbicon"/>
      <gsf:metadata name="srcicon"/>
      </gsf:choose-metadata>
      </gsf:link>
      </td>
  - num: 3
    description: Remove reference to ex.Source metadata as it is set to the nul filename
    type: REMOVE
    find: |-
      <gsf:switch>
      <gsf:metadata name="Source"/>
      <gsf:when test="exists">
      <br/>
      <i>(<gsf:metadata name="Source"/>)</i>
      </gsf:when>
      </gsf:switch>
  - num: 4
    description: Removing the record title from the document display format statement
    type: INSERT_AFTER
    find: |-
      <gsf:option name="TOC" value="true"/>
    text: |-
      <gsf:template name="documentHeading"/>
  - num: 5
    description: Override the default documentContent behaviour with a custom format statement
    type: INSERT_AFTER
    find: |-
      <gsf:template name="documentHeading"/>
    text: |-
      <gsf:template name="documentContent">
      <table>
      <tr>
      <td>Title:</td>
      <td><gsf:metadata name="exp.Title"/></td>
      </tr>
      <tr>
      <td>Subject:</td>
      <td><gsf:metadata name="exp.Subject"/></td>
      </tr>
      <tr>
      <td>Publisher:</td>
      <td><gsf:metadata name="exp.Publisher"/></td>
      </tr>
      </table>
      </gsf:template>
---
tutorial: CDS_ISIS
edits:
  - num: 1
    description: Change BROWSE format statement to display Photographer and Notes metadata
    type: REPLACE
    find: |-
      <gsf:template match="documentNode">
      <td valign="top">
      <gsf:link type="document">
      <gsf:icon type="document"/>
      </gsf:link>
      </td>
      <td valign="top">
      <gsf:link type="source">
      <gsf:choose-metadata>
      <gsf:metadata name="thumbicon"/>
      <gsf:metadata name="srcicon"/>
      </gsf:choose-metadata>
      </gsf:link>
      </td>
      <td valign="top">
      <gsf:link type="document">
      <!--
      Defined in the global format statement
      -->
      <xsl:call-template name="choose-title"/>
      <gsf:switch>
      <gsf:metadata name="Source"/>
      <gsf:when test="exists">
      <br/>
      <i>(<gsf:metadata name="Source"/>)</i>
      </gsf:when>
      </gsf:switch>
      </gsf:link>
      </td>
      </gsf:template>     
    text: |-
      <gsf:template match="documentNode">
      <td valign="top">
      <gsf:link type="document">
      <gsf:icon type="document"/>
      </gsf:link>
      </td>
      <td valign="top">
      <b><gsf:metadata name="Photographer^all"/></b>
      <br/><gsf:metadata name="Notes^all"/>
      </td>
      </gsf:template>
  - num: 2
    description: SEARCH results also to display Photographer and Notes metadata
    type: REPLACE
    find: |-
      <gsf:template match="documentNode">
      <td valign="top">
      <gsf:link type="document">
      <gsf:icon type="document"/>
      </gsf:link>
      </td>
      <td>
      <gsf:link type="document">
      <xsl:call-template name="choose-title"/>
      </gsf:link>
      </td>
      </gsf:template>
    text: |-
      <gsf:template match="documentNode">
      <td valign="top">
      <gsf:link type="document">
      <gsf:icon type="document"/>
      </gsf:link>
      </td>
      <td valign="top">
      <b><gsf:metadata name="Photographer^all"/></b>
      <br/><gsf:metadata name="Notes^all"/>
      </td>
      </gsf:template>
  - num: 3
    description: Controlling documentHeading
    type: INSERT_AFTER
    find: |-
      <gsf:option name="TOC" value="true"/>
    text: |-
      <gsf:template name="documentHeading"/>
  - num: 4
    description: Custom documentContent with JavaScript to show and hide CDS records
    type: INSERT_AFTER
    find: |-
      <gsf:template name="documentHeading"/>
    text: |-
      <gsf:template name="documentContent">
      <p>
      <xsl:call-template name="wrappedSectionText"/>
      </p>

      <a href="javascript:;" id="cdsreclink">Show/Hide CDS Record</a>
      <div id="cdsrecord">
      <b>CDS Record:</b>
      <br/>
      <tt>
      <gsf:metadata name="ISISRawRecord"/>
      </tt>
      </div>

      <script type="text/javascript">
      <xsl:text disable-output-escaping="yes">
      var link=document.getElementById("cdsreclink");
      var div=document.getElementById("cdsrecord");
      gs.functions.makeToggle(link, div);
      </xsl:text>
      </script>
      </gsf:template>
---
tutorial: multimedia
edits:
  - num: 1
    description: Display different icons depending on dc.Format metadata
    type: REPLACE
    find: |-
      <gsf:link type="document">
      <gsf:icon type="document"/>
      </gsf:link>
      </td>
      <td valign="top">
      <gsf:link type="source">
      <gsf:choose-metadata>
      <gsf:metadata name="thumbicon"/>
      <gsf:metadata name="srcicon"/>
      </gsf:choose-metadata>
      </gsf:link>
    text: |-
      <gsf:switch>
      <gsf:metadata name="dc.Format"/>
      <gsf:when test="equals" test-value="Audio">
      <gsf:link type="source">
      <gsf:metadata name="srcicon"/>
      </gsf:link>
      </gsf:when>
      <gsf:when test="equals" test-value="Images">
      <gsf:link type="source">
      <gsf:metadata name="thumbicon"/>
      </gsf:link>
      </gsf:when>
      <gsf:when test="equals" test-value="Supplementary">
      <gsf:link type="source">
      <gsf:metadata name="srcicon"/>
      </gsf:link>
      <gsf:link type="document">
      <gsf:icon type="document"/>
      </gsf:link>
      </gsf:when>
      <gsf:otherwise>
      <gsf:link type="document">
      <gsf:icon type="document"/>
      </gsf:link>
      </gsf:otherwise>
      </gsf:switch>
  - num: 2
    description: Remove the source filename from where it appears after each document
    type: REMOVE
    find: |-
      <gsf:switch>
      <gsf:metadata name="Source"/>
      <gsf:when test="exists">
      <br/>
      <i>(<gsf:metadata name="Source"/>)</i>
      </gsf:when>
      </gsf:switch>
  - num: 3
    description: Making bookshelves show how many items they contain
    type: INSERT_AFTER
    find: |-
      <gsf:link type="classifier">
      <gsf:metadata name="Title"/>
      </gsf:link>
      </td>
    text: |-
      <td valign="top">
      (<gsf:metadata name="numleafdocs"/>)
      </td>
  - num: 5
    description: Using different icons for the multimedia folders
    type: REPLACE
    find: |-
      <gsf:switch>
      <gsf:metadata name="dc.Format"/>
      <gsf:when test="equals" test-value="Audio">
      <gsf:link type="source">
      <gsf:metadata name="srcicon"/>
      </gsf:link>
      </gsf:when>
      <gsf:when test="equals" test-value="Images">
      <gsf:link type="source">
      <gsf:metadata name="thumbicon"/>
      </gsf:link>
      </gsf:when>
      <gsf:when test="equals" test-value="Supplementary">
      <gsf:link type="source">
      <gsf:metadata name="srcicon"/>
      </gsf:link>
      <gsf:link type="document">
      <gsf:icon type="document"/>
      </gsf:link>
      </gsf:when>
      <gsf:otherwise>
      <gsf:link type="document">
      <gsf:icon type="document"/>
      </gsf:link>
      </gsf:otherwise>
      </gsf:switch>
    text: |-
      <gsf:switch>
      <gsf:metadata name="dc.Format"/>
      <gsf:when test="equals" test-value="Lyrics">
      <gsf:link type="document">
      <gsf:icon file="lyrics.gif" select="collection" />
      </gsf:link>
      </gsf:when>
      <gsf:when test="equals" test-value="Discography">
      <gsf:link type="document">
      <gsf:icon file="disc.gif" select="collection" />
      </gsf:link>
      </gsf:when>
      <gsf:when test="equals" test-value="Tablature">
      <gsf:link type="document">
      <gsf:icon file="tab.gif" select="collection" />
      </gsf:link>
      </gsf:when>
      <gsf:when test="equals" test-value="MARC">
      <gsf:link type="document">
      <gsf:icon file="marc.gif" select="collection" />
      </gsf:link>
      </gsf:when>
      <gsf:when test="equals" test-value="Images">
      <gsf:link type="source">
      <gsf:metadata name="thumbicon"/>
      </gsf:link>
      </gsf:when>
      <gsf:when test="equals" test-value="Supplementary">
      <gsf:link type="source">
      <gsf:metadata name="srcicon"/>
      </gsf:link>
      </gsf:when>
      <gsf:when test="equals" test-value="Audio">
      <gsf:link type="source">
      <gsf:switch>
      <gsf:metadata name="FileFormat"/>
      <gsf:when test="equals" test-value="MIDI">
      <gsf:icon file="midi.gif" select="collection" />
      </gsf:when>
      <gsf:otherwise>
      <gsf:metadata name="srcicon"/>
      </gsf:otherwise>
      </gsf:switch>
      </gsf:link>
      </gsf:when>
      </gsf:switch>
---
tutorial: scannedImages
edits:
  - num: 1
    description: Changing Titles format stmt to display more information about the documents - part 1
    type: REPLACE
    find: |-
      <td valign="top">
      <gsf:link type="source">
      <gsf:choose-metadata>
      <gsf:metadata name="thumbicon"/>
      <gsf:metadata name="srcicon"/>
      </gsf:choose-metadata>
      </gsf:link>
      </td>
      <td valign="top">
      <gsf:link type="document">
      <xsl:call-template name="choose-title"/>
      </gsf:link>
      <gsf:switch>
      <gsf:metadata name="Source"/>
      <gsf:when test="exists">
      <br/>
      <i>(<gsf:metadata name="Source"/>)</i>
      </gsf:when>
      </gsf:switch>
      </td>
    text: |-
      <td valign="top">
      Volume: <gsf:metadata name="Volume"/> Number: <gsf:metadata name="Number"/> Date: <gsf:metadata format="formatDate" name="Date"/>
      </td>
  - num: 2
    description: Changing Titles format stmt to display more information about the documents - part 2
    type: REPLACE
    find: |-
      <td valign="top">
      <gsf:link type="classifier">
      <gsf:metadata name="Title"/>
      </gsf:link>
      </td>
    text: |-
      <td valign="top">
      <xsl:call-template name="choose-title"/> (<gsf:metadata name="numleafdocs"/>)
      </td>
  - num: 3
    description: Formatting the DateList classifier - part 1
    type: REPLACE
    find: |-
      <gsf:switch>
      <gsf:metadata name="Source"/>
      <gsf:when test="exists">
      <br/>
      <i>(<gsf:metadata name="Source"/>)</i>
      </gsf:when>
      </gsf:switch>
    text: |-
      </td>
      <td valign="top">
      <xsl:call-template name="choose-date"/>
  - num: 4
    description: Formatting the DateList classifier - part 2
    type: ADD_AT_END
    text: |-
      <gsf:template name="choose-date">
      <gsf:choose-metadata>
      <gsf:metadata format="formatDate" name="dc.Date"/>
      <gsf:metadata format="formatDate" name="exp.Date"/>
      <gsf:metadata format="formatDate" name="ex.dc.Date"/>
      <gsf:metadata format="formatDate" name="Date"/>
      <gsf:default>undated</gsf:default>
      </gsf:choose-metadata>
      </gsf:template>
  - num: 5
    description: Removing the special date-formatting
    type: REPLACE
    find: |-
      <gsf:template name="choose-date">
      <gsf:choose-metadata>
      <gsf:metadata format="formatDate" name="dc.Date"/>
      <gsf:metadata format="formatDate" name="exp.Date"/>
      <gsf:metadata format="formatDate" name="ex.dc.Date"/>
      <gsf:metadata format="formatDate" name="Date"/>
      <gsf:default>undated</gsf:default>
      </gsf:choose-metadata>
      </gsf:template>
    text: |-
      <gsf:template name="choose-date">
      <gsf:choose-metadata>
      <gsf:metadata name="dc.Date"/>
      <gsf:metadata name="exp.Date"/>
      <gsf:metadata name="ex.dc.Date"/>
      <gsf:metadata name="Date"/>
      <gsf:default>undated</gsf:default>
      </gsf:choose-metadata>
      </gsf:template>
  - num: 6
    description: Making search format statement work for both whole newspapers and pages
    type: REPLACE
    find: |-
      <td>
      <gsf:link type="document">
      <xsl:call-template name="choose-title"/>
      </gsf:link>
      </td>
    text: |-
      <td>
      <gsf:switch>
      <gsf:metadata name="Title" select="parent"/>
      <gsf:when test="exists">
      <gsf:metadata name="Title" select="parent"/> Volume:<gsf:metadata name="Volume" select="parent"/> Number:<gsf:metadata name="Number" select="parent"/> - Page:<gsf:metadata name="Title"/>
      </gsf:when>
      <gsf:otherwise>
      <gsf:metadata name="Title"/> Volume:<gsf:metadata name="Volume"/> Number:<gsf:metadata name="Number"/>
      </gsf:otherwise>
      </gsf:switch>
      <br/>
      <i>
      <gsf:choose-metadata>
      <gsf:metadata name="Date" format="formatDate" />
      <gsf:metadata name="Date" select="parent" format="formatDate" />
      <gsf:metadata name="Date" select="root" format="formatDate" />
      <gsf:default>undated</gsf:default>
      </gsf:choose-metadata>
      </i>
      </td>
---
tutorial: OAICollection
edits:
  - num: 1
    description: Replacing the browse format statement's documentNode and VList classifierNode
    type: REPLACE
    text: |-
      <gsf:template match="documentNode">
      <td valign="top">
      <gsf:link type="document">
      <gsf:metadata name="thumbicon"/>
      </gsf:link>
      </td>
      <td valign="middle">
      <i>
      <gsf:metadata name="ex.dc.Description"/>
      </i>
      </td>
      </gsf:template>
      <gsf:template match="classifierNode[@classifierStyle = 'VList']">
      <td valign="top">
      <gsf:link type="classifier">
      <gsf:icon type="classifier"/>
      </gsf:link>
      </td>
      <td valign="top">
      <xsl:call-template name="choose-title"/>
      </td>
      </gsf:template> 
      <gsf:template match="classifierNode[@classifierStyle = 'HList']">
      <gsf:link type="classifier">
      <gsf:metadata name="Title"/>
      </gsf:link>
      </gsf:template>
  - num: 2
    description: Replacing the search format statement in entirety (replaces search documentNode)
    type: REPLACE
    text: |-
      <gsf:template match="documentNode">
      <td valign="top">
      <gsf:link type="document">
      <gsf:metadata name="thumbicon"/>
      </gsf:link>
      </td>
      <td valign="middle">
      <i>
      <gsf:metadata name="ex.dc.Description"/>
      </i>
      </td>
      </gsf:template>
  - num: 3
    description: Appending a custom documentHeading to the display format statement
    type: ADD_AT_END
    text: |-
      <gsf:template name="documentHeading">
      <h3>
      <gsf:metadata name="ex.dc.Subject"/>
      </h3>
      </gsf:template>
  - num: 4
    description: Appending a custom documentContent to the display format statement
    type: ADD_AT_END
    text: |-
      <gsf:template name="documentContent">
      <table>
      <tr>
      <td colspan="2" align="center">
      <a><xsl:attribute name="href">
      <gsf:metadata name="ex.dc.OrigURL"/>
      </xsl:attribute>
      <gsf:metadata name="screenicon"/>
      </a>
      </td>
      </tr>
      <tr>
      <td>Caption:</td>
      <td><i><gsf:metadata name="ex.dc.Description"/></i><br/>
      <gsf:link type="source">
      original <gsf:metadata name="ImageWidth"/>x<gsf:metadata name="ImageHeight"/> <gsf:metadata name="ImageType"/> available
      </gsf:link>
      </td>
      </tr>
      <tr>
      <td>Subject:</td>
      <td><gsf:metadata name="ex.dc.Subject"/></td>
      </tr>
      <tr>
      <td>Publisher:</td>
      <td><gsf:metadata name="ex.dc.Publisher"/></td>
      </tr>
      <tr>
      <td>Rights:</td>
      <td><gsf:metadata name="ex.dc.Rights"/></td>
      </tr>
      </table>
      </gsf:template>
---
tutorial: unknownConverterPluginTutorial
edits:
  - num: 1
    description: Replacing the search format statement to see djvuicon in search results
    type: REPLACE
    text: |-
      <gsf:template match="documentNode">
      <td valign="top">
      <gsf:link type="document">
      <gsf:icon type="document"/>
      </gsf:link>
      </td>
      <td valign="top">
      <gsf:link type="source">
      <gsf:choose-metadata>
      <gsf:metadata name="thumbicon"/>
      <gsf:metadata name="srcicon"/>
      </gsf:choose-metadata>
      </gsf:link>
      </td>
      <td>
      <gsf:link type="document">
      <xsl:call-template name="choose-title"/>
      </gsf:link>
      <gsf:switch>
      <gsf:metadata name="equivDocLink"/>
      <gsf:when test="exists">Also available as: <gsf:metadata name="equivDocLink"/><gsf:metadata name="equivDocIcon"/><gsf:metadata name="/equivDocLink"/>
      </gsf:when>
      </gsf:switch>
      </td>
      </gsf:template>
---
tutorial: stoneD
edits:
  - num: 1
    description: Adding equivDoc to the browse format statement
    type: INSERT_BEFORE
    find: |-
      </td>
      </gsf:template>
    text: |-
      <gsf:switch>
      <gsf:metadata name="equivDocLink"/>
      <gsf:when test="exists">
      <br/>Also available as:
      <gsf:metadata name="equivDocLink"/>
      <gsf:metadata name="equivDocIcon"/>
      <gsf:metadata name="/equivDocLink"/>
      </gsf:when>
      </gsf:switch>
  - num: 2
    description: Display the ex.dc.Title for the CL2 (ex.dc.Contributor) classifier
    type: REPLACE
    find: |-
      <xsl:call-template name="choose-title"/>
    text: |-
      <gsf:metadata name="ex.dc.Title"/>
  - num: 3
    description: Editing the title of CL2's VList classifierNode
    type: REPLACE
    find: |-
      <td valign="top">
      <gsf:link type="classifier">
      <gsf:metadata name="Title"/>
      </gsf:link>
      </td>
    text: |-
      <td valign="top">
      <gsf:link type="classifier">
      <gsf:metadata name="Title"/> (<gsf:metadata name="numleafdocs"/>) 
      </gsf:link>
      </td>
  - num: 4
    description: Adding equivDoc to the CL2 (ex.dc.Contributor) format statement
    type: INSERT_BEFORE
    find: |-
      </td>
      </gsf:template>
    text: |-
      <gsf:switch>
      <gsf:metadata name="equivDocLink"/>
      <gsf:when test="exists">
      <br/>Also available as:
      <gsf:metadata name="equivDocLink"/>
      <gsf:metadata name="equivDocIcon"/>
      <gsf:metadata name="/equivDocLink"/>
      </gsf:when>
      </gsf:switch>
  - num: 5
    description: Adding equivDoc to the search format statement
    type: INSERT_BEFORE
    find: |-
      </td>
      </gsf:template>
    text: |-
      <gsf:switch>
      <gsf:metadata name="equivDocLink"/>
      <gsf:when test="exists">
      <br/>Also available as:
      <gsf:metadata name="equivDocLink"/>
      <gsf:metadata name="equivDocIcon"/>
      <gsf:metadata name="/equivDocLink"/>
      </gsf:when>
      </gsf:switch>
---
tutorial: OAIDownload
edits:
  - num: 1
    description: Repeating backdrop. Replacing browse format statement
    type: REPLACE
    text: |-
      <gsf:template match="documentNode">
      <td valign="top">
      <gsf:link type="source">
      <gsf:metadata name="thumbicon"/>
      </gsf:link>
      </td>
      <td valign="top">Title:<gsf:metadata name="ex.dc.Title"/><br/>Description:<gsf:metadata name="ex.dc.Description"/><br/>Width:<gsf:metadata name="ImageWidth"/><br/>Height:<gsf:metadata name="ImageHeight"/><br/>Size:<gsf:metadata name="ImageSize"/></td>
      </gsf:template>
      <gsf:template match="classifierNode[@classifierStyle = 'VList']">
      <td valign="top">
      <gsf:link type="classifier">
      <gsf:metadata name="thumbicon"/>
      </gsf:link>
      </td>
      <td valign="top">Title:<gsf:metadata name="Image"/></td>
      </gsf:template>
      <gsf:template match="classifierNode[@classifierStyle = 'HList']">
      <gsf:link type="horizontal">
      <gsf:metadata name="Title"/>
      </gsf:link>
      </gsf:template>
  - num: 2
    description: Repeating backdrop. Modifying search format statement
    type: REPLACE    
    text: |-
      <gsf:template match="documentNode">
      <td valign="top">
      <gsf:link type="source">
      <gsf:metadata name="thumbicon"/>
      </gsf:link>
      </td>
      <td valign="top">Title:<gsf:metadata name="ex.dc.Title"/><br/>Description:<gsf:metadata name="ex.dc.Description"/><br/>Width:<gsf:metadata name="ImageWidth"/><br/>Height:<gsf:metadata name="ImageHeight"/><br/>Size:<gsf:metadata name="ImageSize"/></td>
      </gsf:template>
---
tutorial: customisingThemes
edits:
  - num: 1
    description: Modifying default/transform/pages/pref.xsl to use the TutorialTheme
    filename: web/interfaces/default/transform/pages/pref.xsl
    type: REPLACE
    find: |-
      {title:"Greenstone Custom 3", name:"custom-theme3", icon:"theme_90_trontastic.png", url:"interfaces/" + gs.xsltParams.interface_name + "/style/themes/alt_theme_3/jquery-ui.theme.css"},
    text: |-
      {title:"Greenstone Custom 3", name:"custom-theme3", icon:"theme_90_trontastic.png", url:"interfaces/" + gs.xsltParams.interface_name + "/style/themes/alt_theme_3/jquery-ui.theme.css"},
      {title:"Tutorial Theme", name:"TutorialTheme", icon:"TutorialTheme.png", url:"interfaces/" + gs.xsltParams.interface_name + "/style/themes/TutorialTheme/jquery-ui.theme.min.css"}
---
tutorial: collectionSpecificTheme
edits:
  - num: 1
    description: Modifying backdrop's global format statement to use CollectionTheme    
    type: ADD_AT_END
    text: |-
      <xsl:template name="additionalHeaderContent">
      <xsl:variable name="httpCollection">
      <xsl:value-of select="/page/pageResponse/collection/metadataList/metadata[@name='httpPath']"/>
      </xsl:variable>
      <link href="{$httpCollection}/style/CollectionTheme/jquery-ui.theme.min.css" rel="stylesheet" type="text/css" />
      </xsl:template>
---
tutorial: customisingHomePage
edits:
  - num: 1
    description: Modifying interfaceConfig.xml to use home-tutorial.xsl instead of home.xsl
    filename: web/interfaces/default/interfaceConfig.xml
    type: REPLACE
    find: |-
      <subaction name="home" xslt="pages/home.xsl"/>
    text: |-
      <subaction name="home" xslt="pages/home-tutorial.xsl"/>
  - num: 2
    description: Adding the collectionsList template to home-tutorial.xsl
    filename: web/interfaces/default/transform/pages/home-tutorial.xsl
    type: INSERT_BEFORE
    find: |-
      <!-- AUTOMATED TESTING - customisingHomePage INSERTION POINT -->
    text: |-
      <xsl:template name="collectionsList">
      <xsl:for-each select="./page/pageResponse/collectionList/collection">
      <xsl:variable name="collectionName" select="@name"/>
      <li>
      <a href="{$library_name}/collection/{$collectionName}/page/about">
      <xsl:value-of select="displayItemList/displayItem[@name='name']"/>
      </a>
      </li>
      </xsl:for-each>
      </xsl:template>
  - num: 3
    description: Calling the newly added collectionsList template.
    filename: web/interfaces/default/transform/pages/home-tutorial.xsl
    type: REPLACE
    find: |-
      <li><a href="#">Collection 1</a></li>
      <li><a href="#">Collection 2</a></li>
      <li><a href="#">Collection 3</a></li>
      <li><a href="#">Collection 4</a></li>
      <li><a href="#">Collection 5</a></li>
    text: |-
      <xsl:call-template name="collectionsList"/>
  - num: 4
    description: Replacing default search box with one that searches all collections in library.
    filename: web/interfaces/default/transform/pages/home-tutorial.xsl
    type: INSERT_BEFORE
    find: |-
      <!-- AUTOMATED TESTING - customisingHomePage INSERTION POINT -->
    text: |-
      <xsl:template name="searchBox">
      <xsl:for-each select="//page/pageResponse/serviceList/service[@name='TextQuery']">
      <form name="QuickSearch" method="get" action="{$library_name}">
      <input type="hidden" name="a" value="q"/>
      <input type="hidden" name="rt" value="rd"/>
      <input type="hidden" name="s" value="{@name}"/>
      <input type="hidden" name="s1.collection" value="all"/>
      <input type="text" name="s1.query" size="20" id="search-text" value="" />
      <input type="submit" id="search-submit">
      <xsl:attribute name="value">
      <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home.quick_search')"/>
      </xsl:attribute>
      </input>
      </form>
      </xsl:for-each>
      </xsl:template>
  - num: 5
    description: Calling the newly added searchBox template.
    filename: web/interfaces/default/transform/pages/home-tutorial.xsl
    type: REPLACE
    find: |-
      <form method="get" action="#">
      <div>
      <input type="text" name="s" id="search-text" value="" />
      <input type="submit" id="search-submit" value="" />
      </div>
      </form>
    text: |-
      <xsl:call-template name="searchBox"/>
  - num: 6
    description: Define and call a template to display the correct links when user logged in vs not
    filename: web/interfaces/default/transform/pages/home-tutorial.xsl
    type: INSERT_BEFORE
    find: |-
      <!-- AUTOMATED TESTING - customisingHomePage INSERTION POINT -->
    text: |-
      <xsl:template name="loginButton">
      <xsl:variable name="username" select="/page/pageRequest/userInformation/@username"/>
      <xsl:variable name="groups" select="/page/pageRequest/userInformation/@groups"/>
      <xsl:choose>
      <xsl:when test="$username">
      <xsl:if test="contains($groups,'admin')">
      <li class="login"><a href="{$library_name}/admin/AddUser">Add user</a></li>
      <li class="login"><a href="{$library_name}/admin/ListUsers">Administration</a></li>
      </xsl:if>
      <li class="login"><a href="{$library_name}/admin/AccountSettings?s1.username={$username}">Logged in as: <xsl:value-of select="$username"/></a></li>
      <li class="login"><a href="{$library_name}?logout=">Logout</a></li>
      </xsl:when>
      <xsl:otherwise>
      <li class="login">
      <a href="{$library_name}?a=p&amp;sa=login&amp;redirectURL={$library_name}%3Fa=p%26sa=home">Login
      <xsl:attribute name="title">
      <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'login_tip')"/>
      </xsl:attribute>
      </a>
      </li>
      </xsl:otherwise>
      </xsl:choose>
      </xsl:template>
  - num: 7
    description: Calling the newly added loginButton template.
    filename: web/interfaces/default/transform/pages/home-tutorial.xsl
    type: REPLACE
    find: |-
      <li><a href="?a=p&amp;sa=login&amp;redirectURL={$library_name}%3Fa=p%26sa=home">Login</a></li>
      <li><a href="{$library_name}/admin/AccountSettings?s1.username=">Account Settings</a></li>
      <li><a href="{$library_name}/admin/AddUser">Register a new user</a></li>
      <li><a href="{$library_name}/admin/ListUsers">Administration</a></li>
      <li><a href="{$library_name}?logout=">Logout</a></li>
    text: |-
      <xsl:call-template name="loginButton"/>
  - num: 8
    description: Using a template to produce a consistent library name.
    filename: web/interfaces/default/transform/pages/home-tutorial.xsl
    type: REPLACE
    occurrence: 0
    find: |-
      A New Home Page
    text: |-
      <xsl:call-template name="siteName"/>
  - num: 9
    description: Changing the library name referred to by template in its one place.
    filename: web/sites/localsite/siteConfig.xml
    type: REPLACE
    find: |-
      <displayItem name="siteName" lang="en">My Greenstone Library</displayItem>
    text: |-
      <displayItem name="siteName" lang="en">The Best Digital Library</displayItem>
---
tutorial: definingLibraries
edits:
  - num: 1
    description: Checking the default library uses localsite and default interface - part 1
    filename: resources/web/servlets.xml.in
    type: MATCH
    find: |-
      <servlet-name>library</servlet-name>
      <description>The standard gsdl3 library program</description>
      <servlet-class>org.greenstone.gsdl3.LibraryServlet</servlet-class>
      <!-- this is the servlet url path - needs to match what you have specified in servlet-mapping below -->
      <init-param>
      <param-name>library_name</param-name>
      <param-value>library</param-value>
      </init-param>
  - num: 2
    description: Checking the default library uses localsite and default interface - part 2
    filename: resources/web/servlets.xml.in
    type: MATCH
    find: |-
      <init-param>
      <param-name>site_name</param-name>
      <param-value>localsite</param-value>
      </init-param>
      <init-param>
      <param-name>interface_name</param-name>
      <param-value>default</param-value>
      </init-param>
  - num: 3
    description: Checking halftone-library uses localsite and halftone interface
    filename: resources/web/servlets.xml.in
    type: MATCH
    find: |-
      <servlet>
      <servlet-name>halftone-library</servlet-name>
      <description>A library servlet using the standard content, but with the halftone interface.</description>
      <servlet-class>org.greenstone.gsdl3.LibraryServlet</servlet-class>
      <init-param>
      <param-name>library_name</param-name>
      <param-value>halftone-library</param-value>
      </init-param>
      <init-param>
      <param-name>site_name</param-name>
      <param-value>localsite</param-value>
      </init-param>
      <init-param>
      <param-name>interface_name</param-name>
      <param-value>halftone</param-value>
  - num: 4
    description: Checking servlet mapping for the default library
    filename: resources/web/servlets.xml.in
    type: MATCH
    find: |-
      <servlet-mapping>
      <servlet-name>library</servlet-name>
      <url-pattern>/library/*</url-pattern>
      </servlet-mapping>
  - num: 5
    description: Editing servlets.xml.in to define library2 that uses default interface and mysite
    filename: resources/web/servlets.xml.in
    type: ADD_AT_END
    text: |-
      <servlet>
      <servlet-name>library2</servlet-name>
      <description>A new library with my new site!</description>
      <servlet-class>org.greenstone.gsdl3.LibraryServlet</servlet-class>
      <init-param>
      <param-name>library_name</param-name>
      <param-value>library2</param-value>
      </init-param>
      <init-param>
      <param-name>site_name</param-name>
      <param-value>mysite</param-value>
      </init-param>
      <init-param>
      <param-name>interface_name</param-name>
      <param-value>default</param-value>
      </init-param>
      <init-param>
      <param-name>receptionist_class</param-name>
      <param-value>DefaultReceptionist</param-value>
      </init-param>
      <init-param>
      <param-name>default_lang</param-name>
      <param-value>en</param-value>
      </init-param>
      </servlet>
      
      <servlet-mapping>
      <servlet-name>library2</servlet-name>
      <url-pattern>/library2/*</url-pattern>
      </servlet-mapping>
      
  - num: 6
    description: Edit servlets.xml.in to define library rand to use mysite and althor interface
    filename: resources/web/servlets.xml.in
    type: ADD_AT_END
    text: |-
      
      <servlet>
      <servlet-name>rand</servlet-name>
      <description>A new library with my new interface!</description>
      <servlet-class>org.greenstone.gsdl3.LibraryServlet</servlet-class>
      <init-param>
      <param-name>library_name</param-name>
      <param-value>rand</param-value>
      </init-param>
      <init-param>
      <param-name>site_name</param-name>
      <param-value>mysite</param-value>
      </init-param>
      <init-param>
      <param-name>interface_name</param-name>
      <param-value>althor</param-value>
      </init-param>
      <init-param>
      <param-name>receptionist_class</param-name>
      <param-value>DefaultReceptionist</param-value>
      </init-param>
      <init-param>
      <param-name>default_lang</param-name>
      <param-value>en</param-value>
      </init-param>
      </servlet>
      
      <servlet-mapping>
      <servlet-name>rand</servlet-name>
      <url-pattern>/rand/*</url-pattern>
      </servlet-mapping>
---
tutorial: designingANewInterface1
edits:
  - num: 1
    description: Modifying perrin's interfaceConfig.xml to inherit from default interface.
    filename: web/interfaces/perrin/interfaceConfig.xml
    type: REPLACE
    find: |-
      <interfaceConfig>
    text: |-
      <interfaceConfig baseInterface="default">
  - num: 2
    description: Edit servlets.xml.in to define library golden using localsite and perrin interface
    filename: resources/web/servlets.xml.in
    type: ADD_AT_END
    text: |-
      
      <servlet>
      <servlet-name>golden</servlet-name>
      <description>A new library with my new interface!</description>
      <servlet-class>org.greenstone.gsdl3.LibraryServlet</servlet-class>
      <init-param>
      <param-name>library_name</param-name>
      <param-value>golden</param-value>
      </init-param>
      <init-param>
      <param-name>site_name</param-name>
      <param-value>localsite</param-value>
      </init-param>
      <init-param>
      <param-name>interface_name</param-name>
      <param-value>perrin</param-value>
      </init-param>
      <init-param>
      <param-name>receptionist_class</param-name>
      <param-value>DefaultReceptionist</param-value>
      </init-param>
      <init-param>
      <param-name>default_lang</param-name>
      <param-value>en</param-value>
      </init-param>
      </servlet>
      
      <servlet-mapping>
      <servlet-name>golden</servlet-name>
      <url-pattern>/golden/*</url-pattern>
      </servlet-mapping>
  - num: 3
    description: Remove css table import line
    filename: web/interfaces/perrin/styles/layout.css
    type: REMOVE
    find: |-
      @import url("tables.css");
  - num: 3
    description: Remove css table import line
    filename: web/interfaces/perrin/styles/featured_slide.css
    type: REPLACE
    find: |-
      .loader{background:url("../scripts/galleryviewthemes/loader.gif") center center no-repeat;}
    text: |-
      .loader{background:url("../images/galleryviewthemes/loader.gif") center center no-repeat;}
---
tutorial: designingANewInterface2
edits:
  - num: 1
    description: Replacing placeholder text on new interface's home page.
    filename: web/interfaces/perrin/transform/pages/home.xsl
    type: REPLACE
    find: |-
      HOME PAGE CONTENT GOES HERE
    text: |-
      <div class="content">
      <div id="featured_slide">
      <ul id="featurednews">
      <xsl:call-template name="collSlider"/>
      </ul>
      </div>
      </div>
  - num: 2
    description: Adding collSlider template to end of perrin interface's home.xsl
    filename: web/interfaces/perrin/transform/pages/home.xsl
    type: INSERT_BEFORE
    find: |-
      <!-- AUTOMATED TESTING - designingANewInterface2 INSERTION POINT 2 -->
    text: |-
      <xsl:template name="collSlider">
      <xsl:for-each select="./collectionList/collection">
      <xsl:variable name="collectionFolder" select="@name"/>
      <xsl:variable name="collectionName" select="displayItemList/displayItem[@name='name']"/>
      <xsl:variable name="homeImage">
      <xsl:choose>
      <xsl:when test="displayItem[@name='smallicon']">
      sites/<xsl:value-of select="$site_name"/>/collect/<xsl:value-of select="$collectionFolder"/>/images/<xsl:value-of select="displayItem[@name='smallicon']"/>
      </xsl:when>
      <xsl:otherwise>
      interfaces/<xsl:value-of select="$interface_name"/>/images/default.jpg
      </xsl:otherwise>
      </xsl:choose>
      </xsl:variable>

      <li><img src="{$homeImage}" alt="" />
      <div class="panel-overlay">
      <a href="{$library_name}/collection/{$collectionFolder}/page/about">
      <h2><xsl:value-of select="$collectionName"/></h2>
      </a>
      </div>
      </li>
      </xsl:for-each>
      </xsl:template>
  - num: 3
    description: Adding template additionalHeaderContent to end of perrin interface's home.xsl
    filename: web/interfaces/perrin/transform/pages/home.xsl
    type: INSERT_BEFORE
    find: |-
      <!-- AUTOMATED TESTING - designingANewInterface2 INSERTION POINT 2 -->
    text: |-
      <xsl:template name="additionalHeaderContent">
      <script type="text/javascript" src="interfaces/{$interface_name}/scripts/jquery.min.js"><xsl:text> </xsl:text></script>
      <script type="text/javascript" src="interfaces/{$interface_name}/js/jquery-ui-1.13.0.custom/jquery-ui.min.js"><xsl:text> </xsl:text></script>
      <script type="text/javascript" src="interfaces/{$interface_name}/scripts/jquery.easing.1.3.js"><xsl:text> </xsl:text></script>
      <script type="text/javascript" src="interfaces/{$interface_name}/scripts/jquery.timers.1.2.js"><xsl:text> </xsl:text></script>
      <script type="text/javascript" src="interfaces/{$interface_name}/scripts/jquery.galleryview.2.1.1.min.js"><xsl:text> </xsl:text></script>
      <script type="text/javascript" src="interfaces/{$interface_name}/scripts/jquery.galleryview.setup.js"><xsl:text> </xsl:text></script>
      </xsl:template>
  - num: 4
    description: Appending custom content area to page/pageResponse template in perrin home.xsl
    filename: web/interfaces/perrin/transform/pages/home.xsl
    type: INSERT_BEFORE
    find: |-
      <!-- AUTOMATED TESTING - designingANewInterface2 INSERTION POINT 1 -->
    text: |-
      <div class="column">
      <ul class="latestnews">
      <li>
      <p><strong><a href="#">Highlighted Item 1</a></strong><br/>This is a place where you can put information about an item you would like to highlight in your collection, with or without an accompanying image.</p>
      </li>
      <li><img src="interfaces/{$interface_name}/images/80x80.jpg" alt="" />
      <p><strong><a href="#">Highlighted Item 2</a></strong><br/>This is a place where you can put information about an item you would like to highlight in your collection,with or without an accompanying image.</p>
      </li>
      <li class="last"><img src="interfaces/{$interface_name}/images/80x80.jpg" alt="" />
      <p><strong><a href="#">Highlighted Item 3</a></strong><br/>This is a place where you can put information about an item you would like to highlight in your collection, with or without an accompanying image.</p>
      </li>
      </ul>
      </div>
      <br class="clear" />
  - num: 5
    description: Appending collectionsList and collDescription templates to perrin's home.xsl
    filename: web/interfaces/perrin/transform/pages/home.xsl
    type: INSERT_BEFORE
    find: |-
      <!-- AUTOMATED TESTING - designingANewInterface2 INSERTION POINT 1 -->
    text: |-
      <div id="hpage_cats">
      <xsl:call-template name="collectionsList"/>
      </div>
  - num: 6
    description: Calling collectionsList template from page/pageResponse of perrin's home.xsl
    filename: web/interfaces/perrin/transform/pages/home.xsl
    type: INSERT_BEFORE
    find: |-
      <!-- AUTOMATED TESTING - designingANewInterface2 INSERTION POINT 2 -->
    text: |-
      <xsl:template name="collectionsList">
      <xsl:for-each select="./collectionList/collection">
      <xsl:choose>
      <xsl:when test="position() mod 2 = 1">
      <div class="fl_left">
      <xsl:call-template name="collDescription"/>
      </div>
      </xsl:when>
      <xsl:otherwise>
      <div class="fl_right">
      <xsl:call-template name="collDescription"/>
      </div>
      <br class="clear" />
      </xsl:otherwise>
      </xsl:choose>
      </xsl:for-each>
      </xsl:template>

      <xsl:template name="collDescription">
      <xsl:variable name="collectionFolder" select="@name"/>
      <xsl:variable name="collectionName" select="displayItemList/displayItem[@name='name']"/>
      <xsl:variable name="homeImage" select="displayItemList/displayItem[@name='icon']"/>
      <xsl:variable name="aboutImage" select="displayItemList/displayItem[@name='smallicon']"/>
      <xsl:variable name="collDesc" select="displayItemList/displayItem[@name='description']"/>
      <xsl:variable name="numDocs" select="metadataList/metadata[@name='numDocs']"/>

      <h2><a href="{$library_name}/collection/{$collectionFolder}/page/about"><xsl:value-of select="$collectionName"/></a></h2>
      <xsl:if test="$aboutImage">
      <img src="sites/{$site_name}/collect/{$collectionFolder}/images/{$aboutImage}" alt="{$collectionName}" />
      </xsl:if>

      <xsl:choose>
      <xsl:when test="$collDesc">
      <p class="justify"><xsl:apply-templates select="displayItemList/displayItem[@name='description']"/></p>
      </xsl:when>
      <xsl:otherwise>
      <p class="justify">Welcome to the <xsl:value-of select="$collectionName"/> collection. This collection contains <xsl:value-of select="$numDocs"/> documents.</p>
      </xsl:otherwise>
      </xsl:choose>
      </xsl:template>
  - num: 7
    description: Replacing the CSS files referred to by perrin's header.xsl
    filename: web/interfaces/perrin/transform/layouts/header.xsl
    type: REPLACE
    find: |-
      <xsl:choose>
      <xsl:when test="/page/pageResponse/interfaceOptions/option[@name = 'cssTheme']/@value">
      <!-- Get the theme from the interfaceConfig.xml file -->
      <link rel="stylesheet" href="{/page/pageResponse/interfaceOptions/option[@name = 'cssTheme']/@value}" type="text/css"/>
      </xsl:when>
      <xsl:otherwise>
      <link rel="stylesheet" href="interfaces/{$interface_name}/style/themes/main/jquery-ui-1.8.16.custom.css" type="text/css"/>
      </xsl:otherwise>
      </xsl:choose>
      <link rel="stylesheet" href="interfaces/{$interface_name}/style/core.css" type="text/css"/>
    text: |-
      <link rel="stylesheet" href="interfaces/{$interface_name}/styles/layout.css" type="text/css" />
      <link rel="stylesheet" href="interfaces/{$interface_name}/styles/gs3-core-min.css" type="text/css" />
---
tutorial: designingANewInterface3
edits:
  - num: 1
    description: Insert footer content into perrin's main.xsl
    filename: web/interfaces/perrin/transform/layouts/main.xsl
    type: INSERT_AFTER
    find: |-
      <!-- Put footer in here. -->
    text: |-
      <!-- ******DO NOT REMOVE THE LINK TO OS TEMPLATES: Template is free to use/modify, but this link MUST remain on all pages. Do not remove Copyright information. Replace "Your Webpage Here" (and it's link) with your own information.-->
      <div class="wrapper col8">
      <div id="copyright">
      <p class="fl_left">Copyright © 2013 - All Rights Reserved - <a href="#">Your Webpage Here</a></p>
      <p class="fl_right">Template by <a href="http://www.os-templates.com/" title="Free Website Templates">OS Templates</a></p>
      <br class="clear" />
      </div>
      </div>
  - num: 2
    description: Moving image slider and the highlighted items away from edge
    filename: web/interfaces/perrin/transform/layouts/main.xsl
    type: REPLACE
    find: |-
      <div class="container" id="gs_content">
      <xsl:apply-templates select="/page"/>
      </div>
    text: |-
      <div class="wrapper">
      <div class="container" id="gs_content">
      <xsl:apply-templates select="/page"/>
      <br class="clear" />
      </div>
      </div>
  - num: 3
    description: Part 1 of Navigation Bar and Search Box steps combined in perrin's main.xsl
    filename: web/interfaces/perrin/transform/layouts/main.xsl
    type: INSERT_AFTER
    find: |-
      <body>
    text: |-
      <div class="wrapper col2">
      <div id="topbar">
      <div id="topnav">
      <ul>
      <xsl:call-template name="navBar"/>
      </ul>
      </div>
      <!--**********************************************************************-->
      <xsl:choose>
      <xsl:when test="page/pageRequest/@subaction='home'">
      <xsl:call-template name="crossCollSearch"/>
      </xsl:when>
      <xsl:when test="page/pageRequest/paramList/param/@name='c' and /page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']">
      <xsl:call-template name="CollectionSearch"/>
      </xsl:when>
      <xsl:otherwise/>
      </xsl:choose>
      <!--**********************************************************************-->
      </div>
      </div>
  - num: 4
    description: Part 2 of Navigation Bar and Search Box steps combined in perrin's main.xsl
    filename: web/interfaces/perrin/transform/layouts/main.xsl
    type: INSERT_BEFORE
    find: |-
      <!-- AUTOMATED TESTING - designingANewInterface3 INSERTION POINT -->
    text: |-
      <xsl:template name="navBar">
      <xsl:choose>
      <xsl:when test="page/pageResponse/collection">
      <xsl:variable name="count" select="count(/page/pageResponse/collection/serviceList/service[@name='ClassifierBrowse']/classifierList/classifier)"/>
      <xsl:variable name="currentPage" select="page/pageRequest/@fullURL"/>

      <li><a href="{$library_name}">Home</a></li>
      <li>
      <xsl:if test="page/pageRequest/@subaction='about'"><xsl:attribute name="class">active</xsl:attribute></xsl:if>
      <a href="{$library_name}/collection/{$collNameChecked}/page/about">About</a>
      </li>

      <xsl:choose>
      <xsl:when test="$count > 3">
      <li><a href="{$currentPage}">Browse</a>
      <ul>
      <xsl:call-template name="Browsing"/>
      </ul>
      </li>
      </xsl:when>
      <xsl:otherwise>
      <xsl:call-template name="Browsing"/>
      </xsl:otherwise>
      </xsl:choose>

      <xsl:if test="/page/pageResponse/collection/serviceList/service/@type='query'">
      <li><a href="{$currentPage}">Search</a>
      <ul>
      <xsl:for-each select="/page/pageResponse/collection/serviceList/service[@type='query']">
      <xsl:variable name="search" select="@name"/>
      <xsl:variable name="search_name" select="displayItem[@name='name']"/>
      <li><a href="{$library_name}/collection/{$collNameChecked}/search/{$search}"><xsl:value-of select="$search_name"/></a></li>
      </xsl:for-each>
      </ul>
      </li>
      </xsl:if>

      </xsl:when>
      <xsl:otherwise> </xsl:otherwise>
      </xsl:choose>
      </xsl:template>

      <xsl:template name="Browsing">
      <xsl:for-each select="/page/pageResponse/collection/serviceList/service[@name='ClassifierBrowse']/classifierList/classifier">
      <li>
      <xsl:choose>
      <!-- If this tab is selected then colour it differently -->
      <xsl:when test="util:contains(/page/pageRequest/paramList/param[@name = 'cl' and /page/pageRequest/@action = 'b']/@value, @name)">
      <xsl:attribute name='class'>active</xsl:attribute>
      </xsl:when>
      <xsl:otherwise> </xsl:otherwise>
      </xsl:choose>

      <a>
      <!-- Add a title element to the <a> tag if a description exists for this classifier -->
      <xsl:if test="displayItem[@name='description']">
      <xsl:attribute name='title'><xsl:value-of select="displayItem[@name='description']"/></xsl:attribute>
      </xsl:if>

      <!-- Add the href element to the <a> tag -->
      <xsl:choose>
      <xsl:when test="@name">
      <xsl:attribute name="href"><xsl:value-of select="$library_name"/>/collection/<xsl:value-of select="/page/pageResponse/collection[@name=$collNameChecked]/@name"/>/browse/<xsl:value-of select="@name"/></xsl:attribute>
      </xsl:when>
      <xsl:otherwise>
      <xsl:attribute name="href"><xsl:value-of select="$library_name"/>/collection/<xsl:value-of select="/page/pageResponse/collection[@name=$collNameChecked]/@name"/>/browse/1</xsl:attribute>
      </xsl:otherwise>
      </xsl:choose>

      <!-- Add the actual text of the <a> tag -->
      <xsl:value-of select="displayItem[@name='name']"/>
      </a>
      </li>
      </xsl:for-each>
      </xsl:template>


      <xsl:template name="crossCollSearch">
      <div id="search">
      <xsl:for-each select="/page/pageResponse/serviceList/service[@name='TextQuery']">
      <form name="QuickSearch" method="get" action="{$library_name}">
      <input type="hidden" name="a" value="q"/>
      <input type="hidden" name="rt" value="rd"/>
      <input type="hidden" name="s" value="{@name}"/>
      <input type="hidden" name="s1.collection" value="all"/>
      <input type="text" name="s1.query" id="search-text" value="Search all collections…" onfocus="this.value=(this.value=='Search all collections…')? '' : this.value ;" />
      <input type="submit" name="go" id="go" value="Search" />
      </form>
      </xsl:for-each>
      </div>
      <br class="clear" />
      </xsl:template>

      <xsl:template name="CollectionSearch">
      <div id="search">
      <xsl:variable name="subaction" select="/page/pageRequest/@subaction"/>
      <form action="{$library_name}/collection/{$collNameChecked}/search/TextQuery">
      <!-- This parameter says that we have come from the quick search area -->
      <input type="hidden" name="qs" value="1"/>
      <input type="hidden" name="rt" value="rd"/>
      <input type="hidden" name="s1.level">
      <xsl:attribute name="value">
      <xsl:choose>
      <xsl:when test="/page/pageRequest/paramList/param[@name = 's1.level']">
      <xsl:value-of select="/page/pageRequest/paramList/param[@name = 's1.level']/@value"/>
      </xsl:when>
      <xsl:otherwise>
      <xsl:value-of select="/page/pageResponse/collection/serviceList/service[@name='TextQuery']/paramList/param[@name = 'level']/@default"/>
      </xsl:otherwise>
      </xsl:choose>
      </xsl:attribute>
      </input>
      <xsl:choose>
      <xsl:when test="/page/pageResponse/service[@name = 'TextQuery']/paramList/param[@name = 'startPage']">
      <input type="hidden" name="s1.startPage" value="1"/>
      </xsl:when>
      <xsl:otherwise>
      <input type="hidden" name="startPage" value="1"/>
      </xsl:otherwise>
      </xsl:choose>
      <xsl:if test="not(/page/pageRequest/paramList/param[@name = 's1.hitsPerPage'])">
      <input type="hidden" name="s1.hitsPerPage" value="20"/>
      </xsl:if>
      <xsl:if test="not(/page/pageRequest/paramList/param[@name = 's1.maxDocs'])">
      <input type="hidden" name="s1.maxDocs" value="100"/>
      </xsl:if>
      <!-- The query text box -->
      <span class="querybox">
      <xsl:variable name="qs">
      <xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='query']" mode="calculate-default"/>
      </xsl:variable>
      <nobr>
      <xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='query']">
      <xsl:with-param name="default" select="java:org.greenstone.gsdl3.util.XSLTUtil.tidyWhitespace($qs, /page/@lang)"/>
      </xsl:apply-templates>
      </nobr>
      </span>
      <!-- The submit button (for TextQuery) -->
      <xsl:if test="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']">
      <input type="submit" name="go" id="go" value="Search" > </input>
      <br/>
      </xsl:if>
      </form>
      </div>
      <br class="clear" />
      <div id="advanced"><a href="{$library_name}/collection/{$collNameChecked}/search/TextQuery">advanced search</a></div>
      </xsl:template>
  - num: 5
    description: Header to display library name and on collection page also coll title.
    filename: web/interfaces/perrin/transform/layouts/main.xsl
    type: INSERT_AFTER
    find: |-
      <body>
    text: |-
      <div class="wrapper">
      <div id="header">
      <div class="fl_left">
      <h1><a href="{$library_name}"><xsl:call-template name="siteName"/></a></h1>
      <p>&#160;
      <xsl:if test="page/pageResponse/collection">
      <a href="{$library_name}/collection/{$collNameChecked}/page/about">
      <xsl:value-of select="page/pageResponse/collection/displayItemList/displayItem[@name='name']"/>
      </a>
      </xsl:if>
      </p>
      </div>
      <br class="clear"/></div>
      </div>
  - num: 6
    description: Part 1 of adding top bar with links for login, help and preferences
    filename: web/interfaces/perrin/transform/layouts/main.xsl
    type: REPLACE
    find: |-
      <body>
    text: |-
      <body id="top">
      <div class="wrapper col0">
      <div id="topline">
      <ul>
      <xsl:call-template name="loginLinks"/>
      <li><a href="{$library_name}/collection/{$collNameChecked}/page/pref">Preferences</a></li>
      <li><a href="{$library_name}/collection/{$collNameChecked}/page/help">Help</a></li>
      </ul>
      <br class="clear" />
      </div>
      </div>
  - num: 7
    description: Part 2 of adding top bar with links for login, help and preferences
    filename: web/interfaces/perrin/transform/layouts/main.xsl
    type: INSERT_BEFORE
    find: |-
      <!-- AUTOMATED TESTING - designingANewInterface3 INSERTION POINT -->
    text: |-
      <xsl:template name="loginLinks">
      <xsl:variable name="username" select="/page/pageRequest/userInformation/@username"/>
      <xsl:variable name="groups" select="/page/pageRequest/userInformation/@groups"/>

      <xsl:choose>
      <xsl:when test="$username">
      <xsl:if test="contains($groups,'admin')">
      <li class="login"><a href="{$library_name}/admin/AddUser">Add user</a></li>
      <li class="login"><a href="{$library_name}/admin/ListUsers">Administration</a></li>
      <li class="login"><gslib:depositorTitleAndLink/></li>
      </xsl:if>
      <li class="login"><a href="{$library_name}/admin/AccountSettings?s1.username={$username}">Logged in as: <xsl:value-of select="$username"/></a></li>
      <li class="login"><a href="{$library_name}?logout=">Logout</a></li>
      </xsl:when>
      <xsl:otherwise>
      <li class="login">
      <a href="{$library_name}?a=p&amp;sa=login&amp;redirectURL={$library_name}%3Fa=p%26sa=home">Login
      <xsl:attribute name="title">
      <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'login_tip')"/>
      </xsl:attribute>
      </a>
      </li>
      </xsl:otherwise>
      </xsl:choose>
      </xsl:template>
...
