Tonight I coded up a very basic "Active Page" framework. It really does
nothing more than let you embed Smalltalk statements in your HTML in <?
?> tags, but it's pretty powerful as it stands. Not bad for 12 methods
(only a few of which do any really significant work).
I've attached a sample SAP and a sites.cnf for playing with this. Essentially,
the SAP itself is used to generate a method on an instance of SwazooActivePage.
SwazooActivePages are instantiated anew for each Request.
There are a couple of issues that I'd like to open for discussion:
Portability
This depends on the Compiler, whose invocation is undoubtedly platform-dependent.
Should we build a platform-specific SwazooCompiler, or should we just plan
on tweaking this method in each dialect?
Version Numbering
It seems that people want a x.y.z version scheme, which is fine by me. For
what I'm doing, the version number in StORE is enough, but I'd be glad to
accomodate a different scheme. So should I have rolled the revision (HTTPServer
class>>version) to 0.50.1?
Comments are appreciated, fire away...
Ken
Test of Active Pages
1 to: 200 do: [:i | ?>
ws print: i. ?> |
]. ?>
<Site>
<SiteIdentifier ip: '192.168.1.254' port: 8081 host: 'message'>
<Swazoo.SwazooActivePageResource stringUriPattern: '/' filePath: 'Sites/test/' directoryIndex: 'index.sap'>
</Site>