You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Eckenfellner Klaus <ec...@gmail.com> on 2007/06/06 14:34:28 UTC

dynamic plugins / menu problem

hi everybody!

i want to create a modulare application, which is organized into several
plugins (tapestry component libraries). each plugin has it's own pages /
 services / interfaces / logic. each plugin in independent from the
other plugin and also the application.

the application does only contain some stylesheets and minimal basic
functions. the plugins are registered as libraries in the application
using the default application specification mechanism.

my problem now is, that i must give the user some possibility to visit
the pages of the different plugins. -> using pagelink. but that logic
has to be dynamic because the application doesn't know which plugins are
enabled(declared in application specification) or not.

my solution to this problem is ....
all plugins have a hivemind - service which implements a
PluginInterface. now extending applicationServlet.constructRegistry to
get hivemind Registry. using the method
Registry.getServiceIds(java.lang.Class pluginInterface) i get all
enabled plugins ... now with Registry.getService(java.lang.String
serviceId, java.lang.Class serviceInterface) i could invoke each
PluginService which is able to told me pages that i could inject -> now
storing information into ASO.

my questions:
	*	do you know any better solution, because i am not sure if this is the
best way
	*	is the only way to get the Hivemind-Registry to extend
ApplicationServlet.constructRegistry ?

thx
eckenfellner klaus

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


Re: dynamic plugins / menu problem

Posted by Eckenfellner Klaus <ec...@gmail.com>.
thx marcus for your reply ... will try your code snippets this evening,
but i am very optimistic and looks great ... hope my problem is solved. *gg*

Marcus.Schulte@bmw.ch wrote:
> 1. you could define a hivemind configuration-point into which you may
> contribute your page-names, implement a service that takes that takes
> this configuration-point as an arg and inject it wherever you need it.
> No need to access the HM-Reg.
> 
> 2. Skip hivemind altogether and do sth like:
>    for ( String id : getNamespace().getChildIds() ) {
> 	 INamespace lib = getNamespace().getChildNamespace( id );
>        List<String> pages = lib.getPageNames();
> 	//...
>   }
> 
>> -----Original Message-----
>> From: Eckenfellner Klaus [mailto:ecko.nfs@gmail.com] 
>> Sent: Wednesday, June 06, 2007 2:34 PM
>> To: users@tapestry.apache.org
>> Subject: dynamic plugins / menu problem
>>
>> hi everybody!
>>
>> i want to create a modulare application, which is organized 
>> into several plugins (tapestry component libraries). each 
>> plugin has it's own pages /  services / interfaces / logic. 
>> each plugin in independent from the other plugin and also the 
>> application.
>>
>> the application does only contain some stylesheets and 
>> minimal basic functions. the plugins are registered as 
>> libraries in the application using the default application 
>> specification mechanism.
>>
>> my problem now is, that i must give the user some possibility 
>> to visit the pages of the different plugins. -> using 
>> pagelink. but that logic has to be dynamic because the 
>> application doesn't know which plugins are enabled(declared 
>> in application specification) or not.
>>
>> my solution to this problem is ....
>> all plugins have a hivemind - service which implements a 
>> PluginInterface. now extending 
>> applicationServlet.constructRegistry to get hivemind 
>> Registry. using the method 
>> Registry.getServiceIds(java.lang.Class pluginInterface) i get 
>> all enabled plugins ... now with Registry.getService(java.lang.String
>> serviceId, java.lang.Class serviceInterface) i could invoke 
>> each PluginService which is able to told me pages that i 
>> could inject -> now storing information into ASO.
>>
>> my questions:
>> 	*	do you know any better solution, because i am 
>> not sure if this is the
>> best way
>> 	*	is the only way to get the Hivemind-Registry to extend
>> ApplicationServlet.constructRegistry ?
>>
>> thx
>> eckenfellner klaus
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 


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


RE: dynamic plugins / menu problem

Posted by Ma...@bmw.ch.
1. you could define a hivemind configuration-point into which you may
contribute your page-names, implement a service that takes that takes
this configuration-point as an arg and inject it wherever you need it.
No need to access the HM-Reg.

2. Skip hivemind altogether and do sth like:
   for ( String id : getNamespace().getChildIds() ) {
	 INamespace lib = getNamespace().getChildNamespace( id );
       List<String> pages = lib.getPageNames();
	//...
  }

> -----Original Message-----
> From: Eckenfellner Klaus [mailto:ecko.nfs@gmail.com] 
> Sent: Wednesday, June 06, 2007 2:34 PM
> To: users@tapestry.apache.org
> Subject: dynamic plugins / menu problem
> 
> hi everybody!
> 
> i want to create a modulare application, which is organized 
> into several plugins (tapestry component libraries). each 
> plugin has it's own pages /  services / interfaces / logic. 
> each plugin in independent from the other plugin and also the 
> application.
> 
> the application does only contain some stylesheets and 
> minimal basic functions. the plugins are registered as 
> libraries in the application using the default application 
> specification mechanism.
> 
> my problem now is, that i must give the user some possibility 
> to visit the pages of the different plugins. -> using 
> pagelink. but that logic has to be dynamic because the 
> application doesn't know which plugins are enabled(declared 
> in application specification) or not.
> 
> my solution to this problem is ....
> all plugins have a hivemind - service which implements a 
> PluginInterface. now extending 
> applicationServlet.constructRegistry to get hivemind 
> Registry. using the method 
> Registry.getServiceIds(java.lang.Class pluginInterface) i get 
> all enabled plugins ... now with Registry.getService(java.lang.String
> serviceId, java.lang.Class serviceInterface) i could invoke 
> each PluginService which is able to told me pages that i 
> could inject -> now storing information into ASO.
> 
> my questions:
> 	*	do you know any better solution, because i am 
> not sure if this is the
> best way
> 	*	is the only way to get the Hivemind-Registry to extend
> ApplicationServlet.constructRegistry ?
> 
> thx
> eckenfellner klaus
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 

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