You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Martin Grigorov <mg...@apache.org> on 2010/10/22 20:18:54 UTC

Re: Wicket 1.5: IPageFactory and IAuthorizationStrategy.isInstantiationAuthorized related question

On Fri, Oct 22, 2010 at 7:59 PM, Vytautas Racelis <tu...@gmail.com> wrote:

> Hi,
>
> wicket 1.4.x IPageFactory has a method:
> <C extends Page> Page newPage(final Class<C> pageClass);
>
> wicket 1.4.x IAuthorizationStrategy has a method:
> <T extends Component> boolean isInstantiationAuthorized(Class<T>
> componentClass);
>
> So, i was implementing IPageFactory.newPage(...)
>
> and such action was correct:
>
> public <C extends Page> Page newPage(final Class<C> pageClass) {
>        if
> (!Session.get().getAuthorizationStrategy().isInstantiationAuthorized(pageClass)){
> <-- everything is fine
>        }
>        ...
> }
>
> Now what we have in wicket 1.5:
>
> IPageFactory has a method:
> <C extends IRequestablePage> IRequestablePage newPage(final Class<C>
> pageClass);
>
> IAuthorizationStrategy has a method:
> <T extends Component> boolean isInstantiationAuthorized(Class<T>
> componentClass);
>
> So, i am implementing IPageFactory.newPage(...)
>
> and such implementation is not correct anymore:
>
> public <C extends Page> Page newPage(final Class<C> pageClass) {
>        if
> (!Session.get().getAuthorizationStrategy().isInstantiationAuthorized(pageClass)){
> <-- this does not compile
>        }
>        ...
> }
>
> Bound mismatch: The generic method isInstantiationAuthorized(Class<T>) of
> type IAuthorizationStrategy is not applicable for the arguments (Class<C>).
> The inferred type C is not a valid substitute for the bounded parameter <T
> extends Component>
>
>
> Does anybody know how to solve such issue?
>
I know :-)
We need to use IRequestableComponent instead.

>
> Thanks;)
>
> --
> Regards,
> Vytautas Racelis
> -----------------------------------
> phone:+370-600-34389
> www.xaloon.org
> www.allcarindex.com
> www.leenle.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Wicket 1.5: IPageFactory and IAuthorizationStrategy.isInstantiationAuthorized related question

Posted by Vytautas <tu...@gmail.com>.
Thanks, update from trunk did help;)

On 10/22/2010 09:47 PM, Martin Grigorov wrote:
> Update to r1026443 and should be better
>
> On Fri, Oct 22, 2010 at 8:18 PM, Martin Grigorov<mg...@apache.org>wrote:
>
>>
>>
>> On Fri, Oct 22, 2010 at 7:59 PM, Vytautas Racelis<tu...@gmail.com>wrote:
>>
>>> Hi,
>>>
>>> wicket 1.4.x IPageFactory has a method:
>>> <C extends Page>  Page newPage(final Class<C>  pageClass);
>>>
>>> wicket 1.4.x IAuthorizationStrategy has a method:
>>> <T extends Component>  boolean isInstantiationAuthorized(Class<T>
>>> componentClass);
>>>
>>> So, i was implementing IPageFactory.newPage(...)
>>>
>>> and such action was correct:
>>>
>>> public<C extends Page>  Page newPage(final Class<C>  pageClass) {
>>>         if
>>> (!Session.get().getAuthorizationStrategy().isInstantiationAuthorized(pageClass)){
>>> <-- everything is fine
>>>         }
>>>         ...
>>> }
>>>
>>> Now what we have in wicket 1.5:
>>>
>>> IPageFactory has a method:
>>> <C extends IRequestablePage>  IRequestablePage newPage(final Class<C>
>>> pageClass);
>>>
>>> IAuthorizationStrategy has a method:
>>> <T extends Component>  boolean isInstantiationAuthorized(Class<T>
>>> componentClass);
>>>
>>> So, i am implementing IPageFactory.newPage(...)
>>>
>>> and such implementation is not correct anymore:
>>>
>>> public<C extends Page>  Page newPage(final Class<C>  pageClass) {
>>>         if
>>> (!Session.get().getAuthorizationStrategy().isInstantiationAuthorized(pageClass)){
>>> <-- this does not compile
>>>         }
>>>         ...
>>> }
>>>
>>> Bound mismatch: The generic method isInstantiationAuthorized(Class<T>) of
>>> type IAuthorizationStrategy is not applicable for the arguments (Class<C>).
>>> The inferred type C is not a valid substitute for the bounded parameter<T
>>> extends Component>
>>>
>>>
>>> Does anybody know how to solve such issue?
>>>
>> I know :-)
>> We need to use IRequestableComponent instead.
>>
>>>
>>> Thanks;)
>>>
>>> --
>>> Regards,
>>> Vytautas Racelis
>>> -----------------------------------
>>> phone:+370-600-34389
>>> www.xaloon.org
>>> www.allcarindex.com
>>> www.leenle.com
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>
>

-- 
Regards,
Vytautas
-----------------------------------
phone:+370-600-34389
www.xaloon.org
www.allcarindex.com

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


Re: Wicket 1.5: IPageFactory and IAuthorizationStrategy.isInstantiationAuthorized related question

Posted by Martin Grigorov <mg...@apache.org>.
Done.
r1026573


On Fri, Oct 22, 2010 at 11:56 PM, Vytautas <tu...@gmail.com> wrote:

> It would be great to have the same with
>
> org.apache.wicket.authorization.UnauthorizedInstantiationException, which
> currently uses Component:
> public <T extends Component> UnauthorizedInstantiationException(final
> Class<T> componentClass)
>
>
>
>
> On 10/22/2010 09:47 PM, Martin Grigorov wrote:
>
>> Update to r1026443 and should be better
>>
>
>
> --
> Regards,
> Vytautas
>
> -----------------------------------
> phone:+370-600-34389
> www.xaloon.org
> www.allcarindex.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Wicket 1.5: IPageFactory and IAuthorizationStrategy.isInstantiationAuthorized related question

Posted by Vytautas <tu...@gmail.com>.
It would be great to have the same with

org.apache.wicket.authorization.UnauthorizedInstantiationException, which currently uses Component:
public <T extends Component> UnauthorizedInstantiationException(final Class<T> componentClass)



On 10/22/2010 09:47 PM, Martin Grigorov wrote:
> Update to r1026443 and should be better


-- 
Regards,
Vytautas
-----------------------------------
phone:+370-600-34389
www.xaloon.org
www.allcarindex.com

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


Re: Wicket 1.5: IPageFactory and IAuthorizationStrategy.isInstantiationAuthorized related question

Posted by Vytautas <tu...@gmail.com>.
My fault, my apologies ;)

On 10/23/2010 07:25 PM, Martin Grigorov wrote:
> Are you sure that you use latest trunk ?

-- 
Regards,
Vytautas
-----------------------------------
phone:+370-600-34389
www.xaloon.org
www.allcarindex.com

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


Re: Wicket 1.5: IPageFactory and IAuthorizationStrategy.isInstantiationAuthorized related question

Posted by Martin Grigorov <mg...@apache.org>.
Are you sure that you use latest trunk ?
First I changed .IAuthorizationStrategy.isActionAuthorized() to receive
IRequestableComponent, but then I reverted it to Component again.

 org.apache.wicket.Component.isActionAuthorized(Component.java:2182) passes
"this", i.e. Component and it should be OK.

How exactly did you get this exception ?

On Sat, Oct 23, 2010 at 6:20 PM, Vytautas <tu...@gmail.com> wrote:

> Hi again :)
>  well, after trunk update it seems that there some places should be
> updated, which are related to
> IAuthorizationStrategy.boolean isActionAuthorized(Component component,
> Action action);
> to
> boolean isActionAuthorized(IRequestableComponent component, Action action);
> (also related classes)
>
> because without such changes i get an exception after application startup:
>
> java.lang.NoSuchMethodError:
> org.apache.wicket.authorization.IAuthorizationStrategy.isActionAuthorized(Lorg/apache/wicket/request/component/IRequestableComponent;Lorg/apache/wicket/authorization/Action;)Z
>        at
> org.apache.wicket.Component.isActionAuthorized(Component.java:2182)
>        at org.apache.wicket.Page.onBeforeRender(Page.java:1039)
>        ...
>
> Thanks for support ;)
>
>
> On 10/22/2010 09:47 PM, Martin Grigorov wrote:
>
>> Done. r1026573
>>
>
> --
> Regards,
> Vytautas
> -----------------------------------
>
> www.xaloon.org
> www.allcarindex.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Wicket 1.5: IPageFactory and IAuthorizationStrategy.isInstantiationAuthorized related question

Posted by Vytautas <tu...@gmail.com>.
Hi again :)
  well, after trunk update it seems that there some places should be updated, which are related to
IAuthorizationStrategy.boolean isActionAuthorized(Component component, Action action);
to
boolean isActionAuthorized(IRequestableComponent component, Action action);
(also related classes)

because without such changes i get an exception after application startup:

java.lang.NoSuchMethodError: org.apache.wicket.authorization.IAuthorizationStrategy.isActionAuthorized(Lorg/apache/wicket/request/component/IRequestableComponent;Lorg/apache/wicket/authorization/Action;)Z
	at org.apache.wicket.Component.isActionAuthorized(Component.java:2182)
	at org.apache.wicket.Page.onBeforeRender(Page.java:1039)
	...

Thanks for support ;)

On 10/22/2010 09:47 PM, Martin Grigorov wrote:
>Done. r1026573

-- 
Regards,
Vytautas
-----------------------------------
www.xaloon.org
www.allcarindex.com

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


Re: Wicket 1.5: IPageFactory and IAuthorizationStrategy.isInstantiationAuthorized related question

Posted by Martin Grigorov <mg...@apache.org>.
Update to r1026443 and should be better

On Fri, Oct 22, 2010 at 8:18 PM, Martin Grigorov <mg...@apache.org>wrote:

>
>
> On Fri, Oct 22, 2010 at 7:59 PM, Vytautas Racelis <tu...@gmail.com>wrote:
>
>> Hi,
>>
>> wicket 1.4.x IPageFactory has a method:
>> <C extends Page> Page newPage(final Class<C> pageClass);
>>
>> wicket 1.4.x IAuthorizationStrategy has a method:
>> <T extends Component> boolean isInstantiationAuthorized(Class<T>
>> componentClass);
>>
>> So, i was implementing IPageFactory.newPage(...)
>>
>> and such action was correct:
>>
>> public <C extends Page> Page newPage(final Class<C> pageClass) {
>>        if
>> (!Session.get().getAuthorizationStrategy().isInstantiationAuthorized(pageClass)){
>> <-- everything is fine
>>        }
>>        ...
>> }
>>
>> Now what we have in wicket 1.5:
>>
>> IPageFactory has a method:
>> <C extends IRequestablePage> IRequestablePage newPage(final Class<C>
>> pageClass);
>>
>> IAuthorizationStrategy has a method:
>> <T extends Component> boolean isInstantiationAuthorized(Class<T>
>> componentClass);
>>
>> So, i am implementing IPageFactory.newPage(...)
>>
>> and such implementation is not correct anymore:
>>
>> public <C extends Page> Page newPage(final Class<C> pageClass) {
>>        if
>> (!Session.get().getAuthorizationStrategy().isInstantiationAuthorized(pageClass)){
>> <-- this does not compile
>>        }
>>        ...
>> }
>>
>> Bound mismatch: The generic method isInstantiationAuthorized(Class<T>) of
>> type IAuthorizationStrategy is not applicable for the arguments (Class<C>).
>> The inferred type C is not a valid substitute for the bounded parameter <T
>> extends Component>
>>
>>
>> Does anybody know how to solve such issue?
>>
> I know :-)
> We need to use IRequestableComponent instead.
>
>>
>> Thanks;)
>>
>> --
>> Regards,
>> Vytautas Racelis
>> -----------------------------------
>> phone:+370-600-34389
>> www.xaloon.org
>> www.allcarindex.com
>> www.leenle.com
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>