[Seaside] Accessing configuration values from the configuration
William E Harford
seaside at harford.org
Fri Jul 22 04:23:05 CEST 2005
That was my first idea but the idea of changing the base Seaside classes
turned me off. I think changing the seaside code base for a custom site
specific purpose is bad practice.
Plus I also think it will be easier and clearer to do it by writing my
own configuration class and not modifying the Seaside code.
Thanks for your suggestion.
On Thu, 2005-07-21 at 19:42 -0400, David Shaffer wrote:
> > William E Harford wrote:
> >> If there any way to access a site's user inputted configuration
> >> values from a subclass of WASystemConfiguration ?
> >> What I am trying to do is present the site administrator with a
> >> series of questions in the config biased on answers that were given
> >> in the config.
> >> For example
> >> In this application there might be 3 components. The administrator
> >> would put the number 3 for a config value than save the config.
> >> The config might than ask for the 3 component classes and there names.
> >> I have only been able to retrieve the default values for a
> >> SystemConfiguration using.
> >> self localConfiguration valueAt: #numberOfContainers.
> >> I have to admit even though I have read a couple notes on seasides
> >> config component I still don't fully understand how it works.
> One way you could accomplish your goal (probably not the only one but
> the one that I'd try first) is by introducing a new configuration
> parameter "type" and then building an editor for it. A simple example
> can be found in:
> Look at the implementation of SCColorAttribute (actually, the examples
> of attributes in the image are simpler). Note that it requires you to
> _add_ a method to WAConfigurationEditor. That class has an i-var
> "configuration" which is the "local configuration" object. You can get
> the value of a configuration parameter via "configuration valueAt:
> #numberOfContainers" and render your editor appropriately. I have to
> admit that adding a method to a Seaside system class seems awkward. The
> alternative is either to build the rendering method into your attribute
> class or build a separate class to render the editor for the attribute
> (this second option would be difficult since the lifetime of the
> attribute editor should be tied to the WAEditConfigurationDialog but
> there is really no clear way to do that). Hopefully the document above
> will clarify things slightly.
> Seaside mailing list
> Seaside at lists.squeakfoundation.org
More information about the Seaside