001    // Copyright 2011 The Apache Software Foundation
002    //
003    // Licensed under the Apache License, Version 2.0 (the "License");
004    // you may not use this file except in compliance with the License.
005    // You may obtain a copy of the License at
006    //
007    // http://www.apache.org/licenses/LICENSE-2.0
008    //
009    // Unless required by applicable law or agreed to in writing, software
010    // distributed under the License is distributed on an "AS IS" BASIS,
011    // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
012    // See the License for the specific language governing permissions and
013    // limitations under the License.
014    
015    package org.apache.tapestry5.kaptcha.pages;
016    
017    import org.apache.tapestry5.annotations.Component;
018    import org.apache.tapestry5.annotations.Environmental;
019    import org.apache.tapestry5.annotations.Property;
020    import org.apache.tapestry5.kaptcha.components.KaptchaField;
021    import org.apache.tapestry5.kaptcha.components.KaptchaImage;
022    import org.apache.tapestry5.services.PropertyEditContext;
023    
024    /**
025     * Page containing <i>kaptcha</i> edit blocks contributed into the
026     * {@link org.apache.tapestry5.services.BeanBlockSource} service configuration.
027     *
028     * @see org.apache.tapestry5.services.BeanBlockContribution
029     * @see org.apache.tapestry5.corelib.components.BeanEditForm
030     * @since 5.3
031     */
032    public class KaptchaEditBlocks
033    {
034        @Environmental
035        @Property(write = false)
036        private PropertyEditContext context;
037    
038        @Component
039        private KaptchaImage kaptchaImage;
040    
041        @Component(parameters = {
042                "label=prop:context.label",
043                "clientId=prop:context.propertyId",
044                "image=kaptchaImage"})
045        private KaptchaField kaptchaField;
046    }