Oliver Heger schrieb:
Emmanuel Bourg schrieb:
I'm trying to write a PreferencesConfiguration and I'm facing some
issues with the NodeHandler interface. NodeHandler assumes the
existence of container nodes and value nodes. However this is not true
for a Preferences tree, the only node available is a container node
(the Preferences object), a value is only fetched relatively to a
container.
That means PreferencesConfiguration can't be implemented without
creating a custom node structure encapsulating the containers and the
values.
I don't know how to make NodeHandler universal, maybe it should make
an explicit distinction between container nodes and single values
instead of assuming that nodes always serve both purposes.
Emmanuel Bourg
When creating the NodeHandler interface I had a look at the Preferences
class. My idea was to map the values stored in the Preferences to
attributes. So no value nodes would exist, but only attributes for
storing data.
If a properly initialized ExpressionEngine is used, attribute keys can
look the same as node keys, so when querying such a configuration a user
will see no difference.
However when adding new properties it may be necessary to distinguish
between nodes and attributes. I will have a look.
Oliver
I have added a new method to the NodeHandler interface for
distinguishing between the node types.
Based on these changes I have created an initial implementation of
PreferencesConfiguration. This is only a first draft, and there is
certainly room for improvements, e.g. support for sync() operations or
an auto flush mechanism. I would also like to do some more testing and
improve the documentation.
Oliver
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]