You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "John Ross (JIRA)" <ji...@apache.org> on 2011/03/24 16:18:05 UTC

[jira] [Commented] (FELIX-1865) Metatype resolving mechanism does not seem to work correctly

    [ https://issues.apache.org/jira/browse/FELIX-1865?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13010698#comment-13010698 ] 

John Ross commented on FELIX-1865:
----------------------------------

I encountered this same issue with version 3.1.8. It occurs when the <OCD> 'id' and <Object> 'ocdref' attributes do not equal the <Designate> 'pid' and, if present, 'factoryPid' attributes. The only apparent way to avoid it is to make sure all attributes have the same value.

<OCD id="ocd"/>
<Designate pid="designate" factoryPid="designate">
     <Object ocdref="ocd"/>
</Designate>

The above XML incorrectly results in two entries appearing on the console. One entry shows a Factory PID of 'designate'. The other shows a Factory PID of 'ocd'. It almost seems like the code is calling MetaTypeProvider.getObjectClassDefinition() using ObjectClassDefinition.getID(). If so, this would result in a null OCD being returned, which I believe explains why the entry associated with the 'ocd' Factory PID has only a text area requiring the user to enter name/value pairs instead of listing the attributes. The only valid id arguments for getObjectClassDefinition() are those returned by MetaTypeInformation.getPids() (i.e. the pids of all Designates, associated with an OCD, that did not also declare factoryPids) and getFactoryPids() (i.e. the factoryPids of all Designates associated with an OCD).

<OCD id="designate"/>
<Designate pid="designate" factoryPid="designate">
     <Object ocdref="designate"/>
</Designate>

The above XML correctly results in one entry appearing on the console showing a Factory PID of 'designate'.

This is an issue because it effectively limits the use of an OCD to a single Designate, but the intent is for multiple Designates to be able to reference the same OCD.

Note the same behavior results when using either the Equinox or Felix Metatype implementation. Also, this does not appear to be fatal. Configurations can apparently be created, updated, or deleted without issue. It's just a confusing display.

> Metatype resolving mechanism does not seem to work correctly
> ------------------------------------------------------------
>
>                 Key: FELIX-1865
>                 URL: https://issues.apache.org/jira/browse/FELIX-1865
>             Project: Felix
>          Issue Type: Bug
>          Components: Web Console
>    Affects Versions: webconsole-2.0.2
>         Environment: equinox 3.5.1 (release; cm, metatype from the same release)
>            Reporter: Dieter Wimberger
>
> The implementation of the metatype mechanism in the web-console 2.0.2  causes configurations to be listed with the Designate pid and the Object ocdref. 
> i.e.
> <Designate pid="com.acme.addressbook">
>    <Object ocdref="2.5.6.6"/>
> </Designate> 
> Would list "com.acme.addressbook" and "2.5.6.6" where the latter is actually broken and won't load the corresponding form.
> This problem does not occur with the identical installation and a web-console 1.2.10 release bundle.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira