[Seaside] Template support in Seaside 2.5

Alain Fischer alain.fischer at bluewin.ch
Tue Jun 21 22:42:30 CEST 2005


Hi Adnan,

For the first issue, I doesn't got a dependency warning.
Here is how I setup my image:
- downloaded prebuild image from Avi 
(http://beta4.com/seaside2/Seaside-2.5.zip)
- used SqueakMap Package Loader to install SmaCC Smalltalk 
Compiler-Compiler-Runtime version: 4
- opened a repository on the disk space containing 
SeasideTemplate-AFi.1.mcz
- loaded this package in the image.

For the second issue here is a fix:

STTTemplate>>compileIn: aClass

	| methodNode |
	methodNode _ Compiler new
		compile: self asSmalltalkMethod
		in: aClass
		notifying: nil
		ifFail: [^ nil].
	aClass
		addSelector: methodNode selector
		withMethod: (methodNode generate: #(0 0 0 0)).
	aClass organization
		classify: methodNode selector
		under: 'generated'.
	"aClass compileProgrammatically: self asSmalltalkMethod classified: 
'generated'"
	"| node method |
	node := Compiler new
		compile: self asSmalltalkMethod
		in: aClass
		notifying: nil
		ifFail: [self error: 'Syntax Error'].
	method := node generate: #(0 0 0 0).
	aClass addSelector: node selector withMethod: method."


and it should work.

If you try to run STTTest in Test Runner, you will notice:
'13 run, 12 passes, 0 expected failures, 0 failures, 1 errors, 0 
unexpected passes'


Alain


Le 21 juin 05, à 15:42, Adnan Zaman a écrit :

> Hi Alain,
>
> Thanks for the information.
>
> I just installed it in 2.5 and tried to play with it
> but ran into few issues:
>
> - During the installation of the package, I got a
> dependency warning about package RBAbstract Class but
> I still proceeded. I then tried to locate this
> dependent package but was unable to find it.
>
> - I then created a subclass of SSTComponent with an
> instance method of templateString in it:
> templateString
> ^'<H1>Hello World</H1>'
>
> But if I run it via WAKom, I get the following error
> log (only first few lines.....):
>
> String(Object)>>doesNotUnderstand: #string
> self 'renderTemplateOn: html html text:
> ''<H1>Hello</H1>''.'
> temps
> aMessage string
>
> Parser>>removeUnusedTemps
> self a Parser
> temps
> str nil
> end nil
> start nil
> madeChanges false
> temp nil
> inst vars
> source a ReadStream 'renderTemplateOn: html html text:
> ''<H1>Hello</H1>''.'
> mark 51
> hereChar $

> aheadChar $

> token #

> tokenType #doIt
> currentComment nil
> buffer a WriteStream '<H1>Hello</H1>'
> typeTable #(#xBinary #xBinary #xBinary #xBinary
> #xBinary #xBinary #xBinary #xBinary #xDelimiter
> #xDelimiter #x...etc...
> here #

> hereType #doIt
> hereMark 51
> hereEnd 52
> prevMark 51
> prevEnd 52
> encoder {an Encoder}
> requestor a SSTTemplate
> parseNode {[html text: '<H1>Hello</H1>']}
> failBlock [] in Compiler>>translate:noPattern:ifFail:
> {[^ failBlock value]}
> requestorOffset 0
> tempsMark 25
> doitFlag false
> .........
>
> Could you tell me what am I doing wrong here and how
> can I correct it?
>
> Thanks,
> Adnan
>
>>> Message: 7
>>> Date: Mon, 20 Jun 2005 21:04:55 +0200
>>> From: Alain Fischer <alain.fischer at bluewin.ch>
>>> Subject: Re: [Seaside] Template support in Seaside
>>> 2.5
>>> To: "The Squeak Enterprise Aubergines Server -
>>> general discussion."
>>> 	<seaside at lists.squeakfoundation.org>
>>> Message-ID:
>>> <e6ab4ea87133c268d2b272c9fd0e8665 at bluewin.ch>
>>> Content-Type: text/plain; charset=ISO-8859-1;
>>> format=flowed
>>>
>>> Hi Adnan,
>>>
>>> A long time ago, I have implemented and used a
>>> template system for
>>> Seaside.
>>> I have implemented this because the page where done
>>> by a graphic
>>> designer
>>> and it was easier to integrate smalltalk in html
>>> pages than
>>> to translate html pages in smalltalk.
>>>
>>> If there is interest, I could update it for Seside
>>> 2.5.
>>>
>>> Alain
>
>
>
> 		
> __________________________________
> Yahoo! Mail Mobile
> Take Yahoo! Mail with you! Check email on your mobile phone.
> http://mobile.yahoo.com/learn/mail
> _______________________________________________
> Seaside mailing list
> Seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/listinfo/seaside
>



More information about the Seaside mailing list