You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by David Daniel <da...@gmail.com> on 2016/10/03 17:08:29 UTC

setting the objectclassdefinition from felix file install

I have an object class definition

@ObjectClassDefinition(name = "Marklogic Configuration",
pid = "com.marklogic")
@interface MarklogicConfig {
    String content_host() default "localhost";
    String content_username() default "admin";
    String content_pword() default "******";
    String content_dbname() default "****";
}

and a component

@Component(service = {MarkLogicConnector.class})
@Designate(ocd = MarklogicConfig.class)
public class MarkLogicConnector {

I have the felix file install bundle installed and working.  It seems like
it is loading com.marklogic.cfg correctly.  Is there a way to make sure
that the file is loaded before the configuration is passed into the
activate method.  I seem to be getting the default values rather than the
configured ones that came from fileinstall.

Re: setting the objectclassdefinition from felix file install

Posted by David Daniel <da...@gmail.com>.
You are correct and my first question delt with not knowing about the
configurationpolicy option.  My issue with implementing it was this syntax
causes activate to never by called

@ObjectClassDefinition(name = "Marklogic Configuration",
pid = "com.marklogic")

@Component(service = {MarkLogicConnector.class},
configurationPolicy = ConfigurationPolicy.REQUIRE)
@Designate(ocd = MarklogicConfig.class)

this syntax is a build error

@ObjectClassDefinition(name = "Marklogic Configuration",
pid = "com.marklogic")

@Component(service = {MarkLogicConnector.class},
configurationPolicy = ConfigurationPolicy.REQUIRE,
configurationPid = {"com.marklogic"})
@Designate(ocd = MarklogicConfig.class)

Description    Resource    Path    Location    Type
Duplicate pid com.marklogic from class
com.orbis.asae.marklogic.services.MarklogicConfig    bnd.bnd
/asae.marklogic.provider    line 1    Bndtools Problem Marker

but this syntax works and is ultimately what I am using

@ObjectClassDefinition(name = "Marklogic Configuration")
@Component(service = {MarkLogicConnector.class},
configurationPolicy = ConfigurationPolicy.REQUIRE,
configurationPid = {"com.marklogic"})
@Designate(ocd = MarklogicConfig.class)







On Mon, Oct 3, 2016 at 1:45 PM, Milen Dyankov <mi...@gmail.com>
wrote:

> Isn't it so that if your configuration is NOT mandatory the @Activate
> method will get the default and @Modified method will get the one from the
> file later on?
> Or am I misinterpreting the question?
>
> On Mon, Oct 3, 2016 at 7:38 PM, Raymond Auge <ra...@liferay.com>
> wrote:
>
> > Well, I'm not sure about that but because you've not named a pid in your
> > component, it's not associating that with the configuration. Honestly,
> I'm
> > not sure the pid in the OCD will get interpreted as being the pid of the
> > configuration. My gut tells me it's not doing that. So you still need to
> > name the pid in your component.
> >
> > Someone else may correct me of course. However, it should be simple to
> > assert by adding the configurationPid property on the component and
> seeing
> > if it does eventually bind.
> >
> > - Ray
> >
> > On Mon, Oct 3, 2016 at 1:27 PM, David Daniel <
> david.daniel.1979@gmail.com>
> > wrote:
> >
> > > Thank you,  I think I may be wrong somewhere else then.  I have this in
> > my
> > > logs
> > >
> > > *DEBUG*
> > > listConfigurations(filter=(felix.fileinstall.filename=
> > > file:/media/david/abcd2f06-6ee4-4c5a-8c80-e4023ec8a52c/
> > > development/asae/asae-base/packaging/all/etc/com.marklogic.cfg))
> > > *DEBUG* Listing configurations matching
> > > (felix.fileinstall.filename=file:/media/david/abcd2f06-
> > > 6ee4-4c5a-8c80-e4023ec8a52c/development/asae/asae-base/
> > > packaging/all/etc/com.marklogic.cfg)
> > > Creating configuration from com.marklogic.cfg
> > > *DEBUG* getConfiguration(pid=com.marklogic, location=null)
> > >
> > > does setting the pid as I did above not do what I thought it would do.
> > >
> > >
> > > On Mon, Oct 3, 2016 at 1:12 PM, Raymond Auge <raymond.auge@liferay.com
> >
> > > wrote:
> > >
> > > > Make the configuration mandatory in the component!
> > > >
> > > > - Ray
> > > >
> > > > On Mon, Oct 3, 2016 at 1:08 PM, David Daniel <
> > > david.daniel.1979@gmail.com>
> > > > wrote:
> > > >
> > > > > I have an object class definition
> > > > >
> > > > > @ObjectClassDefinition(name = "Marklogic Configuration",
> > > > > pid = "com.marklogic")
> > > > > @interface MarklogicConfig {
> > > > >     String content_host() default "localhost";
> > > > >     String content_username() default "admin";
> > > > >     String content_pword() default "******";
> > > > >     String content_dbname() default "****";
> > > > > }
> > > > >
> > > > > and a component
> > > > >
> > > > > @Component(service = {MarkLogicConnector.class})
> > > > > @Designate(ocd = MarklogicConfig.class)
> > > > > public class MarkLogicConnector {
> > > > >
> > > > > I have the felix file install bundle installed and working.  It
> seems
> > > > like
> > > > > it is loading com.marklogic.cfg correctly.  Is there a way to make
> > sure
> > > > > that the file is loaded before the configuration is passed into the
> > > > > activate method.  I seem to be getting the default values rather
> than
> > > the
> > > > > configured ones that came from fileinstall.
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > *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)
> > > >
> > >
> >
> >
> >
> > --
> > *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)
> >
>
>
>
> --
> http://about.me/milen
>

Re: setting the objectclassdefinition from felix file install

Posted by Milen Dyankov <mi...@gmail.com>.
Isn't it so that if your configuration is NOT mandatory the @Activate
method will get the default and @Modified method will get the one from the
file later on?
Or am I misinterpreting the question?

On Mon, Oct 3, 2016 at 7:38 PM, Raymond Auge <ra...@liferay.com>
wrote:

> Well, I'm not sure about that but because you've not named a pid in your
> component, it's not associating that with the configuration. Honestly, I'm
> not sure the pid in the OCD will get interpreted as being the pid of the
> configuration. My gut tells me it's not doing that. So you still need to
> name the pid in your component.
>
> Someone else may correct me of course. However, it should be simple to
> assert by adding the configurationPid property on the component and seeing
> if it does eventually bind.
>
> - Ray
>
> On Mon, Oct 3, 2016 at 1:27 PM, David Daniel <da...@gmail.com>
> wrote:
>
> > Thank you,  I think I may be wrong somewhere else then.  I have this in
> my
> > logs
> >
> > *DEBUG*
> > listConfigurations(filter=(felix.fileinstall.filename=
> > file:/media/david/abcd2f06-6ee4-4c5a-8c80-e4023ec8a52c/
> > development/asae/asae-base/packaging/all/etc/com.marklogic.cfg))
> > *DEBUG* Listing configurations matching
> > (felix.fileinstall.filename=file:/media/david/abcd2f06-
> > 6ee4-4c5a-8c80-e4023ec8a52c/development/asae/asae-base/
> > packaging/all/etc/com.marklogic.cfg)
> > Creating configuration from com.marklogic.cfg
> > *DEBUG* getConfiguration(pid=com.marklogic, location=null)
> >
> > does setting the pid as I did above not do what I thought it would do.
> >
> >
> > On Mon, Oct 3, 2016 at 1:12 PM, Raymond Auge <ra...@liferay.com>
> > wrote:
> >
> > > Make the configuration mandatory in the component!
> > >
> > > - Ray
> > >
> > > On Mon, Oct 3, 2016 at 1:08 PM, David Daniel <
> > david.daniel.1979@gmail.com>
> > > wrote:
> > >
> > > > I have an object class definition
> > > >
> > > > @ObjectClassDefinition(name = "Marklogic Configuration",
> > > > pid = "com.marklogic")
> > > > @interface MarklogicConfig {
> > > >     String content_host() default "localhost";
> > > >     String content_username() default "admin";
> > > >     String content_pword() default "******";
> > > >     String content_dbname() default "****";
> > > > }
> > > >
> > > > and a component
> > > >
> > > > @Component(service = {MarkLogicConnector.class})
> > > > @Designate(ocd = MarklogicConfig.class)
> > > > public class MarkLogicConnector {
> > > >
> > > > I have the felix file install bundle installed and working.  It seems
> > > like
> > > > it is loading com.marklogic.cfg correctly.  Is there a way to make
> sure
> > > > that the file is loaded before the configuration is passed into the
> > > > activate method.  I seem to be getting the default values rather than
> > the
> > > > configured ones that came from fileinstall.
> > > >
> > >
> > >
> > >
> > > --
> > > *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)
> > >
> >
>
>
>
> --
> *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)
>



-- 
http://about.me/milen

Re: setting the objectclassdefinition from felix file install

Posted by David Daniel <da...@gmail.com>.
Thank you for the explanation David and it makes sense.  I have removed the
designate annotation and set the pid in both the component and ocd

On Mon, Oct 3, 2016 at 1:54 PM, David Jencks <david_jencks@yahoo.com.invalid
> wrote:

> You spotted the problem.
>
> For a component, the default pid is the component name and the default
> component name is the class name. The @Designate annotation hooks up a
> component with a single pid to the mentioned OCD.  So….
>
> Figure out what pid you want, either the FQCN, component name, or
> explicitly specified pid
>
> Hook the component and OCD together using either @Designate or specifying
> pid in @ObjectClassDefinition, but not both
>
> Make sure the file name matches the pid.
>
> david jencks
>
>
> > On Oct 3, 2016, at 10:38 AM, Raymond Auge <ra...@liferay.com>
> wrote:
> >
> > Well, I'm not sure about that but because you've not named a pid in your
> > component, it's not associating that with the configuration. Honestly,
> I'm
> > not sure the pid in the OCD will get interpreted as being the pid of the
> > configuration. My gut tells me it's not doing that. So you still need to
> > name the pid in your component.
> >
> > Someone else may correct me of course. However, it should be simple to
> > assert by adding the configurationPid property on the component and
> seeing
> > if it does eventually bind.
> >
> > - Ray
> >
> > On Mon, Oct 3, 2016 at 1:27 PM, David Daniel <
> david.daniel.1979@gmail.com>
> > wrote:
> >
> >> Thank you,  I think I may be wrong somewhere else then.  I have this in
> my
> >> logs
> >>
> >> *DEBUG*
> >> listConfigurations(filter=(felix.fileinstall.filename=
> >> file:/media/david/abcd2f06-6ee4-4c5a-8c80-e4023ec8a52c/
> >> development/asae/asae-base/packaging/all/etc/com.marklogic.cfg))
> >> *DEBUG* Listing configurations matching
> >> (felix.fileinstall.filename=file:/media/david/abcd2f06-
> >> 6ee4-4c5a-8c80-e4023ec8a52c/development/asae/asae-base/
> >> packaging/all/etc/com.marklogic.cfg)
> >> Creating configuration from com.marklogic.cfg
> >> *DEBUG* getConfiguration(pid=com.marklogic, location=null)
> >>
> >> does setting the pid as I did above not do what I thought it would do.
> >>
> >>
> >> On Mon, Oct 3, 2016 at 1:12 PM, Raymond Auge <ra...@liferay.com>
> >> wrote:
> >>
> >>> Make the configuration mandatory in the component!
> >>>
> >>> - Ray
> >>>
> >>> On Mon, Oct 3, 2016 at 1:08 PM, David Daniel <
> >> david.daniel.1979@gmail.com>
> >>> wrote:
> >>>
> >>>> I have an object class definition
> >>>>
> >>>> @ObjectClassDefinition(name = "Marklogic Configuration",
> >>>> pid = "com.marklogic")
> >>>> @interface MarklogicConfig {
> >>>>    String content_host() default "localhost";
> >>>>    String content_username() default "admin";
> >>>>    String content_pword() default "******";
> >>>>    String content_dbname() default "****";
> >>>> }
> >>>>
> >>>> and a component
> >>>>
> >>>> @Component(service = {MarkLogicConnector.class})
> >>>> @Designate(ocd = MarklogicConfig.class)
> >>>> public class MarkLogicConnector {
> >>>>
> >>>> I have the felix file install bundle installed and working.  It seems
> >>> like
> >>>> it is loading com.marklogic.cfg correctly.  Is there a way to make
> sure
> >>>> that the file is loaded before the configuration is passed into the
> >>>> activate method.  I seem to be getting the default values rather than
> >> the
> >>>> configured ones that came from fileinstall.
> >>>>
> >>>
> >>>
> >>>
> >>> --
> >>> *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)
> >>>
> >>
> >
> >
> >
> > --
> > *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)
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>

Re: setting the objectclassdefinition from felix file install

Posted by David Jencks <da...@yahoo.com.INVALID>.
You spotted the problem.

For a component, the default pid is the component name and the default component name is the class name. The @Designate annotation hooks up a component with a single pid to the mentioned OCD.  So…. 

Figure out what pid you want, either the FQCN, component name, or explicitly specified pid

Hook the component and OCD together using either @Designate or specifying pid in @ObjectClassDefinition, but not both

Make sure the file name matches the pid.

david jencks


> On Oct 3, 2016, at 10:38 AM, Raymond Auge <ra...@liferay.com> wrote:
> 
> Well, I'm not sure about that but because you've not named a pid in your
> component, it's not associating that with the configuration. Honestly, I'm
> not sure the pid in the OCD will get interpreted as being the pid of the
> configuration. My gut tells me it's not doing that. So you still need to
> name the pid in your component.
> 
> Someone else may correct me of course. However, it should be simple to
> assert by adding the configurationPid property on the component and seeing
> if it does eventually bind.
> 
> - Ray
> 
> On Mon, Oct 3, 2016 at 1:27 PM, David Daniel <da...@gmail.com>
> wrote:
> 
>> Thank you,  I think I may be wrong somewhere else then.  I have this in my
>> logs
>> 
>> *DEBUG*
>> listConfigurations(filter=(felix.fileinstall.filename=
>> file:/media/david/abcd2f06-6ee4-4c5a-8c80-e4023ec8a52c/
>> development/asae/asae-base/packaging/all/etc/com.marklogic.cfg))
>> *DEBUG* Listing configurations matching
>> (felix.fileinstall.filename=file:/media/david/abcd2f06-
>> 6ee4-4c5a-8c80-e4023ec8a52c/development/asae/asae-base/
>> packaging/all/etc/com.marklogic.cfg)
>> Creating configuration from com.marklogic.cfg
>> *DEBUG* getConfiguration(pid=com.marklogic, location=null)
>> 
>> does setting the pid as I did above not do what I thought it would do.
>> 
>> 
>> On Mon, Oct 3, 2016 at 1:12 PM, Raymond Auge <ra...@liferay.com>
>> wrote:
>> 
>>> Make the configuration mandatory in the component!
>>> 
>>> - Ray
>>> 
>>> On Mon, Oct 3, 2016 at 1:08 PM, David Daniel <
>> david.daniel.1979@gmail.com>
>>> wrote:
>>> 
>>>> I have an object class definition
>>>> 
>>>> @ObjectClassDefinition(name = "Marklogic Configuration",
>>>> pid = "com.marklogic")
>>>> @interface MarklogicConfig {
>>>>    String content_host() default "localhost";
>>>>    String content_username() default "admin";
>>>>    String content_pword() default "******";
>>>>    String content_dbname() default "****";
>>>> }
>>>> 
>>>> and a component
>>>> 
>>>> @Component(service = {MarkLogicConnector.class})
>>>> @Designate(ocd = MarklogicConfig.class)
>>>> public class MarkLogicConnector {
>>>> 
>>>> I have the felix file install bundle installed and working.  It seems
>>> like
>>>> it is loading com.marklogic.cfg correctly.  Is there a way to make sure
>>>> that the file is loaded before the configuration is passed into the
>>>> activate method.  I seem to be getting the default values rather than
>> the
>>>> configured ones that came from fileinstall.
>>>> 
>>> 
>>> 
>>> 
>>> --
>>> *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)
>>> 
>> 
> 
> 
> 
> -- 
> *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)


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: setting the objectclassdefinition from felix file install

Posted by David Daniel <da...@gmail.com>.
That was the issue but it was a little weird.  If I have it in both the
component and ocd then I get a build error saying duplicate pid.  If I have
it in just the ocd then it doesn't work but if I have it in just the
component then it seems to work ok.

On Mon, Oct 3, 2016 at 1:38 PM, Raymond Auge <ra...@liferay.com>
wrote:

> Well, I'm not sure about that but because you've not named a pid in your
> component, it's not associating that with the configuration. Honestly, I'm
> not sure the pid in the OCD will get interpreted as being the pid of the
> configuration. My gut tells me it's not doing that. So you still need to
> name the pid in your component.
>
> Someone else may correct me of course. However, it should be simple to
> assert by adding the configurationPid property on the component and seeing
> if it does eventually bind.
>
> - Ray
>
> On Mon, Oct 3, 2016 at 1:27 PM, David Daniel <da...@gmail.com>
> wrote:
>
> > Thank you,  I think I may be wrong somewhere else then.  I have this in
> my
> > logs
> >
> > *DEBUG*
> > listConfigurations(filter=(felix.fileinstall.filename=
> > file:/media/david/abcd2f06-6ee4-4c5a-8c80-e4023ec8a52c/
> > development/asae/asae-base/packaging/all/etc/com.marklogic.cfg))
> > *DEBUG* Listing configurations matching
> > (felix.fileinstall.filename=file:/media/david/abcd2f06-
> > 6ee4-4c5a-8c80-e4023ec8a52c/development/asae/asae-base/
> > packaging/all/etc/com.marklogic.cfg)
> > Creating configuration from com.marklogic.cfg
> > *DEBUG* getConfiguration(pid=com.marklogic, location=null)
> >
> > does setting the pid as I did above not do what I thought it would do.
> >
> >
> > On Mon, Oct 3, 2016 at 1:12 PM, Raymond Auge <ra...@liferay.com>
> > wrote:
> >
> > > Make the configuration mandatory in the component!
> > >
> > > - Ray
> > >
> > > On Mon, Oct 3, 2016 at 1:08 PM, David Daniel <
> > david.daniel.1979@gmail.com>
> > > wrote:
> > >
> > > > I have an object class definition
> > > >
> > > > @ObjectClassDefinition(name = "Marklogic Configuration",
> > > > pid = "com.marklogic")
> > > > @interface MarklogicConfig {
> > > >     String content_host() default "localhost";
> > > >     String content_username() default "admin";
> > > >     String content_pword() default "******";
> > > >     String content_dbname() default "****";
> > > > }
> > > >
> > > > and a component
> > > >
> > > > @Component(service = {MarkLogicConnector.class})
> > > > @Designate(ocd = MarklogicConfig.class)
> > > > public class MarkLogicConnector {
> > > >
> > > > I have the felix file install bundle installed and working.  It seems
> > > like
> > > > it is loading com.marklogic.cfg correctly.  Is there a way to make
> sure
> > > > that the file is loaded before the configuration is passed into the
> > > > activate method.  I seem to be getting the default values rather than
> > the
> > > > configured ones that came from fileinstall.
> > > >
> > >
> > >
> > >
> > > --
> > > *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)
> > >
> >
>
>
>
> --
> *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)
>

Re: setting the objectclassdefinition from felix file install

Posted by Raymond Auge <ra...@liferay.com>.
Well, I'm not sure about that but because you've not named a pid in your
component, it's not associating that with the configuration. Honestly, I'm
not sure the pid in the OCD will get interpreted as being the pid of the
configuration. My gut tells me it's not doing that. So you still need to
name the pid in your component.

Someone else may correct me of course. However, it should be simple to
assert by adding the configurationPid property on the component and seeing
if it does eventually bind.

- Ray

On Mon, Oct 3, 2016 at 1:27 PM, David Daniel <da...@gmail.com>
wrote:

> Thank you,  I think I may be wrong somewhere else then.  I have this in my
> logs
>
> *DEBUG*
> listConfigurations(filter=(felix.fileinstall.filename=
> file:/media/david/abcd2f06-6ee4-4c5a-8c80-e4023ec8a52c/
> development/asae/asae-base/packaging/all/etc/com.marklogic.cfg))
> *DEBUG* Listing configurations matching
> (felix.fileinstall.filename=file:/media/david/abcd2f06-
> 6ee4-4c5a-8c80-e4023ec8a52c/development/asae/asae-base/
> packaging/all/etc/com.marklogic.cfg)
> Creating configuration from com.marklogic.cfg
> *DEBUG* getConfiguration(pid=com.marklogic, location=null)
>
> does setting the pid as I did above not do what I thought it would do.
>
>
> On Mon, Oct 3, 2016 at 1:12 PM, Raymond Auge <ra...@liferay.com>
> wrote:
>
> > Make the configuration mandatory in the component!
> >
> > - Ray
> >
> > On Mon, Oct 3, 2016 at 1:08 PM, David Daniel <
> david.daniel.1979@gmail.com>
> > wrote:
> >
> > > I have an object class definition
> > >
> > > @ObjectClassDefinition(name = "Marklogic Configuration",
> > > pid = "com.marklogic")
> > > @interface MarklogicConfig {
> > >     String content_host() default "localhost";
> > >     String content_username() default "admin";
> > >     String content_pword() default "******";
> > >     String content_dbname() default "****";
> > > }
> > >
> > > and a component
> > >
> > > @Component(service = {MarkLogicConnector.class})
> > > @Designate(ocd = MarklogicConfig.class)
> > > public class MarkLogicConnector {
> > >
> > > I have the felix file install bundle installed and working.  It seems
> > like
> > > it is loading com.marklogic.cfg correctly.  Is there a way to make sure
> > > that the file is loaded before the configuration is passed into the
> > > activate method.  I seem to be getting the default values rather than
> the
> > > configured ones that came from fileinstall.
> > >
> >
> >
> >
> > --
> > *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)
> >
>



-- 
*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)

Re: setting the objectclassdefinition from felix file install

Posted by David Daniel <da...@gmail.com>.
Thank you,  I think I may be wrong somewhere else then.  I have this in my
logs

*DEBUG*
listConfigurations(filter=(felix.fileinstall.filename=file:/media/david/abcd2f06-6ee4-4c5a-8c80-e4023ec8a52c/development/asae/asae-base/packaging/all/etc/com.marklogic.cfg))
*DEBUG* Listing configurations matching
(felix.fileinstall.filename=file:/media/david/abcd2f06-6ee4-4c5a-8c80-e4023ec8a52c/development/asae/asae-base/packaging/all/etc/com.marklogic.cfg)
Creating configuration from com.marklogic.cfg
*DEBUG* getConfiguration(pid=com.marklogic, location=null)

does setting the pid as I did above not do what I thought it would do.


On Mon, Oct 3, 2016 at 1:12 PM, Raymond Auge <ra...@liferay.com>
wrote:

> Make the configuration mandatory in the component!
>
> - Ray
>
> On Mon, Oct 3, 2016 at 1:08 PM, David Daniel <da...@gmail.com>
> wrote:
>
> > I have an object class definition
> >
> > @ObjectClassDefinition(name = "Marklogic Configuration",
> > pid = "com.marklogic")
> > @interface MarklogicConfig {
> >     String content_host() default "localhost";
> >     String content_username() default "admin";
> >     String content_pword() default "******";
> >     String content_dbname() default "****";
> > }
> >
> > and a component
> >
> > @Component(service = {MarkLogicConnector.class})
> > @Designate(ocd = MarklogicConfig.class)
> > public class MarkLogicConnector {
> >
> > I have the felix file install bundle installed and working.  It seems
> like
> > it is loading com.marklogic.cfg correctly.  Is there a way to make sure
> > that the file is loaded before the configuration is passed into the
> > activate method.  I seem to be getting the default values rather than the
> > configured ones that came from fileinstall.
> >
>
>
>
> --
> *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)
>

Re: setting the objectclassdefinition from felix file install

Posted by Raymond Auge <ra...@liferay.com>.
Make the configuration mandatory in the component!

- Ray

On Mon, Oct 3, 2016 at 1:08 PM, David Daniel <da...@gmail.com>
wrote:

> I have an object class definition
>
> @ObjectClassDefinition(name = "Marklogic Configuration",
> pid = "com.marklogic")
> @interface MarklogicConfig {
>     String content_host() default "localhost";
>     String content_username() default "admin";
>     String content_pword() default "******";
>     String content_dbname() default "****";
> }
>
> and a component
>
> @Component(service = {MarkLogicConnector.class})
> @Designate(ocd = MarklogicConfig.class)
> public class MarkLogicConnector {
>
> I have the felix file install bundle installed and working.  It seems like
> it is loading com.marklogic.cfg correctly.  Is there a way to make sure
> that the file is loaded before the configuration is passed into the
> activate method.  I seem to be getting the default values rather than the
> configured ones that came from fileinstall.
>



-- 
*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)