I also think the metatype support could be improved.

What I observed is that I often have to repeat the same defaults in the metatype xml and in blueprint.

The reason to have the default values in metatype is to have them for e.g. webconsole. The reason to have the default values in blueprint in the default-properties tag is to make sure my application works when no config is present.

I have added some snippets below to show how it looks like.

I wonder if we could add some more metatype features to the default-properties tag and then use this meta data to create metatype informations like Dirk suggested. So for example we could add attributes for required and type.

Christian




---
Config in metatype:

 <?xml version="1.0"  encoding="UTF-8"?>
<MetaData xmlns="http://www.osgi.org/xmlns/metadata/v1.0.0";
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
     xsi:schemaLocation="
         http://www.osgi.org/xmlns/metadata/v1.0.0 
http://www.osgi.org/xmlns/metatype/v1.1.0/metatype.xsd
     ">
     <OCD description="Configured Example Application"  name="ConfigApp"  
id="ConfigApp">
         <AD name="Title"  id="title"  required="true"  type="String"  default="Default 
Title"  description="Titlefor  the Application"/>
     </OCD>
     <Designate pid="ConfigApp">
         <Object  ocdref="ConfigApp"/>
     </Designate>
</MetaData>



Config in blueprint:

<cm:property-placeholder persistent-id="ConfigApp"  update-strategy="reload"  >
<cm:default-properties>
<cm:property name="title"  value="Default Title"/>
</cm:default-properties>
</cm:property-placeholder>



On 14.05.2013 10:54, Rudolph, Dirk wrote:

Hi all,

currently we are migrating one of our projects from SCR to blueprint using Apache Aries. We defined our services using XML files and want to provide a proper configuration for them using Apache Felix Web Console. According to the OSGI specs we have to write MetaType information for that, what it is a little bit dirty in my eyes. Would it be possible to combine MetaType information and Blueprint definition?

In my eyes the following possibilities would be nice to have:

1.Having a namespace that allows the user to add MetaType information to the blueprint definition XML files. This information could then be published using a MetaTypeProvider.

2.Adding the MetaType information to the Blueprint Annotation API and also publishing them using a MetaTypeProvider

Additionally I had a look at the Blueprint Annotation implementation and mentioned that the Blueprint model is generated during runtime. Wouldn't it be better to generate the model during build (e.g using a maven plugin similar to Apache Felix SCR Plugin)?

Thanks a lot,

*Dirk Rudolph *


T-Systems Multimedia Solutions GmbH
Organisationseinheit CCS
Dirk Rudolph
Software-Entwicklung, OCJP

Hausanschrift: Riesaer Straße 5, 01129 Dresden
Postanschrift: Postfach 10 02 24, 01072 Dresden
+49 351 2820-5363       (Tel)
E-Mail:[email protected] <mailto:[email protected]>
Internet: http://www.t-systems-mms.com <http://www.t-systems-mms.de/>

T-Systems Multimedia Solutions GmbH

Aufsichtsrat: Klaus Werner (Vorsitzender)
Geschäftsführung: Peter Klingenburg, Dr. Jens Nebendahl
Handelsregister: Amtsgericht Dresden HRB 11433
Sitz der Gesellschaft: Dresden
Ust-IdNr.: DE 811 807 949



--
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
http://www.talend.com

Reply via email to