[aida] WebStye (was stupid question)

Janko Mivšek janko.mivsek at eranova.si
Tue Oct 16 23:28:06 CEST 2007

nicolas petton wrote:

>> Well, this redirection is strange on first sight for every Smalltalker 
>> too, but with a bit of explanation you can understand the reason behind: 
>>   a support for another separation between content and style - between 
>> HTML and CSS. CSS support (and style support in general, like "framing" 
>> of page with above mentioned method) is therefore delegated to WebStyle 
>> and its subclasses.
> So, what is the best way to style a site ? Subclassing WebStyle, and
> surcharging #pageFrameWith:title: and some other methods, or create a
> new class from scratch (since WebStyle directly inherit from Object, and
> this class has a lot of methods I may not want) ?

Subclassing WebStyle and overriding existing methods while reusing 
WebStyle ones (like images) is the best way. Just ignore methods you 
don't want or in case of css* methods override them with empty ones to 
nil them. This is a bit clumsy, I know, I'm working on a solution...

>> Another neat feature is that you can change styles on runtime, simply by 
>> changing style in AIDASite.
>> Third reason: that way you can host a same application to many customers 
>> at once, with different style for each. That way you can simply 
>> customize you app to customer wishes, but still run all of them from the 
>> same image.
>> But WebStyle don't hold only CSS, but also images and JS code. Images 
>> are stored in methods (so called method images).

> Is there a simple way to upload images into method images ?

Yes, see some method image how it was created, for instance


	"'imgs/dars-arrow2.gif' asFilename contentsAsMethod"

This code in comment was inspected and result copied in a body of that 
method image. This is how it is done on VisualWorks, On Squeak you have 
String contentsAsMethod, which you can use similarly.

>>  The same goes with 
>> JavaScript code. This is similar to WAFileLibrary in Seaside.
>> And I'm extending WebStyle to support Joomla templates ...
> Very good :) !

>>>> -----Oorspronkelijk bericht-----
>>>> Van: aida-bounces na aidaweb.si [mailto:aida-bounces na aidaweb.si] Namens nicolas petton
>>>> Verzonden: dinsdag 16 oktober 2007 19:53
>>>> Aan: AIDA/Web general discussion list
>>>> Onderwerp: Re: [aida] Stupid question
>>>> Le mardi 16 octobre 2007 à 15:10 +0200, Janko Mivšek a écrit :
>>>>> Hi Nicolas,
>>>> Hi Janko
>>>>> nicolas petton wrote:
>>>>>> I've got a stupid question... where is the code of aidademo site ?
>>>>>> Sorry, I cannot find it.
>>>>> Do you mean a code, which run what is shown  when you start a demo site?
>>>> Yes
>>>>> First page is from WebDiscussions/WebDiscussionsApp (in Aida-Parts), 
>>>>> then there is WebDemoApp for demos, in same category, and WebAdminApp 
>>>>> from Aida-Admin.
>>>> Thanks, I saw it, but I mean the main part of the site (ie the header, the sidebar on the left, stylesheet, etc). Does it make part of the demo ?
>>>> I'm asking this because in the tutorial the new site is in fact a part of the demo (even if I write "self add: e", the css is still there).
>>>>> For "blast from the past" you can also look at WebSecurityManagerApp 
>>>>> with a really old code, back to 1996 :)

Janko Mivšek
Smalltalk Web Application Server

More information about the Aida mailing list