You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@sling.apache.org by Alessandro Novarini <a....@sourcesense.com> on 2011/06/08 16:40:57 UTC

Configuration doesn't show in WebConsole

Hello everybody,

Just like the Jackrabbit Server Bundle does, I'm creating a configuration in my activator, and then recalling it in my bundle.
Everything seems working almost fine, because the activator stores the default configuration only the first time, and the bundle loads it correctly.

What I can't do is to display the configuration in the web console, under the "Configuration" tab, so that I can change the default configuration.
Is this anything that normally should happen automatically once you save the configuration with the admin configuration service?

What's the trick, if there's any?

Thanks in advance
Ale

-- 
Alessandro Novarini
a-dot-novarini-at-sourcesense-dot-com




Re: Configuration doesn't show in WebConsole

Posted by Alessandro Novarini <a....@sourcesense.com>.
Hi James,

You got it! Setting metatype=true worked as expected.

Thank you very much
Ale

On Jun 8, 2011, at 5:30 PM, James Stansell wrote:

> Hi Ale,
> 
> The default metatype value changed from true to false between javadoc and
> annotation.
> 
> Try @Component(metatype="true" ...) ?
> 
> Regards,
> 
> -james.
> 
> On Wed, Jun 8, 2011 at 10:03 AM, Alessandro Novarini <
> a.novarini@sourcesense.com> wrote:
> 
>> Hello again,
>> 
>> I've just done another test, reverting the only major change I did:
>> replacing the felix scr javadoc with the felix annotation.
>> Just to be sure I'm reading again the documentation here:
>> http://felix.apache.org/site/scr-annotations.html
>> 
>> But can you confirm that the following bits of code are equivalent, please?
>> 
>> /**
>> * scr.component label="MY_FOO" description="MY_BAR"
>> *          name="spikes.MyComponent"
>> *          configurationFactory="true" policy="require"
>> *
>> * scr.property name="service.vendor" value="Me"
>> * scr.property name="service.description"
>> *      value="Factory for MyComponent"
>> */
>> 
>> @Component(label = "MY_FOO", description = "MY_BAR", name =
>> "spikes.MyComponent", configurationFactory = true, policy =
>> ConfigurationPolicy.REQUIRE)
>> @Properties({
>>               @Property(name = "service.vendor", value = "Sourcesense"),
>>               @Property(name = "service.description", value = "Factory for
>> MyComponent") })
>> 
>> Because in the latter one, the configuration isn't displayed in the web
>> console.
>> Or I'm still missing something?
>> 
>> Thanks again
>> Ale
>> 
>> 

-- 
Alessandro Novarini
a-dot-novarini-at-sourcesense-dot-com




Re: Configuration doesn't show in WebConsole

Posted by James Stansell <js...@gmail.com>.
Hi Ale,

The default metatype value changed from true to false between javadoc and
annotation.

Try @Component(metatype="true" ...) ?

Regards,

-james.

On Wed, Jun 8, 2011 at 10:03 AM, Alessandro Novarini <
a.novarini@sourcesense.com> wrote:

> Hello again,
>
> I've just done another test, reverting the only major change I did:
> replacing the felix scr javadoc with the felix annotation.
> Just to be sure I'm reading again the documentation here:
> http://felix.apache.org/site/scr-annotations.html
>
> But can you confirm that the following bits of code are equivalent, please?
>
> /**
>  * scr.component label="MY_FOO" description="MY_BAR"
>  *          name="spikes.MyComponent"
>  *          configurationFactory="true" policy="require"
>  *
>  * scr.property name="service.vendor" value="Me"
>  * scr.property name="service.description"
>  *      value="Factory for MyComponent"
>  */
>
> @Component(label = "MY_FOO", description = "MY_BAR", name =
> "spikes.MyComponent", configurationFactory = true, policy =
> ConfigurationPolicy.REQUIRE)
> @Properties({
>                @Property(name = "service.vendor", value = "Sourcesense"),
>                @Property(name = "service.description", value = "Factory for
> MyComponent") })
>
> Because in the latter one, the configuration isn't displayed in the web
> console.
> Or I'm still missing something?
>
> Thanks again
> Ale
>
>

Re: Configuration doesn't show in WebConsole

Posted by Alessandro Novarini <a....@sourcesense.com>.
Hello again,

I've just done another test, reverting the only major change I did: replacing the felix scr javadoc with the felix annotation.
Just to be sure I'm reading again the documentation here:
http://felix.apache.org/site/scr-annotations.html

But can you confirm that the following bits of code are equivalent, please?

/**
 * scr.component label="MY_FOO" description="MY_BAR"
 *          name="spikes.MyComponent"
 *          configurationFactory="true" policy="require"
 *
 * scr.property name="service.vendor" value="Me"
 * scr.property name="service.description"
 *      value="Factory for MyComponent"
 */

@Component(label = "MY_FOO", description = "MY_BAR", name = "spikes.MyComponent", configurationFactory = true, policy = ConfigurationPolicy.REQUIRE)
@Properties({
		@Property(name = "service.vendor", value = "Sourcesense"),
		@Property(name = "service.description", value = "Factory for MyComponent") })

Because in the latter one, the configuration isn't displayed in the web console.
Or I'm still missing something?

Thanks again
Ale

On Jun 8, 2011, at 4:40 PM, Alessandro Novarini wrote:

> Hello everybody,
> 
> Just like the Jackrabbit Server Bundle does, I'm creating a configuration in my activator, and then recalling it in my bundle.
> Everything seems working almost fine, because the activator stores the default configuration only the first time, and the bundle loads it correctly.
> 
> What I can't do is to display the configuration in the web console, under the "Configuration" tab, so that I can change the default configuration.
> Is this anything that normally should happen automatically once you save the configuration with the admin configuration service?
> 
> What's the trick, if there's any?
> 
> Thanks in advance
> Ale
> 
> -- 
> Alessandro Novarini
> a-dot-novarini-at-sourcesense-dot-com
> 
> 
> 

-- 
Alessandro Novarini
a-dot-novarini-at-sourcesense-dot-com