You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hivemind.apache.org by Jochen Zimmermann <ze...@gmx.de> on 2007/04/04 13:54:17 UTC

Configuration Points

Hi!
At first thank you for the fast answers until now :-)

Another (newbie) problem:

I want to use the annotated notation for the java part and xml for the configurations/contributions.

Setup:
I have a service A and an application App.

App uses A.

In the xml-file configure.xml in service A is a configuration point defined.
Now I want to create a configure.xml in App that contains the contribution for the configuration point.

Hivemind finds the configure.xml in App but tells me, that I try to contribute to a non existing configuration point.

If I put the contribution in the same file as the configuration point everything works fine.
I already tried to change the module names to different setups (inserting the apps modulename in the apps xml-file) ...

Thanks for your time!

Regards,
Jochen Zimmermann

Here are my files (not including all the attributes):

Service:
<module id="com.proalpha.java.lucene" version="1.0.0">
  <configuration-point id="IndexingService">
    <schema>
      <element name="Indexer">
        <attribute name="relativePath" required="true"/>
    	<rules>
          <create-object class="com.proalpha.java.lucene.configuration.IndexConfiguration"/>
          <read-attribute property="relativePath" attribute="realtivePath"/>
		      <invoke-parent method="addElement"/>
	    	</rules>
		  </element>
		</schema>
	  </configuration-point>
</module>

App:
<module id="com.proalpha.java.lucene" version="1.0.0">
  <contribution configuration-id="IndexingService">
    <Indexer key="relativePath"       value="Test1"/>
  </contribution>
</module>

Re: Configuration Points

Posted by Jochen Zimmermann <ze...@gmx.de>.
Thanks for your help!
I've got it working now using xml only :-)

Now I try to mix with annotated notation, see if I can make it work, too :-)

Thanks again!



Re: Configuration Points

Posted by Johan Lindquist <jo...@kawoo.co.uk>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Jochen,

Your App configuration file should have a different module id than the
service A id - Hivemind does not allow duplicate module id within the
registry.

Secondly, when referencing the configuration point from outside of the
module which defines it (in this case inside your App configuration
file) you need to specify the complete service id of it [the
configuration point] - i.e. module id + . + configuration point id

So in this case, the conf. id would be:

<!-- Notice the "app" in the below module id -->
<module id="com.proalpha.java.lucene.app" version="1.0.0">

<!-- Config ID contains the complete service id (module + config id) -->
<contribution configuration-id="com.proalpha.java.lucene.IndexingService">
   <Indexer key="relativePath"       value="Test1"/>
</contribution>
</module>

Hope that helps,

Johan

Jochen Zimmermann wrote:
> Hi!
> At first thank you for the fast answers until now :-)
> 
> Another (newbie) problem:
> 
> I want to use the annotated notation for the java part and xml for the configurations/contributions.
> 
> Setup:
> I have a service A and an application App.
> 
> App uses A.
> 
> In the xml-file configure.xml in service A is a configuration point defined.
> Now I want to create a configure.xml in App that contains the contribution for the configuration point.
> 
> Hivemind finds the configure.xml in App but tells me, that I try to contribute to a non existing configuration point.
> 
> If I put the contribution in the same file as the configuration point everything works fine.
> I already tried to change the module names to different setups (inserting the apps modulename in the apps xml-file) ...
> 
> Thanks for your time!
> 
> Regards,
> Jochen Zimmermann
> 
> Here are my files (not including all the attributes):
> 
> Service:
> <module id="com.proalpha.java.lucene" version="1.0.0">
>   <configuration-point id="IndexingService">
>     <schema>
>       <element name="Indexer">
>         <attribute name="relativePath" required="true"/>
>     	<rules>
>           <create-object class="com.proalpha.java.lucene.configuration.IndexConfiguration"/>
>           <read-attribute property="relativePath" attribute="realtivePath"/>
> 		      <invoke-parent method="addElement"/>
> 	    	</rules>
> 		  </element>
> 		</schema>
> 	  </configuration-point>
> </module>
> 
> App:
> <module id="com.proalpha.java.lucene" version="1.0.0">
>   <contribution configuration-id="IndexingService">
>     <Indexer key="relativePath"       value="Test1"/>
>   </contribution>
> </module>
> 
> 

- --
you too?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGE5Su1Tv8wj7aQ34RAqDxAJ9IZLFzk9nnvq0OpIkQbTt2BpcegQCeOv7p
JXtZb9sXWwaMXyecVZdhVLE=
=Hma9
-----END PGP SIGNATURE-----

Re: Configuration Points

Posted by Knut Wannheden <kn...@gmail.com>.
Jochen,

If you have two modules then they must have different IDs and the
<contribution> element needs to reference the configuration with a
fully qualified ID. E.g.

<module id="a">
 <configuration-point id="c">
   ...
 </configuration-point>
</module>

<module id="app">
  <contribution configuration-id="a.c">
    ...
  </contribution>
</module>

HTH,

--knut

On 4/4/07, Jochen Zimmermann <ze...@gmx.de> wrote:
> Hi!
> At first thank you for the fast answers until now :-)
>
> Another (newbie) problem:
>
> I want to use the annotated notation for the java part and xml for the configurations/contributions.
>
> Setup:
> I have a service A and an application App.
>
> App uses A.
>
> In the xml-file configure.xml in service A is a configuration point defined.
> Now I want to create a configure.xml in App that contains the contribution for the configuration point.
>
> Hivemind finds the configure.xml in App but tells me, that I try to contribute to a non existing configuration point.
>
> If I put the contribution in the same file as the configuration point everything works fine.
> I already tried to change the module names to different setups (inserting the apps modulename in the apps xml-file) ...
>
> Thanks for your time!
>
> Regards,
> Jochen Zimmermann
>
> Here are my files (not including all the attributes):
>
> Service:
> <module id="com.proalpha.java.lucene" version="1.0.0">
>   <configuration-point id="IndexingService">
>     <schema>
>       <element name="Indexer">
>         <attribute name="relativePath" required="true"/>
>         <rules>
>           <create-object class="com.proalpha.java.lucene.configuration.IndexConfiguration"/>
>           <read-attribute property="relativePath" attribute="realtivePath"/>
>                       <invoke-parent method="addElement"/>
>                 </rules>
>                   </element>
>                 </schema>
>           </configuration-point>
> </module>
>
> App:
> <module id="com.proalpha.java.lucene" version="1.0.0">
>   <contribution configuration-id="IndexingService">
>     <Indexer key="relativePath"       value="Test1"/>
>   </contribution>
> </module>
>