You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Julien Martin <ba...@gmail.com> on 2012/01/23 12:49:07 UTC

Customizing T5 Kaptcha...

Hello,
I would like to add a T5 Kaptcha to my website but I also need to customize
it (background color, font color, size, readability).
Is this possible with t:kaptcha? If so how?
Regards,
J.

Re: Customizing T5 Kaptcha...

Posted by Julien Martin <ba...@gmail.com>.
After looking at the source code for the T5 Kaptcha implementation, I found
a T5-friendlier way of configuring the Kaptcha.
Just add the following lines to the services.AppModule class and play with
the values and constants:

* @Contribute(KaptchaProducer.class)*
* public static void configureKaptchaProducer(MappedConfiguration<String,
String> configuration) {*
* configuration.add(Constants.KAPTCHA_IMAGE_WIDTH, "200");*
* configuration.add(Constants.KAPTCHA_BACKGROUND_CLR_FROM, "255,255,255");*
* configuration.add(Constants.KAPTCHA_BACKGROUND_CLR_TO, "255,255,255");*
* }*

It is cleaner than polluting the web.xml.
Regards,
J.

2012/1/23 Thiago H. de Paula Figueiredo <th...@gmail.com>

> On Mon, 23 Jan 2012 15:40:40 -0200, Julien Martin <ba...@gmail.com>
> wrote:
>
>  Thiago,
>>
>> I meant are the web.xml init params the only way of specifying the config
>> params for the Kaptcha?
>>
>
> From reading the documentation, that seems to be correct.
>
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
> and instructor
> Owner, Ars Machina Tecnologia da Informação Ltda.
> http://www.arsmachina.com.br
>

Re: Customizing T5 Kaptcha...

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Mon, 23 Jan 2012 15:40:40 -0200, Julien Martin <ba...@gmail.com> wrote:

> Thiago,
> I meant are the web.xml init params the only way of specifying the config
> params for the Kaptcha?

 From reading the documentation, that seems to be correct.

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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


Re: Customizing T5 Kaptcha...

Posted by Julien Martin <ba...@gmail.com>.
Thiago,
I meant are the web.xml init params the only way of specifying the config
params for the Kaptcha?
J.

2012/1/23 Julien Martin <ba...@gmail.com>

> I see. The config param you are pointing to are interesting. How then
> would I specify them with T5 Kaptcha? Is it what
> @SupportsInformalParameters<http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/SupportsInformalParameters.html> are
> for?
> Regards,
> J.
>
> 2012/1/23 Thiago H. de Paula Figueiredo <th...@gmail.com>
>
> On Mon, 23 Jan 2012 11:25:47 -0200, Julien Martin <ba...@gmail.com>
>> wrote:
>>
>>  Thiago,
>>> Isn't the image a gif or a jpeg?
>>>
>>
>> Oops, I mesread your question. I'm sorry.
>>
>> Tapestry-Kaptcha is just a Tapestry wrapper around this package:
>> http://code.google.com/p/**kaptcha/ <http://code.google.com/p/kaptcha/>,
>> so you should check its documentation: http://code.google.com/p/**
>> kaptcha/wiki/ConfigParameters<http://code.google.com/p/kaptcha/wiki/ConfigParameters>
>>
>>
>> --
>> Thiago H. de Paula Figueiredo
>> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
>> and instructor
>> Owner, Ars Machina Tecnologia da Informação Ltda.
>> http://www.arsmachina.com.br
>>
>
>

Re: Customizing T5 Kaptcha...

Posted by Julien Martin <ba...@gmail.com>.
I see. The config param you are pointing to are interesting. How then would
I specify them with T5 Kaptcha? Is it what
@SupportsInformalParameters<http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/SupportsInformalParameters.html>
are
for?
Regards,
J.

2012/1/23 Thiago H. de Paula Figueiredo <th...@gmail.com>

> On Mon, 23 Jan 2012 11:25:47 -0200, Julien Martin <ba...@gmail.com>
> wrote:
>
>  Thiago,
>> Isn't the image a gif or a jpeg?
>>
>
> Oops, I mesread your question. I'm sorry.
>
> Tapestry-Kaptcha is just a Tapestry wrapper around this package:
> http://code.google.com/p/**kaptcha/ <http://code.google.com/p/kaptcha/>,
> so you should check its documentation: http://code.google.com/p/**
> kaptcha/wiki/ConfigParameters<http://code.google.com/p/kaptcha/wiki/ConfigParameters>
>
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
> and instructor
> Owner, Ars Machina Tecnologia da Informação Ltda.
> http://www.arsmachina.com.br
>

Re: Customizing T5 Kaptcha...

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Mon, 23 Jan 2012 11:25:47 -0200, Julien Martin <ba...@gmail.com> wrote:

> Thiago,
> Isn't the image a gif or a jpeg?

Oops, I mesread your question. I'm sorry.

Tapestry-Kaptcha is just a Tapestry wrapper around this package:  
http://code.google.com/p/kaptcha/, so you should check its documentation:  
http://code.google.com/p/kaptcha/wiki/ConfigParameters

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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


Re: Customizing T5 Kaptcha...

Posted by Julien Martin <ba...@gmail.com>.
Thiago,
Isn't the image a gif or a jpeg?
J.

2012/1/23 Thiago H. de Paula Figueiredo <th...@gmail.com>

> On Mon, 23 Jan 2012 09:49:07 -0200, Julien Martin <ba...@gmail.com>
> wrote:
>
>  Hello,
>> I would like to add a T5 Kaptcha to my website but I also need to
>> customize
>> it (background color, font color, size, readability).
>> Is this possible with t:kaptcha? If so how?
>>
>
> Have you tried CSS?
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
> and instructor
> Owner, Ars Machina Tecnologia da Informação Ltda.
> http://www.arsmachina.com.br
>

Re: Customizing T5 Kaptcha...

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Mon, 23 Jan 2012 09:49:07 -0200, Julien Martin <ba...@gmail.com> wrote:

> Hello,
> I would like to add a T5 Kaptcha to my website but I also need to  
> customize
> it (background color, font color, size, readability).
> Is this possible with t:kaptcha? If so how?

Have you tried CSS?

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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