You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Steven Rudolf <St...@web.de> on 2011/09/21 11:18:58 UTC

[CODI] validating typesafe viewConfig

Hello,

I am using CODI and I love the typesafe navigation.
It is described well how the names of the xhtml-pages are resolved from the hierarchy of the viewConfig classes. The problem is that if I made an error in the viewConfig I will realize it only at runtime if I click on the link or the button which navigates to the wrong defined page.
I see there is a log at project startup where CODI resolves all @Page annotations and bind them as view configurations. At this point it should be possible to validate if the xhtml-page to every viewConfig is present in my application. So I would get the definition error at project startup and not if click on the link.

Is it possible somehow?

Respectfully,
Steven
___________________________________________________________
Schon gehört? WEB.DE hat einen genialen Phishing-Filter in die
Toolbar eingebaut! http://produkte.web.de/go/toolbar

Re: [CODI] validating typesafe viewConfig

Posted by Gerhard Petracek <ge...@gmail.com>.
it might be incompatible with extensions which are doing some "magic" at
runtime.
some weeks ago i started prototyping some parts of it and since we will have
the new module also for other features, we should put it there.
(there won't be a new api/spi for it -> we can move it at any time...)

regards,
gerhard

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces


2011/9/21 Mark Struberg <st...@yahoo.de>

> Hi!
>
> Good idea, but why do we like to do this only for Development?
> If so, we can just keep it in the standard module and use
> @ProjectStageActivated
>
> But tbh, it doesnt hurt if we do this in production as well as it will only
> get executed once (at startup).
>
> LieGrue,
> strub
>
>
>
> ----- Original Message -----
> > From: Gerhard Petracek <ge...@gmail.com>
> > To: MyFaces Discussion <us...@myfaces.apache.org>
> > Cc:
> > Sent: Wednesday, September 21, 2011 11:59 AM
> > Subject: Re: [CODI] validating typesafe viewConfig
> >
> > hi steven,
> >
> > i started with a small prototype for an implementation-validation module
> > which will be part of a new dev-module.
> > one part of it will do exactly what you described. currently we are
> working
> > on the last parts of codi v1.0.2 and afterwards i'll continue with this
> new
> > module.
> > if you need it earlier, you could e.g. write your own wrapper which
> > intercepts the calls to the default-ViewConfigExtractor - so you can
> > validate the results (an example is e.g. at [1] and [2]).
> > furthermore, you could provide it as concrete suggestion for this
> upcoming
> > module.
> >
> > regards,
> > gerhard
> >
> > [1]
> >
> https://svn.apache.org/repos/asf/myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/jsf/test/impl/config/view/TestViewConfigExtractor.java
> > [2]
> >
> https://svn.apache.org/repos/asf/myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/test/resources/META-INF/services/org.apache.myfaces.extensions.cdi.jsf.impl.config.view.spi.ViewConfigExtractor
> >
> > http://www.irian.at
> >
> > Your JSF powerhouse -
> > JSF Consulting, Development and
> > Courses in English and German
> >
> > Professional Support for Apache MyFaces
> >
> >
> > 2011/9/21 Steven Rudolf <St...@web.de>
> >
> >>  Hello,
> >>
> >>  I am using CODI and I love the typesafe navigation.
> >>  It is described well how the names of the xhtml-pages are resolved from
> the
> >>  hierarchy of the viewConfig classes. The problem is that if I made an
> error
> >>  in the viewConfig I will realize it only at runtime if I click on the
> link
> >>  or the button which navigates to the wrong defined page.
> >>  I see there is a log at project startup where CODI resolves all @Page
> >>  annotations and bind them as view configurations. At this point it
> should
> > be
> >>  possible to validate if the xhtml-page to every viewConfig is present
> in my
> >>  application. So I would get the definition error at project startup and
> not
> >>  if click on the link.
> >>
> >>  Is it possible somehow?
> >>
> >>  Respectfully,
> >>  Steven
> >>  ___________________________________________________________
> >>  Schon gehört? WEB.DE hat einen genialen Phishing-Filter in die
> >>  Toolbar eingebaut! http://produkte.web.de/go/toolbar
> >>
> >
>

Re: [CODI] validating typesafe viewConfig

Posted by Mark Struberg <st...@yahoo.de>.
Hi!

Good idea, but why do we like to do this only for Development?
If so, we can just keep it in the standard module and use @ProjectStageActivated

But tbh, it doesnt hurt if we do this in production as well as it will only get executed once (at startup).

LieGrue,
strub



----- Original Message -----
> From: Gerhard Petracek <ge...@gmail.com>
> To: MyFaces Discussion <us...@myfaces.apache.org>
> Cc: 
> Sent: Wednesday, September 21, 2011 11:59 AM
> Subject: Re: [CODI] validating typesafe viewConfig
> 
> hi steven,
> 
> i started with a small prototype for an implementation-validation module
> which will be part of a new dev-module.
> one part of it will do exactly what you described. currently we are working
> on the last parts of codi v1.0.2 and afterwards i'll continue with this new
> module.
> if you need it earlier, you could e.g. write your own wrapper which
> intercepts the calls to the default-ViewConfigExtractor - so you can
> validate the results (an example is e.g. at [1] and [2]).
> furthermore, you could provide it as concrete suggestion for this upcoming
> module.
> 
> regards,
> gerhard
> 
> [1]
> https://svn.apache.org/repos/asf/myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/jsf/test/impl/config/view/TestViewConfigExtractor.java
> [2]
> https://svn.apache.org/repos/asf/myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/test/resources/META-INF/services/org.apache.myfaces.extensions.cdi.jsf.impl.config.view.spi.ViewConfigExtractor
> 
> http://www.irian.at
> 
> Your JSF powerhouse -
> JSF Consulting, Development and
> Courses in English and German
> 
> Professional Support for Apache MyFaces
> 
> 
> 2011/9/21 Steven Rudolf <St...@web.de>
> 
>>  Hello,
>> 
>>  I am using CODI and I love the typesafe navigation.
>>  It is described well how the names of the xhtml-pages are resolved from the
>>  hierarchy of the viewConfig classes. The problem is that if I made an error
>>  in the viewConfig I will realize it only at runtime if I click on the link
>>  or the button which navigates to the wrong defined page.
>>  I see there is a log at project startup where CODI resolves all @Page
>>  annotations and bind them as view configurations. At this point it should 
> be
>>  possible to validate if the xhtml-page to every viewConfig is present in my
>>  application. So I would get the definition error at project startup and not
>>  if click on the link.
>> 
>>  Is it possible somehow?
>> 
>>  Respectfully,
>>  Steven
>>  ___________________________________________________________
>>  Schon gehört? WEB.DE hat einen genialen Phishing-Filter in die
>>  Toolbar eingebaut! http://produkte.web.de/go/toolbar
>> 
>

Re: [CODI] validating typesafe viewConfig

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

i started with a small prototype for an implementation-validation module
which will be part of a new dev-module.
one part of it will do exactly what you described. currently we are working
on the last parts of codi v1.0.2 and afterwards i'll continue with this new
module.
if you need it earlier, you could e.g. write your own wrapper which
intercepts the calls to the default-ViewConfigExtractor - so you can
validate the results (an example is e.g. at [1] and [2]).
furthermore, you could provide it as concrete suggestion for this upcoming
module.

regards,
gerhard

[1]
https://svn.apache.org/repos/asf/myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/jsf/test/impl/config/view/TestViewConfigExtractor.java
[2]
https://svn.apache.org/repos/asf/myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/test/resources/META-INF/services/org.apache.myfaces.extensions.cdi.jsf.impl.config.view.spi.ViewConfigExtractor

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces


2011/9/21 Steven Rudolf <St...@web.de>

> Hello,
>
> I am using CODI and I love the typesafe navigation.
> It is described well how the names of the xhtml-pages are resolved from the
> hierarchy of the viewConfig classes. The problem is that if I made an error
> in the viewConfig I will realize it only at runtime if I click on the link
> or the button which navigates to the wrong defined page.
> I see there is a log at project startup where CODI resolves all @Page
> annotations and bind them as view configurations. At this point it should be
> possible to validate if the xhtml-page to every viewConfig is present in my
> application. So I would get the definition error at project startup and not
> if click on the link.
>
> Is it possible somehow?
>
> Respectfully,
> Steven
> ___________________________________________________________
> Schon gehört? WEB.DE hat einen genialen Phishing-Filter in die
> Toolbar eingebaut! http://produkte.web.de/go/toolbar
>