package provide xotcl::actiweb::pageTemplate 0.8 package require xotcl::actiweb::webObject package require xotcl::actiweb::invoker package require xotcl::mixinStrategy package require XOTcl namespace eval ::xotcl::actiweb::pageTemplate { namespace import ::xotcl::* Class PageTemplate -superclass WebObject PageTemplate instproc init args { next my mixinStrategy ::Send=TypedString } PageTemplate abstract instproc listExportedProcs args PageTemplate abstract instproc simplePage args Class PageTemplateHtml -superclass PageTemplate PageTemplateHtml instproc init args { my contentType text/html next } PageTemplateHtml instproc listExportedProcs args { # # place must be a Html place! # set place [HtmlPlace getInstance] set c " The following options are avaiable on $n: " foreach i [my exportedProcs] { set href [my selfAction "[self] $i"] set app {

$i } append c [subst -nobackslashes $app] } return [my simplePage $place [self] $c] } PageTemplateHtml instproc simplePage {title heading content {closing ""}} { set place [Place getInstance] set c { $title

$heading


$content

$closing


} return [subst -nobackslashes -nocommands $c] } # # builds a simple Form -- args are tupels of the form # {text, name, type, default, size} # # PageTemplateHtml instproc simpleForm {action args} { set action [my selfAction $action] set c {

} foreach {text name type def size} $args { append c " " } append c {
$text:
} return [subst -nobackslashes -nocommands $c] } namespace export PageTemplate PageTemplateHtml } namespace import ::xotcl::actiweb::pageTemplate::*