Fwd: CLK-375 in milestone 2

View: New views
2 Messages — Rating Filter:   Alert me  

Parent Message unknown Fwd: CLK-375 in milestone 2

by Malcolm Edgar-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Alexei,

Could you please upload patches for your proposed improvement.

regards Malcolm Edgar

On Wed, Jul 16, 2008 at 2:09 PM, Alexei Sokolov
<alexei.sokolov@...> wrote:

> package net.sf.click.extras.spring;
>
> import org.springframework.beans.factory.config.BeanDefinition;
> import org.springframework.context.annotation.ScopeMetadata;
> import org.springframework.context.annotation.ScopeMetadataResolver;
>
> public class PageScopeResolver implements ScopeMetadataResolver {
>
>     private static final ScopeMetadata DEFAULT_PAGE_SCOPE =
> DEFAULT_PAGE_SCOPE();
>
>     private static final ScopeMetadata DEFAULT_PAGE_SCOPE() {
>         final ScopeMetadata value = new ScopeMetadata();
>         value.setScopeName(BeanDefinition.SCOPE_PROTOTYPE);
>         return value;
>     }
>
>     private ScopeMetadata pageScope = DEFAULT_PAGE_SCOPE;
>
>     @Override
>     public ScopeMetadata resolveScopeMetadata(BeanDefinition definition) {
>         return pageScope;
>     }
>
>     public void setPageScope(ScopeMetadata pageScope) {
>         this.pageScope = pageScope;
>     }
>
> }
>
>
> On Tue, Jul 15, 2008 at 9:04 PM, Alexei Sokolov <alexei.sokolov@...>
> wrote:
>>
>> Bonus:
>>
>> With the code attached to CLK-375 you need to specify @Scope annotation
>> for every page. But usually all pages will have same scope: "prototype" so
>> that new instance of the page is created every time page is requested. So I
>> wrote another class: PageScopeResolver. If you put the following xml
>> fragment in spring config:
>>
>>     <context:component-scan
>>         name-generator="net.sf.click.extras.spring.PageBeanNameGenerator"
>>         scope-resolver="net.sf.click.extras.spring.PageScopeResolver"
>>         base-package="com.clickweb.pages"/>
>>
>> then all of your pages will be created with scope="prototype" and you
>> don't need to annotate every page class with @Scope.
>>
>> Alex
>>
>> On Tue, Jul 15, 2008 at 12:12 PM, Alexei Sokolov
>> <alexei.sokolov@...> wrote:
>>>
>>> Malcolm,
>>>
>>> Is there a chance for http://www.avoka.com:8080/jira/browse/CLK-375 to be
>>> included in Milestone 2? Source code for JDK1.4 and spring framework 2.5 is
>>> included in the comments.
>>>
>>> Alex
>>
>
>

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Click-development mailing list
Click-development@...
https://lists.sourceforge.net/lists/listinfo/click-development

Re: Fwd: CLK-375 in milestone 2

by alexei.sokolov :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Done. See http://www.avoka.com:8080/jira/browse/CLK-375

Alex
On Wed, Jul 16, 2008 at 12:32 AM, Malcolm Edgar <malcolm.edgar@...> wrote:
Hi Alexei,

Could you please upload patches for your proposed improvement.

regards Malcolm Edgar

On Wed, Jul 16, 2008 at 2:09 PM, Alexei Sokolov
<alexei.sokolov@...> wrote:
> package net.sf.click.extras.spring;
>
> import org.springframework.beans.factory.config.BeanDefinition;
> import org.springframework.context.annotation.ScopeMetadata;
> import org.springframework.context.annotation.ScopeMetadataResolver;
>
> public class PageScopeResolver implements ScopeMetadataResolver {
>
>     private static final ScopeMetadata DEFAULT_PAGE_SCOPE =
> DEFAULT_PAGE_SCOPE();
>
>     private static final ScopeMetadata DEFAULT_PAGE_SCOPE() {
>         final ScopeMetadata value = new ScopeMetadata();
>         value.setScopeName(BeanDefinition.SCOPE_PROTOTYPE);
>         return value;
>     }
>
>     private ScopeMetadata pageScope = DEFAULT_PAGE_SCOPE;
>
>     @Override
>     public ScopeMetadata resolveScopeMetadata(BeanDefinition definition) {
>         return pageScope;
>     }
>
>     public void setPageScope(ScopeMetadata pageScope) {
>         this.pageScope = pageScope;
>     }
>
> }
>
>
> On Tue, Jul 15, 2008 at 9:04 PM, Alexei Sokolov <alexei.sokolov@...>
> wrote:
>>
>> Bonus:
>>
>> With the code attached to CLK-375 you need to specify @Scope annotation
>> for every page. But usually all pages will have same scope: "prototype" so
>> that new instance of the page is created every time page is requested. So I
>> wrote another class: PageScopeResolver. If you put the following xml
>> fragment in spring config:
>>
>>     <context:component-scan
>>         name-generator="net.sf.click.extras.spring.PageBeanNameGenerator"
>>         scope-resolver="net.sf.click.extras.spring.PageScopeResolver"
>>         base-package="com.clickweb.pages"/>
>>
>> then all of your pages will be created with scope="prototype" and you
>> don't need to annotate every page class with @Scope.
>>
>> Alex
>>
>> On Tue, Jul 15, 2008 at 12:12 PM, Alexei Sokolov
>> <alexei.sokolov@...> wrote:
>>>
>>> Malcolm,
>>>
>>> Is there a chance for http://www.avoka.com:8080/jira/browse/CLK-375 to be
>>> included in Milestone 2? Source code for JDK1.4 and spring framework 2.5 is
>>> included in the comments.
>>>
>>> Alex
>>
>
>

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Click-development mailing list
Click-development@...
https://lists.sourceforge.net/lists/listinfo/click-development


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Click-development mailing list
Click-development@...
https://lists.sourceforge.net/lists/listinfo/click-development