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

james strachan commented on FELIX-4378:
---------------------------------------

Aha - adding a description on the @Component is the magic to make it generate 
the .properties file - many thanks ;). If this is omited then no properties 
file is created which seems a little counter-intuitive. It seems like 
something's a little wonky in there somewhere. 

I agree it'd be really nice if it checked if the properties file existed. Am 
happy to have some kinda flag that says always generate a properties file or 
something if its looking a bit complex to preserve backwards compatibility and 
add this new behaviour?

Just by adding the @Component(description) field I get this...
{code}
<?xml version="1.0" encoding="UTF-8"?><metatype:MetaData 
xmlns:metatype="http://www.osgi.org/xmlns/metatype/v1.0.0"; 
localization="OSGI-INF/metatype/io.fabric8.camel.autotest.CamelAutoTestService">
    <OCD id="io.fabric8.camel.autotest" 
name="%io.fabric8.camel.autotest.CamelAutoTestService.name" 
description="%io.fabric8.camel.autotest.CamelAutoTestService.description">
        <AD id="mockOutputs" type="Boolean" default="true" 
name="%io.fabric8.camel.autotest.CamelAutoTestService.mockOutputs.name" 
description="%io.fabric8.camel.autotest.CamelAutoTestService.mockOutputs.description"/>
        <AD id="mockInputs" type="Boolean" default="true" 
name="%io.fabric8.camel.autotest.CamelAutoTestService.mockInputs.name" 
description="%io.fabric8.camel.autotest.CamelAutoTestService.mockInputs.description"/>
        <AD id="messageFolder" type="String" default="testMessages" 
name="%io.fabric8.camel.autotest.CamelAutoTestService.messageFolder.name" 
description="%io.fabric8.camel.autotest.CamelAutoTestService.messageFolder.description"/>
    </OCD>
    <Designate pid="io.fabric8.camel.autotest">
        <Object ocdref="io.fabric8.camel.autotest"/>
    </Designate>
</metatype:MetaData>
{code}
and a nice properties file too
{code}
#Wed Jan 15 17:56:14 GMT 2014
io.fabric8.camel.autotest.CamelAutoTestService.mockOutputs.name=Mock output 
endpoints
io.fabric8.camel.autotest.CamelAutoTestService.description=Enabling this 
service will automatically send any sample test messages stored in the wiki for 
the CamelContext ID and route ID to the routes whenever the route is restarted 
(such as if you edit the route or change its source, configuration or code).
io.fabric8.camel.autotest.CamelAutoTestService.mockInputs.name=Mock input 
endpoints
io.fabric8.camel.autotest.CamelAutoTestService.messageFolder.description=The 
folder path in the wiki to store sample input messages
io.fabric8.camel.autotest.CamelAutoTestService.mockOutputs.description=If 
enabled then the output endpoints are replaced with mock endpoints for easier 
testing/viewing and the underlying middleware isn't used.
io.fabric8.camel.autotest.CamelAutoTestService.mockInputs.description=If 
enabled then the input endpoints on tested camel routes are stubbed out so the 
underlying middleware isn't used.
io.fabric8.camel.autotest.CamelAutoTestService.messageFolder.name=Test message 
folder
io.fabric8.camel.autotest.CamelAutoTestService.name=Fabric8 Camel Auto Test 
Service
{code}

many thanks for all your help!


 

> generate a metatype.properties file if label/description values are used on 
> @Component or @Property which don't start with %
> ----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: FELIX-4378
>                 URL: https://issues.apache.org/jira/browse/FELIX-4378
>             Project: Felix
>          Issue Type: Improvement
>          Components: Maven SCR Plugin
>            Reporter: james strachan
>            Assignee: Carsten Ziegeler
>             Fix For: maven-scr-plugin 1.15.0
>
>
> I tried using 1.15.0 of the plugin and added some textual string values 
> (which don't start with %) for label/description on @Component and @Property 
> and they get generated into the metatype.xml file as text strings.
> I was hoping the XML would use "%foo.label" and "%foo.description" then 
> generate a metatype.properties with the mapping of foo.label = "My Label" so 
> that folks can add extra languages by just adding a new metatype file?



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to