<?xml version="1.0"?>

<st-source>






















<class>
<name>SearchEngine</name>
<environment>VisualWave</environment>
<super>VisualWave.HttpServlet</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars></inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>ZZZ</category>
<attributes>
<package>(none)</package>
</attributes>
</class>

<methods>
<class-id>VisualWave.SearchEngine</class-id> <category>serving</category>

<body package="(none)">doGet: aRequest response: aResponse
| anSS aResult anEngine searchURL |

 anSS := aRequest anyFormValueAt: 'searchString'.
 aResult := aRequest anyFormValueAt: 'numResults'.
 anEngine := aRequest anyFormValueAt: 'searchEngine'.

 (anEngine = 'google') ifTrue: 
  [ searchURL := 'http://www.google.com/search?q=',anSS,'&amp;num=',aResult.].
 (anEngine = 'infoseek') ifTrue: 
  [ searchURL := 'http://infoseek.go.com/Titles?qt=',anSS,'&amp;nh=',aResult.].
 (anEngine = 'lycos') ifTrue: 
  [ searchURL := 'http://lycospro.lycos.com/cgi-bin/pursuit?query=',anSS,'&amp;maxhits=',aResult.].
 (anEngine = 'hotbot') ifTrue: 
  [ searchURL := 'http://www.hotbot.com/?MT=',anSS,'&amp;DC=',aResult.].

 aResponse redirectTo: searchURL.</body>

<body package="(none)">doPost: aRequest response: aResponse
| anSS aResult anEngine searchURL |

 anSS := aRequest anyFormValueAt: 'searchString'.
 aResult := aRequest anyFormValueAt: 'numResults'.
 anEngine := aRequest anyFormValueAt: 'searchEngine'.

 (anEngine = 'google') ifTrue: 
  [ searchURL := 'http://www.google.com/search?q=',anSS,'&amp;num=',aResult.].
 (anEngine = 'infoseek') ifTrue: 
  [ searchURL := 'http://infoseek.go.com/Titles?qt=',anSS,'&amp;nh=',aResult.].
 (anEngine = 'lycos') ifTrue: 
  [ searchURL := 'http://lycospro.lycos.com/cgi-bin/pursuit?query=',anSS,'&amp;maxhits=',aResult.].
 (anEngine = 'hotbot') ifTrue: 
  [ searchURL := 'http://www.hotbot.com/?MT=',anSS,'&amp;DC=',aResult.].

 " aResponse redirectTo: searchURL. "

 aResponse write: '&lt;HTML&gt;&lt;BODY&gt;Your searchURL is ', 
 searchURL, 
 ' &lt;/BODY&gt;&lt;HTML&gt;'</body>
</methods>
<new-page/>


<class>
<name>TagStuff</name>
<environment>VisualWave</environment>
<super>Core.Object</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>products </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>ZZZ</category>
<attributes>
<package>(none)</package>
</attributes>
</class>

<!-- -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -   -->


<methods>
<class-id>VisualWave.TagStuff class</class-id> <category>class initialiation</category>

<body package="(none)">new
 ^super new initialize</body>
</methods>

<!-- -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -   -->


<methods>
<class-id>VisualWave.TagStuff</class-id> <category>initialize-release</category>

<body package="(none)">initialize
	products := OrderedCollection new.
	self getProducts.</body>
</methods>

<methods>
<class-id>VisualWave.TagStuff</class-id> <category>accessing</category>

<body package="(none)">getProducts
| prodFile separator stream prodNumber prodName prodDesc category |
prodFile := 'c:\vw72nc\web\sandbox\db\products.csv' asFilename. 
separator := $;. "semi-colon" 
stream := prodFile readStream lineEndCRLF. 
[stream atEnd] whileFalse: [ 
stream upTo: separator. 
prodNumber := (stream upTo: separator). 
category := (stream upTo: separator). 
stream upTo: separator. 
prodName := (stream upTo: separator). 
prodDesc := (stream upTo: separator). 
stream upTo: (Character cr). 
products add: ((Product new) number: prodNumber category: category name: prodName description: prodDesc).
].
^products</body>

<body package="(none)">products
 ^products</body>
</methods>
<new-page/>


<class>
<name>ServletSTuff</name>
<environment>VisualWave</environment>
<super>VisualWave.HttpServlet</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars></inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>ZZZ</category>
<attributes>
<package>(none)</package>
</attributes>
</class>

<methods>
<class-id>VisualWave.ServletSTuff</class-id> <category>serving</category>

<body package="(none)">doGet: aRequest response: aResponse
| anSS |
 anSS := aRequest anyFormValueAt: 'searchString'.
 aResponse write: '&lt;HTML&gt;&lt;BODY&gt;You chose ', anSS, ' for your Search String&lt;/BODY&gt;&lt;HTML&gt;'</body>
</methods>
<new-page/>


<class>
<name>StringBean</name>
<environment>VisualWave</environment>
<super>Core.Object</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>quote </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>ZZZ</category>
<attributes>
<package>(none)</package>
</attributes>
</class>

<!-- -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -   -->


<methods>
<class-id>VisualWave.StringBean class</class-id> <category>class initialiation</category>

<body package="(none)">new
 ^super new initialize</body>
</methods>

<!-- -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -   -->


<methods>
<class-id>VisualWave.StringBean</class-id> <category>initialize-release</category>

<body package="(none)">initialize
	quote := 'Blue Stringers are the best.'</body>
</methods>

<methods>
<class-id>VisualWave.StringBean</class-id> <category>accessing</category>

<body package="(none)">getQuote
 ^quote</body>

<body package="(none)">setQuote: aQuote
 quote := aQuote.</body>
</methods>
<new-page/>


<class>
<name>Product</name>
<environment>VisualWave</environment>
<super>Core.Object</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>category description number name </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>ZZZ</category>
<attributes>
<package>(none)</package>
</attributes>
</class>

<!-- -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -   -->


<methods>
<class-id>VisualWave.Product class</class-id> <category>class initialiation</category>

<body package="(none)">new
 ^super new</body>
</methods>

<!-- -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -   -->


<methods>
<class-id>VisualWave.Product</class-id> <category>accessing</category>

<body package="(none)">category
 ^category</body>

<body package="(none)">category: aCategory
 category := aCategory</body>

<body package="(none)">description
 ^description</body>

<body package="(none)">description: aDescription
 description := aDescription.</body>

<body package="(none)">name
 ^name</body>

<body package="(none)">name: aName
 name := aName.</body>

<body package="(none)">number
 ^number</body>

<body package="(none)">number: aNumber
 number := aNumber.</body>

<body package="(none)">number: aNumber category: aCategory name: aName description: aDescription

	self number: aNumber.
    self category: aCategory.
    self name: aName.
    self description: aDescription.</body>
</methods>

<methods>
<class-id>VisualWave.Product</class-id> <category>printing</category>

<body package="(none)">printOn: aStream
 aStream nextPutAll: (number, ';', name).</body>
</methods>















</st-source>

