--- a/CodeGeneratorTool.st Thu Jul 01 10:54:52 2010 +0200
+++ b/CodeGeneratorTool.st Sat Jul 03 10:49:08 2010 +0200
@@ -1851,6 +1851,26 @@
It will be invoked for every incoming webBrowser-request.
The argument, aRequest contains the parameters (url, fields, parameters etc.)."
+ (aRequest pathRelativeToService = ''hello'') ifTrue:[
+ ^ self process_hello:aRequest
+ ].
+ (aRequest pathRelativeToService = ''hello2'') ifTrue:[
+ ^ self process_hello2:aRequest
+ ].
+
+ aRequest reportNotFound:''URL must be <service>/hello or <service>/hello2''
+'.
+ self
+ compile:txt
+ forClass:nonMetaClass
+ inCategory:'response generation'.
+ ].
+
+ (nonMetaClass includesSelector:#process_hello:) ifFalse:[
+ txt :=
+'process_hello:aRequest
+ "a sample render method - this is the lowest possible level: simply returning a bunch of lines"
+
|response|
response := aRequest response.
@@ -1869,6 +1889,28 @@
inCategory:'response generation'.
].
+ (nonMetaClass includesSelector:#process_hello2:) ifFalse:[
+ txt :=
+'process_hello2:aRequest
+ "a slightly more structured render method - uses a tree builder to ensure correct html"
+
+ |builder|
+
+ builder := HTML::TreeBuilder new.
+
+ builder
+ body;
+ h1:''Hello World2'';
+ bodyEnd.
+
+ aRequest response nextPutAll:(builder htmlString).
+'.
+ self
+ compile:txt
+ forClass:nonMetaClass
+ inCategory:'response generation'.
+ ].
+
(metaClass includesSelector:#linkName) ifFalse:[
txt :=
'linkName
@@ -1898,7 +1940,7 @@
self executeCollectedChangesNamed:('Add WebService Code for ' , className).
- "Modified: / 1.2.1998 / 16:10:03 / cg"
+ "Modified: / 03-07-2010 / 10:48:39 / cg"
!
createWidgetCodeFor:aClass
@@ -3167,9 +3209,9 @@
!CodeGeneratorTool class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libtool/CodeGeneratorTool.st,v 1.85 2010-05-07 12:22:15 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libtool/CodeGeneratorTool.st,v 1.86 2010-07-03 08:49:08 cg Exp $'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libtool/CodeGeneratorTool.st,v 1.85 2010-05-07 12:22:15 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libtool/CodeGeneratorTool.st,v 1.86 2010-07-03 08:49:08 cg Exp $'
! !