[aida] domain to App mapping (was Another question...(about WebUser)

Janko Mivšek janko.mivsek at eranova.si
Fri Oct 26 14:18:11 CEST 2007


nicolas petton a écrit :
> Le vendredi 26 octobre 2007 à 13:44 +0200, Janko Mivšek a écrit :
>   
>> Hi Nicolas,
>>
>> nicolas petton a écrit :
>>     
>>>>> I want to add a new variable to WebUser. I added this : 
>>>>>
>>>>> WebUser>>website
>>>>> 	^self otherValuesAt: 'website' ifAbsent: [self otherValuesAt: 'website'
>>>>> put: ''] 
>>>>>
>>>>> WebUser>>website: aString
>>>>> 	self otherValuesAt: 'website' put: aString 
>>>>>
>>>>> in a custom category, so no problem.
>>>>>
>>>>> But what about views ? I would like to display the new feild in views
>>>>> (WebAdminApp>>viewRegistration and
>>>>> WebSecurityManagerApp>>userElementForm:).
>>>>>
>>>>> My first idea was to subclass this apps, and override MyWebSite>>admin
>>>>> and MyWebSite>>securityManager.
>>>>>
>>>>> But if I do it, I need to create empty subclasses of WebAdmin and
>>>>> WebSecurityManager too, and I really don't like it. Is there another way
>>>>> to do it without creating those empty subclasses ?
>>>>>   
>>>>>       
>>>>>           
>>>> You are right, better avoid subclassing and rather use extensions. So on 
>>>> Squeak, if you have a package MyPackage, add method category *MyPackage 
>>>> in class WebUser and that's it! You don't need change any other classes 
>>>> in that case, specially not WebSecurityManager etc.
>>>>     
>>>>         
>>> But if I don't suclass, there will be no field for website (in the
>>> registration form, and update form), right ? I didn't see the code for
>>> this in WebSecurityManagerApp>>userElementForm: or
>>> WebAdminApp>>viewRegistration
>>>   
>>>       
>> Then override those methods too with your own ones in your package and 
>> you'll have the same result but without subclasing.
>>     
>
> Thank you Janko for your answers.
> But if I do it, there will be another problem: this will be applied to
> all AIDASites.
>
> I have another idea, but I don't know how to do. I would like to
> subclass WebSecurityManagerApp but without subclassing
> WebSecurityManager. But is there a way to set a custom app to an object
> (an app with a different name)? Something like:
> UrlResolver defaultUrl: '/admin.html' forObject: admin app: MyAdminApp
>
>   
That's interesting idea and also a problem which needs to be solved 
somehow. To solve most generally I would start with some object to App 
map and add it to AIDASite, maybe in settings. Then I'd just extend 
method Object>>webApp to look in this map too. What do you think?

Janko


More information about the Aida mailing list