ScoutPalDB Template Center Login

ScoutPal ID:
Password:
What is the Template Center?

ScoutPalDB comes with a built-in standard template that sets up the style and formatting of database lookups on your PDA. But in the spirit of "open source", ScoutPal has opened up this interface, providing full and free open access to templates designed by the ScoutPal user community, and we believe that this will bring fantastic new ScoutPalDB features to all users.

NOTE:  Scripted templates may not work properly on some PDA's that use a version of Windows Mobile above 5.0

View the source-code of an example template that plays "ding.wav" when market price is better (higher) than $7 and rank is better (less) than 2,500,000.

  1. To use a template:
    1. Download a template file from the Template Center Gallery to your computer. To download, click and mark the circle just to the right of the template's title, then click the [Download Selected] button at the top.  Where and how the file downloads is a function and/or setting of your browser.
    2. A folder of sample templates is also included in the installation/update group of files and folders that are put on your device's storage card.
    3. You can optionally edit a template file when it's on your computer: Right-click it and select Open with Notepad. Then carefully edit the criteria numbers to meet your own specifications.  Always use plain numbers only, no dollar signs, commas, or any other punctuation other than an optional decimal point.  Templates can display and evaluate only the data currently residing in the databases.  Specifically: Amazon/Used/New/Collectible lowest price, listing counts (if available), and sales rank.
    4. Templates are written in the elementary languages of the web:  HTML markup and JavaScript programming.  (HTML and JavaScript feature sets are limited by the Windows Mobile operating system.)  Basic HTML formatting is relatively easy to learn and use. JavaScript is more complicated, but there's a wealth of tutorial resources on the web for both HTML and JavaScript.  If you are new to HTML and/or JavaScript, and you want to create your own custom template, the easiest way to start is to choose one of the templates from the Template gallery that seems to come close to what you want it to do.  Download it to your desktop and open it with Windows Notepad. Then edit away, but carefully: computers are quite picky regarding punctuation and syntax.
    5. If you can't figure out how to customize or create a template, send an email to ScoutPal with an attached starting template from the gallery that comes closest to what you want, and tell us in plain English what you want it to do.  For example: "Attached is a template that almost does what I want, except I want it to boldface the rank when the lowest price is greater than 5, and ding when the lowest price is at or above $9.25 and the sales rank is better (lower, but above zero) than 747000."  (Or whatever.) We will translate your specifications into HTML and JavaScript for you, doing our best to make a version that meets your requirements.
    6. Copy the template file to the Pocket PC's storage card, put it in the same place where the database files are; for most users they're in a folder named "SPDB2".
    7. Templates that emit sound(s) will need sound file(s) in the same location as the database. Most templates use a single wav sound file named "ding". You can substitute another sound effect, as long as it is named as required by the template.
    8. Tap Settings / OK in ScoutPalDB each time you change or introduce a template -- this tells the program to pick up and use the newest template file.
    9. You can use the PDA File Explorer to organize your templates into separate folders on the storage card, then copy and paste your selected template into the database file location. Be sure to do the preceding settings/ok step after pasting in a new template. You can switch templates while ScoutPalDB is running.
    10. To test a template, tap in the test code "X42" instead of an ISBN/UPC. The ScoutPalDB program will then bring up random items from the currently active database each time you tap [Seek], so you can quickly see how a template will work with various price/rank scenarios.
  2. Things to check if a template does not seem to work for you:
    1. The template file:
      • Must reside in the exact same folder where the database files are. For most users, they will be in an "SPDB2" folder that's in the root of the SD card.
      • When viewed with the Pocket PC File Explorer program, the template file name must be exactly this: spdbtemplate  (The pda's explorer will hide the file's ".htm" suffix.)
      • When viewed with the Pocket PC File Explorer program, the template file should have an Internet Explorer icon, and then, if you tap on it, it should open in an Internet Explorer window, although it won't actually be 'live' and probably won't display correctly.  But, it should at least be able to be opened by the Pocket PC's Internet Explorer.
      • Must be re-loaded after a template file content change or update. To do this, simply tap the word Settings at the bottom of the ScoutPalDB lookup screen, then tap the [OK] button.
    2. The Database File Location path as specified on the Settings screen must be composed correctly in order for a template to work properly:
      • Be sure that the path is composed with back-slashes (\), not forward-slashes (/).
      • There should not be a slash at the front of the path.
      • Even though a location path composed with forward-slashes may work for db file access, it will not correctly load a template.
      • Here a some examples of location paths that are properly composed for template usage:
        (use "storage card", "sd card", or "cf card", depending on how your Pocket PC names its memory card .)
        • storage card\spdb2\spdb.dbb
        • sd card\spdb.dbb
        • cf card\spdb.dbb
      • Examples of location paths that are not properly composed:
        • sd card/spdb2\spdb.dbb (Change the forward-slash "/" to a back-slash "\")
        • \sd card\spdb.dbb (The leading slash needs to be removed)
    3. If you are using a sound template, and no sounds ever seem to play:
      • Be sure that the required sound files, along with the template file, are in the same place on the storage card as the database.  For most users, this will be in an "SPDB2" folder that's in the root of the SD card.
      • Read the template's source code to find out what sound files it requires.  Most templates need a single ding.wav file, but there are other, more sophisticated templates, that rely on different sound files with unusual names.  To view a template's source code, copy the template to your computer first, then open it up from there, using Notepad.  (Right-click...Open With...Notepad.)
      • Be sure that the PDA's volume control is on full.
      • Tap Start / Settings / Sounds, confirm that sounds for programs are enabled.
      • Using the Pocket PC File Explorer, navigate to, then tap on the sound file -- it should play back with the pda's built-in Media Player program....but not all sound files are compatible with every pda device.
      • If you are using a Bluetooth headset, refer to the FAQ's.
    4. The template's internal HTML and JavaScript, if any, must be free of errors: structure, spelling, punctuation, logic, etc.  Untouched templates, straight from the gallery, will usually work correctly (but not guaranteed, as they originate from other users who may have different equipment or configurations.) Users are free to design their own templates and program their own logic, but they will need to be familiar with fundamentals of html and javascript programming expression, logic, and syntax.  Changing just criteria numbers inside pre-built templates can easily be done by anyone, but be sure to type in the numbers without punctuation (no commas or dollar signs) and to change only the numbers, nothing else.
    5. There's a simple technique that can make debugging template javascript easier.  Most templates start with an initial preamble collection of script code lines whose sole purpose is to assign db values (from tokens) to more useable javascript variables, something like this example:
        lowest = <zlowest/>;
        rank = <zrank/>;
      Token substitution to actual lookup values is done at runtime by the ScoutPalDB program, and the token syntax is foreign to ordinary browsers. However, it's fairly easily to modify a template temporarily to make it statically compatible with a desktop browser's javascript debugger (F12 in Internet Explorer.)  Simply substitute actual numeric scalar values for db value tokens within the javascript, and comment out (or remove) the tokens.  So the example is changed to be this:
        lowest = 5.25; // <zlowest/>;
        rank = 100000; // <zrank/>;
      The idea here is to preload the template's javascript with useable static numbers, and make the javascript compatible with an ordinary browser. This also provides a simple way to test out various price/rank scenarios-- in the given example, a lowest price of $5.25 with a sales rank of 100,000.  (Reminder: javascript numeric values must have no punctuation other than an optional decimal part.)  You can change the numbers, re-save the template, reopen it in your computer browser, and observe the logic effect of the changed numbers.
      Important: if you use this technique, be sure to restore the original <token/> assignment forms on each line you changed (undo what you did), before trying to use the template with the ScoutPalDB program!
  3. Changing the sound that a template uses:
    1. After you have found a sound file that you like:  (in our sound gallery, on the web, or otherwise):
      • Make a folder on the sd card and put a copy of the sound file in there for safe keeping.  You could name the folder “soundstash”, for example, but it doesn’t really matter what its name is; it just needs a safe place on the sd card so that it won’t get overwritten during a DB update.
      • Make the sound file’s primary name be “ding”.
      • You should confirm that the sound file is compatible with the PDA: using the PDA’s File Explorer program, navigate to the sd card, open your new “soundstash” folder, and tap on your new sound file to see if it will play and sound out in the PDA’s Media Player program. You need to do this because not all sound files are compatible with all PDA’s: if it won’t play in the Media Player, it won’t play in the ScoutPalDB program.
    2. When you want to put the custom sound to use, copy and paste it from its safe-keeping folder over to the SPDB2 folder, replacing what is there. If the template expects a sound file named ding, you'll need to restore it to the SPDB2 folder after each datbase update.  You can do this with the PDA’s file explorer, or with the computer’s file explorer while the sd card is currently plugged into the computer.
    3. If you would like to avoid having to restore the custom sound file after each DB update, you can do this:
      1. Put a copy of your current template file on your computer somewhere easy to find and use. (Like on the Desktop or in the My Documents folder.)
      2. Right-click and open it with Notepad. (It must be edited with a plain-text editor like Notepad, not Word or some other fancy program.)
      3. Somewhere in the template source, you'll see a line of program code where it references a sound file named “ding.wav”.  Edit that line of code so that the reference name is mysound.wav, or something like that. (Be very careful that you don’t alter or change any of the punctuation and code around the name; change only the literal primary name reference from “ding” to “mysound”.)
      4. Save the modified template file, then copy it from the computer over to the sd card’s SPDB2 folder, replacing what is there.
      5. If you are going to work with multiple templates, you should also make a safe-keeping folder on the storage card for each of your customized templates, so that you can switch from one to the other on the fly.
      6. Give your special sound file the primary name “mysound” (or whatever name you chose in step 3.c) then put a copy of the special sound file directly in the sd card’s SPDB2 folder.
      7. If, later on, you want to use a different sound, just replace the current sound file with your new sound file, but first give it the same name as the previous one.  Or, if you prefer, you could also do the all of the above steps a-f again.  It's important to understand that the name of any file is just a name, that's all it is.  The name of a file doesn't have to imply what's in it.  A given sound file could make a "Booinggg" or "Pow" or "KaBoom" sound, yet still have a name of "mysound", or "billy", or "dingy", or whatever -- as long as the name matches what the template expects, things will work as expected.
    4. Remember: anytime you change, move, add, or rename files (template, sound, database) you need to tap Settings / OK in the ScoutPalDB program so that it can discover the changed file(s).

Rocket Scientist users only: dynamic frames template with frames from a localhost web server running on the device (hint: pass template substitution tokens to javascript in a target frame get url cgi pairs.)