*******************************************************************************
README file for IndexArtistLeft with Search
Date:    30Dec2011 
Version: 2.0
Author:  LotsOCds@gmail.com
Forum:   http://www.fnprg.com/forum/viewtopic.php?f=39&t=14523
*******************************************************************************
Description:

  The CATraxx Export to HTML IndexArtistLeft set of templates is enhanced by 
  adding an internet search engine.

*******************************************************************************
Change log:
2.0 - Rewritten to work with CATraxx v9.31 and Tipue Drop (30Dec2011)
1.5 - Updated to work with CATraxx v8.11 (04Sep2008)
1.4 - Updated to work with CATraxx v7.30 and later (25Dec2006)
      Fixed "not enough memory" error with large exports
1.3 - Revised Search_IndexArtistLeft_MakeIndex.xsl PI's to reduce memory 
      consumption
1.2 - Search_IndexArtistLeft_MakeIndex.xsl now uses DOS line terminators.
    - Search_IndexArtistLeft_MakeIndex.xsl datafolder PI points to home folder
1.1 - First public release  (18Dec2005)

*******************************************************************************
Requirements:

- CATraxx v9.31 or greater.

- Required templates not supplied with ExportWithSearch:
Common.xsl  (This is the default Export HTML file supplied with CATraxx)

- A Javascript enabled browser.  

*******************************************************************************
Installation Instructions:

- Unzip the contents of ExportWithSearch.zip to the CATraxx\Export\HTML 
  template folder (usually Shared Documents\CATraxx\Export\HTML )
  
- Move search.gif and close.gif to the CATraxx\Explorer Templates folder.
        
*******************************************************************************
Execution Instructions:

Try running this first on the Sample database to be sure it is working properly.

1. From the main menu choose File-> Export-> HTML then, click on 
   ExportWithSearch in the left hand pane. Set an appropriate output 
   folder.  Verify that the root template points to the location of the file
   ExportWithSearch.xsl.  Verify that Index Page is set to "index" and 
   File Extension is set to "html".  
  
2. Run Export.  (It is no longer necessary to rename the file SearchIndex.html.)

3. Done.  Open index.html in the browser.

*******************************************************************************
Additional Notes:

********* Configuration **********

- JavaScript must be enabled in the browser. 

- The example template set indexes the fields for album and track artists, 
titles, labels, catalog numbers, release years, formats, and (optional) lyrics. 

- To enable indexing of lyrics open Search_IndexArtistLeft_MakeIndex.xsl and
set the value of IndexLyrics to "yes".

- To change the number of results displayed, open 
Search_ArtistIndexLeft_MakeIndex.xsl and set 'td_show' to your 
chosen number.

*** Performance Considerations ***

- The Search_IndexArtistLeft Export can take a while to complete.  That is 
because it essentially runs twice.  Once to generate the web pages and a second 
time to create the index.

- Cover thumbnail images are resized by the browser.  Even though they look small the 
full image is downloaded from the web server.  Turn off the display of cover 
images (see instructions above) if that creates a performance issue. 

- The search engine executes in the browser on the client machine.  This means 
that the xml based index file must be downloaded by the browser.  It's not a 
problem on a local machine, but a large index file across the internet could 
be sluggish.  


********* Known Issues ***********
None at this time.

*******************************************************************************
How to create a Search template set.


Step (1) - Copy these files from the ExportWithSearch.zip to the CATraxx\Export\HTML folder.
Search_MakeIndex.xsl
SearchIndex.css

Step (2) - Copy these files into the CATraxx\Explorer Templates folder
search.gif
close.gif

Step (3) - Working in the Export to HTML window create an Overview template or a list template with an Index field chosen on the Index tab.  Work with the Export to HTML definition until it is just the way you want it.  Note that the search pop up assumes that an album cover image appears somewhere in the export definition.

Step (4) - Create a code based clone of your Export to HTML definition by choosing "Clone - Create Code Based" from the "++" pull down menu.  Choose a name for the cloned template set.  For this tutorial we'll assume the name is "ExportWithSearch".  The "ExportWithSearch" template set will be stored in the CATtraxx\Export\HTML folder.

Step (5) - Edit the file ExportWithSearch_Index.xsl.  

Change this code(modify frameset cols definition and add a new frame):
    <FRAMESET COLS="150,*">
      <FRAME NAME="titlelist" SRC="ExportWithSearch_overview.xsl"/>
      <FRAME NAME="details" SRC="ExportWithSearch_info.xsl"/>
    </FRAMESET>

To this code:
    <FRAMESET COLS="330,*">
      <FRAME NAME="titlelist" SRC="ExportWithSearch_overview.xsl"/>
      <FRAME NAME="details" SRC="ExportWithSearch_info.xsl"/>
      <FRAME NAME="index" SRC="Search_MakeIndex.xsl"/>
    </FRAMESET>

Step (6) - Edit the file ExportWithSearch_overview.xsl.

Change this code:
  <HEAD>
    <TITLE><xsl:value-of select="$doctitle"/></TITLE>
    <LINK REL="stylesheet" TYPE="text/css" HREF="ExportWithSearch_overview.css"/>
  </HEAD>
  <BODY>
    <xsl:apply-templates select="data/record"/>
  </BODY>

To this:
  <HEAD>
    <TITLE><xsl:value-of select="$doctitle"/></TITLE>
    <LINK REL="stylesheet" TYPE="text/css" HREF="ExportWithSearch_overview.css"/>
    <LINK REL="stylesheet" TYPE="text/css" HREF="SearchIndex.css"/>
    <script type="text/javascript" src="searchindex.html"></script>
  </HEAD>
  <BODY>
    <div>
      <input type="text" id="tipue_drop_input" autocomplete="off" onkeyup="tipuedrop_show();"/>
    </div>
    <div id="tipue_drop_dropdown"></div>
    <xsl:apply-templates select="data/record"/>
    <img src="close.gif" style="visibility:hidden"/>
    <img src="search.gif" style="visibility:hidden"/>
  </BODY>

Step (7) - Go to the Export HTML window, select ExportWithSearch and be sure the 
Output Folder is set properly.  Click Export.