---------------------------------------------------------------
copyright 2000 by voxeo corporation  (see LGPL.txt)
---------------------------------------------------------------

Note to Self

v1.0 coded in Java Server Pages and CallXML
v1.0 coded by Kathryn Sharron

"Note to Self" is a telephone-based application that works 
like a miniature tape recorder. You dial in, record your 
memo, and "Note to Self" emails you the message. A website 
(notetoself.jsp) helps you create and maintain a "Note to 
Self" account. 

---------------------------------------------------------------

Contents:

   1. Introduction
   2. Installation and setup instructions
      a. Quick Start
      b. SilverStream
      c. tomcat
   3. List of files
   4. Servers
   5. Database(s)

---------------------------------------------------------------

Quick Start Instructions:

1. Unzip the note.zip package onto your server 
   (see below for further instructions).

2. Point a community.voxeo.com phone number to the voice 
   application.

  a. Go to the voxeo community page: http://community.voxeo.com/.
     Click on the "account login" link. 

  b. Click the "log in here" link. (Or create an account if 
     you do not already have one by clicking the "you can 
     get one here" link.)

  c. Click the "url mappings" tab.

  d. Fill in the url mapping form:

       platform: leave it on the "CallXML" default

       select a city near you

       url: point to the notecall.jsp file on your server

     Click the "Add Mapping" button.

  e. A new number should appear with the URL. Test the URL link 
     by clicking it. A new window will pop up, and you should see 
     an XML file that starts with the following line:

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


SilverStream:
http://devcenter.silverstream.com/SilverHelp3/Docs/help/
framesets/GSWelcome.fs.html

1. Create a directory under \SilverStream35, and subdirectories 
   appropriate to the package name you will be using, for example 
   \SilverStream35\Noteapp\com\voxeo\note. Unzip the note.zip 
   package here. Move the jar files, ssdeploy.xml, ssdeploy.bat, 
   and index.html back up to the first directory (Noteapp, or 
   whatever). Move ssadd_db.xml to \SilverStream35\bin.

2. Application Database: 

   Administrator's Guide, Chapter 4: Database Configuration
   http://devcenter.silverstream.com/SilverHelp3/Docs/help/
   framesets/AdminGuideTOC.fs.html

   Tools Guide, Chapter 15: SilverCmd Reference
   http://devcenter.silverstream.com/SilverHelp3/Docs/help/
   framesets/ToolsGuideTOC.fs.html

   a. SilverStream uses "system tables" to store your classes, 
      etc. You can combine the system tables and any data tables 
      your application needs into one database, but I found it 
      easier to leave my existing database (note.mdb) alone and 
      create a new one for the system tables (ssnote.db). The 
      SilverStream Developer version comes with Sybase Adaptive 
      Server Anywhere 6.

      Create a new, blank database in your application directory. 
      You should also create a username/password that 
      SilverStream server uses to access the database, and 
      another for the application if you're storing application 
      data in the same database. ASA's default username/password 
      is dba/sql.

   b. If you're using ODBC, set up an ODBC data source. In 
      Windows, you would commonly go to Control Panel and open 
      Data Sources (ODBC). Click the System DSN tab, and select 
      Add. Choose the database you're using, and click Finish. 
      The steps from here vary depending on the kind of database 
      you're using.

   c. I use SilverCmd instead of SilverStream Designer. 
      ssadd_db.xml adds the database to the server (or see 
      add_database_sample.xml in the DTDs directory of 
      SilverStream).
  
<?xml version="1.0" encoding="UTF-8"?>
<?AgMetaXML 1.0?>
<!-- Uses DTD "add_database.dtd" -->
<obj_DatabaseOptions>
  <obj_MainDatabase>
    <obj_ConnectionOptions>
      <DatabaseName>ssnote</DatabaseName>
      <Username>dba</Username>
      <Password>sql</Password>
      <LDSKey>SybAdaptiveV6AgBridge</LDSKey>
    </obj_ConnectionOptions>

    <obj_TableIncludeList>
      <TableNameList type="StringArray"></TableNameList>
      <TableNamePatterns type="StringArray"></TableNamePatterns>
    </obj_TableIncludeList>
  </obj_MainDatabase>

  <obj_SystemTablesDatabase>
    <obj_ConnectionOptions>
      <DatabaseName>ssnote</DatabaseName>
      <Username>dba</Username>
      <Password>sql</Password>
      <LDSKey>SybAdaptiveV6AgBridge</LDSKey>
    </obj_ConnectionOptions>
  </obj_SystemTablesDatabase>
</obj_DatabaseOptions>

   d. Open a command prompt and type the following:

      cd silverstream35\bin
      silvercmd AddDatabase yourservername[:andtheport] -f ssadd_db.xml [anyoptions]

      The options are
  
        -U & -P   username and password for SilverStream 
                  authentication
        ?         displays the usage message 

   e. Open the SilverStream Management Console
      (http://yourservername/Silverstream/Pages/smc.html). 
      Go to Configuration, Databases, and check the drop-down 
      list to see if the database has been added.

3. Deploying the application

   Programmer's Guide, Chapter 13: Using Java Server Pages
   http://devcenter.silverstream.com/SilverHelp3/Docs/help/
   framesets/ProgGuideTOC.fs.html
  
   Application Techniques: Using Java Server Pages with SilverStream
   http://devcenter.silverstream.com/SilverHelp3/Docs/help/
   framesets/S3TechniquesTOC.fs.html

   a. SilverStream JSP applications have the following URL:
      
      http://servername/appdatabase/filler/package/name/file.jsp

      The deployment file, ssdeploy.xml, establishes the "filler" 
      section and allows you to specify any other JAR files your 
      application needs. The "filler" seems to be mandatory, but 
      you can make more than one URL this way. The file looks like 
      (or see deploy_jsp_sample.xml in the DTDs directory of 
      SilverStream):

<?xml version="1.0" encoding="UTF-8"?>
<?AgMetaXML 1.0?>

<obj_DeployJSP>
  <URLs type="StringArray">
    <el>filler</el>
    <!-- http://servername/appdatabase/otherfiller/package/name/file.jsp -->
    <el>otherfiller</el>
  </URLs>
  <JARs type="StringArray">
    <el>note.jar</el>
    <el>ntindex.jar</el>
  </JARs>
</obj_DeployJSP>

   b. You can use a batch file to shorten the process of 
      deploying the application. ssdeploy.bat, with comments:
  
cd SilverStream35\Note\com\voxeo\note

// JspCompiler turns your .jsp files into .java files.
// Your package name must match your directory structure.

\SilverStream35\bin\silvercmd JspCompiler -p com.voxeo.note notetoself.jsp 
\SilverStream35\bin\silvercmd JspCompiler -p com.voxeo.note notecall.jsp

cd..
cd..
cd..
cd..
set classpath=c:\SilverStream35\jre\lib\rt.jar;c:\SilverStream35\lib\silverdesignerall.zip;c:\SilverStream35\lib\servlet.jar;c:\SilverStream35\Docs\help\books\TechCode\jsptech;c:\SilverStream35\jre\lib\ext\jndi.jar;c:\SilverStream35\lib\javax_sql.zip;c:\SilverStream35\lib\silverserverall.zip 

cd SilverStream35\Note\com\voxeo\note
javac notetoself.java
javac notecall.java

cd..
cd..
cd..
jar cvf note.jar com/voxeo/note/*.class com/voxeo/note/note.css com/voxeo/note/*.gif com/voxeo/note/*.wav
jar tvf note.jar
jar cvf ntindex.jar index.html com/voxeo/note/*.txt 
jar tvf ntindex.jar

//DeployJsp deploys the JAR to your application database using the 
//xml file.
\SilverStream35\bin\silvercmd deployjsp -f ssdeploy.xml -o localhost ssnote ntindex.jar 
\SilverStream35\bin\silvercmd deployjsp -f ssdeploy.xml -o localhost ssnote note.jar 

      Bring that command prompt back up. I would suggest that you 
      type this in line by line the first time, take notes, and 
      then use the batch file to make updates and changes.

   c. Go to http://server/db/filler/your/pkg/notetoself.jsp and 
      see what happens.

4. Point a community.voxeo.com phone number to the voice 
   application notecall.jsp (see above).


tomcat:

1. Create a directory under \tomcat\webapps\. Unzip the note.zip 
   package here.

2. Connect the note database file as an ODBC data source 
   (NoteToSelf). In Windows, you would commonly go to Control 
   Panel and open Data Sources (ODBC). Click the System DSN tab, 
   and select Add. Choose the database you're using, and click 
   Finish. The steps from here vary depending on the kind of 
   database you're using.

3. Point a community.voxeo.com phone number to the voice 
   application notecall.jsp (see above).


---------------------------------------------------------------

The entire suite contains 22 files:

  Readme.txt	  
  LGPL.txt     The open source license agreement.

  note.mdb     A sample database in MS Access.   


PHONE APPLICATION: (1 file, plus audio)

  notecall.jsp	


AUDIO: (6 files)

All files are PCM format, 8-bit, mono, unsigned. 

  greeting.wav	"Welcome. Please enter your personal 
                 identification number."	

  hello.wav     "Hello"

  message.wav   "Please record your message after the 
                 beep, and then press the pound key."

  invalid.wav	"That is not a valid personal 
                 identification number."

  thankyou.wav	"Thank you."

  sent.wav      "Your message has been sent."


WEB APPLICATION: (5 files)

  notetoself.jsp	

  note.css     A stylesheet for the web pages. 

  background_curve.gif   Images for the web pages.
  logo.gif
  top_slogan.gif
	

SILVERSTREAM SPECIFIC: (7 files)

  ssadd_db.xml   An xml file that tells SilverStream how to 
                 configure the application database.
	
  ssdeploy.xml   An xml file that tells SilverStream how to 
                 deploy the application.
	
  note.jar       The application. 
                 (Not included in the note.zip file.)
	
  ssdeploy.bat   Optional. A shortcut for deploying the 
                 application to the server.
	
  ssnote.db      Optional. SilverStream requires an 
                 application database; you can combine it 
                 into the note database or create a seperate 
                 one. 

  index.html     Optional. I found an index file useful; 
                 SilverStream expects one.

  ntindex.jar    Optional. The index.html, Readme.txt, and 
                 LGPL.txt files.
                 (Not included in the note.zip file.)
	

---------------------------------------------------------------

Server requirements:	

Any Java application server that supports Java Servlets 2.2 
and Java Server Pages 1.1. This application has been tested 
on tomcat 3.1 and SilverStream 3.5.

---------------------------------------------------------------

Database(s):

The database is an ODBC resource called NoteToSelf,

   Data Source Name:   NoteToSelf
   Database File:      note.mdb (or .whatever)

which contains one table: Users
with columns called: Key, PIN, Name, Email

SilverStream requires an application database. You can combine 
the system tables with your data tables into one database, or 
use seperate databases. Since I had an existing Access database, 
I created a new Sybase ASA database for the system tables as 
an ODBC resource called ssnote,

   Data Source Name:   ssnote
   Database File:      ssnote.db 

with tables constructed via the ssadd_db.xml file.


---------------------------------------------------------------