[jboss-cvs] jboss-seam/doc/reference/en/modules ...

Shane Bryzak sbryzak at redhat.com
Wed Sep 19 00:28:47 EDT 2007


  User: sbryzak2
  Date: 07/09/19 00:28:47

  Modified:    doc/reference/en/modules  security.xml
  Log:
  JBSEAM-865
  
  Revision  Changes    Path
  1.73      +44 -0     jboss-seam/doc/reference/en/modules/security.xml
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: security.xml
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/doc/reference/en/modules/security.xml,v
  retrieving revision 1.72
  retrieving revision 1.73
  diff -u -b -r1.72 -r1.73
  --- security.xml	2 Sep 2007 23:33:17 -0000	1.72
  +++ security.xml	19 Sep 2007 04:28:47 -0000	1.73
  @@ -1269,6 +1269,50 @@
         
       </sect2>
       
  +    <sect2>
  +      <title>Customising the Captcha image</title>
  +      
  +      <para>
  +        The captcha image itself may be customised by providing an alternative <literal>ImageCaptchaService</literal>
  +        to the default (<literal>DefaultManageableImageCaptchaService</literal>). To configure a different
  +        <literal>ImageCaptchaService</literal>, add the following entry to <literal>components.xml</literal>:
  +      </para>
  +      
  +      <programlisting><![CDATA[  <component name="org.jboss.seam.captcha.captchaImage" service="#{customCaptcha.service}"/>]]></programlisting>
  +      
  +      <para>
  +        The <literal>service</literal> attribute specifies the <literal>ImageCaptchaService</literal> instance to
  +        use to generate captcha images.  For more information on configuring an <literal>ImageCaptchaService</literal> please
  +        refer to the JCaptcha documentation.  Here is an example of a custom image generator (which can be found in the 
  +        seamspace example):
  +      </para>
  +      
  +      <programlisting><![CDATA[@Name("customCaptcha")
  +public class CustomCaptcha
  +{
  +   public ImageCaptchaService getService()
  +   {
  +      BasicGimpyEngine customCaptcha = new BasicGimpyEngine();
  +      GimpyFactory factory = new GimpyFactory(
  +            new RandomWordGenerator("ABCDEFGHIJKLMNOPQRSTUVWXYZ23456789"), 
  +            new ComposedWordToImage(new RandomFontGenerator(new Integer(15), 
  +                  new Integer(15)), new UniColorBackgroundGenerator(new Integer(150), 
  +                        new Integer(30)), new RandomTextPaster(new Integer(4), 
  +                              new Integer(7), Color.BLACK)));
  +      GimpyFactory[] factories = {factory};
  +      customCaptcha.setFactories(factories);
  +      
  +      return new DefaultManageableImageCaptchaService(
  +                   new FastHashMapCaptchaStore(),
  +                   customCaptcha,
  +                   180,
  +                   120000,
  +                   75000);      
  +   }
  +}]]></programlisting>
  +
  +    </sect2>
  +    
     </sect1>
   
   </chapter>
  
  
  



More information about the jboss-cvs-commits mailing list