You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltaspike.apache.org by Gerhard Petracek <ge...@gmail.com> on 2012/10/17 11:14:03 UTC

[DISCUSS] features related to the jsf lifecycle

hi @ all,

the support of cdi-observers for jsf phase-events in codi and seam-faces is
very similar.
a central difference is that codi uses only one additional annotation per
observer.
initially it was a workaround for a portability issue. however, you only
have to remember one annotation (per observer) and you get the rest via
std. auto-complete.

example:
protected void observePreRenderView(@Observes @BeforePhase(RENDER_RESPONSE)
PhaseEvent phaseEvent) {
  //...
}

codi even supports to filter it for views - e.g.:
@View(DemoPage.class)
public void observePostInvokeApplication(@Observes
@AfterPhase(JsfPhaseId.INVOKE_APPLICATION) PhaseEvent event) {
  //...
}

but we have to postpone that part for now until we have an agreement
concerning type-safe view-config and navigation.
(@View is also used for other features in codi.)

furthermore, we could add @BeforeFacesRequest and @AfterFacesRequest.
technically we could merge them with the annotations for phase-events, but
i wouldn't do it (because it's a slightly different topic and might confuse
users).

moreover, we could add @JsfPhaseListener which allows to add std. jsf
phase-listeners without xml config and enables injection support for them.
in codi we really register those listeners -> per default you don't have an
overhead. however, we needed some workarounds for mojarra.
-> as an alternative we could register one ds-phase-listener per default
which delegates to beans with @JsfPhaseListener.

since we don't support jsf 1.2, we can skip JsfLifecyclePhaseInformation
(jsf 2.0+ provides FacesContext#getCurrentPhaseId).

regards,
gerhard

Re: [DISCUSS] features related to the jsf lifecycle

Posted by Gerhard Petracek <ge...@gmail.com>.
back then i tried to avoid "*FacesPhase*" and i used Jsf* because it's
easier for the daily work, because your ide will never suggest a class from
the jsf-api itself.
+0 to align those names, but i would tend to use @BeforeJsfRequest /
@AfterJsfRequest and keep the other names.

regards,
gerhard



2012/10/17 Thomas Andraschko <zo...@gmail.com>

> +1 For "Faces" prefix istead of "Jsf"
>

Re: [DISCUSS] features related to the jsf lifecycle

Posted by Thomas Andraschko <zo...@gmail.com>.
+1 For "Faces" prefix istead of "Jsf"

Re: [DISCUSS] features related to the jsf lifecycle

Posted by Christian Kaltepoth <ch...@kaltepoth.de>.
+1

2012/10/19 Jason Porter <li...@gmail.com>

> +1
>
> On Thu, Oct 18, 2012 at 3:42 PM, Mark Struberg <st...@yahoo.de> wrote:
>
> > +1
> >
> > LieGrue,
> > strub
> >
> >
> >
> >
> > ----- Original Message -----
> > > From: Gerhard Petracek <ge...@gmail.com>
> > > To: deltaspike-dev@incubator.apache.org
> > > Cc:
> > > Sent: Thursday, October 18, 2012 11:39 PM
> > > Subject: Re: [DISCUSS] features related to the jsf lifecycle
> > >
> > > if there are no objections, i'll import the annotations tomorrow.
> > > -> we can change the names later on (as soon as we have an agreement).
> > >
> > > regards,
> > > gerhard
> > >
> > >
> > >
> > > 2012/10/17 Jason Porter <li...@gmail.com>
> > >
> > >>  I honestly don't have a preference for the names.
> > >>
> > >>  +1 for @BeforePhase / @AfterPhase
> > >>
> > >>  On Wed, Oct 17, 2012 at 12:38 PM, Brian Leathem <bl...@gmail.com>
> > >>  wrote:
> > >>
> > >>  > On Wed 17 Oct 2012 11:17:46 AM PDT, Brian Leathem wrote:
> > >>  >
> > >>  >> can we not build on the @ListenerFor annotation in JSF [1]?
> > >>  >>
> > >>  >> @ListenerFor(phaseEventClass=.**..)
> > >>  >>
> > >>  >> or, if we need a unique name, perhaps:
> > >>  >>
> > >>  >> @ListenerForPhase(**phaseEventClass=...)
> > >>  >>
> > >>  >
> > >>  > As Gerhard pointed out in IRC, this would just be a marker
> > annotation,
> > >>  and
> > >>  > hence empty:
> > >>  > @ListenerForPhase()
> > >>  >
> > >>  > Brian
> > >>  >
> > >>  >
> > >>
> > >>
> > >>  --
> > >>  Jason Porter
> > >>  http://lightguard-jp.blogspot.com
> > >>  http://twitter.com/lightguardjp
> > >>
> > >>  Software Engineer
> > >>  Open Source Advocate
> > >>
> > >>  PGP key id: 926CCFF5
> > >>  PGP key available at: keyserver.net, pgp.mit.edu
> > >>
> > >
> >
>
>
>
> --
> Jason Porter
> http://lightguard-jp.blogspot.com
> http://twitter.com/lightguardjp
>
> Software Engineer
> Open Source Advocate
>
> PGP key id: 926CCFF5
> PGP key available at: keyserver.net, pgp.mit.edu
>



-- 
Christian Kaltepoth
Blog: http://chkal.blogspot.com/
Twitter: http://twitter.com/chkal

Re: [DISCUSS] features related to the jsf lifecycle

Posted by Jason Porter <li...@gmail.com>.
+1

On Thu, Oct 18, 2012 at 3:42 PM, Mark Struberg <st...@yahoo.de> wrote:

> +1
>
> LieGrue,
> strub
>
>
>
>
> ----- Original Message -----
> > From: Gerhard Petracek <ge...@gmail.com>
> > To: deltaspike-dev@incubator.apache.org
> > Cc:
> > Sent: Thursday, October 18, 2012 11:39 PM
> > Subject: Re: [DISCUSS] features related to the jsf lifecycle
> >
> > if there are no objections, i'll import the annotations tomorrow.
> > -> we can change the names later on (as soon as we have an agreement).
> >
> > regards,
> > gerhard
> >
> >
> >
> > 2012/10/17 Jason Porter <li...@gmail.com>
> >
> >>  I honestly don't have a preference for the names.
> >>
> >>  +1 for @BeforePhase / @AfterPhase
> >>
> >>  On Wed, Oct 17, 2012 at 12:38 PM, Brian Leathem <bl...@gmail.com>
> >>  wrote:
> >>
> >>  > On Wed 17 Oct 2012 11:17:46 AM PDT, Brian Leathem wrote:
> >>  >
> >>  >> can we not build on the @ListenerFor annotation in JSF [1]?
> >>  >>
> >>  >> @ListenerFor(phaseEventClass=.**..)
> >>  >>
> >>  >> or, if we need a unique name, perhaps:
> >>  >>
> >>  >> @ListenerForPhase(**phaseEventClass=...)
> >>  >>
> >>  >
> >>  > As Gerhard pointed out in IRC, this would just be a marker
> annotation,
> >>  and
> >>  > hence empty:
> >>  > @ListenerForPhase()
> >>  >
> >>  > Brian
> >>  >
> >>  >
> >>
> >>
> >>  --
> >>  Jason Porter
> >>  http://lightguard-jp.blogspot.com
> >>  http://twitter.com/lightguardjp
> >>
> >>  Software Engineer
> >>  Open Source Advocate
> >>
> >>  PGP key id: 926CCFF5
> >>  PGP key available at: keyserver.net, pgp.mit.edu
> >>
> >
>



-- 
Jason Porter
http://lightguard-jp.blogspot.com
http://twitter.com/lightguardjp

Software Engineer
Open Source Advocate

PGP key id: 926CCFF5
PGP key available at: keyserver.net, pgp.mit.edu

Re: [DISCUSS] features related to the jsf lifecycle

Posted by Mark Struberg <st...@yahoo.de>.
+1

LieGrue,
strub




----- Original Message -----
> From: Gerhard Petracek <ge...@gmail.com>
> To: deltaspike-dev@incubator.apache.org
> Cc: 
> Sent: Thursday, October 18, 2012 11:39 PM
> Subject: Re: [DISCUSS] features related to the jsf lifecycle
> 
> if there are no objections, i'll import the annotations tomorrow.
> -> we can change the names later on (as soon as we have an agreement).
> 
> regards,
> gerhard
> 
> 
> 
> 2012/10/17 Jason Porter <li...@gmail.com>
> 
>>  I honestly don't have a preference for the names.
>> 
>>  +1 for @BeforePhase / @AfterPhase
>> 
>>  On Wed, Oct 17, 2012 at 12:38 PM, Brian Leathem <bl...@gmail.com>
>>  wrote:
>> 
>>  > On Wed 17 Oct 2012 11:17:46 AM PDT, Brian Leathem wrote:
>>  >
>>  >> can we not build on the @ListenerFor annotation in JSF [1]?
>>  >>
>>  >> @ListenerFor(phaseEventClass=.**..)
>>  >>
>>  >> or, if we need a unique name, perhaps:
>>  >>
>>  >> @ListenerForPhase(**phaseEventClass=...)
>>  >>
>>  >
>>  > As Gerhard pointed out in IRC, this would just be a marker annotation,
>>  and
>>  > hence empty:
>>  > @ListenerForPhase()
>>  >
>>  > Brian
>>  >
>>  >
>> 
>> 
>>  --
>>  Jason Porter
>>  http://lightguard-jp.blogspot.com
>>  http://twitter.com/lightguardjp
>> 
>>  Software Engineer
>>  Open Source Advocate
>> 
>>  PGP key id: 926CCFF5
>>  PGP key available at: keyserver.net, pgp.mit.edu
>> 
> 

Re: [DISCUSS] features related to the jsf lifecycle

Posted by Gerhard Petracek <ge...@gmail.com>.
if there are no objections, i'll import the annotations tomorrow.
-> we can change the names later on (as soon as we have an agreement).

regards,
gerhard



2012/10/17 Jason Porter <li...@gmail.com>

> I honestly don't have a preference for the names.
>
> +1 for @BeforePhase / @AfterPhase
>
> On Wed, Oct 17, 2012 at 12:38 PM, Brian Leathem <bl...@gmail.com>
> wrote:
>
> > On Wed 17 Oct 2012 11:17:46 AM PDT, Brian Leathem wrote:
> >
> >> can we not build on the @ListenerFor annotation in JSF [1]?
> >>
> >> @ListenerFor(phaseEventClass=.**..)
> >>
> >> or, if we need a unique name, perhaps:
> >>
> >> @ListenerForPhase(**phaseEventClass=...)
> >>
> >
> > As Gerhard pointed out in IRC, this would just be a marker annotation,
> and
> > hence empty:
> > @ListenerForPhase()
> >
> > Brian
> >
> >
>
>
> --
> Jason Porter
> http://lightguard-jp.blogspot.com
> http://twitter.com/lightguardjp
>
> Software Engineer
> Open Source Advocate
>
> PGP key id: 926CCFF5
> PGP key available at: keyserver.net, pgp.mit.edu
>

Re: [DISCUSS] features related to the jsf lifecycle

Posted by Jason Porter <li...@gmail.com>.
I honestly don't have a preference for the names.

+1 for @BeforePhase / @AfterPhase

On Wed, Oct 17, 2012 at 12:38 PM, Brian Leathem <bl...@gmail.com> wrote:

> On Wed 17 Oct 2012 11:17:46 AM PDT, Brian Leathem wrote:
>
>> can we not build on the @ListenerFor annotation in JSF [1]?
>>
>> @ListenerFor(phaseEventClass=.**..)
>>
>> or, if we need a unique name, perhaps:
>>
>> @ListenerForPhase(**phaseEventClass=...)
>>
>
> As Gerhard pointed out in IRC, this would just be a marker annotation, and
> hence empty:
> @ListenerForPhase()
>
> Brian
>
>


-- 
Jason Porter
http://lightguard-jp.blogspot.com
http://twitter.com/lightguardjp

Software Engineer
Open Source Advocate

PGP key id: 926CCFF5
PGP key available at: keyserver.net, pgp.mit.edu

Re: [DISCUSS] features related to the jsf lifecycle

Posted by Brian Leathem <bl...@gmail.com>.
On Wed 17 Oct 2012 11:17:46 AM PDT, Brian Leathem wrote:
> can we not build on the @ListenerFor annotation in JSF [1]?
>
> @ListenerFor(phaseEventClass=...)
>
> or, if we need a unique name, perhaps:
>
> @ListenerForPhase(phaseEventClass=...)

As Gerhard pointed out in IRC, this would just be a marker annotation, 
and hence empty:
@ListenerForPhase()

Brian


Re: [DISCUSS] features related to the jsf lifecycle

Posted by Brian Leathem <bl...@gmail.com>.
On 12-10-17 08:24 AM, Christian Kaltepoth wrote:
> +1 for @BeforePhase and @AfterPhase.

Agreed, this is tighter than the pair of annotations required in Seam Faces.

> I like that this forces the user to specify both the concrete phase and the
> time (before vs after).
>
> +0.8 for @BeforeFacesRequest, @AfterFacesRequest

+1 !!

>   and @JsfPhaseListener

can we not build on the @ListenerFor annotation in JSF [1]?

@ListenerFor(phaseEventClass=...)

or, if we need a unique name, perhaps:

@ListenerForPhase(phaseEventClass=...)


> I like the concept, but I suggest that we use "Jsf" or "Faces" consistently

+1 for being consistent between JSF/Faces in general.

Brian

> in the annotation names. So if we use @BeforeFacesRequest, we should also
> use @FacesPhaseListener. This would also apply to the enum JsfPhaseId.
> Perhaps we could just use "Phase" here?
>
> Christian
>
>
> 2012/10/17 Pete Muir <pm...@redhat.com>
>
>> +0 from me, I would be happy with either + don't really use JSF anymore ;-)
>>
>> On 17 Oct 2012, at 10:27, Mark Struberg wrote:
>>
>>> +1
>>>
>>> looks really good!
>>>
>>> LieGrue,
>>> strub
>>>
>>>
>>>
>>>
>>> ----- Original Message -----
>>>> From: Gerhard Petracek <ge...@gmail.com>
>>>> To: deltaspike <de...@incubator.apache.org>
>>>> Cc:
>>>> Sent: Wednesday, October 17, 2012 11:14 AM
>>>> Subject: Re: [DISCUSS] features related to the jsf lifecycle
>>>>
>>>> +1 for:
>>>> @BeforePhase / @AfterPhase
>>>> @BeforeFacesRequest / @AfterFacesRequest
>>>> @JsfPhaseListener
>>>>
>>>> regards,
>>>> gerhard
>>>>
>>>>
>>>>
>>>> 2012/10/17 Gerhard Petracek <ge...@gmail.com>
>>>>
>>>>> hi @ all,
>>>>>
>>>>> the support of cdi-observers for jsf phase-events in codi and
>> seam-faces
>>>>> is very similar.
>>>>> a central difference is that codi uses only one additional annotation
>> per
>>>>> observer.
>>>>> initially it was a workaround for a portability issue. however, you
>> only
>>>>> have to remember one annotation (per observer) and you get the rest via
>>>>> std. auto-complete.
>>>>>
>>>>> example:
>>>>> protected void observePreRenderView(@Observes
>>>>> @BeforePhase(RENDER_RESPONSE) PhaseEvent phaseEvent) {
>>>>>     //...
>>>>> }
>>>>>
>>>>> codi even supports to filter it for views - e.g.:
>>>>> @View(DemoPage.class)
>>>>> public void observePostInvokeApplication(@Observes
>>>>> @AfterPhase(JsfPhaseId.INVOKE_APPLICATION) PhaseEvent event) {
>>>>>     //...
>>>>> }
>>>>>
>>>>> but we have to postpone that part for now until we have an agreement
>>>>> concerning type-safe view-config and navigation.
>>>>> (@View is also used for other features in codi.)
>>>>>
>>>>> furthermore, we could add @BeforeFacesRequest and @AfterFacesRequest.
>>>>> technically we could merge them with the annotations for phase-events,
>> but
>>>>> i wouldn't do it (because it's a slightly different topic and might
>>>> confuse
>>>>> users).
>>>>>
>>>>> moreover, we could add @JsfPhaseListener which allows to add std. jsf
>>>>> phase-listeners without xml config and enables injection support for
>> them.
>>>>> in codi we really register those listeners -> per default you don't
>>>> have
>>>>> an overhead. however, we needed some workarounds for mojarra.
>>>>> -> as an alternative we could register one ds-phase-listener per
>> default
>>>>> which delegates to beans with @JsfPhaseListener.
>>>>>
>>>>> since we don't support jsf 1.2, we can skip
>>>> JsfLifecyclePhaseInformation
>>>>> (jsf 2.0+ provides FacesContext#getCurrentPhaseId).
>>>>>
>>>>> regards,
>>>>> gerhard
>>>>>
>>
>


Re: [DISCUSS] features related to the jsf lifecycle

Posted by Christian Kaltepoth <ch...@kaltepoth.de>.
+1 for @BeforePhase and @AfterPhase.

I like that this forces the user to specify both the concrete phase and the
time (before vs after).

+0.8 for @BeforeFacesRequest, @AfterFacesRequest and @JsfPhaseListener

I like the concept, but I suggest that we use "Jsf" or "Faces" consistently
in the annotation names. So if we use @BeforeFacesRequest, we should also
use @FacesPhaseListener. This would also apply to the enum JsfPhaseId.
Perhaps we could just use "Phase" here?

Christian


2012/10/17 Pete Muir <pm...@redhat.com>

> +0 from me, I would be happy with either + don't really use JSF anymore ;-)
>
> On 17 Oct 2012, at 10:27, Mark Struberg wrote:
>
> > +1
> >
> > looks really good!
> >
> > LieGrue,
> > strub
> >
> >
> >
> >
> > ----- Original Message -----
> >> From: Gerhard Petracek <ge...@gmail.com>
> >> To: deltaspike <de...@incubator.apache.org>
> >> Cc:
> >> Sent: Wednesday, October 17, 2012 11:14 AM
> >> Subject: Re: [DISCUSS] features related to the jsf lifecycle
> >>
> >> +1 for:
> >> @BeforePhase / @AfterPhase
> >> @BeforeFacesRequest / @AfterFacesRequest
> >> @JsfPhaseListener
> >>
> >> regards,
> >> gerhard
> >>
> >>
> >>
> >> 2012/10/17 Gerhard Petracek <ge...@gmail.com>
> >>
> >>> hi @ all,
> >>>
> >>> the support of cdi-observers for jsf phase-events in codi and
> seam-faces
> >>> is very similar.
> >>> a central difference is that codi uses only one additional annotation
> per
> >>> observer.
> >>> initially it was a workaround for a portability issue. however, you
> only
> >>> have to remember one annotation (per observer) and you get the rest via
> >>> std. auto-complete.
> >>>
> >>> example:
> >>> protected void observePreRenderView(@Observes
> >>> @BeforePhase(RENDER_RESPONSE) PhaseEvent phaseEvent) {
> >>>    //...
> >>> }
> >>>
> >>> codi even supports to filter it for views - e.g.:
> >>> @View(DemoPage.class)
> >>> public void observePostInvokeApplication(@Observes
> >>> @AfterPhase(JsfPhaseId.INVOKE_APPLICATION) PhaseEvent event) {
> >>>    //...
> >>> }
> >>>
> >>> but we have to postpone that part for now until we have an agreement
> >>> concerning type-safe view-config and navigation.
> >>> (@View is also used for other features in codi.)
> >>>
> >>> furthermore, we could add @BeforeFacesRequest and @AfterFacesRequest.
> >>> technically we could merge them with the annotations for phase-events,
> but
> >>> i wouldn't do it (because it's a slightly different topic and might
> >> confuse
> >>> users).
> >>>
> >>> moreover, we could add @JsfPhaseListener which allows to add std. jsf
> >>> phase-listeners without xml config and enables injection support for
> them.
> >>> in codi we really register those listeners -> per default you don't
> >> have
> >>> an overhead. however, we needed some workarounds for mojarra.
> >>> -> as an alternative we could register one ds-phase-listener per
> default
> >>> which delegates to beans with @JsfPhaseListener.
> >>>
> >>> since we don't support jsf 1.2, we can skip
> >> JsfLifecyclePhaseInformation
> >>> (jsf 2.0+ provides FacesContext#getCurrentPhaseId).
> >>>
> >>> regards,
> >>> gerhard
> >>>
> >>
>
>


-- 
Christian Kaltepoth
Blog: http://chkal.blogspot.com/
Twitter: http://twitter.com/chkal

Re: [DISCUSS] features related to the jsf lifecycle

Posted by Pete Muir <pm...@redhat.com>.
+0 from me, I would be happy with either + don't really use JSF anymore ;-)

On 17 Oct 2012, at 10:27, Mark Struberg wrote:

> +1
> 
> looks really good!
> 
> LieGrue,
> strub
> 
> 
> 
> 
> ----- Original Message -----
>> From: Gerhard Petracek <ge...@gmail.com>
>> To: deltaspike <de...@incubator.apache.org>
>> Cc: 
>> Sent: Wednesday, October 17, 2012 11:14 AM
>> Subject: Re: [DISCUSS] features related to the jsf lifecycle
>> 
>> +1 for:
>> @BeforePhase / @AfterPhase
>> @BeforeFacesRequest / @AfterFacesRequest
>> @JsfPhaseListener
>> 
>> regards,
>> gerhard
>> 
>> 
>> 
>> 2012/10/17 Gerhard Petracek <ge...@gmail.com>
>> 
>>> hi @ all,
>>> 
>>> the support of cdi-observers for jsf phase-events in codi and seam-faces
>>> is very similar.
>>> a central difference is that codi uses only one additional annotation per
>>> observer.
>>> initially it was a workaround for a portability issue. however, you only
>>> have to remember one annotation (per observer) and you get the rest via
>>> std. auto-complete.
>>> 
>>> example:
>>> protected void observePreRenderView(@Observes
>>> @BeforePhase(RENDER_RESPONSE) PhaseEvent phaseEvent) {
>>>    //...
>>> }
>>> 
>>> codi even supports to filter it for views - e.g.:
>>> @View(DemoPage.class)
>>> public void observePostInvokeApplication(@Observes
>>> @AfterPhase(JsfPhaseId.INVOKE_APPLICATION) PhaseEvent event) {
>>>    //...
>>> }
>>> 
>>> but we have to postpone that part for now until we have an agreement
>>> concerning type-safe view-config and navigation.
>>> (@View is also used for other features in codi.)
>>> 
>>> furthermore, we could add @BeforeFacesRequest and @AfterFacesRequest.
>>> technically we could merge them with the annotations for phase-events, but
>>> i wouldn't do it (because it's a slightly different topic and might 
>> confuse
>>> users).
>>> 
>>> moreover, we could add @JsfPhaseListener which allows to add std. jsf
>>> phase-listeners without xml config and enables injection support for them.
>>> in codi we really register those listeners -> per default you don't 
>> have
>>> an overhead. however, we needed some workarounds for mojarra.
>>> -> as an alternative we could register one ds-phase-listener per default
>>> which delegates to beans with @JsfPhaseListener.
>>> 
>>> since we don't support jsf 1.2, we can skip 
>> JsfLifecyclePhaseInformation
>>> (jsf 2.0+ provides FacesContext#getCurrentPhaseId).
>>> 
>>> regards,
>>> gerhard
>>> 
>> 


Re: [DISCUSS] features related to the jsf lifecycle

Posted by Mark Struberg <st...@yahoo.de>.
+1

looks really good!

LieGrue,
strub




----- Original Message -----
> From: Gerhard Petracek <ge...@gmail.com>
> To: deltaspike <de...@incubator.apache.org>
> Cc: 
> Sent: Wednesday, October 17, 2012 11:14 AM
> Subject: Re: [DISCUSS] features related to the jsf lifecycle
> 
> +1 for:
> @BeforePhase / @AfterPhase
> @BeforeFacesRequest / @AfterFacesRequest
> @JsfPhaseListener
> 
> regards,
> gerhard
> 
> 
> 
> 2012/10/17 Gerhard Petracek <ge...@gmail.com>
> 
>>  hi @ all,
>> 
>>  the support of cdi-observers for jsf phase-events in codi and seam-faces
>>  is very similar.
>>  a central difference is that codi uses only one additional annotation per
>>  observer.
>>  initially it was a workaround for a portability issue. however, you only
>>  have to remember one annotation (per observer) and you get the rest via
>>  std. auto-complete.
>> 
>>  example:
>>  protected void observePreRenderView(@Observes
>>  @BeforePhase(RENDER_RESPONSE) PhaseEvent phaseEvent) {
>>    //...
>>  }
>> 
>>  codi even supports to filter it for views - e.g.:
>>  @View(DemoPage.class)
>>  public void observePostInvokeApplication(@Observes
>>  @AfterPhase(JsfPhaseId.INVOKE_APPLICATION) PhaseEvent event) {
>>    //...
>>  }
>> 
>>  but we have to postpone that part for now until we have an agreement
>>  concerning type-safe view-config and navigation.
>>  (@View is also used for other features in codi.)
>> 
>>  furthermore, we could add @BeforeFacesRequest and @AfterFacesRequest.
>>  technically we could merge them with the annotations for phase-events, but
>>  i wouldn't do it (because it's a slightly different topic and might 
> confuse
>>  users).
>> 
>>  moreover, we could add @JsfPhaseListener which allows to add std. jsf
>>  phase-listeners without xml config and enables injection support for them.
>>  in codi we really register those listeners -> per default you don't 
> have
>>  an overhead. however, we needed some workarounds for mojarra.
>>  -> as an alternative we could register one ds-phase-listener per default
>>  which delegates to beans with @JsfPhaseListener.
>> 
>>  since we don't support jsf 1.2, we can skip 
> JsfLifecyclePhaseInformation
>>  (jsf 2.0+ provides FacesContext#getCurrentPhaseId).
>> 
>>  regards,
>>  gerhard
>> 
> 

Re: [DISCUSS] features related to the jsf lifecycle

Posted by Gerhard Petracek <ge...@gmail.com>.
+1 for:
@BeforePhase / @AfterPhase
@BeforeFacesRequest / @AfterFacesRequest
@JsfPhaseListener

regards,
gerhard



2012/10/17 Gerhard Petracek <ge...@gmail.com>

> hi @ all,
>
> the support of cdi-observers for jsf phase-events in codi and seam-faces
> is very similar.
> a central difference is that codi uses only one additional annotation per
> observer.
> initially it was a workaround for a portability issue. however, you only
> have to remember one annotation (per observer) and you get the rest via
> std. auto-complete.
>
> example:
> protected void observePreRenderView(@Observes
> @BeforePhase(RENDER_RESPONSE) PhaseEvent phaseEvent) {
>   //...
> }
>
> codi even supports to filter it for views - e.g.:
> @View(DemoPage.class)
> public void observePostInvokeApplication(@Observes
> @AfterPhase(JsfPhaseId.INVOKE_APPLICATION) PhaseEvent event) {
>   //...
> }
>
> but we have to postpone that part for now until we have an agreement
> concerning type-safe view-config and navigation.
> (@View is also used for other features in codi.)
>
> furthermore, we could add @BeforeFacesRequest and @AfterFacesRequest.
> technically we could merge them with the annotations for phase-events, but
> i wouldn't do it (because it's a slightly different topic and might confuse
> users).
>
> moreover, we could add @JsfPhaseListener which allows to add std. jsf
> phase-listeners without xml config and enables injection support for them.
> in codi we really register those listeners -> per default you don't have
> an overhead. however, we needed some workarounds for mojarra.
> -> as an alternative we could register one ds-phase-listener per default
> which delegates to beans with @JsfPhaseListener.
>
> since we don't support jsf 1.2, we can skip JsfLifecyclePhaseInformation
> (jsf 2.0+ provides FacesContext#getCurrentPhaseId).
>
> regards,
> gerhard
>

Re: [DISCUSS] features related to the jsf lifecycle

Posted by Gerhard Petracek <ge...@gmail.com>.
hi pete,

@View is just an interceptor which is often used in combination with the
phase-listener observer-methods.
i just mentioned it since it's documented side-by-side in the wiki,
however, as mentioned before we have to postpone the discussion about it.

regards,
gerhard



2012/10/17 Pete Muir <pm...@redhat.com>

> Shouldn't @View be a parameter annotation?
>
> Semantically, you are saying "observe the after phase of invoke
> application on DemoPage" AIUI.
>
> On 17 Oct 2012, at 10:14, Gerhard Petracek wrote:
>
> > codi even supports to filter it for views - e.g.:
> > @View(DemoPage.class)
> > public void observePostInvokeApplication(@Observes
> > @AfterPhase(JsfPhaseId.INVOKE_APPLICATION) PhaseEvent event) {
> >  //...
> > }
> >
> > but we have to postpone that part for now until we have an agreement
> > concerning type-safe view-config and navigation.
> > (@View is also used for other features in codi.)
>
>

Re: [DISCUSS] features related to the jsf lifecycle

Posted by Pete Muir <pm...@redhat.com>.
Shouldn't @View be a parameter annotation?

Semantically, you are saying "observe the after phase of invoke application on DemoPage" AIUI.

On 17 Oct 2012, at 10:14, Gerhard Petracek wrote:

> codi even supports to filter it for views - e.g.:
> @View(DemoPage.class)
> public void observePostInvokeApplication(@Observes
> @AfterPhase(JsfPhaseId.INVOKE_APPLICATION) PhaseEvent event) {
>  //...
> }
> 
> but we have to postpone that part for now until we have an agreement
> concerning type-safe view-config and navigation.
> (@View is also used for other features in codi.)