Hello everyone,

I've come to realize that while metatype is a brilliant spec, it has a
couple of shortcomings.

1) when the number of OCDs is large it becomes very difficult to organize
them into a UI logically. This is due to the lack of any classification
mechanism which could help in filtering.

2) there is no way to produce a foreign-key like field on which you could
filter for an exact instance. This field would be readOnly after creation
of a configuration. With such a foreign-key field one could easily lookup
specific instances produced from a factory.

3) no UI can accurately know how a field should be presented in the UI.
This is particularly true for string fields. There are many ways to present
a text field in the UI and currently it's impossible to even guess and so
everything is represented in a single way.

I propose adding a "hints" namespace (which would be a felix schema) in
which we could extend the metatype XML providing "hints" particularly to UI
implementations of how a specific OCD should be rendered.

These "hints" would be just that, they would not be enforced by the
metatype or by config admin at all. Simply they would guide the UI on the
presentation alone. Therefore no changes would be required in the
underlying logic of either implementations.

However, a metatype implementation change would be required but ONLY for
access to said new "hints" information. This would require:

1) reading the extra schema info while parsing the metatype xml
2) providing API access to the information

Implementing
1) is simple, just need to enhance the parser with the fields we decide
2) I was thinking of something like the following:

org.osgi.service.metatype.ObjectClassDefinition ocd = ...
org.apache.felix.metatype.ObjectClassDefinitionExt ocdExt =
(org.apache.felix.metatype.ObjectClassDefinitionExt)ocd;
org.apache.felix.metatype.OCDHints hints = ecdExt.getHints();

AND

org.osgi.service.metatype.AttributeDefinition ad = ...
org.apache.felix.metatype.AttributeDefinitionExt adExt = (
org.apache.felix.metatype.AttributeDefinitionExt)ad;
org.apache.felix.metatype.ADHints hints = adExt.getHints();

The hints objects would contain the UI hints we specify.

-- 
*Raymond Augé* <http://www.liferay.com/web/raymond.auge/profile>
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* <http://www.liferay.com>
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance <http://osgi.org> (@OSGiAlliance)

Reply via email to