Re: CODI Messages + properties file

2012-04-04 Thread José Luis Cetina
Great!! Thanks, i can do it with my own CDI Producer Method and works!!

Thanks

2012/4/4 Gerhard Petracek 

> hi jose,
>
> if you really need it for advanced use-cases, you can create your own cdi
> producer-method - e.g.:
>
>@Produces
>@Enhanced
>@Dependent
>protected MessageContext createCustomMessageContext(@Jsf MessageContext
> jsfMessageContext)
>{
>return  jsfMessageContext.config().use().messageResolver(new
> CustomMessageResolver()).create();
>}
> ->
>@Inject
>@Enhanced
>private MessageContext messageContext;
>
> (instead of @Enhanced you can create your own cdi-qualifier)
>
> regards,
> gerhard
>
>
>
> http://www.irian.at
>
> Your JSF/JavaEE powerhouse -
> JavaEE Consulting, Development and
> Courses in English and German
>
> Professional Support for Apache MyFaces
>
>
> 2012/4/4 José Luis Cetina 
>
> > Is there a way to override MessageContext for set the messageResolver
> > always to my own resolver?
> >
> >
> > Beacuse in each managed bean i have to do this after use it:
> >
> > @Inject
> >@Jsf
> >private MessageContext messageContext;
> >
> > //some method
> > *   messageContext.config().change().messageResolver(new
> > MyOwnMessageResolver());*
> > *
> > *
> > *
> > *
> > *Thanks*
> >
> >
> > 2012/4/4 Gerhard Petracek 
> >
> > > hi jose,
> > >
> > > i said: "std. jsf application message bundle."
> > >
> > > ->
> > >
> > > 
> > >...
> > > 
> > >
> > > see e.g. [1]
> > >
> > > regards,
> > > gerhard
> > >
> > > [1]
> > >
> > >
> >
> https://svn.apache.org/repos/asf/myfaces/extensions/cdi/tags/extcdi-1.0.4/examples/jsf-examples/hello_myfaces-codi_jsf20/src/main/webapp/WEB-INF/faces-config.xml
> > >
> > >
> > >
> > > http://www.irian.at
> > >
> > > Your JSF/JavaEE powerhouse -
> > > JavaEE Consulting, Development and
> > > Courses in English and German
> > >
> > > Professional Support for Apache MyFaces
> > >
> > >
> > > 2012/4/4 José Luis Cetina 
> > >
> > > > I found a solution, creating my own MessageResolver, thanks, i will
> > share
> > > > later.
> > > >
> > > > El 4 de abril de 2012 10:57, José Luis Cetina  > > > >escribió:
> > > >
> > > > > I have 2 resource bundle:
> > > > >
> > > > > 
> > > > > my.package.i18n.messages
> > > > > prop_general
> > > > >  
> > > > >
> > > > > 
> > > > >  my.package2.i18n.messages
> > > > > prop_users
> > > > > 
> > > > >
> > > > >
> > > > > and in my class:
> > > > > @Inject
> > > > > private MessageContext messageContext;
> > > > >
> > > > > String messageText =
> > messageContext.message().text("msgKey").toText();
> > > > >
> > > > > How CODI know where resource-bundle has to use?
> > > > >
> > > > >
> > > > >
> > > > > El 4 de abril de 2012 10:27, José Luis Cetina <
> maxtorz...@gmail.com
> > > > >escribió:
> > > > >
> > > > > My JSF app use this:
> > > > >>
> > > > >> 
> > > > >> my.package.i18n.messages
> > > > >> prop_general
> > > > >>  
> > > > >>
> > > > >> In my xhtml page i use
> > > > >>
> > > > >> #{prop_general.mykey}
> > > > >>
> > > > >>
> > > > >> but i dont know how i can use this with CODI Messages,
> > > > >>
> > > > >> I see this example:
> > > > >>
> > > > >> String messageText =
> > messageContext.message().text("msgKey").toText();
> > > > >>
> > > > >> but how CODI get my property file? and where i get the
> > > > >> object messageContext ??
> > > > >> i think the tutorial is not specific about this
> > > > >>
> > > > >>
> > > > >> 2012/4/4 Gerhard Petracek 
> > > > >>
> > > > >>> hi jose,
> > > > >>>
> > > > >>> in a jsf application:
> > > > >>> just configure your std. jsf application message bundle.
> > > > >>>
> > > > >>> regards,
> > > > >>> gerhard
> > > > >>>
> > > > >>>
> > > > >>>
> > > > >>> http://www.irian.at
> > > > >>>
> > > > >>> Your JSF/JavaEE powerhouse -
> > > > >>> JavaEE Consulting, Development and
> > > > >>> Courses in English and German
> > > > >>>
> > > > >>> Professional Support for Apache MyFaces
> > > > >>>
> > > > >>>
> > > > >>> 2012/4/4 José Luis Cetina 
> > > > >>>
> > > > >>> > Hi im new with CODI Messages Module, im reading this page:
> > > > >>> > https://cwiki.apache.org/EXTCDI/message-usage.html
> > > > >>> >
> > > > >>> > but i cant find a way to use codi msgs with properties file, it
> > is
> > > > >>> > possible?.
> > > > >>> >
> > > > >>> > Normally i use properties file where the use can change their
> > msgs
> > > > but
> > > > >>> here
> > > > >>> > in CODI.
> > > > >>> >
> > > > >>> >
> > > > >>> >
> > > > >>> >
> > > > >>> > --
> > > > >>> >
> > ---
> > > > >>> > *SCJA. José Luis Cetina*
> > > > >>> >
> > ---
> > > > >>> >
> > > > >>>
> > > > >>
> > > > >>
> > > > >>
> > > > >> --
> > > > >>
> ---
> > > > >> *SCJA. José Luis Cetina*
> > > > >>
> ---

Re: CODI Messages + properties file

2012-04-04 Thread Gerhard Petracek
hi jose,

if you really need it for advanced use-cases, you can create your own cdi
producer-method - e.g.:

@Produces
@Enhanced
@Dependent
protected MessageContext createCustomMessageContext(@Jsf MessageContext
jsfMessageContext)
{
return  jsfMessageContext.config().use().messageResolver(new
CustomMessageResolver()).create();
}
->
@Inject
@Enhanced
private MessageContext messageContext;

(instead of @Enhanced you can create your own cdi-qualifier)

regards,
gerhard



http://www.irian.at

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

Professional Support for Apache MyFaces


2012/4/4 José Luis Cetina 

> Is there a way to override MessageContext for set the messageResolver
> always to my own resolver?
>
>
> Beacuse in each managed bean i have to do this after use it:
>
> @Inject
>@Jsf
>private MessageContext messageContext;
>
> //some method
> *   messageContext.config().change().messageResolver(new
> MyOwnMessageResolver());*
> *
> *
> *
> *
> *Thanks*
>
>
> 2012/4/4 Gerhard Petracek 
>
> > hi jose,
> >
> > i said: "std. jsf application message bundle."
> >
> > ->
> >
> > 
> >...
> > 
> >
> > see e.g. [1]
> >
> > regards,
> > gerhard
> >
> > [1]
> >
> >
> https://svn.apache.org/repos/asf/myfaces/extensions/cdi/tags/extcdi-1.0.4/examples/jsf-examples/hello_myfaces-codi_jsf20/src/main/webapp/WEB-INF/faces-config.xml
> >
> >
> >
> > http://www.irian.at
> >
> > Your JSF/JavaEE powerhouse -
> > JavaEE Consulting, Development and
> > Courses in English and German
> >
> > Professional Support for Apache MyFaces
> >
> >
> > 2012/4/4 José Luis Cetina 
> >
> > > I found a solution, creating my own MessageResolver, thanks, i will
> share
> > > later.
> > >
> > > El 4 de abril de 2012 10:57, José Luis Cetina  > > >escribió:
> > >
> > > > I have 2 resource bundle:
> > > >
> > > > 
> > > > my.package.i18n.messages
> > > > prop_general
> > > >  
> > > >
> > > > 
> > > >  my.package2.i18n.messages
> > > > prop_users
> > > > 
> > > >
> > > >
> > > > and in my class:
> > > > @Inject
> > > > private MessageContext messageContext;
> > > >
> > > > String messageText =
> messageContext.message().text("msgKey").toText();
> > > >
> > > > How CODI know where resource-bundle has to use?
> > > >
> > > >
> > > >
> > > > El 4 de abril de 2012 10:27, José Luis Cetina  > > >escribió:
> > > >
> > > > My JSF app use this:
> > > >>
> > > >> 
> > > >> my.package.i18n.messages
> > > >> prop_general
> > > >>  
> > > >>
> > > >> In my xhtml page i use
> > > >>
> > > >> #{prop_general.mykey}
> > > >>
> > > >>
> > > >> but i dont know how i can use this with CODI Messages,
> > > >>
> > > >> I see this example:
> > > >>
> > > >> String messageText =
> messageContext.message().text("msgKey").toText();
> > > >>
> > > >> but how CODI get my property file? and where i get the
> > > >> object messageContext ??
> > > >> i think the tutorial is not specific about this
> > > >>
> > > >>
> > > >> 2012/4/4 Gerhard Petracek 
> > > >>
> > > >>> hi jose,
> > > >>>
> > > >>> in a jsf application:
> > > >>> just configure your std. jsf application message bundle.
> > > >>>
> > > >>> regards,
> > > >>> gerhard
> > > >>>
> > > >>>
> > > >>>
> > > >>> http://www.irian.at
> > > >>>
> > > >>> Your JSF/JavaEE powerhouse -
> > > >>> JavaEE Consulting, Development and
> > > >>> Courses in English and German
> > > >>>
> > > >>> Professional Support for Apache MyFaces
> > > >>>
> > > >>>
> > > >>> 2012/4/4 José Luis Cetina 
> > > >>>
> > > >>> > Hi im new with CODI Messages Module, im reading this page:
> > > >>> > https://cwiki.apache.org/EXTCDI/message-usage.html
> > > >>> >
> > > >>> > but i cant find a way to use codi msgs with properties file, it
> is
> > > >>> > possible?.
> > > >>> >
> > > >>> > Normally i use properties file where the use can change their
> msgs
> > > but
> > > >>> here
> > > >>> > in CODI.
> > > >>> >
> > > >>> >
> > > >>> >
> > > >>> >
> > > >>> > --
> > > >>> >
> ---
> > > >>> > *SCJA. José Luis Cetina*
> > > >>> >
> ---
> > > >>> >
> > > >>>
> > > >>
> > > >>
> > > >>
> > > >> --
> > > >> ---
> > > >> *SCJA. José Luis Cetina*
> > > >> ---
> > > >>
> > > >>
> > > >
> > > >
> > > > --
> > > > ---
> > > > *SCJA. José Luis Cetina*
> > > > ---
> > > >
> > > >
> > >
> > >
> > > --
> > > ---
> > > *SCJA. José Luis Cetina*
> > > ---
> > >
> >
>
>
>
> --
> -

Re: CODI Messages + properties file

2012-04-04 Thread José Luis Cetina
Is there a way to override MessageContext for set the messageResolver
always to my own resolver?


Beacuse in each managed bean i have to do this after use it:

@Inject
@Jsf
private MessageContext messageContext;

//some method
 *   messageContext.config().change().messageResolver(new
MyOwnMessageResolver());*
*
*
*
*
*Thanks*


2012/4/4 Gerhard Petracek 

> hi jose,
>
> i said: "std. jsf application message bundle."
>
> ->
>
> 
>...
> 
>
> see e.g. [1]
>
> regards,
> gerhard
>
> [1]
>
> https://svn.apache.org/repos/asf/myfaces/extensions/cdi/tags/extcdi-1.0.4/examples/jsf-examples/hello_myfaces-codi_jsf20/src/main/webapp/WEB-INF/faces-config.xml
>
>
>
> http://www.irian.at
>
> Your JSF/JavaEE powerhouse -
> JavaEE Consulting, Development and
> Courses in English and German
>
> Professional Support for Apache MyFaces
>
>
> 2012/4/4 José Luis Cetina 
>
> > I found a solution, creating my own MessageResolver, thanks, i will share
> > later.
> >
> > El 4 de abril de 2012 10:57, José Luis Cetina  > >escribió:
> >
> > > I have 2 resource bundle:
> > >
> > > 
> > > my.package.i18n.messages
> > > prop_general
> > >  
> > >
> > > 
> > >  my.package2.i18n.messages
> > > prop_users
> > > 
> > >
> > >
> > > and in my class:
> > > @Inject
> > > private MessageContext messageContext;
> > >
> > > String messageText = messageContext.message().text("msgKey").toText();
> > >
> > > How CODI know where resource-bundle has to use?
> > >
> > >
> > >
> > > El 4 de abril de 2012 10:27, José Luis Cetina  > >escribió:
> > >
> > > My JSF app use this:
> > >>
> > >> 
> > >> my.package.i18n.messages
> > >> prop_general
> > >>  
> > >>
> > >> In my xhtml page i use
> > >>
> > >> #{prop_general.mykey}
> > >>
> > >>
> > >> but i dont know how i can use this with CODI Messages,
> > >>
> > >> I see this example:
> > >>
> > >> String messageText = messageContext.message().text("msgKey").toText();
> > >>
> > >> but how CODI get my property file? and where i get the
> > >> object messageContext ??
> > >> i think the tutorial is not specific about this
> > >>
> > >>
> > >> 2012/4/4 Gerhard Petracek 
> > >>
> > >>> hi jose,
> > >>>
> > >>> in a jsf application:
> > >>> just configure your std. jsf application message bundle.
> > >>>
> > >>> regards,
> > >>> gerhard
> > >>>
> > >>>
> > >>>
> > >>> http://www.irian.at
> > >>>
> > >>> Your JSF/JavaEE powerhouse -
> > >>> JavaEE Consulting, Development and
> > >>> Courses in English and German
> > >>>
> > >>> Professional Support for Apache MyFaces
> > >>>
> > >>>
> > >>> 2012/4/4 José Luis Cetina 
> > >>>
> > >>> > Hi im new with CODI Messages Module, im reading this page:
> > >>> > https://cwiki.apache.org/EXTCDI/message-usage.html
> > >>> >
> > >>> > but i cant find a way to use codi msgs with properties file, it is
> > >>> > possible?.
> > >>> >
> > >>> > Normally i use properties file where the use can change their msgs
> > but
> > >>> here
> > >>> > in CODI.
> > >>> >
> > >>> >
> > >>> >
> > >>> >
> > >>> > --
> > >>> > ---
> > >>> > *SCJA. José Luis Cetina*
> > >>> > ---
> > >>> >
> > >>>
> > >>
> > >>
> > >>
> > >> --
> > >> ---
> > >> *SCJA. José Luis Cetina*
> > >> ---
> > >>
> > >>
> > >
> > >
> > > --
> > > ---
> > > *SCJA. José Luis Cetina*
> > > ---
> > >
> > >
> >
> >
> > --
> > ---
> > *SCJA. José Luis Cetina*
> > ---
> >
>



-- 
---
*SCJA. José Luis Cetina*
---


Re: CODI Messages + properties file

2012-04-04 Thread Gerhard Petracek
hi jose,

i said: "std. jsf application message bundle."

->


...


see e.g. [1]

regards,
gerhard

[1]
https://svn.apache.org/repos/asf/myfaces/extensions/cdi/tags/extcdi-1.0.4/examples/jsf-examples/hello_myfaces-codi_jsf20/src/main/webapp/WEB-INF/faces-config.xml



http://www.irian.at

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

Professional Support for Apache MyFaces


2012/4/4 José Luis Cetina 

> I found a solution, creating my own MessageResolver, thanks, i will share
> later.
>
> El 4 de abril de 2012 10:57, José Luis Cetina  >escribió:
>
> > I have 2 resource bundle:
> >
> > 
> > my.package.i18n.messages
> > prop_general
> >  
> >
> > 
> >  my.package2.i18n.messages
> > prop_users
> > 
> >
> >
> > and in my class:
> > @Inject
> > private MessageContext messageContext;
> >
> > String messageText = messageContext.message().text("msgKey").toText();
> >
> > How CODI know where resource-bundle has to use?
> >
> >
> >
> > El 4 de abril de 2012 10:27, José Luis Cetina  >escribió:
> >
> > My JSF app use this:
> >>
> >> 
> >> my.package.i18n.messages
> >> prop_general
> >>  
> >>
> >> In my xhtml page i use
> >>
> >> #{prop_general.mykey}
> >>
> >>
> >> but i dont know how i can use this with CODI Messages,
> >>
> >> I see this example:
> >>
> >> String messageText = messageContext.message().text("msgKey").toText();
> >>
> >> but how CODI get my property file? and where i get the
> >> object messageContext ??
> >> i think the tutorial is not specific about this
> >>
> >>
> >> 2012/4/4 Gerhard Petracek 
> >>
> >>> hi jose,
> >>>
> >>> in a jsf application:
> >>> just configure your std. jsf application message bundle.
> >>>
> >>> regards,
> >>> gerhard
> >>>
> >>>
> >>>
> >>> http://www.irian.at
> >>>
> >>> Your JSF/JavaEE powerhouse -
> >>> JavaEE Consulting, Development and
> >>> Courses in English and German
> >>>
> >>> Professional Support for Apache MyFaces
> >>>
> >>>
> >>> 2012/4/4 José Luis Cetina 
> >>>
> >>> > Hi im new with CODI Messages Module, im reading this page:
> >>> > https://cwiki.apache.org/EXTCDI/message-usage.html
> >>> >
> >>> > but i cant find a way to use codi msgs with properties file, it is
> >>> > possible?.
> >>> >
> >>> > Normally i use properties file where the use can change their msgs
> but
> >>> here
> >>> > in CODI.
> >>> >
> >>> >
> >>> >
> >>> >
> >>> > --
> >>> > ---
> >>> > *SCJA. José Luis Cetina*
> >>> > ---
> >>> >
> >>>
> >>
> >>
> >>
> >> --
> >> ---
> >> *SCJA. José Luis Cetina*
> >> ---
> >>
> >>
> >
> >
> > --
> > ---
> > *SCJA. José Luis Cetina*
> > ---
> >
> >
>
>
> --
> ---
> *SCJA. José Luis Cetina*
> ---
>


Re: CODI Messages + properties file

2012-04-04 Thread José Luis Cetina
I found a solution, creating my own MessageResolver, thanks, i will share
later.

El 4 de abril de 2012 10:57, José Luis Cetina escribió:

> I have 2 resource bundle:
>
> 
> my.package.i18n.messages
> prop_general
>  
>
> 
>  my.package2.i18n.messages
> prop_users
> 
>
>
> and in my class:
> @Inject
> private MessageContext messageContext;
>
> String messageText = messageContext.message().text("msgKey").toText();
>
> How CODI know where resource-bundle has to use?
>
>
>
> El 4 de abril de 2012 10:27, José Luis Cetina escribió:
>
> My JSF app use this:
>>
>> 
>> my.package.i18n.messages
>> prop_general
>>  
>>
>> In my xhtml page i use
>>
>> #{prop_general.mykey}
>>
>>
>> but i dont know how i can use this with CODI Messages,
>>
>> I see this example:
>>
>> String messageText = messageContext.message().text("msgKey").toText();
>>
>> but how CODI get my property file? and where i get the
>> object messageContext ??
>> i think the tutorial is not specific about this
>>
>>
>> 2012/4/4 Gerhard Petracek 
>>
>>> hi jose,
>>>
>>> in a jsf application:
>>> just configure your std. jsf application message bundle.
>>>
>>> regards,
>>> gerhard
>>>
>>>
>>>
>>> http://www.irian.at
>>>
>>> Your JSF/JavaEE powerhouse -
>>> JavaEE Consulting, Development and
>>> Courses in English and German
>>>
>>> Professional Support for Apache MyFaces
>>>
>>>
>>> 2012/4/4 José Luis Cetina 
>>>
>>> > Hi im new with CODI Messages Module, im reading this page:
>>> > https://cwiki.apache.org/EXTCDI/message-usage.html
>>> >
>>> > but i cant find a way to use codi msgs with properties file, it is
>>> > possible?.
>>> >
>>> > Normally i use properties file where the use can change their msgs but
>>> here
>>> > in CODI.
>>> >
>>> >
>>> >
>>> >
>>> > --
>>> > ---
>>> > *SCJA. José Luis Cetina*
>>> > ---
>>> >
>>>
>>
>>
>>
>> --
>> ---
>> *SCJA. José Luis Cetina*
>> ---
>>
>>
>
>
> --
> ---
> *SCJA. José Luis Cetina*
> ---
>
>


-- 
---
*SCJA. José Luis Cetina*
---


Re: CODI Messages + properties file

2012-04-04 Thread José Luis Cetina
I have 2 resource bundle:


my.package.i18n.messages
prop_general
 


 my.package2.i18n.messages
prop_users



and in my class:
@Inject
private MessageContext messageContext;

String messageText = messageContext.message().text("msgKey").toText();

How CODI know where resource-bundle has to use?



El 4 de abril de 2012 10:27, José Luis Cetina escribió:

> My JSF app use this:
>
> 
> my.package.i18n.messages
> prop_general
>  
>
> In my xhtml page i use
>
> #{prop_general.mykey}
>
>
> but i dont know how i can use this with CODI Messages,
>
> I see this example:
>
> String messageText = messageContext.message().text("msgKey").toText();
>
> but how CODI get my property file? and where i get the
> object messageContext ??
> i think the tutorial is not specific about this
>
>
> 2012/4/4 Gerhard Petracek 
>
>> hi jose,
>>
>> in a jsf application:
>> just configure your std. jsf application message bundle.
>>
>> regards,
>> gerhard
>>
>>
>>
>> http://www.irian.at
>>
>> Your JSF/JavaEE powerhouse -
>> JavaEE Consulting, Development and
>> Courses in English and German
>>
>> Professional Support for Apache MyFaces
>>
>>
>> 2012/4/4 José Luis Cetina 
>>
>> > Hi im new with CODI Messages Module, im reading this page:
>> > https://cwiki.apache.org/EXTCDI/message-usage.html
>> >
>> > but i cant find a way to use codi msgs with properties file, it is
>> > possible?.
>> >
>> > Normally i use properties file where the use can change their msgs but
>> here
>> > in CODI.
>> >
>> >
>> >
>> >
>> > --
>> > ---
>> > *SCJA. José Luis Cetina*
>> > ---
>> >
>>
>
>
>
> --
> ---
> *SCJA. José Luis Cetina*
> ---
>
>


-- 
---
*SCJA. José Luis Cetina*
---


Re: CODI Messages + properties file

2012-04-04 Thread José Luis Cetina
My JSF app use this:


my.package.i18n.messages
prop_general
 

In my xhtml page i use

#{prop_general.mykey}


but i dont know how i can use this with CODI Messages,

I see this example:

String messageText = messageContext.message().text("msgKey").toText();

but how CODI get my property file? and where i get the
object messageContext ??
i think the tutorial is not specific about this


2012/4/4 Gerhard Petracek 

> hi jose,
>
> in a jsf application:
> just configure your std. jsf application message bundle.
>
> regards,
> gerhard
>
>
>
> http://www.irian.at
>
> Your JSF/JavaEE powerhouse -
> JavaEE Consulting, Development and
> Courses in English and German
>
> Professional Support for Apache MyFaces
>
>
> 2012/4/4 José Luis Cetina 
>
> > Hi im new with CODI Messages Module, im reading this page:
> > https://cwiki.apache.org/EXTCDI/message-usage.html
> >
> > but i cant find a way to use codi msgs with properties file, it is
> > possible?.
> >
> > Normally i use properties file where the use can change their msgs but
> here
> > in CODI.
> >
> >
> >
> >
> > --
> > ---
> > *SCJA. José Luis Cetina*
> > ---
> >
>



-- 
---
*SCJA. José Luis Cetina*
---


Re: CODI Messages + properties file

2012-04-04 Thread Gerhard Petracek
hi jose,

in a jsf application:
just configure your std. jsf application message bundle.

regards,
gerhard



http://www.irian.at

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

Professional Support for Apache MyFaces


2012/4/4 José Luis Cetina 

> Hi im new with CODI Messages Module, im reading this page:
> https://cwiki.apache.org/EXTCDI/message-usage.html
>
> but i cant find a way to use codi msgs with properties file, it is
> possible?.
>
> Normally i use properties file where the use can change their msgs but here
> in CODI.
>
>
>
>
> --
> ---
> *SCJA. José Luis Cetina*
> ---
>