defaults
- From: Douglas Hubler <dhubler (at) pingtel.com>
- Date: Thu, 26 Jan 2006 11:19:28 -0500
Hannu Strang wrote:
To have system and group wide settings for timezone etc. I'm thinking (and
trying out) something like this:
- a new phone model "Generic phone settings" which is editable at Phone
Models page but the model can't be used for adding a new phone (opposite of
unknown phone)
- that model is loaded with every real phone model to get access to the
settings but hidden from the real phones edit screens
- those settings are used to generate device specific default settings
instead of current timezone and addmappings (needs device specific code)
- server timezone and the values now used for addmapping are used as
defaults for the generic phone settings only
- to have system wide default values, a default phone group which can't be
removed and which is loaded to every phone before any other groups (without
having to add the phones to the group separately)
That would give shared generic settings for all phones supporting the group
structure and without any new user interfaces.
This is a very good idea. One recommendation, because the setttings
we'd want to capture would be known and fixed at least for each version,
we might be better off with real Class instead of a SettingModel
Example:
class PhoneDefaults {
Calendar getTimeZone() {
}
}
rather than:
phone_defaults.xml
----------------------
<setting name="timezone">
<type></type> /
</setting>
Advantages:
1. )We can contruct a much richer UI to edit PhoneDefaults than the
settings file values
2.) Phone models would have more maintainable and flexible code
Class PhoneXyx extends Phone {
setPhoneDefaults(Settings s, PhoneDefaults defaults) {
String myTimezone = defaults.getTimeZone().getZone();
getSetting("my-timezone").setValue(myTimeZone);
}
rather than
Class PhoneXyx extends Phone {
setPhoneDefaults(Settings s, Setting defaults) {
String myTimezone = defaults.getSetting(DEFAULTS_TIMEZONE);
getSetting("my-timezone").setValue(myTimeZone);
}
There is already a class called PhoneDefaults which kinda already does
this, but it's values are pulled from system config file and can be
pulled from database instead to support what you'd like to do.
I can get you setup getting PhoneDefaults to/from database if you want
and this looks like a good idea.
_______________________________________________
sipx-dev mailing list
sipx-dev (at) list.sipfoundry.org
List Archive: http://list.sipfoundry.org/archive/sipx-dev
- Follow-Ups:
- defaults
- From: Damian Krzeminski <damian (at) pingtel.com>