You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Michal Wegrzyn <mi...@onior.com> on 2012/09/25 10:35:40 UTC

Wicket plugin architecture

Dear developers,

I need to prepare plugin architecture for a Wicket based project.
I've found that open source Hippo CMS ( http://svn.onehippo.org/repos/hippo/ ) does it, but I am
curious if there are any other projects that do such a thing?

Do you maybe know this kind of projects or frameworks?

Are there any important in-depth aspects of Wicket of which should I be aware of for creating plugin architecture?

Best regards,
Michal Wegrzyn

Re: Wicket plugin architecture

Posted by Decebal Suiu <de...@asf.ro>.
Hi

Jenkins/Hudson has this ability (do it with class loaders management). See
more at
http://kohsuke.org/2011/12/06/installing-plugins-to-jenkins-without-restart/. 
Jenkins is so popular because it uses a relative simple (vs osgi) with a
good versatility plugin system.
Probably it's possible to adapt jenkins plugin system to wicket but I don't
know how big is this task.

It's anybody here that can explains us how the plugin system is implemented
in brixcms?

Best regards,
Decebal



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-plugin-architecture-tp4652305p4652327.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: Wicket plugin architecture

Posted by "seba.wagner@gmail.com" <se...@gmail.com>.
sorry to hijack this Thread, I am just curious :)

Is it possible to hot-deploy a Plugin in Wicket with the described
mechanism?

Thanks!
Sebastian

2012/9/25 Decebal Suiu <de...@asf.ro>

> Good question and good answers :)
>
> I am searching for an answer too. In our product (NextReports server) we
> use
> spring framework for this purpose. You can add contributors as section,
> menu
> action, popup action, ... and at runtime a component (for example a menu
> panel) takes all contributors and generate the markup. It's ok but this
> approach requires extra  library (spring) and it's not a true plugin system
> (no class loaders management).
> Personal, I like the plugin system for Jenkins/Hudson. This system uses a
> specific class loader for each plugin. For more information see
> https://wiki.jenkins-ci.org/display/JENKINS/Plugin+Structure. You can
> define
> extension points and you can write extension for an extension points
> (similar to brixcms). I suppose that the key is how to define an extension
> point. In jenkins an extension point implements ExtensionPoint and an
> extension has an @Extension annotation. At runtime, jenkins search all
> @Extension annotations (It seems to me a time consuming operation).
> As plugin framework you can use something like http://jpf.sourceforge.net/
>
> Best regards,
> Decebal
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Wicket-plugin-architecture-tp4652305p4652321.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Sebastian Wagner
https://twitter.com/#!/dead_lock
http://www.webbase-design.de
http://www.wagner-sebastian.com
seba.wagner@gmail.com

Re: Wicket plugin architecture

Posted by Decebal Suiu <de...@asf.ro>.
Good question and good answers :)

I am searching for an answer too. In our product (NextReports server) we use
spring framework for this purpose. You can add contributors as section, menu
action, popup action, ... and at runtime a component (for example a menu
panel) takes all contributors and generate the markup. It's ok but this
approach requires extra  library (spring) and it's not a true plugin system
(no class loaders management).
Personal, I like the plugin system for Jenkins/Hudson. This system uses a
specific class loader for each plugin. For more information see
https://wiki.jenkins-ci.org/display/JENKINS/Plugin+Structure. You can define
extension points and you can write extension for an extension points
(similar to brixcms). I suppose that the key is how to define an extension
point. In jenkins an extension point implements ExtensionPoint and an
extension has an @Extension annotation. At runtime, jenkins search all
@Extension annotations (It seems to me a time consuming operation).
As plugin framework you can use something like http://jpf.sourceforge.net/

Best regards,
Decebal



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-plugin-architecture-tp4652305p4652321.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Fwd: Wicket plugin architecture

Posted by Maxim Solodovnik <so...@gmail.com>.
JFYI
Maybe it will be interesting for implementing OM plugins

---------- Forwarded message ----------
From: Decebal Suiu <de...@asf.ro>
Date: Wed, Jul 17, 2013 at 6:49 PM
Subject: Re: Wicket plugin architecture
To: users@wicket.apache.org


Hi

If anybody is interested,  Wicket Plugin
<https://github.com/decebals/wicket-plugin>   is now available on github.

Best regards,
Decebal



--
View this message in context:
http://apache-wicket.1842946.n4.nabble.com/Wicket-plugin-architecture-tp4652305p4660307.html
Sent from the Users forum mailing list archive at Nabble.com.

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




-- 
WBR
Maxim aka solomax

Re: Wicket plugin architecture

Posted by Decebal Suiu <de...@asf.ro>.
Hi

If anybody is interested,  Wicket Plugin
<https://github.com/decebals/wicket-plugin>   is now available on github.

Best regards,
Decebal



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-plugin-architecture-tp4652305p4660307.html
Sent from the Users forum mailing list archive at Nabble.com.

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


RE: Wicket plugin architecture

Posted by Decebal Suiu <de...@asf.ro>.
Hi Michal

I will commit the initial version of my  wicket-plugin
<https://github.com/decebals/wicket-plugin>   project in a few days (now i'm
a little busy).
This project is based on another project developed by me  PF4J
<https://github.com/decebals/pf4j>   and is intended to add a little
improvement over the solution chosen by you. A demo will be also available.

I will come with more information in the next post.

Any suggestion or idea is welcome.

Best regards,
Decebal




--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-plugin-architecture-tp4652305p4653078.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: Wicket plugin architecture

Posted by Bas Gooren <ba...@iswd.nl>.
Michal,

I wrote a mapper which mounts all resources in a package at a fixed url.
This eliminates the need for a mapper per resource.

See
http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-alternative-to-1-4-shared-resources-class-aliases-td4652842.html 


Met vriendelijke groet,
Kind regards,

Bas Gooren

Op 18-10-2012 16:35, schreef Michal Wegrzyn:
> In Initializer implementation I do something like:
>
> 		PackageResourceReference logoReference = new PackageResourceReference( MyInitializer.class, "img/custom_header_logo.png" );
> 		WebApplication.get().getSharedResources().add( "img/custom_header_logo.png", logoReference.getResource() );
> 		WebApplication.get().mountResource( "img/custom_header_logo.png", logoReference );
>
> It makes for every mounted image new request mapper.
> Won't it be a problem for a lot of custom images?
>
> Best regards,
> Michal Wegrzyn
>
>> -----Original Message-----
>> From: Martin Grigorov [mailto:mgrigorov@apache.org]
>> Sent: Thursday, October 18, 2012 16:24
>> To: users@wicket.apache.org
>> Subject: Re: Wicket plugin architecture
>>
>> On Thu, Oct 18, 2012 at 4:21 PM, Michal Wegrzyn
>> <mi...@onior.com> wrote:
>>> Thank you all for suggestions.
>>>
>>> Finally I have used Wicket's org.apache.wicket.IInitializer (as
>> pointed Martin) together with
>> org.apache.wicket.Application.setMetaData(MetaDataKey<T> key, Object
>> object) for configuration.
>>> Implementing more complex solution is not necessary unless you need
>> advanced runtime plugin mechanism.
>>> For custom plugin CSS/JS I use metadata and render all extra resource
>> references on pages.
>>> Images are mounted as shared resources. It works, but for large
>> amount of images it will not be efficient.
>>>
>>> Question: do you know a better Wicket-way to handle custom images?
>> Please explain how you use the shared resources and what will be not
>> optimal with them. Then we can try to find a better solution.
>>
>>> Best regards,
>>> Michal Wegrzyn
>>>
>>>> -----Original Message-----
>>>> From: Martin Grigorov [mailto:mgrigorov@apache.org]
>>>> Sent: Tuesday, September 25, 2012 10:48
>>>> To: users@wicket.apache.org
>>>> Subject: Re: Wicket plugin architecture
>>>>
>>>> Hi,
>>>>
>>>> The simplest way is to use Wicket's org.apache.wicket.IInitializer
>>>> class.
>>>> Just create a Jar (the plugin) that contains the plugin classes and
>>>> wicket.properties in the root package and a line inside:
>>>> initializer=com.example.MyInitializer
>>>>
>>>> MyInitializer#init(Application) will be called just before
>>>> MyApp#init(). In this method you can add whatever your plugin
>>>> provides to the global configuration
>>>>
>>>> On Tue, Sep 25, 2012 at 11:35 AM, Michal Wegrzyn
>>>> <mi...@onior.com> wrote:
>>>>> Dear developers,
>>>>>
>>>>> I need to prepare plugin architecture for a Wicket based project.
>>>>> I've found that open source Hippo CMS (
>>>>> http://svn.onehippo.org/repos/hippo/ ) does it, but I am curious
>> if
>>>> there are any other projects that do such a thing?
>>>>> Do you maybe know this kind of projects or frameworks?
>>>>>
>>>>> Are there any important in-depth aspects of Wicket of which should
>>>>> I
>>>> be aware of for creating plugin architecture?
>>>>> Best regards,
>>>>> Michal Wegrzyn
>>>>
>>>>
>>>> --
>>>> Martin Grigorov
>>>> jWeekend
>>>> Training, Consulting, Development
>>>> http://jWeekend.com
>>>>
>>>> --------------------------------------------------------------------
>> -
>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>> --
>> Martin Grigorov
>> jWeekend
>> Training, Consulting, Development
>> http://jWeekend.com
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>


RE: Wicket plugin architecture

Posted by Michal Wegrzyn <mi...@onior.com>.
In Initializer implementation I do something like:

		PackageResourceReference logoReference = new PackageResourceReference( MyInitializer.class, "img/custom_header_logo.png" );
		WebApplication.get().getSharedResources().add( "img/custom_header_logo.png", logoReference.getResource() );
		WebApplication.get().mountResource( "img/custom_header_logo.png", logoReference );

It makes for every mounted image new request mapper. 
Won't it be a problem for a lot of custom images?

Best regards,
Michal Wegrzyn

> -----Original Message-----
> From: Martin Grigorov [mailto:mgrigorov@apache.org]
> Sent: Thursday, October 18, 2012 16:24
> To: users@wicket.apache.org
> Subject: Re: Wicket plugin architecture
> 
> On Thu, Oct 18, 2012 at 4:21 PM, Michal Wegrzyn
> <mi...@onior.com> wrote:
> > Thank you all for suggestions.
> >
> > Finally I have used Wicket's org.apache.wicket.IInitializer (as
> pointed Martin) together with
> org.apache.wicket.Application.setMetaData(MetaDataKey<T> key, Object
> object) for configuration.
> >
> > Implementing more complex solution is not necessary unless you need
> advanced runtime plugin mechanism.
> > For custom plugin CSS/JS I use metadata and render all extra resource
> references on pages.
> >
> > Images are mounted as shared resources. It works, but for large
> amount of images it will not be efficient.
> >
> >
> > Question: do you know a better Wicket-way to handle custom images?
> 
> Please explain how you use the shared resources and what will be not
> optimal with them. Then we can try to find a better solution.
> 
> >
> > Best regards,
> > Michal Wegrzyn
> >
> >> -----Original Message-----
> >> From: Martin Grigorov [mailto:mgrigorov@apache.org]
> >> Sent: Tuesday, September 25, 2012 10:48
> >> To: users@wicket.apache.org
> >> Subject: Re: Wicket plugin architecture
> >>
> >> Hi,
> >>
> >> The simplest way is to use Wicket's org.apache.wicket.IInitializer
> >> class.
> >> Just create a Jar (the plugin) that contains the plugin classes and
> >> wicket.properties in the root package and a line inside:
> >> initializer=com.example.MyInitializer
> >>
> >> MyInitializer#init(Application) will be called just before
> >> MyApp#init(). In this method you can add whatever your plugin
> >> provides to the global configuration
> >>
> >> On Tue, Sep 25, 2012 at 11:35 AM, Michal Wegrzyn
> >> <mi...@onior.com> wrote:
> >> > Dear developers,
> >> >
> >> > I need to prepare plugin architecture for a Wicket based project.
> >> > I've found that open source Hippo CMS (
> >> > http://svn.onehippo.org/repos/hippo/ ) does it, but I am curious
> if
> >> there are any other projects that do such a thing?
> >> >
> >> > Do you maybe know this kind of projects or frameworks?
> >> >
> >> > Are there any important in-depth aspects of Wicket of which should
> >> > I
> >> be aware of for creating plugin architecture?
> >> >
> >> > Best regards,
> >> > Michal Wegrzyn
> >>
> >>
> >>
> >> --
> >> Martin Grigorov
> >> jWeekend
> >> Training, Consulting, Development
> >> http://jWeekend.com
> >>
> >> --------------------------------------------------------------------
> -
> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >> For additional commands, e-mail: users-help@wicket.apache.org
> >
> 
> 
> 
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org


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


Re: Wicket plugin architecture

Posted by Martin Grigorov <mg...@apache.org>.
On Thu, Oct 18, 2012 at 4:21 PM, Michal Wegrzyn
<mi...@onior.com> wrote:
> Thank you all for suggestions.
>
> Finally I have used Wicket's org.apache.wicket.IInitializer (as pointed Martin) together with org.apache.wicket.Application.setMetaData(MetaDataKey<T> key, Object object) for configuration.
>
> Implementing more complex solution is not necessary unless you need advanced runtime plugin mechanism.
> For custom plugin CSS/JS I use metadata and render all extra resource references on pages.
>
> Images are mounted as shared resources. It works, but for large amount of images it will not be efficient.
>
>
> Question: do you know a better Wicket-way to handle custom images?

Please explain how you use the shared resources and what will be not
optimal with them. Then we can try to find a better solution.

>
> Best regards,
> Michal Wegrzyn
>
>> -----Original Message-----
>> From: Martin Grigorov [mailto:mgrigorov@apache.org]
>> Sent: Tuesday, September 25, 2012 10:48
>> To: users@wicket.apache.org
>> Subject: Re: Wicket plugin architecture
>>
>> Hi,
>>
>> The simplest way is to use Wicket's org.apache.wicket.IInitializer
>> class.
>> Just create a Jar (the plugin) that contains the plugin classes and
>> wicket.properties in the root package and a line inside:
>> initializer=com.example.MyInitializer
>>
>> MyInitializer#init(Application) will be called just before
>> MyApp#init(). In this method you can add whatever your plugin provides
>> to the global configuration
>>
>> On Tue, Sep 25, 2012 at 11:35 AM, Michal Wegrzyn
>> <mi...@onior.com> wrote:
>> > Dear developers,
>> >
>> > I need to prepare plugin architecture for a Wicket based project.
>> > I've found that open source Hippo CMS (
>> > http://svn.onehippo.org/repos/hippo/ ) does it, but I am curious if
>> there are any other projects that do such a thing?
>> >
>> > Do you maybe know this kind of projects or frameworks?
>> >
>> > Are there any important in-depth aspects of Wicket of which should I
>> be aware of for creating plugin architecture?
>> >
>> > Best regards,
>> > Michal Wegrzyn
>>
>>
>>
>> --
>> Martin Grigorov
>> jWeekend
>> Training, Consulting, Development
>> http://jWeekend.com
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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


RE: Wicket plugin architecture

Posted by Michal Wegrzyn <mi...@onior.com>.
Thank you all for suggestions. 

Finally I have used Wicket's org.apache.wicket.IInitializer (as pointed Martin) together with org.apache.wicket.Application.setMetaData(MetaDataKey<T> key, Object object) for configuration.

Implementing more complex solution is not necessary unless you need advanced runtime plugin mechanism.
For custom plugin CSS/JS I use metadata and render all extra resource references on pages.
 
Images are mounted as shared resources. It works, but for large amount of images it will not be efficient.


Question: do you know a better Wicket-way to handle custom images?

Best regards,
Michal Wegrzyn

> -----Original Message-----
> From: Martin Grigorov [mailto:mgrigorov@apache.org]
> Sent: Tuesday, September 25, 2012 10:48
> To: users@wicket.apache.org
> Subject: Re: Wicket plugin architecture
> 
> Hi,
> 
> The simplest way is to use Wicket's org.apache.wicket.IInitializer
> class.
> Just create a Jar (the plugin) that contains the plugin classes and
> wicket.properties in the root package and a line inside:
> initializer=com.example.MyInitializer
> 
> MyInitializer#init(Application) will be called just before
> MyApp#init(). In this method you can add whatever your plugin provides
> to the global configuration
> 
> On Tue, Sep 25, 2012 at 11:35 AM, Michal Wegrzyn
> <mi...@onior.com> wrote:
> > Dear developers,
> >
> > I need to prepare plugin architecture for a Wicket based project.
> > I've found that open source Hippo CMS (
> > http://svn.onehippo.org/repos/hippo/ ) does it, but I am curious if
> there are any other projects that do such a thing?
> >
> > Do you maybe know this kind of projects or frameworks?
> >
> > Are there any important in-depth aspects of Wicket of which should I
> be aware of for creating plugin architecture?
> >
> > Best regards,
> > Michal Wegrzyn
> 
> 
> 
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org


Re: Wicket plugin architecture

Posted by Dan Simko <wi...@gmail.com>.
Hi,

You can also look at https://github.com/brix-cms/brix-cms. It is much
simpler than hippo.

Best regards,
Dan

On Tue, Sep 25, 2012 at 10:48 AM, Martin Grigorov <mg...@apache.org>wrote:

> Hi,
>
> The simplest way is to use Wicket's org.apache.wicket.IInitializer class.
> Just create a Jar (the plugin) that contains the plugin classes and
> wicket.properties in the root package and a line inside:
> initializer=com.example.MyInitializer
>
> MyInitializer#init(Application) will be called just before
> MyApp#init(). In this method you can add whatever your plugin provides
> to the global configuration
>
> On Tue, Sep 25, 2012 at 11:35 AM, Michal Wegrzyn
> <mi...@onior.com> wrote:
> > Dear developers,
> >
> > I need to prepare plugin architecture for a Wicket based project.
> > I've found that open source Hippo CMS (
> http://svn.onehippo.org/repos/hippo/ ) does it, but I am
> > curious if there are any other projects that do such a thing?
> >
> > Do you maybe know this kind of projects or frameworks?
> >
> > Are there any important in-depth aspects of Wicket of which should I be
> aware of for creating plugin architecture?
> >
> > Best regards,
> > Michal Wegrzyn
>
>
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Wicket plugin architecture

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

The simplest way is to use Wicket's org.apache.wicket.IInitializer class.
Just create a Jar (the plugin) that contains the plugin classes and
wicket.properties in the root package and a line inside:
initializer=com.example.MyInitializer

MyInitializer#init(Application) will be called just before
MyApp#init(). In this method you can add whatever your plugin provides
to the global configuration

On Tue, Sep 25, 2012 at 11:35 AM, Michal Wegrzyn
<mi...@onior.com> wrote:
> Dear developers,
>
> I need to prepare plugin architecture for a Wicket based project.
> I've found that open source Hippo CMS ( http://svn.onehippo.org/repos/hippo/ ) does it, but I am
> curious if there are any other projects that do such a thing?
>
> Do you maybe know this kind of projects or frameworks?
>
> Are there any important in-depth aspects of Wicket of which should I be aware of for creating plugin architecture?
>
> Best regards,
> Michal Wegrzyn



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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