Re: svn commit: r735965 - in /ofbiz/trunk: framework/common/src/org/ofbiz/common/ framework/common/widget/ specialpurpose/myportal/config/ specialpurpose/myportal/script/org/ofbiz/myportal/ specialpurpose/myportal/webapp/myportal/WEB-INF/ specialpurpose/my...

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r735965 - in /ofbiz/trunk: framework/common/src/org/ofbiz/common/ framework/common/widget/ specialpurpose/myportal/config/ specialpurpose/myportal/script/org/ofbiz/myportal/ specialpurpose/myportal/webapp/myportal/WEB-INF/ specialpurpose/my...

risalitim@gmail.com
Hi Hans,

I suggest to use the prefix MyPortal for those type of labels, I spent  
a lot of days to cleanup all the wasted labels into OFBiz and I think  
we cannot all use different standard to codify the labels.
And if it's possible do not use the underscore character in the labels  
name could be more readable.

In my opinion for example CaptchaMissingError could be  
MyPortalCaptchaMissingError or something similar to that.

If we do not follow this simple rule in two or three months the labels  
will be completed wasted again.

What others thinks about that ?

Thanks
Marco


Il giorno 20/gen/09, alle ore 09:30, [hidden email] ha scritto:

> Author: hansbak
> Date: Tue Jan 20 00:30:41 2009
> New Revision: 735965
>
> URL: http://svn.apache.org/viewvc?rev=735965&view=rev
> Log:
> first version of captcha, not perfect yet: multiple users  
> registering at the same time, image should be stored in 'runtime'  
> not working on windows. Another problem is what files to put  
> where.....the captcha itself looks like a framework  
> feature...however the registration process needs the party  
> component....so let us know, we will correct it....
>
> Added:
>    ofbiz/trunk/framework/common/src/org/ofbiz/common/Captcha.java    
> (with props)
>    ofbiz/trunk/specialpurpose/myportal/widget/login.ftl   (with props)
> Modified:
>    ofbiz/trunk/framework/common/widget/CommonMenus.xml
>    ofbiz/trunk/specialpurpose/myportal/config/MyPortalUiLabels.xml
>    ofbiz/trunk/specialpurpose/myportal/script/org/ofbiz/myportal/
> Events.xml
>    ofbiz/trunk/specialpurpose/myportal/webapp/myportal/WEB-INF/
> controller.xml
>    ofbiz/trunk/specialpurpose/myportal/widget/CommonScreens.xml
>    ofbiz/trunk/specialpurpose/myportal/widget/MyPortalForms.xml
>
> Added: ofbiz/trunk/framework/common/src/org/ofbiz/common/Captcha.java
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/src/org/ofbiz/common/Captcha.java?rev=735965&view=auto
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- ofbiz/trunk/framework/common/src/org/ofbiz/common/Captcha.java  
> (added)
> +++ ofbiz/trunk/framework/common/src/org/ofbiz/common/Captcha.java  
> Tue Jan 20 00:30:41 2009
> @@ -0,0 +1,163 @@
> +/
> *******************************************************************************
> + * Licensed to the Apache Software Foundation (ASF) under one
> + * or more contributor license agreements.  See the NOTICE file
> + * distributed with this work for additional information
> + * regarding copyright ownership.  The ASF licenses this file
> + * to you under the Apache License, Version 2.0 (the
> + * "License"); you may not use this file except in compliance
> + * with the License.  You may obtain a copy of the License at
> + *
> + * http://www.apache.org/licenses/LICENSE-2.0
> + *
> + * Unless required by applicable law or agreed to in writing,
> + * software distributed under the License is distributed on an
> + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> + * KIND, either express or implied.  See the License for the
> + * specific language governing permissions and limitations
> + * under the License.
> +  
> *******************************************************************************/
> +
> +// copied from : http://cocoon.apache.org/2.2/blocks/captcha/1.0/1436_1_1.html
> +
> +package org.ofbiz.common;
> +
> +import javax.imageio.ImageIO;
> +import javax.servlet.http.HttpServletRequest;
> +import javax.servlet.http.HttpServletResponse;
> +import java.awt.*;
> +import java.awt.geom.AffineTransform;
> +import java.awt.image.BufferedImage;
> +import java.io.File;
> +import java.io.IOException;
> +
> +public class Captcha {
> +
> +    public static String ID_KEY = null;
> +
> +    public static String getCodeCaptcha(HttpServletRequest  
> request,HttpServletResponse response) {
> +     StringBuffer finalString = new StringBuffer();
> +        String elegibleChars =  
> "ABCDEFGHJKLMPQRSTUVWXYabcdefhjkmnpqrstuvwxy23456789";
> +        int charsToPrint = 6;
> +        char[] chars = elegibleChars.toCharArray();
> +
> +        for (int i = 0; i < charsToPrint; i++) {
> +            double randomValue = Math.random();
> +            int randomIndex = (int) Math.round(randomValue *  
> (chars.length - 1));
> +            char characterToShow = chars[randomIndex];
> +            finalString.append(characterToShow);
> +        }
> +        ID_KEY = finalString.toString();
> +        if(createImageCaptcha (request,response)) return "success";
> +        return "error";
> +    }
> +
> +    public static boolean createImageCaptcha (HttpServletRequest  
> request,HttpServletResponse response) {
> +        try {        
> +            //It is possible to pass the font size, image width and  
> height with the request as well
> +            Color backgroundColor = Color.gray;
> +            Color borderColor = Color.DARK_GRAY;
> +            Color textColor = Color.ORANGE;
> +            Color circleColor = new Color(160, 160, 160);
> +            Font textFont = new Font("Arial", Font.PLAIN,  
> paramInt(request, "fontSize", 22));
> +            int charsToPrint = 6;
> +            int width = paramInt(request, "width", 149);
> +            int height = paramInt(request, "height", 40);
> +            int circlesToDraw = 6;
> +            float horizMargin = 20.0f;
> +            double rotationRange = 0.7; // in radians
> +            BufferedImage bufferedImage = new BufferedImage(width,  
> height, BufferedImage.TYPE_INT_RGB);
> +
> +            Graphics2D g = (Graphics2D) bufferedImage.getGraphics();
> +
> +            g.setColor(backgroundColor);
> +            g.fillRect(0, 0, width, height);
> +
> +            //Generating some circles for background noise
> +            g.setColor(circleColor);
> +            for (int i = 0; i < circlesToDraw; i++) {
> +                int circleRadius = (int) (Math.random() * height /  
> 2.0);
> +                int circleX = (int) (Math.random() * width -  
> circleRadius);
> +                int circleY = (int) (Math.random() * height -  
> circleRadius);
> +                g.drawOval(circleX, circleY, circleRadius * 2,  
> circleRadius * 2);
> +            }
> +            g.setColor(textColor);
> +            g.setFont(textFont);
> +
> +            FontMetrics fontMetrics = g.getFontMetrics();
> +            int maxAdvance = fontMetrics.getMaxAdvance();
> +            int fontHeight = fontMetrics.getHeight();
> +
> +            //We are not using certain characters, which might  
> confuse users
> +            String characterToShow = ID_KEY;
> +            float spaceForLetters = -horizMargin * 2 + width;
> +            float spacePerChar = spaceForLetters / (charsToPrint -  
> 1.0f);
> +
> +            for (int i = 0; i < characterToShow.length(); i++) {
> +
> +                // this is a separate canvas used for the character  
> so that
> +                // we can rotate it independently
> +                int charWidth =  
> fontMetrics.charWidth(characterToShow.charAt(i));
> +                int charDim = Math.max(maxAdvance, fontHeight);
> +                int halfCharDim = (int) (charDim / 2);
> +
> +                BufferedImage charImage =
> +                        new BufferedImage(charDim, charDim,  
> BufferedImage.TYPE_INT_ARGB);
> +                Graphics2D charGraphics = charImage.createGraphics();
> +                charGraphics.translate(halfCharDim, halfCharDim);
> +                double angle = (Math.random() - 0.5) * rotationRange;
> +                
> charGraphics.transform(AffineTransform.getRotateInstance(angle));
> +                charGraphics.translate(-halfCharDim, -halfCharDim);
> +                charGraphics.setColor(textColor);
> +                charGraphics.setFont(textFont);
> +
> +                int charX = (int) (0.5 * charDim - 0.5 * charWidth);
> +                charGraphics.drawString("" +  
> characterToShow.charAt(i), charX,
> +                        (int) ((charDim -  
> fontMetrics.getAscent()) / 2 + fontMetrics.getAscent()));
> +
> +                float x = horizMargin + spacePerChar * (i) -  
> charDim / 2.0f;
> +                int y = (int) ((height - charDim) / 2);
> +
> +                g.drawImage(charImage, (int) x, y, charDim,  
> charDim, null, null);
> +
> +                charGraphics.dispose();
> +            }
> +            // Drawing the image border
> +            g.setColor(borderColor);
> +            g.drawRect(0, 0, width - 1, height - 1);
> +            g.dispose();
> +            Captcha.writeImage(bufferedImage, "captchaImage.png");
> +
> +        } catch (Exception ioe) {
> +            return false;
> +        }
> +    //Adding this because we called response.getOutputStream()  
> above. This will prevent and illegal state exception being thrown
> +        return true;
> +    }
> +
> + public static void writeImage(BufferedImage image, String fileName)
> + {
> + if (fileName == null) return;
> + int offset = fileName.lastIndexOf( "." );
> + String type = offset == -1 ? "png" : fileName.substring(offset +  
> 1);
> + String path;
> + try {
> + path = new java.io.File(".").getCanonicalPath();
> + path += "/framework/images/webapp/images/";
> + path += fileName;
> + System.out.println("\n\nPath =  "+path+"\n");
> + System.out.println("Captcha Key =  "+ID_KEY+"\n\n");
> + ImageIO.write(image, type, new File( path ));
> + } catch (IOException e) {
> + return;
> + }
> + }
> +
> +    public static String paramString(HttpServletRequest request,  
> String paramName,
> +            String defaultString) {
> +        return request.getParameter(paramName) != null ?  
> request.getParameter(paramName) : defaultString;
> +    }
> +
> +    public static int paramInt(HttpServletRequest request, String  
> paramName, int defaultInt) {
> +        return request.getParameter(paramName) != null ?  
> Integer.parseInt(request.getParameter(paramName)) : defaultInt;
> +    }
> +}
> \ No newline at end of file
>
> Propchange: ofbiz/trunk/framework/common/src/org/ofbiz/common/
> Captcha.java
> ------------------------------------------------------------------------------
>    svn:eol-style = native
>
> Propchange: ofbiz/trunk/framework/common/src/org/ofbiz/common/
> Captcha.java
> ------------------------------------------------------------------------------
>    svn:keywords = "Date Rev Author URL Id"
>
> Propchange: ofbiz/trunk/framework/common/src/org/ofbiz/common/
> Captcha.java
> ------------------------------------------------------------------------------
>    svn:mime-type = text/plain
>
> Modified: ofbiz/trunk/framework/common/widget/CommonMenus.xml
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/widget/CommonMenus.xml?rev=735965&r1=735964&r2=735965&view=diff
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- ofbiz/trunk/framework/common/widget/CommonMenus.xml (original)
> +++ ofbiz/trunk/framework/common/widget/CommonMenus.xml Tue Jan 20  
> 00:30:41 2009
> @@ -31,7 +31,7 @@
>          </menu-item>
>          <menu-item name="Login" title="${uiLabelMap.CommonLogin}"  
> align-style="opposed">
>              <condition><if-empty field-name="userLogin"/></condition>
> -             <link target="${checkLoginUrl}"/>
> +             <link target="logout"/>
>          </menu-item>
>      </menu>
>
>
> Modified: ofbiz/trunk/specialpurpose/myportal/config/
> MyPortalUiLabels.xml
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/myportal/config/MyPortalUiLabels.xml?rev=735965&r1=735964&r2=735965&view=diff
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- ofbiz/trunk/specialpurpose/myportal/config/MyPortalUiLabels.xml  
> (original)
> +++ ofbiz/trunk/specialpurpose/myportal/config/MyPortalUiLabels.xml  
> Tue Jan 20 00:30:41 2009
> @@ -18,6 +18,18 @@
>     under the License.
> -->
> <resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
> +    <property key="CaptchaMissingError">
> +        <value xml:lang="en">Verify code captcha is missing or  
> wrong</value>
> +        <value xml:lang="th">รหัสตัวเà¸
> ¥à¸‚ที่ท่านกรภกมีข้ภผิดพà¸
> ¥à¸²à¸”</value>
> +    </property>
> +    <property key="FirstName_Missing">
> +        <value xml:lang="en">Your firstName is missing</value>
> +        <value xml:lang="th">กรุณากรภกชื่ภ 
> ขภงท่าน</value>
> +    </property>
> +    <property key="LastName_Missing">
> +        <value xml:lang="en">Your lastname is missing</value>
> +        <value xml:lang="th">กรุณากรภ 
> กนามสกุลขภงท่าน</value>
> +    </property>
>     <property key="MyPortalDashboard">
>         <value xml:lang="en">My Portal</value>
>         <value xml:lang="fr">Mon portail</value>
> @@ -30,6 +42,10 @@
>         <value xml:lang="it">Invia email ad ogni cliente per le  
> modifiche sulla richiesta</value>
>         <value xml:lang="th">ส่งภีเมล์ถึงà¸
> ¥à¸¹à¸à¸„้าที่เปลี่ยนความต้ภ 
> งการ</value>
>     </property>
> +    <property key="NewRegistration">
> +        <value xml:lang="en">New Registration </value>
> +        <value xml:lang="th">ลงทะเบียน </value>
> +    </property>
>     <property key="PageTitleMyPortal">
>         <value xml:lang="en">My Portal for : </value>
>         <value xml:lang="it">Mio portale per : </value>
> @@ -41,4 +57,24 @@
>         <value xml:lang="it">Pagina mio portale</value>
>         <value xml:lang="th">หน้าส่วนตัวขภ 
> งฉัน</value>
>     </property>
> +    <property key="PicCaptcha">
> +        <value xml:lang="en">Code Captcha</value>
> +        <value xml:lang="th">รหัสตรวจสภบ</
> value>
> +    </property>
> +    <property key="RegisterComplete">
> +        <value xml:lang="en">Register of new person is  
> complete...Please </value>
> +        <value xml:lang="th">การลงทะเบีà¸
> ¢à¸™à¹ƒà¸«à¸¡à¹ˆà¸ªà¸³à¸«à¸£à¸±à¸šà¸šà¸¸à¸„คà¸
> ¥à¹„ด้ทำการเสร็จสิ้นสมบูà¸
> £à¸“์แล้ว...สามารถเข้าสู่รà¸
> °à¸šà¸šà¹„ด้ </value>
> +    </property>
> +    <property key="RegisterForCustomer">
> +        <value xml:lang="en">Register for customer</value>
> +        <value xml:lang="th">ลงทะเบียนสำหà¸
> £à¸±à¸šà¸¥à¸¹à¸à¸„้า</value>
> +    </property>
> +    <property key="VerifyCaptcha">
> +        <value xml:lang="en">Verify captcha code</value>
> +        <value xml:lang="th">ใส่รหัสตามà¸
> £à¸¹à¸›</value>
> +    </property>
> +    <property key="UserLogin">
> +        <value xml:lang="en">User Login</value>
> +        <value xml:lang="th">ข้ภมูลการลงทà¸
> °à¹€à¸šà¸µà¸¢à¸™</value>
> +    </property>
> </resource>
>
> Modified: ofbiz/trunk/specialpurpose/myportal/script/org/ofbiz/
> myportal/Events.xml
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/myportal/script/org/ofbiz/myportal/Events.xml?rev=735965&r1=735964&r2=735965&view=diff
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- ofbiz/trunk/specialpurpose/myportal/script/org/ofbiz/myportal/
> Events.xml (original)
> +++ ofbiz/trunk/specialpurpose/myportal/script/org/ofbiz/myportal/
> Events.xml Tue Jan 20 00:30:41 2009
> @@ -312,4 +312,87 @@
>             request-name="communicationEventTypeId"/>
>         <field-to-request field="communicationEventId" request-
> name="communicationEventId"/>
>     </simple-method>
> +
> +    <simple-method method-name="createRegister"
> +        short-description="Create person when new register" login-
> required="false">
> +        <if-empty field="parameters.firstName"><property-to-field  
> field="errorMessage" resource="MyPortalUiLabels"  
> property="FirstName_Missing"/><field-to-list field="errorMessage"  
> list="error_list"/></if-empty>
> +        <if-empty field="parameters.lastName"><property-to-field  
> field="errorMessage" resource="MyPortalUiLabels"  
> property="LastName_Missing"/><field-to-list field="errorMessage"  
> list="error_list"/></if-empty>
> +        <if-empty field="parameters.USERNAME"><property-to-field  
> field="errorMessage" resource="PartyUiLabels"  
> property="PartyUserNameMissing"/><field-to-list field="errorMessage"  
> list="error_list"/></if-empty>
> +        <if-empty field="parameters.PASSWORD"><property-to-field  
> field="errorMessage" resource="PartyUiLabels"  
> property="PartyPasswordMissing"/><field-to-list field="errorMessage"  
> list="error_list"/></if-empty>
> +        <call-bsh><![CDATA[
> +            
> parameters.put("captchaCode",org.ofbiz.common.Captcha.ID_KEY);
> +        ]]></call-bsh>
> +        <call-object-method obj-field="PASSWORD" obj-map-
> name="parameters" method-name="toLowerCase" ret-field="PASSWORD" ret-
> map-name="parameters"/>
> +        <call-object-method obj-field="CONFIRM_PASSWORD" obj-map-
> name="parameters" method-name="toLowerCase" ret-
> field="CONFIRM_PASSWORD" ret-map-name="parameters"/>
> +        <if-compare field="parameters.PASSWORD" value="$
> {parameters.CONFIRM_PASSWORD}" operator="equals">
> +            <call-object-method obj-field="captcha" obj-map-
> name="parameters" method-name="toLowerCase" ret-field="captcha" ret-
> map-name="parameters"/>
> +            <call-object-method obj-field="captchaCode" obj-map-
> name="parameters" method-name="toLowerCase" ret-field="captchaCode"  
> ret-map-name="parameters"/>
> +            <if-compare field="parameters.captcha" value="$
> {parameters.captchaCode}" operator="equals">
> +
> +                <!-- Create Person -->
> +                <set field="parameters.statusId"  
> value="PARTY_ENABLED"/>
> +                <make-value entity-name="Party" value-
> field="newEntity"/>
> +                <set-pk-fields map="parameters" value-
> field="newEntity"/>
> +                <make-next-seq-id value-field="newEntity" seq-field-
> name="partyId"/>
> +                <set field="newEntity.partyTypeId" value="PERSON"/>
> +                <set-nonpk-fields map="parameters" value-
> field="newEntity"/>
> +                <create-value value-field="newEntity"/>
> +
> +                <make-value entity-name="PartyStatus" value-
> field="newEntity2"/>
> +                <set field="newEntity2.partyId" from-
> field="newEntity.partyId"/>
> +                <set field="newEntity2.statusId" from-
> field="newEntity.statusId"/>
> +                <set field="newEntity2.statusDate" from-
> field="newEntity.createdStamp"/>
> +                <create-value value-field="newEntity2"/>
> +
> +                <make-value entity-name="Person" value-
> field="newEntity3"/>
> +                <set field="newEntity3.partyId" from-
> field="newEntity.partyId"/>
> +                <set-nonpk-fields map="parameters" value-
> field="newEntity3"/>
> +                <create-value value-field="newEntity3"/>
> +
> +                <!-- Create the UserLogin Record -->
> +                <call-map-processor in-map-name="parameters" out-
> map-name="userLoginContext">
> +                    <simple-map-processor name="newUserLogin">
> +                        <process field="USERNAME"><copy to-
> field="userLoginId"/></process>
> +                        <process field="PASSWORD"><copy to-
> field="currentPassword"/></process>
> +                        <process field="CONFIRM_PASSWORD"><copy to-
> field="currentPasswordVerify"/></process>
> +                        <process field="PASSWORD_HINT"><copy to-
> field="passwordHint"/></process>
> +                    </simple-map-processor>
> +                </call-map-processor>
> +                <set field="userLoginExistsMap.userLoginId"  from-
> field="userLoginContext.userLoginId" />
> +                <find-by-primary-key entity-name="UserLogin"  
> map="userLoginExistsMap" value-field="existingUserLogin"/>
> +                <if-not-empty field="existingUserLogin">
> +                    <set field="errorMessage" value="Username in  
> use, please choose another." />
> +                    <field-to-list field="errorMessage"  
> list="error_list"/>
> +                    <check-errors error-list-name="error_list"  
> error-code="resultPage"/>
> +                    <else>
> +                        <make-value entity-name="UserLogin" value-
> field="newUserLogin"/>
> +                        <set field="newUserLogin.userLoginId" from-
> field="userLoginContext.userLoginId"/>
> +                        <set field="newUserLogin.currentPassword"  
> from-field="userLoginContext.currentPassword" />
> +                        <set field="newUserLogin.passwordHint" from-
> field="userLoginContext.passwordHint" />
> +                        <!-- Check the password, etc for validity -->
> +                        <call-bsh><![CDATA[
> +                            String password = (String)  
> userLoginContext.get("currentPassword");
> +                            String confirmPassword = (String)  
> userLoginContext.get("currentPasswordVerify");
> +                            String passwordHint = (String)  
> userLoginContext.get("passwordHint");
> +                            
> org.ofbiz.common.login.LoginServices.checkNewPassword(newUserLogin,  
> null, password, confirmPassword, passwordHint, error_list, true,  
> locale);
> +                            boolean useEncryption =  
> "true
> ".equals
> (org.ofbiz.base.util.UtilProperties.getPropertyValue("security",  
> "password.encrypt"));
> +                            if (useEncryption)  
> { newUserLogin.set("currentPassword",  
> org.ofbiz.base.crypto.HashCrypt.getDigestHash((String)  
> newUserLogin.get("currentPassword"))); }
> +                            ]]></call-bsh>
> +                        <set field="newUserLogin.partyId" from-
> field="newEntity.partyId" />
> +                        <create-value value-field="newUserLogin"/>
> +                    </else>
> +                </if-not-empty>
> +                <set field="partyId" from-field="newEntity.partyId"/>
> +                <field-to-request field="partyId" request-
> name="partyId"/>
> +                <return response-code="resultPage"/>
> +                <else>
> +                    <property-to-field field="errorMessage"  
> resource="MyPortalUiLabels" property="CaptchaMissingError"/><field-
> to-list field="errorMessage" list="error_list"/>
> +                </else>
> +            </if-compare>
> +            <else>
> +                <property-to-field field="errorMessage"  
> resource="PartyUiLabels" property="PartyPasswordMatchError"/><field-
> to-list field="errorMessage" list="error_list"/>
> +            </else>
> +        </if-compare>
> +        <check-errors error-list-name="error_list" error-
> code="resultPage"/>
> +    </simple-method>
> </simple-methods>
>
> Modified: ofbiz/trunk/specialpurpose/myportal/webapp/myportal/WEB-
> INF/controller.xml
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/myportal/webapp/myportal/WEB-INF/controller.xml?rev=735965&r1=735964&r2=735965&view=diff
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- ofbiz/trunk/specialpurpose/myportal/webapp/myportal/WEB-INF/
> controller.xml (original)
> +++ ofbiz/trunk/specialpurpose/myportal/webapp/myportal/WEB-INF/
> controller.xml Tue Jan 20 00:30:41 2009
> @@ -31,6 +31,23 @@
>         <security https="true" auth="true"/>
>         <response name="success" type="view" value="main"/>
>     </request-map>
> +    <request-map uri="login">
> +        <security https="true" auth="false"/>
> +        <event type="java"  
> path="org.ofbiz.securityext.login.LoginEvents" invoke="storeLogin"/>
> +        <response name="success" type="view" value="main"/>
> +        <response name="requirePasswordChange" type="view"  
> value="requirePasswordChange"/>
> +        <response name="error" type="view" value="login"/>
> +    </request-map>
> +    <request-map uri="newRegisterLogin">
> +        <security https="true" auth="false"/>
> +        <event type="java" invoke="getCodeCaptcha"  
> path="org.ofbiz.common.Captcha"/>
> +        <response name="success" type="view"  
> value="newRegisterLogin"/>
> +    </request-map>
> +    <request-map uri="createRegister">
> +        <security https="true" auth="false"/>
> +        <event type="simple" invoke="createRegister" path="org/
> ofbiz/myportal/Events.xml"/>
> +        <response name="resultPage" type="url"  
> value="newRegisterLogin"/>
> +    </request-map>
>
>     <!-- TIMESHEET -->
>     <request-map uri="myTimesheet">
> @@ -270,6 +287,8 @@
>     </request-map>
>
>     <view-map name="main" type="screen" page="component://myportal/
> widget/CommonScreens.xml#main"/>
> +    <view-map name="login" type="screen" page="component://myportal/
> widget/CommonScreens.xml#login"/>
> +    <view-map name="newRegisterLogin" type="screen"  
> page="component://myportal/widget/
> CommonScreens.xml#newRegisterLogin"/>
>     <view-map name="myTasks" type="screen" page="component://
> myportal/widget/CommonScreens.xml#MyTasks"/>
>     <view-map name="myCommunications" type="screen"  
> page="component://myportal/widget/
> CommonScreens.xml#MyCommunications"/>
>     <view-map name="otherCommunications" type="screen"  
> page="component://myportal/widget/
> CommonScreens.xml#OtherCommunications"/>
>
> Modified: ofbiz/trunk/specialpurpose/myportal/widget/CommonScreens.xml
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/myportal/widget/CommonScreens.xml?rev=735965&r1=735964&r2=735965&view=diff
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- ofbiz/trunk/specialpurpose/myportal/widget/CommonScreens.xml  
> (original)
> +++ ofbiz/trunk/specialpurpose/myportal/widget/CommonScreens.xml Tue  
> Jan 20 00:30:41 2009
> @@ -164,6 +164,66 @@
>             </widgets>
>         </section>
>     </screen>
> +
> +    <screen name="login">
> +        <section>
> +            <widgets>
> +                <decorator-screen name="main-decorator" location="$
> {parameters.mainDecoratorLocation}">
> +                    <decorator-section name="body">
> +                        <platform-specific>
> +                            <html><html-template  
> location="component://myportal/widget/login.ftl"/></html>
> +                        </platform-specific>
> +                    </decorator-section>
> +                </decorator-screen>
> +            </widgets>
> +        </section>
> +    </screen>
> +
> +    <!--New Register Person-->
> +    <screen name="newRegisterLogin">
> +        <section>
> +            <actions>
> +                <set field="partyId" from-
> field="parameters.partyId"/>
> +                <entity-one entity-name="PartyAndPerson" value-
> name="personInfo"/>
> +            </actions>
> +            <widgets>
> +                <decorator-screen name="main-decorator" location="$
> {parameters.mainDecoratorLocation}">
> +                    <decorator-section name="body">
> +                        <section>
> +                            <condition>
> +                                <not><if-empty field-
> name="parameters.partyId"/></not>
> +                            </condition>
> +                            <actions>
> +                                <set field="partyId" from-
> field="parameters.partyId"/>
> +                                <script location="component://party/
> webapp/partymgr/WEB-INF/actions/party/ViewProfile.groovy"/>
> +                            </actions>
> +                            <widgets>
> +                                <label style="h2" text="$
> {uiLabelMap.RegisterComplete}"/><link target="main" style="h2"  
> text="${uiLabelMap.CommonBeLogged}"></link>
> +                                <label style="h2"  
> text="&lt;br&gt;&lt;br&gt;"/>
> +                                <include-screen name="Party"  
> location="component://party/widget/partymgr/ProfileScreens.xml"/>
> +                            </widgets>
> +                            <fail-widgets>
> +                                <container style="screenlet">
> +                                    <container style="screenlet-
> title-bar">
> +                                        <container style="h3">
> +                                            <label text="$
> {uiLabelMap.NewRegistration}"/>
> +                                        </container>
> +                                    </container>
> +                                    <container style="screenlet-
> body">
> +                                        <section>
> +                                            <widgets>
> +                                                <include-form  
> name="RegisterPerson" location="component://myportal/widget/
> MyPortalForms.xml"/>
> +                                            </widgets>
> +                                        </section>
> +                                    </container>
> +                                </container>
> +                            </fail-widgets>
> +                        </section>
> +                    </decorator-section>
> +                </decorator-screen>
> +            </widgets>
> +        </section>
> +    </screen>
>
>     <screen name="CommonRequestDecorator">
>         <section>
>
> Modified: ofbiz/trunk/specialpurpose/myportal/widget/MyPortalForms.xml
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/myportal/widget/MyPortalForms.xml?rev=735965&r1=735964&r2=735965&view=diff
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- ofbiz/trunk/specialpurpose/myportal/widget/MyPortalForms.xml  
> (original)
> +++ ofbiz/trunk/specialpurpose/myportal/widget/MyPortalForms.xml Tue  
> Jan 20 00:30:41 2009
> @@ -276,4 +276,75 @@
>         <field name="task"><display description="${workEffortName}"/
> ></field>
>     </form>
>
> +    <!--New Register Person-->
> +    <form name="RegisterPerson" type="single"  
> target="createRegister" default-map-name="personInfo"
> +        focus-field-name="salutation" header-row-style="header-row"  
> default-table-style="basic-table">
> +        <auto-fields-service service-name="updatePerson"/>
> +        <field use-when="personInfo!=null" name="partyId" title="$
> {uiLabelMap.PartyPartyId}" tooltip="$
> {uiLabelMap.CommonNotModifRecreat}"><display/></field>
> +        <field use-when="personInfo==null&amp;&amp;partyId==null"  
> name="partyId" title="${uiLabelMap.PartyPartyId}"><ignored/></field>
> +        <field use-when="personInfo==null&amp;&amp;partyId!=null"  
> name="partyId" title="${uiLabelMap.PartyPartyId}" tooltip="$
> {uiLabelMap.CommonCannotBeFound}: [${partyId}]"><display also-
> hidden="false"/></field>
> +        <field name="firstName" title="$
> {uiLabelMap.PartyFirstName}" tooltip="${uiLabelMap.CommonRequired}"  
> widget-style="required"><text size="40" maxlength="60"/></field>
> +        <field name="lastName" title="${uiLabelMap.PartyLastName}"  
> tooltip="${uiLabelMap.CommonRequired}" widget-style="required"><text  
> size="40" maxlength="60"/></field>
> +        <field name="gender">
> +            <drop-down allow-empty="true">
> +                <option key="M" description="$
> {uiLabelMap.CommonMale}"/>
> +                <option key="F" description="$
> {uiLabelMap.CommonFemale}"/>
> +            </drop-down>
> +        </field>
> +        <field name="maritalStatus">
> +            <drop-down allow-empty="true">
> +                <option key="S" description="$
> {uiLabelMap.PartyMaritalStatusSingle}"/>
> +                <option key="M" description="$
> {uiLabelMap.PartyMaritalStatusMarried}"/>
> +                <option key="P" description="$
> {uiLabelMap.PartyMaritalStatusSeparated}"/>
> +                <option key="D" description="$
> {uiLabelMap.PartyMaritalStatusDivorced}"/>
> +                <option key="W" description="$
> {uiLabelMap.PartyMaritalStatusWidowed}"/>
> +            </drop-down>
> +        </field>
> +        <field name="employmentStatusEnumId">
> +            <drop-down allow-empty="true">
> +                <entity-options entity-name="Enumeration" key-field-
> name="enumId" description="${description} [${enumCode}]">
> +                    <entity-constraint name="enumTypeId"  
> value="EMPLOY_STTS"/>
> +                    <entity-order-by field-name="sequenceId"/>
> +                </entity-options>
> +            </drop-down>
> +        </field>
> +        <field name="residenceStatusEnumId">
> +            <drop-down allow-empty="true">
> +                <entity-options entity-name="Enumeration" key-field-
> name="enumId" description="${description} [${enumCode}]">
> +                    <entity-constraint name="enumTypeId"  
> value="PTY_RESID_STTS"/>
> +                    <entity-order-by field-name="sequenceId"/>
> +                </entity-options>
> +            </drop-down>
> +        </field>
> +        <field name="existingCustomer">
> +            <drop-down allow-empty="true"><option key="Y"  
> description="${uiLabelMap.CommonY}"/><option key="N" description="$
> {uiLabelMap.CommonN}"/></drop-down>
> +        </field>
> +        <field name="preferredCurrencyUomId">
> +            <drop-down allow-empty="true">
> +                <entity-options key-field-name="uomId"  
> description="${abbreviation} - ${description}" entity-name="Uom">
> +                    <entity-constraint name="uomTypeId"  
> operator="equals" value="CURRENCY_MEASURE"/>
> +                    <entity-order-by field-name="abbreviation"/>
> +                </entity-options>
> +            </drop-down>
> +        </field>
> +        <field name="statusId" use-when="person==null"><hidden/></
> field>
> +        <field name="statusId" use-when="person!=null">
> +            <drop-down allow-empty="false">
> +                <entity-options description="${description}" entity-
> name="StatusItem">
> +                    <entity-constraint name="statusTypeId"  
> value="PARTY_STATUS"/>
> +                    <entity-order-by field-name="sequenceId"/>
> +                </entity-options>
> +            </drop-down>
> +        </field>
> +        <field name="UserLogin" title="${uiLabelMap.UserLogin}"  
> title-area-style="group-label"><display description=" " also-
> hidden="false"/></field>
> +        <field name="USERNAME" title="${uiLabelMap.CommonUsername}"  
> tooltip="${uiLabelMap.CommonRequired}" widget-style="required"><text  
> size="30" maxlength="250"/></field>
> +        <field name="PASSWORD" title="${uiLabelMap.CommonPassword}"  
> tooltip="${uiLabelMap.CommonRequired}" widget-
> style="required"><password size="15" maxlength="250"/></field>
> +        <field name="CONFIRM_PASSWORD" title="$
> {uiLabelMap.CommonPassword}" tooltip="* ${uiLabelMap.CommonConfirm}"  
> widget-style="required"><password size="15" maxlength="250"/></field>
> +        <field name="VerifyCaptchaTitle" title="$
> {uiLabelMap.VerifyCaptcha}" title-area-style="group-label"><display  
> description=" " also-hidden="false"/></field>
> +        <field name="picOfcaptcha" title="$
> {uiLabelMap.PicCaptcha}"><image value="/images/captchaImage.png"></
> image></field>
> +        <field name="reload" title=" "><image value="/images/feed-
> icon-14x14.png"><sub-hyperlink target="newRegisterLogin"  
> description="reload image"/></image></field>
> +        <field name="captcha" title="${uiLabelMap.VerifyCaptcha}"  
> tooltip="${uiLabelMap.CommonRequired}" widget-style="required"><text  
> size="23" maxlength="30"/></field>
> +        <field name="submitButton" title="${uiLabelMap.CommonSave}"  
> title-area-style="group-label"><submit button-type="button"/></field>
> +    </form>
> +
> </forms>
>
> Added: ofbiz/trunk/specialpurpose/myportal/widget/login.ftl
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/myportal/widget/login.ftl?rev=735965&view=auto
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- ofbiz/trunk/specialpurpose/myportal/widget/login.ftl (added)
> +++ ofbiz/trunk/specialpurpose/myportal/widget/login.ftl Tue Jan 20  
> 00:30:41 2009
> @@ -0,0 +1,73 @@
> +<#--
> +Licensed to the Apache Software Foundation (ASF) under one
> +or more contributor license agreements.  See the NOTICE file
> +distributed with this work for additional information
> +regarding copyright ownership.  The ASF licenses this file
> +to you under the Apache License, Version 2.0 (the
> +"License"); you may not use this file except in compliance
> +with the License.  You may obtain a copy of the License at
> +
> +http://www.apache.org/licenses/LICENSE-2.0
> +
> +Unless required by applicable law or agreed to in writing,
> +software distributed under the License is distributed on an
> +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> +KIND, either express or implied.  See the License for the
> +specific language governing permissions and limitations
> +under the License.
> +-->
> +
> +<#if requestAttributes.uiLabelMap?exists><#assign uiLabelMap =  
> requestAttributes.uiLabelMap></#if>
> +
> +<#assign previousParams = sessionAttributes._PREVIOUS_PARAMS_?
> if_exists>
> +<#if previousParams?has_content>
> +  <#assign previousParams = "?" + previousParams>
> +</#if>
> +
> +<#assign username = requestParameters.USERNAME?
> default((sessionAttributes.autoUserLogin.userLoginId)?default(""))>
> +<#if username != "">
> +  <#assign focusName = false>
> +<#else>
> +  <#assign focusName = true>
> +</#if>
> +
> +<center>
> +  <div class="screenlet login-screenlet" style="width: 22%; margin-
> left: 5px; text-align: center;">
> +    <div class="screenlet-title-bar">
> +      <h3>${uiLabelMap.CommonRegistered}</h3>
> +    </div>
> +    <div class="screenlet-body">
> +      <form method="post" action="<@ofbizUrl>login${previousParams?
> if_exists}</@ofbizUrl>" name="loginform">
> +        <table class="basic-table" cellspacing="0">
> +          <tr>
> +            <td class="label" style="width: 31%;">$
> {uiLabelMap.CommonUsername}</td>
> +            <td><input type="text" name="USERNAME" value="$
> {username}" size="20"/></td>
> +          </tr>
> +          <tr>
> +            <td class="label">${uiLabelMap.CommonPassword}</td>
> +            <td><input type="password" name="PASSWORD" value=""  
> size="20"/></td>
> +          </tr>
> +          <tr>
> +            <td colspan="2" align="center">
> +              <input type="submit" value="$
> {uiLabelMap.CommonLogin}"/>
> +            </td>
> +          </tr>
> +        </table>
> +        <input type="hidden" name="JavaScriptEnabled" value="N"/>
> +        <br/>
> +        <a href="<@ofbizUrl>forgotPassword${previousParams?
> if_exists}</@ofbizUrl>">${uiLabelMap.CommonForgotYourPassword}?</a>
> +        <br/>
> +        <a href="<@ofbizUrl>newRegisterLogin${previousParams?
> if_exists}</@ofbizUrl>">${uiLabelMap.NewRegistration}</a>
> +      </form>
> +    </div>
> +  </div>
> +</center>
> +
> +<script language="JavaScript" type="text/javascript">
> +  document.loginform.JavaScriptEnabled.value = "Y";
> +  <#if focusName>
> +    document.loginform.USERNAME.focus();
> +  <#else>
> +    document.loginform.PASSWORD.focus();
> +  </#if>
> +</script>
> \ No newline at end of file
>
> Propchange: ofbiz/trunk/specialpurpose/myportal/widget/login.ftl
> ------------------------------------------------------------------------------
>    svn:eol-style = native
>
> Propchange: ofbiz/trunk/specialpurpose/myportal/widget/login.ftl
> ------------------------------------------------------------------------------
>    svn:keywords = "Date Rev Author URL Id"
>
> Propchange: ofbiz/trunk/specialpurpose/myportal/widget/login.ftl
> ------------------------------------------------------------------------------
>    svn:mime-type = text/plain
>
>

Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r735965 - in /ofbiz/trunk: framework/common/src/org/ofbiz/common/ framework/common/widget/ specialpurpose/myportal/config/ specialpurpose/myportal/script/org/ofbiz/myportal/ specialpurpose/myportal/webapp/myportal/WEB-INF/ specialpurpose/my...

hans_bakker
Hi Marco,

sure we can do this, however captcha itself is a framework function, but
at the moment only used in myportal... We will move the captcha messages
to the framwork....

regards,
Hans

On Sat, 2009-01-24 at 22:22 +0100, [hidden email] wrote:

> Hi Hans,
>
> I suggest to use the prefix MyPortal for those type of labels, I spent  
> a lot of days to cleanup all the wasted labels into OFBiz and I think  
> we cannot all use different standard to codify the labels.
> And if it's possible do not use the underscore character in the labels  
> name could be more readable.
>
> In my opinion for example CaptchaMissingError could be  
> MyPortalCaptchaMissingError or something similar to that.
>
> If we do not follow this simple rule in two or three months the labels  
> will be completed wasted again.
>
> What others thinks about that ?
>
> Thanks
> Marco
>
>
> Il giorno 20/gen/09, alle ore 09:30, [hidden email] ha scritto:
>
> > Author: hansbak
> > Date: Tue Jan 20 00:30:41 2009
> > New Revision: 735965
> >
> > URL: http://svn.apache.org/viewvc?rev=735965&view=rev
> > Log:
> > first version of captcha, not perfect yet: multiple users  
> > registering at the same time, image should be stored in 'runtime'  
> > not working on windows. Another problem is what files to put  
> > where.....the captcha itself looks like a framework  
> > feature...however the registration process needs the party  
> > component....so let us know, we will correct it....
> >
> > Added:
> >    ofbiz/trunk/framework/common/src/org/ofbiz/common/Captcha.java    
> > (with props)
> >    ofbiz/trunk/specialpurpose/myportal/widget/login.ftl   (with props)
> > Modified:
> >    ofbiz/trunk/framework/common/widget/CommonMenus.xml
> >    ofbiz/trunk/specialpurpose/myportal/config/MyPortalUiLabels.xml
> >    ofbiz/trunk/specialpurpose/myportal/script/org/ofbiz/myportal/
> > Events.xml
> >    ofbiz/trunk/specialpurpose/myportal/webapp/myportal/WEB-INF/
> > controller.xml
> >    ofbiz/trunk/specialpurpose/myportal/widget/CommonScreens.xml
> >    ofbiz/trunk/specialpurpose/myportal/widget/MyPortalForms.xml
> >
> > Added: ofbiz/trunk/framework/common/src/org/ofbiz/common/Captcha.java
> > URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/src/org/ofbiz/common/Captcha.java?rev=735965&view=auto
> > =
> > =
> > =
> > =
> > =
> > =
> > =
> > =
> > ======================================================================
> > --- ofbiz/trunk/framework/common/src/org/ofbiz/common/Captcha.java  
> > (added)
> > +++ ofbiz/trunk/framework/common/src/org/ofbiz/common/Captcha.java  
> > Tue Jan 20 00:30:41 2009
> > @@ -0,0 +1,163 @@
> > +/
> > *******************************************************************************
> > + * Licensed to the Apache Software Foundation (ASF) under one
> > + * or more contributor license agreements.  See the NOTICE file
> > + * distributed with this work for additional information
> > + * regarding copyright ownership.  The ASF licenses this file
> > + * to you under the Apache License, Version 2.0 (the
> > + * "License"); you may not use this file except in compliance
> > + * with the License.  You may obtain a copy of the License at
> > + *
> > + * http://www.apache.org/licenses/LICENSE-2.0
> > + *
> > + * Unless required by applicable law or agreed to in writing,
> > + * software distributed under the License is distributed on an
> > + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> > + * KIND, either express or implied.  See the License for the
> > + * specific language governing permissions and limitations
> > + * under the License.
> > +  
> > *******************************************************************************/
> > +
> > +// copied from : http://cocoon.apache.org/2.2/blocks/captcha/1.0/1436_1_1.html
> > +
> > +package org.ofbiz.common;
> > +
> > +import javax.imageio.ImageIO;
> > +import javax.servlet.http.HttpServletRequest;
> > +import javax.servlet.http.HttpServletResponse;
> > +import java.awt.*;
> > +import java.awt.geom.AffineTransform;
> > +import java.awt.image.BufferedImage;
> > +import java.io.File;
> > +import java.io.IOException;
> > +
> > +public class Captcha {
> > +
> > +    public static String ID_KEY = null;
> > +
> > +    public static String getCodeCaptcha(HttpServletRequest  
> > request,HttpServletResponse response) {
> > +     StringBuffer finalString = new StringBuffer();
> > +        String elegibleChars =  
> > "ABCDEFGHJKLMPQRSTUVWXYabcdefhjkmnpqrstuvwxy23456789";
> > +        int charsToPrint = 6;
> > +        char[] chars = elegibleChars.toCharArray();
> > +
> > +        for (int i = 0; i < charsToPrint; i++) {
> > +            double randomValue = Math.random();
> > +            int randomIndex = (int) Math.round(randomValue *  
> > (chars.length - 1));
> > +            char characterToShow = chars[randomIndex];
> > +            finalString.append(characterToShow);
> > +        }
> > +        ID_KEY = finalString.toString();
> > +        if(createImageCaptcha (request,response)) return "success";
> > +        return "error";
> > +    }
> > +
> > +    public static boolean createImageCaptcha (HttpServletRequest  
> > request,HttpServletResponse response) {
> > +        try {        
> > +            //It is possible to pass the font size, image width and  
> > height with the request as well
> > +            Color backgroundColor = Color.gray;
> > +            Color borderColor = Color.DARK_GRAY;
> > +            Color textColor = Color.ORANGE;
> > +            Color circleColor = new Color(160, 160, 160);
> > +            Font textFont = new Font("Arial", Font.PLAIN,  
> > paramInt(request, "fontSize", 22));
> > +            int charsToPrint = 6;
> > +            int width = paramInt(request, "width", 149);
> > +            int height = paramInt(request, "height", 40);
> > +            int circlesToDraw = 6;
> > +            float horizMargin = 20.0f;
> > +            double rotationRange = 0.7; // in radians
> > +            BufferedImage bufferedImage = new BufferedImage(width,  
> > height, BufferedImage.TYPE_INT_RGB);
> > +
> > +            Graphics2D g = (Graphics2D) bufferedImage.getGraphics();
> > +
> > +            g.setColor(backgroundColor);
> > +            g.fillRect(0, 0, width, height);
> > +
> > +            //Generating some circles for background noise
> > +            g.setColor(circleColor);
> > +            for (int i = 0; i < circlesToDraw; i++) {
> > +                int circleRadius = (int) (Math.random() * height /  
> > 2.0);
> > +                int circleX = (int) (Math.random() * width -  
> > circleRadius);
> > +                int circleY = (int) (Math.random() * height -  
> > circleRadius);
> > +                g.drawOval(circleX, circleY, circleRadius * 2,  
> > circleRadius * 2);
> > +            }
> > +            g.setColor(textColor);
> > +            g.setFont(textFont);
> > +
> > +            FontMetrics fontMetrics = g.getFontMetrics();
> > +            int maxAdvance = fontMetrics.getMaxAdvance();
> > +            int fontHeight = fontMetrics.getHeight();
> > +
> > +            //We are not using certain characters, which might  
> > confuse users
> > +            String characterToShow = ID_KEY;
> > +            float spaceForLetters = -horizMargin * 2 + width;
> > +            float spacePerChar = spaceForLetters / (charsToPrint -  
> > 1.0f);
> > +
> > +            for (int i = 0; i < characterToShow.length(); i++) {
> > +
> > +                // this is a separate canvas used for the character  
> > so that
> > +                // we can rotate it independently
> > +                int charWidth =  
> > fontMetrics.charWidth(characterToShow.charAt(i));
> > +                int charDim = Math.max(maxAdvance, fontHeight);
> > +                int halfCharDim = (int) (charDim / 2);
> > +
> > +                BufferedImage charImage =
> > +                        new BufferedImage(charDim, charDim,  
> > BufferedImage.TYPE_INT_ARGB);
> > +                Graphics2D charGraphics = charImage.createGraphics();
> > +                charGraphics.translate(halfCharDim, halfCharDim);
> > +                double angle = (Math.random() - 0.5) * rotationRange;
> > +                
> > charGraphics.transform(AffineTransform.getRotateInstance(angle));
> > +                charGraphics.translate(-halfCharDim, -halfCharDim);
> > +                charGraphics.setColor(textColor);
> > +                charGraphics.setFont(textFont);
> > +
> > +                int charX = (int) (0.5 * charDim - 0.5 * charWidth);
> > +                charGraphics.drawString("" +  
> > characterToShow.charAt(i), charX,
> > +                        (int) ((charDim -  
> > fontMetrics.getAscent()) / 2 + fontMetrics.getAscent()));
> > +
> > +                float x = horizMargin + spacePerChar * (i) -  
> > charDim / 2.0f;
> > +                int y = (int) ((height - charDim) / 2);
> > +
> > +                g.drawImage(charImage, (int) x, y, charDim,  
> > charDim, null, null);
> > +
> > +                charGraphics.dispose();
> > +            }
> > +            // Drawing the image border
> > +            g.setColor(borderColor);
> > +            g.drawRect(0, 0, width - 1, height - 1);
> > +            g.dispose();
> > +            Captcha.writeImage(bufferedImage, "captchaImage.png");
> > +
> > +        } catch (Exception ioe) {
> > +            return false;
> > +        }
> > +    //Adding this because we called response.getOutputStream()  
> > above. This will prevent and illegal state exception being thrown
> > +        return true;
> > +    }
> > +
> > + public static void writeImage(BufferedImage image, String fileName)
> > + {
> > + if (fileName == null) return;
> > + int offset = fileName.lastIndexOf( "." );
> > + String type = offset == -1 ? "png" : fileName.substring(offset +  
> > 1);
> > + String path;
> > + try {
> > + path = new java.io.File(".").getCanonicalPath();
> > + path += "/framework/images/webapp/images/";
> > + path += fileName;
> > + System.out.println("\n\nPath =  "+path+"\n");
> > + System.out.println("Captcha Key =  "+ID_KEY+"\n\n");
> > + ImageIO.write(image, type, new File( path ));
> > + } catch (IOException e) {
> > + return;
> > + }
> > + }
> > +
> > +    public static String paramString(HttpServletRequest request,  
> > String paramName,
> > +            String defaultString) {
> > +        return request.getParameter(paramName) != null ?  
> > request.getParameter(paramName) : defaultString;
> > +    }
> > +
> > +    public static int paramInt(HttpServletRequest request, String  
> > paramName, int defaultInt) {
> > +        return request.getParameter(paramName) != null ?  
> > Integer.parseInt(request.getParameter(paramName)) : defaultInt;
> > +    }
> > +}
> > \ No newline at end of file
> >
> > Propchange: ofbiz/trunk/framework/common/src/org/ofbiz/common/
> > Captcha.java
> > ------------------------------------------------------------------------------
> >    svn:eol-style = native
> >
> > Propchange: ofbiz/trunk/framework/common/src/org/ofbiz/common/
> > Captcha.java
> > ------------------------------------------------------------------------------
> >    svn:keywords = "Date Rev Author URL Id"
> >
> > Propchange: ofbiz/trunk/framework/common/src/org/ofbiz/common/
> > Captcha.java
> > ------------------------------------------------------------------------------
> >    svn:mime-type = text/plain
> >
> > Modified: ofbiz/trunk/framework/common/widget/CommonMenus.xml
> > URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/widget/CommonMenus.xml?rev=735965&r1=735964&r2=735965&view=diff
> > =
> > =
> > =
> > =
> > =
> > =
> > =
> > =
> > ======================================================================
> > --- ofbiz/trunk/framework/common/widget/CommonMenus.xml (original)
> > +++ ofbiz/trunk/framework/common/widget/CommonMenus.xml Tue Jan 20  
> > 00:30:41 2009
> > @@ -31,7 +31,7 @@
> >          </menu-item>
> >          <menu-item name="Login" title="${uiLabelMap.CommonLogin}"  
> > align-style="opposed">
> >              <condition><if-empty field-name="userLogin"/></condition>
> > -             <link target="${checkLoginUrl}"/>
> > +             <link target="logout"/>
> >          </menu-item>
> >      </menu>
> >
> >
> > Modified: ofbiz/trunk/specialpurpose/myportal/config/
> > MyPortalUiLabels.xml
> > URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/myportal/config/MyPortalUiLabels.xml?rev=735965&r1=735964&r2=735965&view=diff
> > =
> > =
> > =
> > =
> > =
> > =
> > =
> > =
> > ======================================================================
> > --- ofbiz/trunk/specialpurpose/myportal/config/MyPortalUiLabels.xml  
> > (original)
> > +++ ofbiz/trunk/specialpurpose/myportal/config/MyPortalUiLabels.xml  
> > Tue Jan 20 00:30:41 2009
> > @@ -18,6 +18,18 @@
> >     under the License.
> > -->
> > <resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
> > +    <property key="CaptchaMissingError">
> > +        <value xml:lang="en">Verify code captcha is missing or  
> > wrong</value>
> > +        <value xml:lang="th">รหัสตัวเà¸
> > ¥à¸‚ที่ท่านกรภกมีข้ภผิดพà¸
> > ¥à¸²à¸”</value>
> > +    </property>
> > +    <property key="FirstName_Missing">
> > +        <value xml:lang="en">Your firstName is missing</value>
> > +        <value xml:lang="th">กรุณากรภกชื่ภ 
> > ขภงท่าน</value>
> > +    </property>
> > +    <property key="LastName_Missing">
> > +        <value xml:lang="en">Your lastname is missing</value>
> > +        <value xml:lang="th">กรุณากรภ 
> > กนามสกุลขภงท่าน</value>
> > +    </property>
> >     <property key="MyPortalDashboard">
> >         <value xml:lang="en">My Portal</value>
> >         <value xml:lang="fr">Mon portail</value>
> > @@ -30,6 +42,10 @@
> >         <value xml:lang="it">Invia email ad ogni cliente per le  
> > modifiche sulla richiesta</value>
> >         <value xml:lang="th">ส่งภีเมล์ถึงà¸
> > ¥à¸¹à¸à¸„้าที่เปลี่ยนความต้ภ 
> > งการ</value>
> >     </property>
> > +    <property key="NewRegistration">
> > +        <value xml:lang="en">New Registration </value>
> > +        <value xml:lang="th">ลงทะเบียน </value>
> > +    </property>
> >     <property key="PageTitleMyPortal">
> >         <value xml:lang="en">My Portal for : </value>
> >         <value xml:lang="it">Mio portale per : </value>
> > @@ -41,4 +57,24 @@
> >         <value xml:lang="it">Pagina mio portale</value>
> >         <value xml:lang="th">หน้าส่วนตัวขภ 
> > งฉัน</value>
> >     </property>
> > +    <property key="PicCaptcha">
> > +        <value xml:lang="en">Code Captcha</value>
> > +        <value xml:lang="th">รหัสตรวจสภบ</
> > value>
> > +    </property>
> > +    <property key="RegisterComplete">
> > +        <value xml:lang="en">Register of new person is  
> > complete...Please </value>
> > +        <value xml:lang="th">การลงทะเบีà¸
> > ¢à¸™à¹ƒà¸«à¸¡à¹ˆà¸ªà¸³à¸«à¸£à¸±à¸šà¸šà¸¸à¸„คà¸
> > ¥à¹„ด้ทำการเสร็จสิ้นสมบูà¸
> > £à¸“์แล้ว...สามารถเข้าสู่รà¸
> > °à¸šà¸šà¹„ด้ </value>
> > +    </property>
> > +    <property key="RegisterForCustomer">
> > +        <value xml:lang="en">Register for customer</value>
> > +        <value xml:lang="th">ลงทะเบียนสำหà¸
> > £à¸±à¸šà¸¥à¸¹à¸à¸„้า</value>
> > +    </property>
> > +    <property key="VerifyCaptcha">
> > +        <value xml:lang="en">Verify captcha code</value>
> > +        <value xml:lang="th">ใส่รหัสตามà¸
> > £à¸¹à¸›</value>
> > +    </property>
> > +    <property key="UserLogin">
> > +        <value xml:lang="en">User Login</value>
> > +        <value xml:lang="th">ข้ภมูลการลงทà¸
> > °à¹€à¸šà¸µà¸¢à¸™</value>
> > +    </property>
> > </resource>
> >
> > Modified: ofbiz/trunk/specialpurpose/myportal/script/org/ofbiz/
> > myportal/Events.xml
> > URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/myportal/script/org/ofbiz/myportal/Events.xml?rev=735965&r1=735964&r2=735965&view=diff
> > =
> > =
> > =
> > =
> > =
> > =
> > =
> > =
> > ======================================================================
> > --- ofbiz/trunk/specialpurpose/myportal/script/org/ofbiz/myportal/
> > Events.xml (original)
> > +++ ofbiz/trunk/specialpurpose/myportal/script/org/ofbiz/myportal/
> > Events.xml Tue Jan 20 00:30:41 2009
> > @@ -312,4 +312,87 @@
> >             request-name="communicationEventTypeId"/>
> >         <field-to-request field="communicationEventId" request-
> > name="communicationEventId"/>
> >     </simple-method>
> > +
> > +    <simple-method method-name="createRegister"
> > +        short-description="Create person when new register" login-
> > required="false">
> > +        <if-empty field="parameters.firstName"><property-to-field  
> > field="errorMessage" resource="MyPortalUiLabels"  
> > property="FirstName_Missing"/><field-to-list field="errorMessage"  
> > list="error_list"/></if-empty>
> > +        <if-empty field="parameters.lastName"><property-to-field  
> > field="errorMessage" resource="MyPortalUiLabels"  
> > property="LastName_Missing"/><field-to-list field="errorMessage"  
> > list="error_list"/></if-empty>
> > +        <if-empty field="parameters.USERNAME"><property-to-field  
> > field="errorMessage" resource="PartyUiLabels"  
> > property="PartyUserNameMissing"/><field-to-list field="errorMessage"  
> > list="error_list"/></if-empty>
> > +        <if-empty field="parameters.PASSWORD"><property-to-field  
> > field="errorMessage" resource="PartyUiLabels"  
> > property="PartyPasswordMissing"/><field-to-list field="errorMessage"  
> > list="error_list"/></if-empty>
> > +        <call-bsh><![CDATA[
> > +            
> > parameters.put("captchaCode",org.ofbiz.common.Captcha.ID_KEY);
> > +        ]]></call-bsh>
> > +        <call-object-method obj-field="PASSWORD" obj-map-
> > name="parameters" method-name="toLowerCase" ret-field="PASSWORD" ret-
> > map-name="parameters"/>
> > +        <call-object-method obj-field="CONFIRM_PASSWORD" obj-map-
> > name="parameters" method-name="toLowerCase" ret-
> > field="CONFIRM_PASSWORD" ret-map-name="parameters"/>
> > +        <if-compare field="parameters.PASSWORD" value="$
> > {parameters.CONFIRM_PASSWORD}" operator="equals">
> > +            <call-object-method obj-field="captcha" obj-map-
> > name="parameters" method-name="toLowerCase" ret-field="captcha" ret-
> > map-name="parameters"/>
> > +            <call-object-method obj-field="captchaCode" obj-map-
> > name="parameters" method-name="toLowerCase" ret-field="captchaCode"  
> > ret-map-name="parameters"/>
> > +            <if-compare field="parameters.captcha" value="$
> > {parameters.captchaCode}" operator="equals">
> > +
> > +                <!-- Create Person -->
> > +                <set field="parameters.statusId"  
> > value="PARTY_ENABLED"/>
> > +                <make-value entity-name="Party" value-
> > field="newEntity"/>
> > +                <set-pk-fields map="parameters" value-
> > field="newEntity"/>
> > +                <make-next-seq-id value-field="newEntity" seq-field-
> > name="partyId"/>
> > +                <set field="newEntity.partyTypeId" value="PERSON"/>
> > +                <set-nonpk-fields map="parameters" value-
> > field="newEntity"/>
> > +                <create-value value-field="newEntity"/>
> > +
> > +                <make-value entity-name="PartyStatus" value-
> > field="newEntity2"/>
> > +                <set field="newEntity2.partyId" from-
> > field="newEntity.partyId"/>
> > +                <set field="newEntity2.statusId" from-
> > field="newEntity.statusId"/>
> > +                <set field="newEntity2.statusDate" from-
> > field="newEntity.createdStamp"/>
> > +                <create-value value-field="newEntity2"/>
> > +
> > +                <make-value entity-name="Person" value-
> > field="newEntity3"/>
> > +                <set field="newEntity3.partyId" from-
> > field="newEntity.partyId"/>
> > +                <set-nonpk-fields map="parameters" value-
> > field="newEntity3"/>
> > +                <create-value value-field="newEntity3"/>
> > +
> > +                <!-- Create the UserLogin Record -->
> > +                <call-map-processor in-map-name="parameters" out-
> > map-name="userLoginContext">
> > +                    <simple-map-processor name="newUserLogin">
> > +                        <process field="USERNAME"><copy to-
> > field="userLoginId"/></process>
> > +                        <process field="PASSWORD"><copy to-
> > field="currentPassword"/></process>
> > +                        <process field="CONFIRM_PASSWORD"><copy to-
> > field="currentPasswordVerify"/></process>
> > +                        <process field="PASSWORD_HINT"><copy to-
> > field="passwordHint"/></process>
> > +                    </simple-map-processor>
> > +                </call-map-processor>
> > +                <set field="userLoginExistsMap.userLoginId"  from-
> > field="userLoginContext.userLoginId" />
> > +                <find-by-primary-key entity-name="UserLogin"  
> > map="userLoginExistsMap" value-field="existingUserLogin"/>
> > +                <if-not-empty field="existingUserLogin">
> > +                    <set field="errorMessage" value="Username in  
> > use, please choose another." />
> > +                    <field-to-list field="errorMessage"  
> > list="error_list"/>
> > +                    <check-errors error-list-name="error_list"  
> > error-code="resultPage"/>
> > +                    <else>
> > +                        <make-value entity-name="UserLogin" value-
> > field="newUserLogin"/>
> > +                        <set field="newUserLogin.userLoginId" from-
> > field="userLoginContext.userLoginId"/>
> > +                        <set field="newUserLogin.currentPassword"  
> > from-field="userLoginContext.currentPassword" />
> > +                        <set field="newUserLogin.passwordHint" from-
> > field="userLoginContext.passwordHint" />
> > +                        <!-- Check the password, etc for validity -->
> > +                        <call-bsh><![CDATA[
> > +                            String password = (String)  
> > userLoginContext.get("currentPassword");
> > +                            String confirmPassword = (String)  
> > userLoginContext.get("currentPasswordVerify");
> > +                            String passwordHint = (String)  
> > userLoginContext.get("passwordHint");
> > +                            
> > org.ofbiz.common.login.LoginServices.checkNewPassword(newUserLogin,  
> > null, password, confirmPassword, passwordHint, error_list, true,  
> > locale);
> > +                            boolean useEncryption =  
> > "true
> > ".equals
> > (org.ofbiz.base.util.UtilProperties.getPropertyValue("security",  
> > "password.encrypt"));
> > +                            if (useEncryption)  
> > { newUserLogin.set("currentPassword",  
> > org.ofbiz.base.crypto.HashCrypt.getDigestHash((String)  
> > newUserLogin.get("currentPassword"))); }
> > +                            ]]></call-bsh>
> > +                        <set field="newUserLogin.partyId" from-
> > field="newEntity.partyId" />
> > +                        <create-value value-field="newUserLogin"/>
> > +                    </else>
> > +                </if-not-empty>
> > +                <set field="partyId" from-field="newEntity.partyId"/>
> > +                <field-to-request field="partyId" request-
> > name="partyId"/>
> > +                <return response-code="resultPage"/>
> > +                <else>
> > +                    <property-to-field field="errorMessage"  
> > resource="MyPortalUiLabels" property="CaptchaMissingError"/><field-
> > to-list field="errorMessage" list="error_list"/>
> > +                </else>
> > +            </if-compare>
> > +            <else>
> > +                <property-to-field field="errorMessage"  
> > resource="PartyUiLabels" property="PartyPasswordMatchError"/><field-
> > to-list field="errorMessage" list="error_list"/>
> > +            </else>
> > +        </if-compare>
> > +        <check-errors error-list-name="error_list" error-
> > code="resultPage"/>
> > +    </simple-method>
> > </simple-methods>
> >
> > Modified: ofbiz/trunk/specialpurpose/myportal/webapp/myportal/WEB-
> > INF/controller.xml
> > URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/myportal/webapp/myportal/WEB-INF/controller.xml?rev=735965&r1=735964&r2=735965&view=diff
> > =
> > =
> > =
> > =
> > =
> > =
> > =
> > =
> > ======================================================================
> > --- ofbiz/trunk/specialpurpose/myportal/webapp/myportal/WEB-INF/
> > controller.xml (original)
> > +++ ofbiz/trunk/specialpurpose/myportal/webapp/myportal/WEB-INF/
> > controller.xml Tue Jan 20 00:30:41 2009
> > @@ -31,6 +31,23 @@
> >         <security https="true" auth="true"/>
> >         <response name="success" type="view" value="main"/>
> >     </request-map>
> > +    <request-map uri="login">
> > +        <security https="true" auth="false"/>
> > +        <event type="java"  
> > path="org.ofbiz.securityext.login.LoginEvents" invoke="storeLogin"/>
> > +        <response name="success" type="view" value="main"/>
> > +        <response name="requirePasswordChange" type="view"  
> > value="requirePasswordChange"/>
> > +        <response name="error" type="view" value="login"/>
> > +    </request-map>
> > +    <request-map uri="newRegisterLogin">
> > +        <security https="true" auth="false"/>
> > +        <event type="java" invoke="getCodeCaptcha"  
> > path="org.ofbiz.common.Captcha"/>
> > +        <response name="success" type="view"  
> > value="newRegisterLogin"/>
> > +    </request-map>
> > +    <request-map uri="createRegister">
> > +        <security https="true" auth="false"/>
> > +        <event type="simple" invoke="createRegister" path="org/
> > ofbiz/myportal/Events.xml"/>
> > +        <response name="resultPage" type="url"  
> > value="newRegisterLogin"/>
> > +    </request-map>
> >
> >     <!-- TIMESHEET -->
> >     <request-map uri="myTimesheet">
> > @@ -270,6 +287,8 @@
> >     </request-map>
> >
> >     <view-map name="main" type="screen" page="component://myportal/
> > widget/CommonScreens.xml#main"/>
> > +    <view-map name="login" type="screen" page="component://myportal/
> > widget/CommonScreens.xml#login"/>
> > +    <view-map name="newRegisterLogin" type="screen"  
> > page="component://myportal/widget/
> > CommonScreens.xml#newRegisterLogin"/>
> >     <view-map name="myTasks" type="screen" page="component://
> > myportal/widget/CommonScreens.xml#MyTasks"/>
> >     <view-map name="myCommunications" type="screen"  
> > page="component://myportal/widget/
> > CommonScreens.xml#MyCommunications"/>
> >     <view-map name="otherCommunications" type="screen"  
> > page="component://myportal/widget/
> > CommonScreens.xml#OtherCommunications"/>
> >
> > Modified: ofbiz/trunk/specialpurpose/myportal/widget/CommonScreens.xml
> > URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/myportal/widget/CommonScreens.xml?rev=735965&r1=735964&r2=735965&view=diff
> > =
> > =
> > =
> > =
> > =
> > =
> > =
> > =
> > ======================================================================
> > --- ofbiz/trunk/specialpurpose/myportal/widget/CommonScreens.xml  
> > (original)
> > +++ ofbiz/trunk/specialpurpose/myportal/widget/CommonScreens.xml Tue  
> > Jan 20 00:30:41 2009
> > @@ -164,6 +164,66 @@
> >             </widgets>
> >         </section>
> >     </screen>
> > +
> > +    <screen name="login">
> > +        <section>
> > +            <widgets>
> > +                <decorator-screen name="main-decorator" location="$
> > {parameters.mainDecoratorLocation}">
> > +                    <decorator-section name="body">
> > +                        <platform-specific>
> > +                            <html><html-template  
> > location="component://myportal/widget/login.ftl"/></html>
> > +                        </platform-specific>
> > +                    </decorator-section>
> > +                </decorator-screen>
> > +            </widgets>
> > +        </section>
> > +    </screen>
> > +
> > +    <!--New Register Person-->
> > +    <screen name="newRegisterLogin">
> > +        <section>
> > +            <actions>
> > +                <set field="partyId" from-
> > field="parameters.partyId"/>
> > +                <entity-one entity-name="PartyAndPerson" value-
> > name="personInfo"/>
> > +            </actions>
> > +            <widgets>
> > +                <decorator-screen name="main-decorator" location="$
> > {parameters.mainDecoratorLocation}">
> > +                    <decorator-section name="body">
> > +                        <section>
> > +                            <condition>
> > +                                <not><if-empty field-
> > name="parameters.partyId"/></not>
> > +                            </condition>
> > +                            <actions>
> > +                                <set field="partyId" from-
> > field="parameters.partyId"/>
> > +                                <script location="component://party/
> > webapp/partymgr/WEB-INF/actions/party/ViewProfile.groovy"/>
> > +                            </actions>
> > +                            <widgets>
> > +                                <label style="h2" text="$
> > {uiLabelMap.RegisterComplete}"/><link target="main" style="h2"  
> > text="${uiLabelMap.CommonBeLogged}"></link>
> > +                                <label style="h2"  
> > text="&lt;br&gt;&lt;br&gt;"/>
> > +                                <include-screen name="Party"  
> > location="component://party/widget/partymgr/ProfileScreens.xml"/>
> > +                            </widgets>
> > +                            <fail-widgets>
> > +                                <container style="screenlet">
> > +                                    <container style="screenlet-
> > title-bar">
> > +                                        <container style="h3">
> > +                                            <label text="$
> > {uiLabelMap.NewRegistration}"/>
> > +                                        </container>
> > +                                    </container>
> > +                                    <container style="screenlet-
> > body">
> > +                                        <section>
> > +                                            <widgets>
> > +                                                <include-form  
> > name="RegisterPerson" location="component://myportal/widget/
> > MyPortalForms.xml"/>
> > +                                            </widgets>
> > +                                        </section>
> > +                                    </container>
> > +                                </container>
> > +                            </fail-widgets>
> > +                        </section>
> > +                    </decorator-section>
> > +                </decorator-screen>
> > +            </widgets>
> > +        </section>
> > +    </screen>
> >
> >     <screen name="CommonRequestDecorator">
> >         <section>
> >
> > Modified: ofbiz/trunk/specialpurpose/myportal/widget/MyPortalForms.xml
> > URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/myportal/widget/MyPortalForms.xml?rev=735965&r1=735964&r2=735965&view=diff
> > =
> > =
> > =
> > =
> > =
> > =
> > =
> > =
> > ======================================================================
> > --- ofbiz/trunk/specialpurpose/myportal/widget/MyPortalForms.xml  
> > (original)
> > +++ ofbiz/trunk/specialpurpose/myportal/widget/MyPortalForms.xml Tue  
> > Jan 20 00:30:41 2009
> > @@ -276,4 +276,75 @@
> >         <field name="task"><display description="${workEffortName}"/
> > ></field>
> >     </form>
> >
> > +    <!--New Register Person-->
> > +    <form name="RegisterPerson" type="single"  
> > target="createRegister" default-map-name="personInfo"
> > +        focus-field-name="salutation" header-row-style="header-row"  
> > default-table-style="basic-table">
> > +        <auto-fields-service service-name="updatePerson"/>
> > +        <field use-when="personInfo!=null" name="partyId" title="$
> > {uiLabelMap.PartyPartyId}" tooltip="$
> > {uiLabelMap.CommonNotModifRecreat}"><display/></field>
> > +        <field use-when="personInfo==null&amp;&amp;partyId==null"  
> > name="partyId" title="${uiLabelMap.PartyPartyId}"><ignored/></field>
> > +        <field use-when="personInfo==null&amp;&amp;partyId!=null"  
> > name="partyId" title="${uiLabelMap.PartyPartyId}" tooltip="$
> > {uiLabelMap.CommonCannotBeFound}: [${partyId}]"><display also-
> > hidden="false"/></field>
> > +        <field name="firstName" title="$
> > {uiLabelMap.PartyFirstName}" tooltip="${uiLabelMap.CommonRequired}"  
> > widget-style="required"><text size="40" maxlength="60"/></field>
> > +        <field name="lastName" title="${uiLabelMap.PartyLastName}"  
> > tooltip="${uiLabelMap.CommonRequired}" widget-style="required"><text  
> > size="40" maxlength="60"/></field>
> > +        <field name="gender">
> > +            <drop-down allow-empty="true">
> > +                <option key="M" description="$
> > {uiLabelMap.CommonMale}"/>
> > +                <option key="F" description="$
> > {uiLabelMap.CommonFemale}"/>
> > +            </drop-down>
> > +        </field>
> > +        <field name="maritalStatus">
> > +            <drop-down allow-empty="true">
> > +                <option key="S" description="$
> > {uiLabelMap.PartyMaritalStatusSingle}"/>
> > +                <option key="M" description="$
> > {uiLabelMap.PartyMaritalStatusMarried}"/>
> > +                <option key="P" description="$
> > {uiLabelMap.PartyMaritalStatusSeparated}"/>
> > +                <option key="D" description="$
> > {uiLabelMap.PartyMaritalStatusDivorced}"/>
> > +                <option key="W" description="$
> > {uiLabelMap.PartyMaritalStatusWidowed}"/>
> > +            </drop-down>
> > +        </field>
> > +        <field name="employmentStatusEnumId">
> > +            <drop-down allow-empty="true">
> > +                <entity-options entity-name="Enumeration" key-field-
> > name="enumId" description="${description} [${enumCode}]">
> > +                    <entity-constraint name="enumTypeId"  
> > value="EMPLOY_STTS"/>
> > +                    <entity-order-by field-name="sequenceId"/>
> > +                </entity-options>
> > +            </drop-down>
> > +        </field>
> > +        <field name="residenceStatusEnumId">
> > +            <drop-down allow-empty="true">
> > +                <entity-options entity-name="Enumeration" key-field-
> > name="enumId" description="${description} [${enumCode}]">
> > +                    <entity-constraint name="enumTypeId"  
> > value="PTY_RESID_STTS"/>
> > +                    <entity-order-by field-name="sequenceId"/>
> > +                </entity-options>
> > +            </drop-down>
> > +        </field>
> > +        <field name="existingCustomer">
> > +            <drop-down allow-empty="true"><option key="Y"  
> > description="${uiLabelMap.CommonY}"/><option key="N" description="$
> > {uiLabelMap.CommonN}"/></drop-down>
> > +        </field>
> > +        <field name="preferredCurrencyUomId">
> > +            <drop-down allow-empty="true">
> > +                <entity-options key-field-name="uomId"  
> > description="${abbreviation} - ${description}" entity-name="Uom">
> > +                    <entity-constraint name="uomTypeId"  
> > operator="equals" value="CURRENCY_MEASURE"/>
> > +                    <entity-order-by field-name="abbreviation"/>
> > +                </entity-options>
> > +            </drop-down>
> > +        </field>
> > +        <field name="statusId" use-when="person==null"><hidden/></
> > field>
> > +        <field name="statusId" use-when="person!=null">
> > +            <drop-down allow-empty="false">
> > +                <entity-options description="${description}" entity-
> > name="StatusItem">
> > +                    <entity-constraint name="statusTypeId"  
> > value="PARTY_STATUS"/>
> > +                    <entity-order-by field-name="sequenceId"/>
> > +                </entity-options>
> > +            </drop-down>
> > +        </field>
> > +        <field name="UserLogin" title="${uiLabelMap.UserLogin}"  
> > title-area-style="group-label"><display description=" " also-
> > hidden="false"/></field>
> > +        <field name="USERNAME" title="${uiLabelMap.CommonUsername}"  
> > tooltip="${uiLabelMap.CommonRequired}" widget-style="required"><text  
> > size="30" maxlength="250"/></field>
> > +        <field name="PASSWORD" title="${uiLabelMap.CommonPassword}"  
> > tooltip="${uiLabelMap.CommonRequired}" widget-
> > style="required"><password size="15" maxlength="250"/></field>
> > +        <field name="CONFIRM_PASSWORD" title="$
> > {uiLabelMap.CommonPassword}" tooltip="* ${uiLabelMap.CommonConfirm}"  
> > widget-style="required"><password size="15" maxlength="250"/></field>
> > +        <field name="VerifyCaptchaTitle" title="$
> > {uiLabelMap.VerifyCaptcha}" title-area-style="group-label"><display  
> > description=" " also-hidden="false"/></field>
> > +        <field name="picOfcaptcha" title="$
> > {uiLabelMap.PicCaptcha}"><image value="/images/captchaImage.png"></
> > image></field>
> > +        <field name="reload" title=" "><image value="/images/feed-
> > icon-14x14.png"><sub-hyperlink target="newRegisterLogin"  
> > description="reload image"/></image></field>
> > +        <field name="captcha" title="${uiLabelMap.VerifyCaptcha}"  
> > tooltip="${uiLabelMap.CommonRequired}" widget-style="required"><text  
> > size="23" maxlength="30"/></field>
> > +        <field name="submitButton" title="${uiLabelMap.CommonSave}"  
> > title-area-style="group-label"><submit button-type="button"/></field>
> > +    </form>
> > +
> > </forms>
> >
> > Added: ofbiz/trunk/specialpurpose/myportal/widget/login.ftl
> > URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/myportal/widget/login.ftl?rev=735965&view=auto
> > =
> > =
> > =
> > =
> > =
> > =
> > =
> > =
> > ======================================================================
> > --- ofbiz/trunk/specialpurpose/myportal/widget/login.ftl (added)
> > +++ ofbiz/trunk/specialpurpose/myportal/widget/login.ftl Tue Jan 20  
> > 00:30:41 2009
> > @@ -0,0 +1,73 @@
> > +<#--
> > +Licensed to the Apache Software Foundation (ASF) under one
> > +or more contributor license agreements.  See the NOTICE file
> > +distributed with this work for additional information
> > +regarding copyright ownership.  The ASF licenses this file
> > +to you under the Apache License, Version 2.0 (the
> > +"License"); you may not use this file except in compliance
> > +with the License.  You may obtain a copy of the License at
> > +
> > +http://www.apache.org/licenses/LICENSE-2.0
> > +
> > +Unless required by applicable law or agreed to in writing,
> > +software distributed under the License is distributed on an
> > +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> > +KIND, either express or implied.  See the License for the
> > +specific language governing permissions and limitations
> > +under the License.
> > +-->
> > +
> > +<#if requestAttributes.uiLabelMap?exists><#assign uiLabelMap =  
> > requestAttributes.uiLabelMap></#if>
> > +
> > +<#assign previousParams = sessionAttributes._PREVIOUS_PARAMS_?
> > if_exists>
> > +<#if previousParams?has_content>
> > +  <#assign previousParams = "?" + previousParams>
> > +</#if>
> > +
> > +<#assign username = requestParameters.USERNAME?
> > default((sessionAttributes.autoUserLogin.userLoginId)?default(""))>
> > +<#if username != "">
> > +  <#assign focusName = false>
> > +<#else>
> > +  <#assign focusName = true>
> > +</#if>
> > +
> > +<center>
> > +  <div class="screenlet login-screenlet" style="width: 22%; margin-
> > left: 5px; text-align: center;">
> > +    <div class="screenlet-title-bar">
> > +      <h3>${uiLabelMap.CommonRegistered}</h3>
> > +    </div>
> > +    <div class="screenlet-body">
> > +      <form method="post" action="<@ofbizUrl>login${previousParams?
> > if_exists}</@ofbizUrl>" name="loginform">
> > +        <table class="basic-table" cellspacing="0">
> > +          <tr>
> > +            <td class="label" style="width: 31%;">$
> > {uiLabelMap.CommonUsername}</td>
> > +            <td><input type="text" name="USERNAME" value="$
> > {username}" size="20"/></td>
> > +          </tr>
> > +          <tr>
> > +            <td class="label">${uiLabelMap.CommonPassword}</td>
> > +            <td><input type="password" name="PASSWORD" value=""  
> > size="20"/></td>
> > +          </tr>
> > +          <tr>
> > +            <td colspan="2" align="center">
> > +              <input type="submit" value="$
> > {uiLabelMap.CommonLogin}"/>
> > +            </td>
> > +          </tr>
> > +        </table>
> > +        <input type="hidden" name="JavaScriptEnabled" value="N"/>
> > +        <br/>
> > +        <a href="<@ofbizUrl>forgotPassword${previousParams?
> > if_exists}</@ofbizUrl>">${uiLabelMap.CommonForgotYourPassword}?</a>
> > +        <br/>
> > +        <a href="<@ofbizUrl>newRegisterLogin${previousParams?
> > if_exists}</@ofbizUrl>">${uiLabelMap.NewRegistration}</a>
> > +      </form>
> > +    </div>
> > +  </div>
> > +</center>
> > +
> > +<script language="JavaScript" type="text/javascript">
> > +  document.loginform.JavaScriptEnabled.value = "Y";
> > +  <#if focusName>
> > +    document.loginform.USERNAME.focus();
> > +  <#else>
> > +    document.loginform.PASSWORD.focus();
> > +  </#if>
> > +</script>
> > \ No newline at end of file
> >
> > Propchange: ofbiz/trunk/specialpurpose/myportal/widget/login.ftl
> > ------------------------------------------------------------------------------
> >    svn:eol-style = native
> >
> > Propchange: ofbiz/trunk/specialpurpose/myportal/widget/login.ftl
> > ------------------------------------------------------------------------------
> >    svn:keywords = "Date Rev Author URL Id"
> >
> > Propchange: ofbiz/trunk/specialpurpose/myportal/widget/login.ftl
> > ------------------------------------------------------------------------------
> >    svn:mime-type = text/plain
> >
> >
>
--
Antwebsystems.com: Quality OFBiz services for competitive prices

Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r735965 - in /ofbiz/trunk: framework/common/src/org/ofbiz/common/ framework/common/widget/ specialpurpose/myportal/config/ specialpurpose/myportal/script/org/ofbiz/myportal/ specialpurpose/myportal/webapp/myportal/WEB-INF/ specialpurpose/my...

risalitim@gmail.com
Hi Hans,

it's ok to move it to the framework is they are more generics and they  
can be shared by all the components but in this case I think it's  
better to put the Common prefix on those labels.

Thanks
Marco


Il giorno 25/gen/09, alle ore 02:54, Hans Bakker ha scritto:

> Hi Marco,
>
> sure we can do this, however captcha itself is a framework function,  
> but
> at the moment only used in myportal... We will move the captcha  
> messages
> to the framwork....
>
> regards,
> Hans
>
> On Sat, 2009-01-24 at 22:22 +0100, [hidden email] wrote:
>> Hi Hans,
>>
>> I suggest to use the prefix MyPortal for those type of labels, I  
>> spent
>> a lot of days to cleanup all the wasted labels into OFBiz and I think
>> we cannot all use different standard to codify the labels.
>> And if it's possible do not use the underscore character in the  
>> labels
>> name could be more readable.
>>
>> In my opinion for example CaptchaMissingError could be
>> MyPortalCaptchaMissingError or something similar to that.
>>
>> If we do not follow this simple rule in two or three months the  
>> labels
>> will be completed wasted again.
>>
>> What others thinks about that ?
>>
>> Thanks
>> Marco
>>
>>
>> Il giorno 20/gen/09, alle ore 09:30, [hidden email] ha scritto:
>>
>>> Author: hansbak
>>> Date: Tue Jan 20 00:30:41 2009
>>> New Revision: 735965
>>>
>>> URL: http://svn.apache.org/viewvc?rev=735965&view=rev
>>> Log:
>>> first version of captcha, not perfect yet: multiple users
>>> registering at the same time, image should be stored in 'runtime'
>>> not working on windows. Another problem is what files to put
>>> where.....the captcha itself looks like a framework
>>> feature...however the registration process needs the party
>>> component....so let us know, we will correct it....
>>>
>>> Added:
>>>   ofbiz/trunk/framework/common/src/org/ofbiz/common/Captcha.java
>>> (with props)
>>>   ofbiz/trunk/specialpurpose/myportal/widget/login.ftl   (with  
>>> props)
>>> Modified:
>>>   ofbiz/trunk/framework/common/widget/CommonMenus.xml
>>>   ofbiz/trunk/specialpurpose/myportal/config/MyPortalUiLabels.xml
>>>   ofbiz/trunk/specialpurpose/myportal/script/org/ofbiz/myportal/
>>> Events.xml
>>>   ofbiz/trunk/specialpurpose/myportal/webapp/myportal/WEB-INF/
>>> controller.xml
>>>   ofbiz/trunk/specialpurpose/myportal/widget/CommonScreens.xml
>>>   ofbiz/trunk/specialpurpose/myportal/widget/MyPortalForms.xml
>>>
>>> Added: ofbiz/trunk/framework/common/src/org/ofbiz/common/
>>> Captcha.java
>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/src/org/ofbiz/common/Captcha.java?rev=735965&view=auto
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> ====================================================================
>>> --- ofbiz/trunk/framework/common/src/org/ofbiz/common/Captcha.java
>>> (added)
>>> +++ ofbiz/trunk/framework/common/src/org/ofbiz/common/Captcha.java
>>> Tue Jan 20 00:30:41 2009
>>> @@ -0,0 +1,163 @@
>>> +/
>>> *******************************************************************************
>>> + * Licensed to the Apache Software Foundation (ASF) under one
>>> + * or more contributor license agreements.  See the NOTICE file
>>> + * distributed with this work for additional information
>>> + * regarding copyright ownership.  The ASF licenses this file
>>> + * to you under the Apache License, Version 2.0 (the
>>> + * "License"); you may not use this file except in compliance
>>> + * with the License.  You may obtain a copy of the License at
>>> + *
>>> + * http://www.apache.org/licenses/LICENSE-2.0
>>> + *
>>> + * Unless required by applicable law or agreed to in writing,
>>> + * software distributed under the License is distributed on an
>>> + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>>> + * KIND, either express or implied.  See the License for the
>>> + * specific language governing permissions and limitations
>>> + * under the License.
>>> +
>>> *******************************************************************************/
>>> +
>>> +// copied from : http://cocoon.apache.org/2.2/blocks/captcha/1.0/1436_1_1.html
>>> +
>>> +package org.ofbiz.common;
>>> +
>>> +import javax.imageio.ImageIO;
>>> +import javax.servlet.http.HttpServletRequest;
>>> +import javax.servlet.http.HttpServletResponse;
>>> +import java.awt.*;
>>> +import java.awt.geom.AffineTransform;
>>> +import java.awt.image.BufferedImage;
>>> +import java.io.File;
>>> +import java.io.IOException;
>>> +
>>> +public class Captcha {
>>> +
>>> +    public static String ID_KEY = null;
>>> +
>>> +    public static String getCodeCaptcha(HttpServletRequest
>>> request,HttpServletResponse response) {
>>> +     StringBuffer finalString = new StringBuffer();
>>> +        String elegibleChars =
>>> "ABCDEFGHJKLMPQRSTUVWXYabcdefhjkmnpqrstuvwxy23456789";
>>> +        int charsToPrint = 6;
>>> +        char[] chars = elegibleChars.toCharArray();
>>> +
>>> +        for (int i = 0; i < charsToPrint; i++) {
>>> +            double randomValue = Math.random();
>>> +            int randomIndex = (int) Math.round(randomValue *
>>> (chars.length - 1));
>>> +            char characterToShow = chars[randomIndex];
>>> +            finalString.append(characterToShow);
>>> +        }
>>> +        ID_KEY = finalString.toString();
>>> +        if(createImageCaptcha (request,response)) return "success";
>>> +        return "error";
>>> +    }
>>> +
>>> +    public static boolean createImageCaptcha (HttpServletRequest
>>> request,HttpServletResponse response) {
>>> +        try {        
>>> +            //It is possible to pass the font size, image width and
>>> height with the request as well
>>> +            Color backgroundColor = Color.gray;
>>> +            Color borderColor = Color.DARK_GRAY;
>>> +            Color textColor = Color.ORANGE;
>>> +            Color circleColor = new Color(160, 160, 160);
>>> +            Font textFont = new Font("Arial", Font.PLAIN,
>>> paramInt(request, "fontSize", 22));
>>> +            int charsToPrint = 6;
>>> +            int width = paramInt(request, "width", 149);
>>> +            int height = paramInt(request, "height", 40);
>>> +            int circlesToDraw = 6;
>>> +            float horizMargin = 20.0f;
>>> +            double rotationRange = 0.7; // in radians
>>> +            BufferedImage bufferedImage = new BufferedImage(width,
>>> height, BufferedImage.TYPE_INT_RGB);
>>> +
>>> +            Graphics2D g = (Graphics2D)  
>>> bufferedImage.getGraphics();
>>> +
>>> +            g.setColor(backgroundColor);
>>> +            g.fillRect(0, 0, width, height);
>>> +
>>> +            //Generating some circles for background noise
>>> +            g.setColor(circleColor);
>>> +            for (int i = 0; i < circlesToDraw; i++) {
>>> +                int circleRadius = (int) (Math.random() * height /
>>> 2.0);
>>> +                int circleX = (int) (Math.random() * width -
>>> circleRadius);
>>> +                int circleY = (int) (Math.random() * height -
>>> circleRadius);
>>> +                g.drawOval(circleX, circleY, circleRadius * 2,
>>> circleRadius * 2);
>>> +            }
>>> +            g.setColor(textColor);
>>> +            g.setFont(textFont);
>>> +
>>> +            FontMetrics fontMetrics = g.getFontMetrics();
>>> +            int maxAdvance = fontMetrics.getMaxAdvance();
>>> +            int fontHeight = fontMetrics.getHeight();
>>> +
>>> +            //We are not using certain characters, which might
>>> confuse users
>>> +            String characterToShow = ID_KEY;
>>> +            float spaceForLetters = -horizMargin * 2 + width;
>>> +            float spacePerChar = spaceForLetters / (charsToPrint -
>>> 1.0f);
>>> +
>>> +            for (int i = 0; i < characterToShow.length(); i++) {
>>> +
>>> +                // this is a separate canvas used for the character
>>> so that
>>> +                // we can rotate it independently
>>> +                int charWidth =
>>> fontMetrics.charWidth(characterToShow.charAt(i));
>>> +                int charDim = Math.max(maxAdvance, fontHeight);
>>> +                int halfCharDim = (int) (charDim / 2);
>>> +
>>> +                BufferedImage charImage =
>>> +                        new BufferedImage(charDim, charDim,
>>> BufferedImage.TYPE_INT_ARGB);
>>> +                Graphics2D charGraphics =  
>>> charImage.createGraphics();
>>> +                charGraphics.translate(halfCharDim, halfCharDim);
>>> +                double angle = (Math.random() - 0.5) *  
>>> rotationRange;
>>> +
>>> charGraphics.transform(AffineTransform.getRotateInstance(angle));
>>> +                charGraphics.translate(-halfCharDim, -halfCharDim);
>>> +                charGraphics.setColor(textColor);
>>> +                charGraphics.setFont(textFont);
>>> +
>>> +                int charX = (int) (0.5 * charDim - 0.5 *  
>>> charWidth);
>>> +                charGraphics.drawString("" +
>>> characterToShow.charAt(i), charX,
>>> +                        (int) ((charDim -
>>> fontMetrics.getAscent()) / 2 + fontMetrics.getAscent()));
>>> +
>>> +                float x = horizMargin + spacePerChar * (i) -
>>> charDim / 2.0f;
>>> +                int y = (int) ((height - charDim) / 2);
>>> +
>>> +                g.drawImage(charImage, (int) x, y, charDim,
>>> charDim, null, null);
>>> +
>>> +                charGraphics.dispose();
>>> +            }
>>> +            // Drawing the image border
>>> +            g.setColor(borderColor);
>>> +            g.drawRect(0, 0, width - 1, height - 1);
>>> +            g.dispose();
>>> +            Captcha.writeImage(bufferedImage, "captchaImage.png");
>>> +
>>> +        } catch (Exception ioe) {
>>> +            return false;
>>> +        }
>>> +    //Adding this because we called response.getOutputStream()
>>> above. This will prevent and illegal state exception being thrown
>>> +        return true;
>>> +    }
>>> +
>>> + public static void writeImage(BufferedImage image, String  
>>> fileName)
>>> + {
>>> + if (fileName == null) return;
>>> + int offset = fileName.lastIndexOf( "." );
>>> + String type = offset == -1 ? "png" : fileName.substring(offset +
>>> 1);
>>> + String path;
>>> + try {
>>> + path = new java.io.File(".").getCanonicalPath();
>>> + path += "/framework/images/webapp/images/";
>>> + path += fileName;
>>> + System.out.println("\n\nPath =  "+path+"\n");
>>> + System.out.println("Captcha Key =  "+ID_KEY+"\n\n");
>>> + ImageIO.write(image, type, new File( path ));
>>> + } catch (IOException e) {
>>> + return;
>>> + }
>>> + }
>>> +
>>> +    public static String paramString(HttpServletRequest request,
>>> String paramName,
>>> +            String defaultString) {
>>> +        return request.getParameter(paramName) != null ?
>>> request.getParameter(paramName) : defaultString;
>>> +    }
>>> +
>>> +    public static int paramInt(HttpServletRequest request, String
>>> paramName, int defaultInt) {
>>> +        return request.getParameter(paramName) != null ?
>>> Integer.parseInt(request.getParameter(paramName)) : defaultInt;
>>> +    }
>>> +}
>>> \ No newline at end of file
>>>
>>> Propchange: ofbiz/trunk/framework/common/src/org/ofbiz/common/
>>> Captcha.java
>>> ------------------------------------------------------------------------------
>>>   svn:eol-style = native
>>>
>>> Propchange: ofbiz/trunk/framework/common/src/org/ofbiz/common/
>>> Captcha.java
>>> ------------------------------------------------------------------------------
>>>   svn:keywords = "Date Rev Author URL Id"
>>>
>>> Propchange: ofbiz/trunk/framework/common/src/org/ofbiz/common/
>>> Captcha.java
>>> ------------------------------------------------------------------------------
>>>   svn:mime-type = text/plain
>>>
>>> Modified: ofbiz/trunk/framework/common/widget/CommonMenus.xml
>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/widget/CommonMenus.xml?rev=735965&r1=735964&r2=735965&view=diff
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> ====================================================================
>>> --- ofbiz/trunk/framework/common/widget/CommonMenus.xml (original)
>>> +++ ofbiz/trunk/framework/common/widget/CommonMenus.xml Tue Jan 20
>>> 00:30:41 2009
>>> @@ -31,7 +31,7 @@
>>>         </menu-item>
>>>         <menu-item name="Login" title="${uiLabelMap.CommonLogin}"
>>> align-style="opposed">
>>>             <condition><if-empty field-name="userLogin"/></
>>> condition>
>>> -             <link target="${checkLoginUrl}"/>
>>> +             <link target="logout"/>
>>>         </menu-item>
>>>     </menu>
>>>
>>>
>>> Modified: ofbiz/trunk/specialpurpose/myportal/config/
>>> MyPortalUiLabels.xml
>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/myportal/config/MyPortalUiLabels.xml?rev=735965&r1=735964&r2=735965&view=diff
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> ====================================================================
>>> --- ofbiz/trunk/specialpurpose/myportal/config/MyPortalUiLabels.xml
>>> (original)
>>> +++ ofbiz/trunk/specialpurpose/myportal/config/MyPortalUiLabels.xml
>>> Tue Jan 20 00:30:41 2009
>>> @@ -18,6 +18,18 @@
>>>    under the License.
>>> -->
>>> <resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
>>> +    <property key="CaptchaMissingError">
>>> +        <value xml:lang="en">Verify code captcha is missing or
>>> wrong</value>
>>> +        <value xml:lang="th">รหัสตà¸
>>> ±à¸§à¹€à¸
>>> ¥à¸‚ที่ท่านกà¸
>>> £à¸ กมีข้ภผà¸
>>> ´à¸”พà¸
>>> ¥à¸²à¸”</value>
>>> +    </property>
>>> +    <property key="FirstName_Missing">
>>> +        <value xml:lang="en">Your firstName is missing</value>
>>> +        <value xml:lang="th">กà¸
>>> £à¸¸à¸“ากรภกชื่à¸
>>> ขภงท่าน</value>
>>> +    </property>
>>> +    <property key="LastName_Missing">
>>> +        <value xml:lang="en">Your lastname is missing</value>
>>> +        <value xml:lang="th">กà¸
>>> £à¸¸à¸“ากรà¸
>>> กนามสกุลขภ 
>>> งท่าน</value>
>>> +    </property>
>>>    <property key="MyPortalDashboard">
>>>        <value xml:lang="en">My Portal</value>
>>>        <value xml:lang="fr">Mon portail</value>
>>> @@ -30,6 +42,10 @@
>>>        <value xml:lang="it">Invia email ad ogni cliente per le
>>> modifiche sulla richiesta</value>
>>>        <value xml:lang="th">ส่งภีà¹
>>> €à¸¡à¸¥à¹Œà¸–ึงà¸
>>> ¥à¸¹à¸à¸„้าที่à¹
>>> €à¸›à¸¥à¸µà¹ˆà¸
>>> ¢à¸™à¸„วามต้à¸
>>> งการ</value>
>>>    </property>
>>> +    <property key="NewRegistration">
>>> +        <value xml:lang="en">New Registration </value>
>>> +        <value xml:lang="th">ลงทะà¹
>>> €à¸šà¸µà¸¢à¸™ </value>
>>> +    </property>
>>>    <property key="PageTitleMyPortal">
>>>        <value xml:lang="en">My Portal for : </value>
>>>        <value xml:lang="it">Mio portale per : </value>
>>> @@ -41,4 +57,24 @@
>>>        <value xml:lang="it">Pagina mio portale</value>
>>>        <value xml:lang="th">หนà¹
>>> ‰à¸²à¸ªà¹ˆà¸§à¸™à¸•à¸±à¸§à¸‚à¸
>>> งฉัน</value>
>>>    </property>
>>> +    <property key="PicCaptcha">
>>> +        <value xml:lang="en">Code Captcha</value>
>>> +        <value xml:lang="th">รหัสตà¸
>>> £à¸§à¸ˆà¸ªà¸ บ</
>>> value>
>>> +    </property>
>>> +    <property key="RegisterComplete">
>>> +        <value xml:lang="en">Register of new person is
>>> complete...Please </value>
>>> +        <value xml:lang="th">การลงท
>>> ะเบีà¸
>>> ¢à¸™à¹ƒà¸«à¸¡à¹ˆà¸ªà¸³à¸«à¸£à¸
>>> ±à¸šà¸šà¸¸à¸„คà¸
>>> ¥à¹„ด้ทำการà¹
>>> €à¸ªà¸£à¹‡à¸ˆà¸ªà¸´à¹
>>> ‰à¸™à¸ªà¸¡à¸šà¸¹à¸
>>> £à¸“์แลà¹
>>> ‰à¸§...สามารถเขà¹
>>> ‰à¸²à¸ªà¸¹à¹ˆà¸£à¸
>>> °à¸šà¸šà¹„ด้ </value>
>>> +    </property>
>>> +    <property key="RegisterForCustomer">
>>> +        <value xml:lang="en">Register for customer</value>
>>> +        <value xml:lang="th">ลงทะà¹
>>> €à¸šà¸µà¸¢à¸™à¸ªà¸³à¸«à¸
>>> £à¸±à¸šà¸¥à¸¹à¸à¸„้า</value>
>>> +    </property>
>>> +    <property key="VerifyCaptcha">
>>> +        <value xml:lang="en">Verify captcha code</value>
>>> +        <value xml:lang="th">ใส่รหà¸
>>> ±à¸ªà¸•à¸²à¸¡à¸
>>> £à¸¹à¸›</value>
>>> +    </property>
>>> +    <property key="UserLogin">
>>> +        <value xml:lang="en">User Login</value>
>>> +        <value xml:lang="th">ข้ภมูà¸
>>> ¥à¸à¸²à¸£à¸¥à¸‡à¸—à¸
>>> °à¹€à¸šà¸µà¸¢à¸™</value>
>>> +    </property>
>>> </resource>
>>>
>>> Modified: ofbiz/trunk/specialpurpose/myportal/script/org/ofbiz/
>>> myportal/Events.xml
>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/myportal/script/org/ofbiz/myportal/Events.xml?rev=735965&r1=735964&r2=735965&view=diff
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> ====================================================================
>>> --- ofbiz/trunk/specialpurpose/myportal/script/org/ofbiz/myportal/
>>> Events.xml (original)
>>> +++ ofbiz/trunk/specialpurpose/myportal/script/org/ofbiz/myportal/
>>> Events.xml Tue Jan 20 00:30:41 2009
>>> @@ -312,4 +312,87 @@
>>>            request-name="communicationEventTypeId"/>
>>>        <field-to-request field="communicationEventId" request-
>>> name="communicationEventId"/>
>>>    </simple-method>
>>> +
>>> +    <simple-method method-name="createRegister"
>>> +        short-description="Create person when new register" login-
>>> required="false">
>>> +        <if-empty field="parameters.firstName"><property-to-field
>>> field="errorMessage" resource="MyPortalUiLabels"
>>> property="FirstName_Missing"/><field-to-list field="errorMessage"
>>> list="error_list"/></if-empty>
>>> +        <if-empty field="parameters.lastName"><property-to-field
>>> field="errorMessage" resource="MyPortalUiLabels"
>>> property="LastName_Missing"/><field-to-list field="errorMessage"
>>> list="error_list"/></if-empty>
>>> +        <if-empty field="parameters.USERNAME"><property-to-field
>>> field="errorMessage" resource="PartyUiLabels"
>>> property="PartyUserNameMissing"/><field-to-list field="errorMessage"
>>> list="error_list"/></if-empty>
>>> +        <if-empty field="parameters.PASSWORD"><property-to-field
>>> field="errorMessage" resource="PartyUiLabels"
>>> property="PartyPasswordMissing"/><field-to-list field="errorMessage"
>>> list="error_list"/></if-empty>
>>> +        <call-bsh><![CDATA[
>>> +
>>> parameters.put("captchaCode",org.ofbiz.common.Captcha.ID_KEY);
>>> +        ]]></call-bsh>
>>> +        <call-object-method obj-field="PASSWORD" obj-map-
>>> name="parameters" method-name="toLowerCase" ret-field="PASSWORD"  
>>> ret-
>>> map-name="parameters"/>
>>> +        <call-object-method obj-field="CONFIRM_PASSWORD" obj-map-
>>> name="parameters" method-name="toLowerCase" ret-
>>> field="CONFIRM_PASSWORD" ret-map-name="parameters"/>
>>> +        <if-compare field="parameters.PASSWORD" value="$
>>> {parameters.CONFIRM_PASSWORD}" operator="equals">
>>> +            <call-object-method obj-field="captcha" obj-map-
>>> name="parameters" method-name="toLowerCase" ret-field="captcha" ret-
>>> map-name="parameters"/>
>>> +            <call-object-method obj-field="captchaCode" obj-map-
>>> name="parameters" method-name="toLowerCase" ret-field="captchaCode"
>>> ret-map-name="parameters"/>
>>> +            <if-compare field="parameters.captcha" value="$
>>> {parameters.captchaCode}" operator="equals">
>>> +
>>> +                <!-- Create Person -->
>>> +                <set field="parameters.statusId"
>>> value="PARTY_ENABLED"/>
>>> +                <make-value entity-name="Party" value-
>>> field="newEntity"/>
>>> +                <set-pk-fields map="parameters" value-
>>> field="newEntity"/>
>>> +                <make-next-seq-id value-field="newEntity" seq-
>>> field-
>>> name="partyId"/>
>>> +                <set field="newEntity.partyTypeId" value="PERSON"/>
>>> +                <set-nonpk-fields map="parameters" value-
>>> field="newEntity"/>
>>> +                <create-value value-field="newEntity"/>
>>> +
>>> +                <make-value entity-name="PartyStatus" value-
>>> field="newEntity2"/>
>>> +                <set field="newEntity2.partyId" from-
>>> field="newEntity.partyId"/>
>>> +                <set field="newEntity2.statusId" from-
>>> field="newEntity.statusId"/>
>>> +                <set field="newEntity2.statusDate" from-
>>> field="newEntity.createdStamp"/>
>>> +                <create-value value-field="newEntity2"/>
>>> +
>>> +                <make-value entity-name="Person" value-
>>> field="newEntity3"/>
>>> +                <set field="newEntity3.partyId" from-
>>> field="newEntity.partyId"/>
>>> +                <set-nonpk-fields map="parameters" value-
>>> field="newEntity3"/>
>>> +                <create-value value-field="newEntity3"/>
>>> +
>>> +                <!-- Create the UserLogin Record -->
>>> +                <call-map-processor in-map-name="parameters" out-
>>> map-name="userLoginContext">
>>> +                    <simple-map-processor name="newUserLogin">
>>> +                        <process field="USERNAME"><copy to-
>>> field="userLoginId"/></process>
>>> +                        <process field="PASSWORD"><copy to-
>>> field="currentPassword"/></process>
>>> +                        <process field="CONFIRM_PASSWORD"><copy to-
>>> field="currentPasswordVerify"/></process>
>>> +                        <process field="PASSWORD_HINT"><copy to-
>>> field="passwordHint"/></process>
>>> +                    </simple-map-processor>
>>> +                </call-map-processor>
>>> +                <set field="userLoginExistsMap.userLoginId"  from-
>>> field="userLoginContext.userLoginId" />
>>> +                <find-by-primary-key entity-name="UserLogin"
>>> map="userLoginExistsMap" value-field="existingUserLogin"/>
>>> +                <if-not-empty field="existingUserLogin">
>>> +                    <set field="errorMessage" value="Username in
>>> use, please choose another." />
>>> +                    <field-to-list field="errorMessage"
>>> list="error_list"/>
>>> +                    <check-errors error-list-name="error_list"
>>> error-code="resultPage"/>
>>> +                    <else>
>>> +                        <make-value entity-name="UserLogin" value-
>>> field="newUserLogin"/>
>>> +                        <set field="newUserLogin.userLoginId" from-
>>> field="userLoginContext.userLoginId"/>
>>> +                        <set field="newUserLogin.currentPassword"
>>> from-field="userLoginContext.currentPassword" />
>>> +                        <set field="newUserLogin.passwordHint"  
>>> from-
>>> field="userLoginContext.passwordHint" />
>>> +                        <!-- Check the password, etc for validity  
>>> -->
>>> +                        <call-bsh><![CDATA[
>>> +                            String password = (String)
>>> userLoginContext.get("currentPassword");
>>> +                            String confirmPassword = (String)
>>> userLoginContext.get("currentPasswordVerify");
>>> +                            String passwordHint = (String)
>>> userLoginContext.get("passwordHint");
>>> +
>>> org.ofbiz.common.login.LoginServices.checkNewPassword(newUserLogin,
>>> null, password, confirmPassword, passwordHint, error_list, true,
>>> locale);
>>> +                            boolean useEncryption =
>>> "true
>>> ".equals
>>> (org.ofbiz.base.util.UtilProperties.getPropertyValue("security",
>>> "password.encrypt"));
>>> +                            if (useEncryption)
>>> { newUserLogin.set("currentPassword",
>>> org.ofbiz.base.crypto.HashCrypt.getDigestHash((String)
>>> newUserLogin.get("currentPassword"))); }
>>> +                            ]]></call-bsh>
>>> +                        <set field="newUserLogin.partyId" from-
>>> field="newEntity.partyId" />
>>> +                        <create-value value-field="newUserLogin"/>
>>> +                    </else>
>>> +                </if-not-empty>
>>> +                <set field="partyId" from-
>>> field="newEntity.partyId"/>
>>> +                <field-to-request field="partyId" request-
>>> name="partyId"/>
>>> +                <return response-code="resultPage"/>
>>> +                <else>
>>> +                    <property-to-field field="errorMessage"
>>> resource="MyPortalUiLabels" property="CaptchaMissingError"/><field-
>>> to-list field="errorMessage" list="error_list"/>
>>> +                </else>
>>> +            </if-compare>
>>> +            <else>
>>> +                <property-to-field field="errorMessage"
>>> resource="PartyUiLabels" property="PartyPasswordMatchError"/><field-
>>> to-list field="errorMessage" list="error_list"/>
>>> +            </else>
>>> +        </if-compare>
>>> +        <check-errors error-list-name="error_list" error-
>>> code="resultPage"/>
>>> +    </simple-method>
>>> </simple-methods>
>>>
>>> Modified: ofbiz/trunk/specialpurpose/myportal/webapp/myportal/WEB-
>>> INF/controller.xml
>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/myportal/webapp/myportal/WEB-INF/controller.xml?rev=735965&r1=735964&r2=735965&view=diff
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> ====================================================================
>>> --- ofbiz/trunk/specialpurpose/myportal/webapp/myportal/WEB-INF/
>>> controller.xml (original)
>>> +++ ofbiz/trunk/specialpurpose/myportal/webapp/myportal/WEB-INF/
>>> controller.xml Tue Jan 20 00:30:41 2009
>>> @@ -31,6 +31,23 @@
>>>        <security https="true" auth="true"/>
>>>        <response name="success" type="view" value="main"/>
>>>    </request-map>
>>> +    <request-map uri="login">
>>> +        <security https="true" auth="false"/>
>>> +        <event type="java"
>>> path="org.ofbiz.securityext.login.LoginEvents" invoke="storeLogin"/>
>>> +        <response name="success" type="view" value="main"/>
>>> +        <response name="requirePasswordChange" type="view"
>>> value="requirePasswordChange"/>
>>> +        <response name="error" type="view" value="login"/>
>>> +    </request-map>
>>> +    <request-map uri="newRegisterLogin">
>>> +        <security https="true" auth="false"/>
>>> +        <event type="java" invoke="getCodeCaptcha"
>>> path="org.ofbiz.common.Captcha"/>
>>> +        <response name="success" type="view"
>>> value="newRegisterLogin"/>
>>> +    </request-map>
>>> +    <request-map uri="createRegister">
>>> +        <security https="true" auth="false"/>
>>> +        <event type="simple" invoke="createRegister" path="org/
>>> ofbiz/myportal/Events.xml"/>
>>> +        <response name="resultPage" type="url"
>>> value="newRegisterLogin"/>
>>> +    </request-map>
>>>
>>>    <!-- TIMESHEET -->
>>>    <request-map uri="myTimesheet">
>>> @@ -270,6 +287,8 @@
>>>    </request-map>
>>>
>>>    <view-map name="main" type="screen" page="component://myportal/
>>> widget/CommonScreens.xml#main"/>
>>> +    <view-map name="login" type="screen" page="component://
>>> myportal/
>>> widget/CommonScreens.xml#login"/>
>>> +    <view-map name="newRegisterLogin" type="screen"
>>> page="component://myportal/widget/
>>> CommonScreens.xml#newRegisterLogin"/>
>>>    <view-map name="myTasks" type="screen" page="component://
>>> myportal/widget/CommonScreens.xml#MyTasks"/>
>>>    <view-map name="myCommunications" type="screen"
>>> page="component://myportal/widget/
>>> CommonScreens.xml#MyCommunications"/>
>>>    <view-map name="otherCommunications" type="screen"
>>> page="component://myportal/widget/
>>> CommonScreens.xml#OtherCommunications"/>
>>>
>>> Modified: ofbiz/trunk/specialpurpose/myportal/widget/
>>> CommonScreens.xml
>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/myportal/widget/CommonScreens.xml?rev=735965&r1=735964&r2=735965&view=diff
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> ====================================================================
>>> --- ofbiz/trunk/specialpurpose/myportal/widget/CommonScreens.xml
>>> (original)
>>> +++ ofbiz/trunk/specialpurpose/myportal/widget/CommonScreens.xml Tue
>>> Jan 20 00:30:41 2009
>>> @@ -164,6 +164,66 @@
>>>            </widgets>
>>>        </section>
>>>    </screen>
>>> +
>>> +    <screen name="login">
>>> +        <section>
>>> +            <widgets>
>>> +                <decorator-screen name="main-decorator" location="$
>>> {parameters.mainDecoratorLocation}">
>>> +                    <decorator-section name="body">
>>> +                        <platform-specific>
>>> +                            <html><html-template
>>> location="component://myportal/widget/login.ftl"/></html>
>>> +                        </platform-specific>
>>> +                    </decorator-section>
>>> +                </decorator-screen>
>>> +            </widgets>
>>> +        </section>
>>> +    </screen>
>>> +
>>> +    <!--New Register Person-->
>>> +    <screen name="newRegisterLogin">
>>> +        <section>
>>> +            <actions>
>>> +                <set field="partyId" from-
>>> field="parameters.partyId"/>
>>> +                <entity-one entity-name="PartyAndPerson" value-
>>> name="personInfo"/>
>>> +            </actions>
>>> +            <widgets>
>>> +                <decorator-screen name="main-decorator" location="$
>>> {parameters.mainDecoratorLocation}">
>>> +                    <decorator-section name="body">
>>> +                        <section>
>>> +                            <condition>
>>> +                                <not><if-empty field-
>>> name="parameters.partyId"/></not>
>>> +                            </condition>
>>> +                            <actions>
>>> +                                <set field="partyId" from-
>>> field="parameters.partyId"/>
>>> +                                <script location="component://
>>> party/
>>> webapp/partymgr/WEB-INF/actions/party/ViewProfile.groovy"/>
>>> +                            </actions>
>>> +                            <widgets>
>>> +                                <label style="h2" text="$
>>> {uiLabelMap.RegisterComplete}"/><link target="main" style="h2"
>>> text="${uiLabelMap.CommonBeLogged}"></link>
>>> +                                <label style="h2"
>>> text="&lt;br&gt;&lt;br&gt;"/>
>>> +                                <include-screen name="Party"
>>> location="component://party/widget/partymgr/ProfileScreens.xml"/>
>>> +                            </widgets>
>>> +                            <fail-widgets>
>>> +                                <container style="screenlet">
>>> +                                    <container style="screenlet-
>>> title-bar">
>>> +                                        <container style="h3">
>>> +                                            <label text="$
>>> {uiLabelMap.NewRegistration}"/>
>>> +                                        </container>
>>> +                                    </container>
>>> +                                    <container style="screenlet-
>>> body">
>>> +                                        <section>
>>> +                                            <widgets>
>>> +                                                <include-form
>>> name="RegisterPerson" location="component://myportal/widget/
>>> MyPortalForms.xml"/>
>>> +                                            </widgets>
>>> +                                        </section>
>>> +                                    </container>
>>> +                                </container>
>>> +                            </fail-widgets>
>>> +                        </section>
>>> +                    </decorator-section>
>>> +                </decorator-screen>
>>> +            </widgets>
>>> +        </section>
>>> +    </screen>
>>>
>>>    <screen name="CommonRequestDecorator">
>>>        <section>
>>>
>>> Modified: ofbiz/trunk/specialpurpose/myportal/widget/
>>> MyPortalForms.xml
>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/myportal/widget/MyPortalForms.xml?rev=735965&r1=735964&r2=735965&view=diff
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> ====================================================================
>>> --- ofbiz/trunk/specialpurpose/myportal/widget/MyPortalForms.xml
>>> (original)
>>> +++ ofbiz/trunk/specialpurpose/myportal/widget/MyPortalForms.xml Tue
>>> Jan 20 00:30:41 2009
>>> @@ -276,4 +276,75 @@
>>>        <field name="task"><display description="${workEffortName}"/
>>>> </field>
>>>    </form>
>>>
>>> +    <!--New Register Person-->
>>> +    <form name="RegisterPerson" type="single"
>>> target="createRegister" default-map-name="personInfo"
>>> +        focus-field-name="salutation" header-row-style="header-row"
>>> default-table-style="basic-table">
>>> +        <auto-fields-service service-name="updatePerson"/>
>>> +        <field use-when="personInfo!=null" name="partyId" title="$
>>> {uiLabelMap.PartyPartyId}" tooltip="$
>>> {uiLabelMap.CommonNotModifRecreat}"><display/></field>
>>> +        <field use-when="personInfo==null&amp;&amp;partyId==null"
>>> name="partyId" title="${uiLabelMap.PartyPartyId}"><ignored/></field>
>>> +        <field use-when="personInfo==null&amp;&amp;partyId!=null"
>>> name="partyId" title="${uiLabelMap.PartyPartyId}" tooltip="$
>>> {uiLabelMap.CommonCannotBeFound}: [${partyId}]"><display also-
>>> hidden="false"/></field>
>>> +        <field name="firstName" title="$
>>> {uiLabelMap.PartyFirstName}" tooltip="${uiLabelMap.CommonRequired}"
>>> widget-style="required"><text size="40" maxlength="60"/></field>
>>> +        <field name="lastName" title="${uiLabelMap.PartyLastName}"
>>> tooltip="${uiLabelMap.CommonRequired}" widget-style="required"><text
>>> size="40" maxlength="60"/></field>
>>> +        <field name="gender">
>>> +            <drop-down allow-empty="true">
>>> +                <option key="M" description="$
>>> {uiLabelMap.CommonMale}"/>
>>> +                <option key="F" description="$
>>> {uiLabelMap.CommonFemale}"/>
>>> +            </drop-down>
>>> +        </field>
>>> +        <field name="maritalStatus">
>>> +            <drop-down allow-empty="true">
>>> +                <option key="S" description="$
>>> {uiLabelMap.PartyMaritalStatusSingle}"/>
>>> +                <option key="M" description="$
>>> {uiLabelMap.PartyMaritalStatusMarried}"/>
>>> +                <option key="P" description="$
>>> {uiLabelMap.PartyMaritalStatusSeparated}"/>
>>> +                <option key="D" description="$
>>> {uiLabelMap.PartyMaritalStatusDivorced}"/>
>>> +                <option key="W" description="$
>>> {uiLabelMap.PartyMaritalStatusWidowed}"/>
>>> +            </drop-down>
>>> +        </field>
>>> +        <field name="employmentStatusEnumId">
>>> +            <drop-down allow-empty="true">
>>> +                <entity-options entity-name="Enumeration" key-
>>> field-
>>> name="enumId" description="${description} [${enumCode}]">
>>> +                    <entity-constraint name="enumTypeId"
>>> value="EMPLOY_STTS"/>
>>> +                    <entity-order-by field-name="sequenceId"/>
>>> +                </entity-options>
>>> +            </drop-down>
>>> +        </field>
>>> +        <field name="residenceStatusEnumId">
>>> +            <drop-down allow-empty="true">
>>> +                <entity-options entity-name="Enumeration" key-
>>> field-
>>> name="enumId" description="${description} [${enumCode}]">
>>> +                    <entity-constraint name="enumTypeId"
>>> value="PTY_RESID_STTS"/>
>>> +                    <entity-order-by field-name="sequenceId"/>
>>> +                </entity-options>
>>> +            </drop-down>
>>> +        </field>
>>> +        <field name="existingCustomer">
>>> +            <drop-down allow-empty="true"><option key="Y"
>>> description="${uiLabelMap.CommonY}"/><option key="N" description="$
>>> {uiLabelMap.CommonN}"/></drop-down>
>>> +        </field>
>>> +        <field name="preferredCurrencyUomId">
>>> +            <drop-down allow-empty="true">
>>> +                <entity-options key-field-name="uomId"
>>> description="${abbreviation} - ${description}" entity-name="Uom">
>>> +                    <entity-constraint name="uomTypeId"
>>> operator="equals" value="CURRENCY_MEASURE"/>
>>> +                    <entity-order-by field-name="abbreviation"/>
>>> +                </entity-options>
>>> +            </drop-down>
>>> +        </field>
>>> +        <field name="statusId" use-when="person==null"><hidden/></
>>> field>
>>> +        <field name="statusId" use-when="person!=null">
>>> +            <drop-down allow-empty="false">
>>> +                <entity-options description="${description}"  
>>> entity-
>>> name="StatusItem">
>>> +                    <entity-constraint name="statusTypeId"
>>> value="PARTY_STATUS"/>
>>> +                    <entity-order-by field-name="sequenceId"/>
>>> +                </entity-options>
>>> +            </drop-down>
>>> +        </field>
>>> +        <field name="UserLogin" title="${uiLabelMap.UserLogin}"
>>> title-area-style="group-label"><display description=" " also-
>>> hidden="false"/></field>
>>> +        <field name="USERNAME" title="${uiLabelMap.CommonUsername}"
>>> tooltip="${uiLabelMap.CommonRequired}" widget-style="required"><text
>>> size="30" maxlength="250"/></field>
>>> +        <field name="PASSWORD" title="${uiLabelMap.CommonPassword}"
>>> tooltip="${uiLabelMap.CommonRequired}" widget-
>>> style="required"><password size="15" maxlength="250"/></field>
>>> +        <field name="CONFIRM_PASSWORD" title="$
>>> {uiLabelMap.CommonPassword}" tooltip="* ${uiLabelMap.CommonConfirm}"
>>> widget-style="required"><password size="15" maxlength="250"/></
>>> field>
>>> +        <field name="VerifyCaptchaTitle" title="$
>>> {uiLabelMap.VerifyCaptcha}" title-area-style="group-label"><display
>>> description=" " also-hidden="false"/></field>
>>> +        <field name="picOfcaptcha" title="$
>>> {uiLabelMap.PicCaptcha}"><image value="/images/captchaImage.png"></
>>> image></field>
>>> +        <field name="reload" title=" "><image value="/images/feed-
>>> icon-14x14.png"><sub-hyperlink target="newRegisterLogin"
>>> description="reload image"/></image></field>
>>> +        <field name="captcha" title="${uiLabelMap.VerifyCaptcha}"
>>> tooltip="${uiLabelMap.CommonRequired}" widget-style="required"><text
>>> size="23" maxlength="30"/></field>
>>> +        <field name="submitButton" title="${uiLabelMap.CommonSave}"
>>> title-area-style="group-label"><submit button-type="button"/></
>>> field>
>>> +    </form>
>>> +
>>> </forms>
>>>
>>> Added: ofbiz/trunk/specialpurpose/myportal/widget/login.ftl
>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/myportal/widget/login.ftl?rev=735965&view=auto
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> ====================================================================
>>> --- ofbiz/trunk/specialpurpose/myportal/widget/login.ftl (added)
>>> +++ ofbiz/trunk/specialpurpose/myportal/widget/login.ftl Tue Jan 20
>>> 00:30:41 2009
>>> @@ -0,0 +1,73 @@
>>> +<#--
>>> +Licensed to the Apache Software Foundation (ASF) under one
>>> +or more contributor license agreements.  See the NOTICE file
>>> +distributed with this work for additional information
>>> +regarding copyright ownership.  The ASF licenses this file
>>> +to you under the Apache License, Version 2.0 (the
>>> +"License"); you may not use this file except in compliance
>>> +with the License.  You may obtain a copy of the License at
>>> +
>>> +http://www.apache.org/licenses/LICENSE-2.0
>>> +
>>> +Unless required by applicable law or agreed to in writing,
>>> +software distributed under the License is distributed on an
>>> +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>>> +KIND, either express or implied.  See the License for the
>>> +specific language governing permissions and limitations
>>> +under the License.
>>> +-->
>>> +
>>> +<#if requestAttributes.uiLabelMap?exists><#assign uiLabelMap =
>>> requestAttributes.uiLabelMap></#if>
>>> +
>>> +<#assign previousParams = sessionAttributes._PREVIOUS_PARAMS_?
>>> if_exists>
>>> +<#if previousParams?has_content>
>>> +  <#assign previousParams = "?" + previousParams>
>>> +</#if>
>>> +
>>> +<#assign username = requestParameters.USERNAME?
>>> default((sessionAttributes.autoUserLogin.userLoginId)?default(""))>
>>> +<#if username != "">
>>> +  <#assign focusName = false>
>>> +<#else>
>>> +  <#assign focusName = true>
>>> +</#if>
>>> +
>>> +<center>
>>> +  <div class="screenlet login-screenlet" style="width: 22%; margin-
>>> left: 5px; text-align: center;">
>>> +    <div class="screenlet-title-bar">
>>> +      <h3>${uiLabelMap.CommonRegistered}</h3>
>>> +    </div>
>>> +    <div class="screenlet-body">
>>> +      <form method="post" action="<@ofbizUrl>login${previousParams?
>>> if_exists}</@ofbizUrl>" name="loginform">
>>> +        <table class="basic-table" cellspacing="0">
>>> +          <tr>
>>> +            <td class="label" style="width: 31%;">$
>>> {uiLabelMap.CommonUsername}</td>
>>> +            <td><input type="text" name="USERNAME" value="$
>>> {username}" size="20"/></td>
>>> +          </tr>
>>> +          <tr>
>>> +            <td class="label">${uiLabelMap.CommonPassword}</td>
>>> +            <td><input type="password" name="PASSWORD" value=""
>>> size="20"/></td>
>>> +          </tr>
>>> +          <tr>
>>> +            <td colspan="2" align="center">
>>> +              <input type="submit" value="$
>>> {uiLabelMap.CommonLogin}"/>
>>> +            </td>
>>> +          </tr>
>>> +        </table>
>>> +        <input type="hidden" name="JavaScriptEnabled" value="N"/>
>>> +        <br/>
>>> +        <a href="<@ofbizUrl>forgotPassword${previousParams?
>>> if_exists}</@ofbizUrl>">${uiLabelMap.CommonForgotYourPassword}?</a>
>>> +        <br/>
>>> +        <a href="<@ofbizUrl>newRegisterLogin${previousParams?
>>> if_exists}</@ofbizUrl>">${uiLabelMap.NewRegistration}</a>
>>> +      </form>
>>> +    </div>
>>> +  </div>
>>> +</center>
>>> +
>>> +<script language="JavaScript" type="text/javascript">
>>> +  document.loginform.JavaScriptEnabled.value = "Y";
>>> +  <#if focusName>
>>> +    document.loginform.USERNAME.focus();
>>> +  <#else>
>>> +    document.loginform.PASSWORD.focus();
>>> +  </#if>
>>> +</script>
>>> \ No newline at end of file
>>>
>>> Propchange: ofbiz/trunk/specialpurpose/myportal/widget/login.ftl
>>> ------------------------------------------------------------------------------
>>>   svn:eol-style = native
>>>
>>> Propchange: ofbiz/trunk/specialpurpose/myportal/widget/login.ftl
>>> ------------------------------------------------------------------------------
>>>   svn:keywords = "Date Rev Author URL Id"
>>>
>>> Propchange: ofbiz/trunk/specialpurpose/myportal/widget/login.ftl
>>> ------------------------------------------------------------------------------
>>>   svn:mime-type = text/plain
>>>
>>>
>>
> --
> Antwebsystems.com: Quality OFBiz services for competitive prices
>

Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r735965 - in /ofbiz/trunk: framework/common/src/org/ofbiz/common/ framework/common/widget/ specialpurpose/myportal/config/ specialpurpose/myportal/script/org/ofbiz/myportal/ specialpurpose/myportal/webapp/myportal/WEB-INF/ specialpurpose/my...

Jacopo Cappellato-4
I really think it is time to start to think about splitting the common  
component into two components:
1) a common component to be placed into the applications folder and  
loaded before the other ones
2) a common component that will stay in the framework folder

All these labels, plus other ERP related artifacts, should then go in #1

In my opinion entities like Geo, CountryCode, KeywordThesaurus should  
not appear in a framework only distro.

But maybe I am off topic in this thread and I should create a new one.

Jacopo


On Jan 25, 2009, at 10:14 AM, [hidden email] wrote:

> Hi Hans,
>
> it's ok to move it to the framework is they are more generics and  
> they can be shared by all the components but in this case I think  
> it's better to put the Common prefix on those labels.
>
> Thanks
> Marco
>
>
> Il giorno 25/gen/09, alle ore 02:54, Hans Bakker ha scritto:
>
>> Hi Marco,
>>
>> sure we can do this, however captcha itself is a framework  
>> function, but
>> at the moment only used in myportal... We will move the captcha  
>> messages
>> to the framwork....
>>
>> regards,
>> Hans
>>
>> On Sat, 2009-01-24 at 22:22 +0100, [hidden email] wrote:
>>> Hi Hans,
>>>
>>> I suggest to use the prefix MyPortal for those type of labels, I  
>>> spent
>>> a lot of days to cleanup all the wasted labels into OFBiz and I  
>>> think
>>> we cannot all use different standard to codify the labels.
>>> And if it's possible do not use the underscore character in the  
>>> labels
>>> name could be more readable.
>>>
>>> In my opinion for example CaptchaMissingError could be
>>> MyPortalCaptchaMissingError or something similar to that.
>>>
>>> If we do not follow this simple rule in two or three months the  
>>> labels
>>> will be completed wasted again.
>>>
>>> What others thinks about that ?
>>>
>>> Thanks
>>> Marco
>>>
>>>
>>> Il giorno 20/gen/09, alle ore 09:30, [hidden email] ha scritto:
>>>
>>>> Author: hansbak
>>>> Date: Tue Jan 20 00:30:41 2009
>>>> New Revision: 735965
>>>>
>>>> URL: http://svn.apache.org/viewvc?rev=735965&view=rev
>>>> Log:
>>>> first version of captcha, not perfect yet: multiple users
>>>> registering at the same time, image should be stored in 'runtime'
>>>> not working on windows. Another problem is what files to put
>>>> where.....the captcha itself looks like a framework
>>>> feature...however the registration process needs the party
>>>> component....so let us know, we will correct it....
>>>>
>>>> Added:
>>>>  ofbiz/trunk/framework/common/src/org/ofbiz/common/Captcha.java
>>>> (with props)
>>>>  ofbiz/trunk/specialpurpose/myportal/widget/login.ftl   (with  
>>>> props)
>>>> Modified:
>>>>  ofbiz/trunk/framework/common/widget/CommonMenus.xml
>>>>  ofbiz/trunk/specialpurpose/myportal/config/MyPortalUiLabels.xml
>>>>  ofbiz/trunk/specialpurpose/myportal/script/org/ofbiz/myportal/
>>>> Events.xml
>>>>  ofbiz/trunk/specialpurpose/myportal/webapp/myportal/WEB-INF/
>>>> controller.xml
>>>>  ofbiz/trunk/specialpurpose/myportal/widget/CommonScreens.xml
>>>>  ofbiz/trunk/specialpurpose/myportal/widget/MyPortalForms.xml
>>>>
>>>> Added: ofbiz/trunk/framework/common/src/org/ofbiz/common/
>>>> Captcha.java
>>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/src/org/ofbiz/common/Captcha.java?rev=735965&view=auto
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> ===================================================================
>>>> --- ofbiz/trunk/framework/common/src/org/ofbiz/common/Captcha.java
>>>> (added)
>>>> +++ ofbiz/trunk/framework/common/src/org/ofbiz/common/Captcha.java
>>>> Tue Jan 20 00:30:41 2009
>>>> @@ -0,0 +1,163 @@
>>>> +/
>>>> *******************************************************************************
>>>> + * Licensed to the Apache Software Foundation (ASF) under one
>>>> + * or more contributor license agreements.  See the NOTICE file
>>>> + * distributed with this work for additional information
>>>> + * regarding copyright ownership.  The ASF licenses this file
>>>> + * to you under the Apache License, Version 2.0 (the
>>>> + * "License"); you may not use this file except in compliance
>>>> + * with the License.  You may obtain a copy of the License at
>>>> + *
>>>> + * http://www.apache.org/licenses/LICENSE-2.0
>>>> + *
>>>> + * Unless required by applicable law or agreed to in writing,
>>>> + * software distributed under the License is distributed on an
>>>> + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>>>> + * KIND, either express or implied.  See the License for the
>>>> + * specific language governing permissions and limitations
>>>> + * under the License.
>>>> +
>>>> *******************************************************************************/
>>>> +
>>>> +// copied from : http://cocoon.apache.org/2.2/blocks/captcha/1.0/1436_1_1.html
>>>> +
>>>> +package org.ofbiz.common;
>>>> +
>>>> +import javax.imageio.ImageIO;
>>>> +import javax.servlet.http.HttpServletRequest;
>>>> +import javax.servlet.http.HttpServletResponse;
>>>> +import java.awt.*;
>>>> +import java.awt.geom.AffineTransform;
>>>> +import java.awt.image.BufferedImage;
>>>> +import java.io.File;
>>>> +import java.io.IOException;
>>>> +
>>>> +public class Captcha {
>>>> +
>>>> +    public static String ID_KEY = null;
>>>> +
>>>> +    public static String getCodeCaptcha(HttpServletRequest
>>>> request,HttpServletResponse response) {
>>>> +     StringBuffer finalString = new StringBuffer();
>>>> +        String elegibleChars =
>>>> "ABCDEFGHJKLMPQRSTUVWXYabcdefhjkmnpqrstuvwxy23456789";
>>>> +        int charsToPrint = 6;
>>>> +        char[] chars = elegibleChars.toCharArray();
>>>> +
>>>> +        for (int i = 0; i < charsToPrint; i++) {
>>>> +            double randomValue = Math.random();
>>>> +            int randomIndex = (int) Math.round(randomValue *
>>>> (chars.length - 1));
>>>> +            char characterToShow = chars[randomIndex];
>>>> +            finalString.append(characterToShow);
>>>> +        }
>>>> +        ID_KEY = finalString.toString();
>>>> +        if(createImageCaptcha (request,response)) return  
>>>> "success";
>>>> +        return "error";
>>>> +    }
>>>> +
>>>> +    public static boolean createImageCaptcha (HttpServletRequest
>>>> request,HttpServletResponse response) {
>>>> +        try {        
>>>> +            //It is possible to pass the font size, image width  
>>>> and
>>>> height with the request as well
>>>> +            Color backgroundColor = Color.gray;
>>>> +            Color borderColor = Color.DARK_GRAY;
>>>> +            Color textColor = Color.ORANGE;
>>>> +            Color circleColor = new Color(160, 160, 160);
>>>> +            Font textFont = new Font("Arial", Font.PLAIN,
>>>> paramInt(request, "fontSize", 22));
>>>> +            int charsToPrint = 6;
>>>> +            int width = paramInt(request, "width", 149);
>>>> +            int height = paramInt(request, "height", 40);
>>>> +            int circlesToDraw = 6;
>>>> +            float horizMargin = 20.0f;
>>>> +            double rotationRange = 0.7; // in radians
>>>> +            BufferedImage bufferedImage = new BufferedImage(width,
>>>> height, BufferedImage.TYPE_INT_RGB);
>>>> +
>>>> +            Graphics2D g = (Graphics2D)  
>>>> bufferedImage.getGraphics();
>>>> +
>>>> +            g.setColor(backgroundColor);
>>>> +            g.fillRect(0, 0, width, height);
>>>> +
>>>> +            //Generating some circles for background noise
>>>> +            g.setColor(circleColor);
>>>> +            for (int i = 0; i < circlesToDraw; i++) {
>>>> +                int circleRadius = (int) (Math.random() * height /
>>>> 2.0);
>>>> +                int circleX = (int) (Math.random() * width -
>>>> circleRadius);
>>>> +                int circleY = (int) (Math.random() * height -
>>>> circleRadius);
>>>> +                g.drawOval(circleX, circleY, circleRadius * 2,
>>>> circleRadius * 2);
>>>> +            }
>>>> +            g.setColor(textColor);
>>>> +            g.setFont(textFont);
>>>> +
>>>> +            FontMetrics fontMetrics = g.getFontMetrics();
>>>> +            int maxAdvance = fontMetrics.getMaxAdvance();
>>>> +            int fontHeight = fontMetrics.getHeight();
>>>> +
>>>> +            //We are not using certain characters, which might
>>>> confuse users
>>>> +            String characterToShow = ID_KEY;
>>>> +            float spaceForLetters = -horizMargin * 2 + width;
>>>> +            float spacePerChar = spaceForLetters / (charsToPrint -
>>>> 1.0f);
>>>> +
>>>> +            for (int i = 0; i < characterToShow.length(); i++) {
>>>> +
>>>> +                // this is a separate canvas used for the  
>>>> character
>>>> so that
>>>> +                // we can rotate it independently
>>>> +                int charWidth =
>>>> fontMetrics.charWidth(characterToShow.charAt(i));
>>>> +                int charDim = Math.max(maxAdvance, fontHeight);
>>>> +                int halfCharDim = (int) (charDim / 2);
>>>> +
>>>> +                BufferedImage charImage =
>>>> +                        new BufferedImage(charDim, charDim,
>>>> BufferedImage.TYPE_INT_ARGB);
>>>> +                Graphics2D charGraphics =  
>>>> charImage.createGraphics();
>>>> +                charGraphics.translate(halfCharDim, halfCharDim);
>>>> +                double angle = (Math.random() - 0.5) *  
>>>> rotationRange;
>>>> +
>>>> charGraphics.transform(AffineTransform.getRotateInstance(angle));
>>>> +                charGraphics.translate(-halfCharDim, -
>>>> halfCharDim);
>>>> +                charGraphics.setColor(textColor);
>>>> +                charGraphics.setFont(textFont);
>>>> +
>>>> +                int charX = (int) (0.5 * charDim - 0.5 *  
>>>> charWidth);
>>>> +                charGraphics.drawString("" +
>>>> characterToShow.charAt(i), charX,
>>>> +                        (int) ((charDim -
>>>> fontMetrics.getAscent()) / 2 + fontMetrics.getAscent()));
>>>> +
>>>> +                float x = horizMargin + spacePerChar * (i) -
>>>> charDim / 2.0f;
>>>> +                int y = (int) ((height - charDim) / 2);
>>>> +
>>>> +                g.drawImage(charImage, (int) x, y, charDim,
>>>> charDim, null, null);
>>>> +
>>>> +                charGraphics.dispose();
>>>> +            }
>>>> +            // Drawing the image border
>>>> +            g.setColor(borderColor);
>>>> +            g.drawRect(0, 0, width - 1, height - 1);
>>>> +            g.dispose();
>>>> +            Captcha.writeImage(bufferedImage, "captchaImage.png");
>>>> +
>>>> +        } catch (Exception ioe) {
>>>> +            return false;
>>>> +        }
>>>> +    //Adding this because we called response.getOutputStream()
>>>> above. This will prevent and illegal state exception being thrown
>>>> +        return true;
>>>> +    }
>>>> +
>>>> + public static void writeImage(BufferedImage image, String  
>>>> fileName)
>>>> + {
>>>> + if (fileName == null) return;
>>>> + int offset = fileName.lastIndexOf( "." );
>>>> + String type = offset == -1 ? "png" : fileName.substring(offset +
>>>> 1);
>>>> + String path;
>>>> + try {
>>>> + path = new java.io.File(".").getCanonicalPath();
>>>> + path += "/framework/images/webapp/images/";
>>>> + path += fileName;
>>>> + System.out.println("\n\nPath =  "+path+"\n");
>>>> + System.out.println("Captcha Key =  "+ID_KEY+"\n\n");
>>>> + ImageIO.write(image, type, new File( path ));
>>>> + } catch (IOException e) {
>>>> + return;
>>>> + }
>>>> + }
>>>> +
>>>> +    public static String paramString(HttpServletRequest request,
>>>> String paramName,
>>>> +            String defaultString) {
>>>> +        return request.getParameter(paramName) != null ?
>>>> request.getParameter(paramName) : defaultString;
>>>> +    }
>>>> +
>>>> +    public static int paramInt(HttpServletRequest request, String
>>>> paramName, int defaultInt) {
>>>> +        return request.getParameter(paramName) != null ?
>>>> Integer.parseInt(request.getParameter(paramName)) : defaultInt;
>>>> +    }
>>>> +}
>>>> \ No newline at end of file
>>>>
>>>> Propchange: ofbiz/trunk/framework/common/src/org/ofbiz/common/
>>>> Captcha.java
>>>> ------------------------------------------------------------------------------
>>>>  svn:eol-style = native
>>>>
>>>> Propchange: ofbiz/trunk/framework/common/src/org/ofbiz/common/
>>>> Captcha.java
>>>> ------------------------------------------------------------------------------
>>>>  svn:keywords = "Date Rev Author URL Id"
>>>>
>>>> Propchange: ofbiz/trunk/framework/common/src/org/ofbiz/common/
>>>> Captcha.java
>>>> ------------------------------------------------------------------------------
>>>>  svn:mime-type = text/plain
>>>>
>>>> Modified: ofbiz/trunk/framework/common/widget/CommonMenus.xml
>>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/widget/CommonMenus.xml?rev=735965&r1=735964&r2=735965&view=diff
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> ===================================================================
>>>> --- ofbiz/trunk/framework/common/widget/CommonMenus.xml (original)
>>>> +++ ofbiz/trunk/framework/common/widget/CommonMenus.xml Tue Jan 20
>>>> 00:30:41 2009
>>>> @@ -31,7 +31,7 @@
>>>>        </menu-item>
>>>>        <menu-item name="Login" title="${uiLabelMap.CommonLogin}"
>>>> align-style="opposed">
>>>>            <condition><if-empty field-name="userLogin"/></
>>>> condition>
>>>> -             <link target="${checkLoginUrl}"/>
>>>> +             <link target="logout"/>
>>>>        </menu-item>
>>>>    </menu>
>>>>
>>>>
>>>> Modified: ofbiz/trunk/specialpurpose/myportal/config/
>>>> MyPortalUiLabels.xml
>>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/myportal/config/MyPortalUiLabels.xml?rev=735965&r1=735964&r2=735965&view=diff
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> ===================================================================
>>>> --- ofbiz/trunk/specialpurpose/myportal/config/MyPortalUiLabels.xml
>>>> (original)
>>>> +++ ofbiz/trunk/specialpurpose/myportal/config/MyPortalUiLabels.xml
>>>> Tue Jan 20 00:30:41 2009
>>>> @@ -18,6 +18,18 @@
>>>>   under the License.
>>>> -->
>>>> <resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
>>>> +    <property key="CaptchaMissingError">
>>>> +        <value xml:lang="en">Verify code captcha is missing or
>>>> wrong</value>
>>>> +        <value xml:lang="th">รหัสตà¸
>>>> ±à¸§à¹€à¸
>>>> ¥à¸‚ที่ท่านกà¸
>>>> £à¸ กมีข้ภผà¸
>>>> ´à¸”พà¸
>>>> ¥à¸²à¸”</value>
>>>> +    </property>
>>>> +    <property key="FirstName_Missing">
>>>> +        <value xml:lang="en">Your firstName is missing</value>
>>>> +        <value xml:lang="th">กà¸
>>>> £à¸¸à¸“ากรภกชื่à¸
>>>> ขภงท่าน</value>
>>>> +    </property>
>>>> +    <property key="LastName_Missing">
>>>> +        <value xml:lang="en">Your lastname is missing</value>
>>>> +        <value xml:lang="th">กà¸
>>>> £à¸¸à¸“ากรà¸
>>>> กนามสกุลขภ 
>>>> งท่าน</value>
>>>> +    </property>
>>>>   <property key="MyPortalDashboard">
>>>>       <value xml:lang="en">My Portal</value>
>>>>       <value xml:lang="fr">Mon portail</value>
>>>> @@ -30,6 +42,10 @@
>>>>       <value xml:lang="it">Invia email ad ogni cliente per le
>>>> modifiche sulla richiesta</value>
>>>>       <value xml:lang="th">ส่งภีà¹
>>>> €à¸¡à¸¥à¹Œà¸–ึงà¸
>>>> ¥à¸¹à¸à¸„้าที่à¹
>>>> €à¸›à¸¥à¸µà¹ˆà¸
>>>> ¢à¸™à¸„วามต้à¸
>>>> งการ</value>
>>>>   </property>
>>>> +    <property key="NewRegistration">
>>>> +        <value xml:lang="en">New Registration </value>
>>>> +        <value xml:lang="th">ลงทะà¹
>>>> €à¸šà¸µà¸¢à¸™ </value>
>>>> +    </property>
>>>>   <property key="PageTitleMyPortal">
>>>>       <value xml:lang="en">My Portal for : </value>
>>>>       <value xml:lang="it">Mio portale per : </value>
>>>> @@ -41,4 +57,24 @@
>>>>       <value xml:lang="it">Pagina mio portale</value>
>>>>       <value xml:lang="th">หนà¹
>>>> ‰à¸²à¸ªà¹ˆà¸§à¸™à¸•à¸±à¸§à¸‚à¸
>>>> งฉัน</value>
>>>>   </property>
>>>> +    <property key="PicCaptcha">
>>>> +        <value xml:lang="en">Code Captcha</value>
>>>> +        <value xml:lang="th">รหัสตà¸
>>>> £à¸§à¸ˆà¸ªà¸ บ</
>>>> value>
>>>> +    </property>
>>>> +    <property key="RegisterComplete">
>>>> +        <value xml:lang="en">Register of new person is
>>>> complete...Please </value>
>>>> +        <value xml:lang="th">การลงà¸
>>>> —ะเบีà¸
>>>> ¢à¸™à¹ƒà¸«à¸¡à¹ˆà¸ªà¸³à¸«à¸£à¸
>>>> ±à¸šà¸šà¸¸à¸„คà¸
>>>> ¥à¹„ด้ทำการà¹
>>>> €à¸ªà¸£à¹‡à¸ˆà¸ªà¸´à¹
>>>> ‰à¸™à¸ªà¸¡à¸šà¸¹à¸
>>>> £à¸“์แลà¹
>>>> ‰à¸§...สามารถเขà¹
>>>> ‰à¸²à¸ªà¸¹à¹ˆà¸£à¸
>>>> °à¸šà¸šà¹„ด้ </value>
>>>> +    </property>
>>>> +    <property key="RegisterForCustomer">
>>>> +        <value xml:lang="en">Register for customer</value>
>>>> +        <value xml:lang="th">ลงทะà¹
>>>> €à¸šà¸µà¸¢à¸™à¸ªà¸³à¸«à¸
>>>> £à¸±à¸šà¸¥à¸¹à¸à¸„้า</value>
>>>> +    </property>
>>>> +    <property key="VerifyCaptcha">
>>>> +        <value xml:lang="en">Verify captcha code</value>
>>>> +        <value xml:lang="th">ใส่รหà¸
>>>> ±à¸ªà¸•à¸²à¸¡à¸
>>>> £à¸¹à¸›</value>
>>>> +    </property>
>>>> +    <property key="UserLogin">
>>>> +        <value xml:lang="en">User Login</value>
>>>> +        <value xml:lang="th">ข้ภมูà¸
>>>> ¥à¸à¸²à¸£à¸¥à¸‡à¸—à¸
>>>> °à¹€à¸šà¸µà¸¢à¸™</value>
>>>> +    </property>
>>>> </resource>
>>>>
>>>> Modified: ofbiz/trunk/specialpurpose/myportal/script/org/ofbiz/
>>>> myportal/Events.xml
>>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/myportal/script/org/ofbiz/myportal/Events.xml?rev=735965&r1=735964&r2=735965&view=diff
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> ===================================================================
>>>> --- ofbiz/trunk/specialpurpose/myportal/script/org/ofbiz/myportal/
>>>> Events.xml (original)
>>>> +++ ofbiz/trunk/specialpurpose/myportal/script/org/ofbiz/myportal/
>>>> Events.xml Tue Jan 20 00:30:41 2009
>>>> @@ -312,4 +312,87 @@
>>>>           request-name="communicationEventTypeId"/>
>>>>       <field-to-request field="communicationEventId" request-
>>>> name="communicationEventId"/>
>>>>   </simple-method>
>>>> +
>>>> +    <simple-method method-name="createRegister"
>>>> +        short-description="Create person when new register" login-
>>>> required="false">
>>>> +        <if-empty field="parameters.firstName"><property-to-field
>>>> field="errorMessage" resource="MyPortalUiLabels"
>>>> property="FirstName_Missing"/><field-to-list field="errorMessage"
>>>> list="error_list"/></if-empty>
>>>> +        <if-empty field="parameters.lastName"><property-to-field
>>>> field="errorMessage" resource="MyPortalUiLabels"
>>>> property="LastName_Missing"/><field-to-list field="errorMessage"
>>>> list="error_list"/></if-empty>
>>>> +        <if-empty field="parameters.USERNAME"><property-to-field
>>>> field="errorMessage" resource="PartyUiLabels"
>>>> property="PartyUserNameMissing"/><field-to-list  
>>>> field="errorMessage"
>>>> list="error_list"/></if-empty>
>>>> +        <if-empty field="parameters.PASSWORD"><property-to-field
>>>> field="errorMessage" resource="PartyUiLabels"
>>>> property="PartyPasswordMissing"/><field-to-list  
>>>> field="errorMessage"
>>>> list="error_list"/></if-empty>
>>>> +        <call-bsh><![CDATA[
>>>> +
>>>> parameters.put("captchaCode",org.ofbiz.common.Captcha.ID_KEY);
>>>> +        ]]></call-bsh>
>>>> +        <call-object-method obj-field="PASSWORD" obj-map-
>>>> name="parameters" method-name="toLowerCase" ret-field="PASSWORD"  
>>>> ret-
>>>> map-name="parameters"/>
>>>> +        <call-object-method obj-field="CONFIRM_PASSWORD" obj-map-
>>>> name="parameters" method-name="toLowerCase" ret-
>>>> field="CONFIRM_PASSWORD" ret-map-name="parameters"/>
>>>> +        <if-compare field="parameters.PASSWORD" value="$
>>>> {parameters.CONFIRM_PASSWORD}" operator="equals">
>>>> +            <call-object-method obj-field="captcha" obj-map-
>>>> name="parameters" method-name="toLowerCase" ret-field="captcha"  
>>>> ret-
>>>> map-name="parameters"/>
>>>> +            <call-object-method obj-field="captchaCode" obj-map-
>>>> name="parameters" method-name="toLowerCase" ret-field="captchaCode"
>>>> ret-map-name="parameters"/>
>>>> +            <if-compare field="parameters.captcha" value="$
>>>> {parameters.captchaCode}" operator="equals">
>>>> +
>>>> +                <!-- Create Person -->
>>>> +                <set field="parameters.statusId"
>>>> value="PARTY_ENABLED"/>
>>>> +                <make-value entity-name="Party" value-
>>>> field="newEntity"/>
>>>> +                <set-pk-fields map="parameters" value-
>>>> field="newEntity"/>
>>>> +                <make-next-seq-id value-field="newEntity" seq-
>>>> field-
>>>> name="partyId"/>
>>>> +                <set field="newEntity.partyTypeId"  
>>>> value="PERSON"/>
>>>> +                <set-nonpk-fields map="parameters" value-
>>>> field="newEntity"/>
>>>> +                <create-value value-field="newEntity"/>
>>>> +
>>>> +                <make-value entity-name="PartyStatus" value-
>>>> field="newEntity2"/>
>>>> +                <set field="newEntity2.partyId" from-
>>>> field="newEntity.partyId"/>
>>>> +                <set field="newEntity2.statusId" from-
>>>> field="newEntity.statusId"/>
>>>> +                <set field="newEntity2.statusDate" from-
>>>> field="newEntity.createdStamp"/>
>>>> +                <create-value value-field="newEntity2"/>
>>>> +
>>>> +                <make-value entity-name="Person" value-
>>>> field="newEntity3"/>
>>>> +                <set field="newEntity3.partyId" from-
>>>> field="newEntity.partyId"/>
>>>> +                <set-nonpk-fields map="parameters" value-
>>>> field="newEntity3"/>
>>>> +                <create-value value-field="newEntity3"/>
>>>> +
>>>> +                <!-- Create the UserLogin Record -->
>>>> +                <call-map-processor in-map-name="parameters" out-
>>>> map-name="userLoginContext">
>>>> +                    <simple-map-processor name="newUserLogin">
>>>> +                        <process field="USERNAME"><copy to-
>>>> field="userLoginId"/></process>
>>>> +                        <process field="PASSWORD"><copy to-
>>>> field="currentPassword"/></process>
>>>> +                        <process field="CONFIRM_PASSWORD"><copy  
>>>> to-
>>>> field="currentPasswordVerify"/></process>
>>>> +                        <process field="PASSWORD_HINT"><copy to-
>>>> field="passwordHint"/></process>
>>>> +                    </simple-map-processor>
>>>> +                </call-map-processor>
>>>> +                <set field="userLoginExistsMap.userLoginId"  from-
>>>> field="userLoginContext.userLoginId" />
>>>> +                <find-by-primary-key entity-name="UserLogin"
>>>> map="userLoginExistsMap" value-field="existingUserLogin"/>
>>>> +                <if-not-empty field="existingUserLogin">
>>>> +                    <set field="errorMessage" value="Username in
>>>> use, please choose another." />
>>>> +                    <field-to-list field="errorMessage"
>>>> list="error_list"/>
>>>> +                    <check-errors error-list-name="error_list"
>>>> error-code="resultPage"/>
>>>> +                    <else>
>>>> +                        <make-value entity-name="UserLogin" value-
>>>> field="newUserLogin"/>
>>>> +                        <set field="newUserLogin.userLoginId"  
>>>> from-
>>>> field="userLoginContext.userLoginId"/>
>>>> +                        <set field="newUserLogin.currentPassword"
>>>> from-field="userLoginContext.currentPassword" />
>>>> +                        <set field="newUserLogin.passwordHint"  
>>>> from-
>>>> field="userLoginContext.passwordHint" />
>>>> +                        <!-- Check the password, etc for  
>>>> validity -->
>>>> +                        <call-bsh><![CDATA[
>>>> +                            String password = (String)
>>>> userLoginContext.get("currentPassword");
>>>> +                            String confirmPassword = (String)
>>>> userLoginContext.get("currentPasswordVerify");
>>>> +                            String passwordHint = (String)
>>>> userLoginContext.get("passwordHint");
>>>> +
>>>> org.ofbiz.common.login.LoginServices.checkNewPassword(newUserLogin,
>>>> null, password, confirmPassword, passwordHint, error_list, true,
>>>> locale);
>>>> +                            boolean useEncryption =
>>>> "true
>>>> ".equals
>>>> (org.ofbiz.base.util.UtilProperties.getPropertyValue("security",
>>>> "password.encrypt"));
>>>> +                            if (useEncryption)
>>>> { newUserLogin.set("currentPassword",
>>>> org.ofbiz.base.crypto.HashCrypt.getDigestHash((String)
>>>> newUserLogin.get("currentPassword"))); }
>>>> +                            ]]></call-bsh>
>>>> +                        <set field="newUserLogin.partyId" from-
>>>> field="newEntity.partyId" />
>>>> +                        <create-value value-field="newUserLogin"/>
>>>> +                    </else>
>>>> +                </if-not-empty>
>>>> +                <set field="partyId" from-
>>>> field="newEntity.partyId"/>
>>>> +                <field-to-request field="partyId" request-
>>>> name="partyId"/>
>>>> +                <return response-code="resultPage"/>
>>>> +                <else>
>>>> +                    <property-to-field field="errorMessage"
>>>> resource="MyPortalUiLabels" property="CaptchaMissingError"/><field-
>>>> to-list field="errorMessage" list="error_list"/>
>>>> +                </else>
>>>> +            </if-compare>
>>>> +            <else>
>>>> +                <property-to-field field="errorMessage"
>>>> resource="PartyUiLabels" property="PartyPasswordMatchError"/
>>>> ><field-
>>>> to-list field="errorMessage" list="error_list"/>
>>>> +            </else>
>>>> +        </if-compare>
>>>> +        <check-errors error-list-name="error_list" error-
>>>> code="resultPage"/>
>>>> +    </simple-method>
>>>> </simple-methods>
>>>>
>>>> Modified: ofbiz/trunk/specialpurpose/myportal/webapp/myportal/WEB-
>>>> INF/controller.xml
>>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/myportal/webapp/myportal/WEB-INF/controller.xml?rev=735965&r1=735964&r2=735965&view=diff
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> ===================================================================
>>>> --- ofbiz/trunk/specialpurpose/myportal/webapp/myportal/WEB-INF/
>>>> controller.xml (original)
>>>> +++ ofbiz/trunk/specialpurpose/myportal/webapp/myportal/WEB-INF/
>>>> controller.xml Tue Jan 20 00:30:41 2009
>>>> @@ -31,6 +31,23 @@
>>>>       <security https="true" auth="true"/>
>>>>       <response name="success" type="view" value="main"/>
>>>>   </request-map>
>>>> +    <request-map uri="login">
>>>> +        <security https="true" auth="false"/>
>>>> +        <event type="java"
>>>> path="org.ofbiz.securityext.login.LoginEvents"  
>>>> invoke="storeLogin"/>
>>>> +        <response name="success" type="view" value="main"/>
>>>> +        <response name="requirePasswordChange" type="view"
>>>> value="requirePasswordChange"/>
>>>> +        <response name="error" type="view" value="login"/>
>>>> +    </request-map>
>>>> +    <request-map uri="newRegisterLogin">
>>>> +        <security https="true" auth="false"/>
>>>> +        <event type="java" invoke="getCodeCaptcha"
>>>> path="org.ofbiz.common.Captcha"/>
>>>> +        <response name="success" type="view"
>>>> value="newRegisterLogin"/>
>>>> +    </request-map>
>>>> +    <request-map uri="createRegister">
>>>> +        <security https="true" auth="false"/>
>>>> +        <event type="simple" invoke="createRegister" path="org/
>>>> ofbiz/myportal/Events.xml"/>
>>>> +        <response name="resultPage" type="url"
>>>> value="newRegisterLogin"/>
>>>> +    </request-map>
>>>>
>>>>   <!-- TIMESHEET -->
>>>>   <request-map uri="myTimesheet">
>>>> @@ -270,6 +287,8 @@
>>>>   </request-map>
>>>>
>>>>   <view-map name="main" type="screen" page="component://myportal/
>>>> widget/CommonScreens.xml#main"/>
>>>> +    <view-map name="login" type="screen" page="component://
>>>> myportal/
>>>> widget/CommonScreens.xml#login"/>
>>>> +    <view-map name="newRegisterLogin" type="screen"
>>>> page="component://myportal/widget/
>>>> CommonScreens.xml#newRegisterLogin"/>
>>>>   <view-map name="myTasks" type="screen" page="component://
>>>> myportal/widget/CommonScreens.xml#MyTasks"/>
>>>>   <view-map name="myCommunications" type="screen"
>>>> page="component://myportal/widget/
>>>> CommonScreens.xml#MyCommunications"/>
>>>>   <view-map name="otherCommunications" type="screen"
>>>> page="component://myportal/widget/
>>>> CommonScreens.xml#OtherCommunications"/>
>>>>
>>>> Modified: ofbiz/trunk/specialpurpose/myportal/widget/
>>>> CommonScreens.xml
>>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/myportal/widget/CommonScreens.xml?rev=735965&r1=735964&r2=735965&view=diff
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> ===================================================================
>>>> --- ofbiz/trunk/specialpurpose/myportal/widget/CommonScreens.xml
>>>> (original)
>>>> +++ ofbiz/trunk/specialpurpose/myportal/widget/CommonScreens.xml  
>>>> Tue
>>>> Jan 20 00:30:41 2009
>>>> @@ -164,6 +164,66 @@
>>>>           </widgets>
>>>>       </section>
>>>>   </screen>
>>>> +
>>>> +    <screen name="login">
>>>> +        <section>
>>>> +            <widgets>
>>>> +                <decorator-screen name="main-decorator"  
>>>> location="$
>>>> {parameters.mainDecoratorLocation}">
>>>> +                    <decorator-section name="body">
>>>> +                        <platform-specific>
>>>> +                            <html><html-template
>>>> location="component://myportal/widget/login.ftl"/></html>
>>>> +                        </platform-specific>
>>>> +                    </decorator-section>
>>>> +                </decorator-screen>
>>>> +            </widgets>
>>>> +        </section>
>>>> +    </screen>
>>>> +
>>>> +    <!--New Register Person-->
>>>> +    <screen name="newRegisterLogin">
>>>> +        <section>
>>>> +            <actions>
>>>> +                <set field="partyId" from-
>>>> field="parameters.partyId"/>
>>>> +                <entity-one entity-name="PartyAndPerson" value-
>>>> name="personInfo"/>
>>>> +            </actions>
>>>> +            <widgets>
>>>> +                <decorator-screen name="main-decorator"  
>>>> location="$
>>>> {parameters.mainDecoratorLocation}">
>>>> +                    <decorator-section name="body">
>>>> +                        <section>
>>>> +                            <condition>
>>>> +                                <not><if-empty field-
>>>> name="parameters.partyId"/></not>
>>>> +                            </condition>
>>>> +                            <actions>
>>>> +                                <set field="partyId" from-
>>>> field="parameters.partyId"/>
>>>> +                                <script location="component://
>>>> party/
>>>> webapp/partymgr/WEB-INF/actions/party/ViewProfile.groovy"/>
>>>> +                            </actions>
>>>> +                            <widgets>
>>>> +                                <label style="h2" text="$
>>>> {uiLabelMap.RegisterComplete}"/><link target="main" style="h2"
>>>> text="${uiLabelMap.CommonBeLogged}"></link>
>>>> +                                <label style="h2"
>>>> text="&lt;br&gt;&lt;br&gt;"/>
>>>> +                                <include-screen name="Party"
>>>> location="component://party/widget/partymgr/ProfileScreens.xml"/>
>>>> +                            </widgets>
>>>> +                            <fail-widgets>
>>>> +                                <container style="screenlet">
>>>> +                                    <container style="screenlet-
>>>> title-bar">
>>>> +                                        <container style="h3">
>>>> +                                            <label text="$
>>>> {uiLabelMap.NewRegistration}"/>
>>>> +                                        </container>
>>>> +                                    </container>
>>>> +                                    <container style="screenlet-
>>>> body">
>>>> +                                        <section>
>>>> +                                            <widgets>
>>>> +                                                <include-form
>>>> name="RegisterPerson" location="component://myportal/widget/
>>>> MyPortalForms.xml"/>
>>>> +                                            </widgets>
>>>> +                                        </section>
>>>> +                                    </container>
>>>> +                                </container>
>>>> +                            </fail-widgets>
>>>> +                        </section>
>>>> +                    </decorator-section>
>>>> +                </decorator-screen>
>>>> +            </widgets>
>>>> +        </section>
>>>> +    </screen>
>>>>
>>>>   <screen name="CommonRequestDecorator">
>>>>       <section>
>>>>
>>>> Modified: ofbiz/trunk/specialpurpose/myportal/widget/
>>>> MyPortalForms.xml
>>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/myportal/widget/MyPortalForms.xml?rev=735965&r1=735964&r2=735965&view=diff
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> ===================================================================
>>>> --- ofbiz/trunk/specialpurpose/myportal/widget/MyPortalForms.xml
>>>> (original)
>>>> +++ ofbiz/trunk/specialpurpose/myportal/widget/MyPortalForms.xml  
>>>> Tue
>>>> Jan 20 00:30:41 2009
>>>> @@ -276,4 +276,75 @@
>>>>       <field name="task"><display description="${workEffortName}"/
>>>>> </field>
>>>>   </form>
>>>>
>>>> +    <!--New Register Person-->
>>>> +    <form name="RegisterPerson" type="single"
>>>> target="createRegister" default-map-name="personInfo"
>>>> +        focus-field-name="salutation" header-row-style="header-
>>>> row"
>>>> default-table-style="basic-table">
>>>> +        <auto-fields-service service-name="updatePerson"/>
>>>> +        <field use-when="personInfo!=null" name="partyId" title="$
>>>> {uiLabelMap.PartyPartyId}" tooltip="$
>>>> {uiLabelMap.CommonNotModifRecreat}"><display/></field>
>>>> +        <field use-when="personInfo==null&amp;&amp;partyId==null"
>>>> name="partyId" title="${uiLabelMap.PartyPartyId}"><ignored/></
>>>> field>
>>>> +        <field use-when="personInfo==null&amp;&amp;partyId!=null"
>>>> name="partyId" title="${uiLabelMap.PartyPartyId}" tooltip="$
>>>> {uiLabelMap.CommonCannotBeFound}: [${partyId}]"><display also-
>>>> hidden="false"/></field>
>>>> +        <field name="firstName" title="$
>>>> {uiLabelMap.PartyFirstName}" tooltip="${uiLabelMap.CommonRequired}"
>>>> widget-style="required"><text size="40" maxlength="60"/></field>
>>>> +        <field name="lastName" title="${uiLabelMap.PartyLastName}"
>>>> tooltip="${uiLabelMap.CommonRequired}" widget-
>>>> style="required"><text
>>>> size="40" maxlength="60"/></field>
>>>> +        <field name="gender">
>>>> +            <drop-down allow-empty="true">
>>>> +                <option key="M" description="$
>>>> {uiLabelMap.CommonMale}"/>
>>>> +                <option key="F" description="$
>>>> {uiLabelMap.CommonFemale}"/>
>>>> +            </drop-down>
>>>> +        </field>
>>>> +        <field name="maritalStatus">
>>>> +            <drop-down allow-empty="true">
>>>> +                <option key="S" description="$
>>>> {uiLabelMap.PartyMaritalStatusSingle}"/>
>>>> +                <option key="M" description="$
>>>> {uiLabelMap.PartyMaritalStatusMarried}"/>
>>>> +                <option key="P" description="$
>>>> {uiLabelMap.PartyMaritalStatusSeparated}"/>
>>>> +                <option key="D" description="$
>>>> {uiLabelMap.PartyMaritalStatusDivorced}"/>
>>>> +                <option key="W" description="$
>>>> {uiLabelMap.PartyMaritalStatusWidowed}"/>
>>>> +            </drop-down>
>>>> +        </field>
>>>> +        <field name="employmentStatusEnumId">
>>>> +            <drop-down allow-empty="true">
>>>> +                <entity-options entity-name="Enumeration" key-
>>>> field-
>>>> name="enumId" description="${description} [${enumCode}]">
>>>> +                    <entity-constraint name="enumTypeId"
>>>> value="EMPLOY_STTS"/>
>>>> +                    <entity-order-by field-name="sequenceId"/>
>>>> +                </entity-options>
>>>> +            </drop-down>
>>>> +        </field>
>>>> +        <field name="residenceStatusEnumId">
>>>> +            <drop-down allow-empty="true">
>>>> +                <entity-options entity-name="Enumeration" key-
>>>> field-
>>>> name="enumId" description="${description} [${enumCode}]">
>>>> +                    <entity-constraint name="enumTypeId"
>>>> value="PTY_RESID_STTS"/>
>>>> +                    <entity-order-by field-name="sequenceId"/>
>>>> +                </entity-options>
>>>> +            </drop-down>
>>>> +        </field>
>>>> +        <field name="existingCustomer">
>>>> +            <drop-down allow-empty="true"><option key="Y"
>>>> description="${uiLabelMap.CommonY}"/><option key="N" description="$
>>>> {uiLabelMap.CommonN}"/></drop-down>
>>>> +        </field>
>>>> +        <field name="preferredCurrencyUomId">
>>>> +            <drop-down allow-empty="true">
>>>> +                <entity-options key-field-name="uomId"
>>>> description="${abbreviation} - ${description}" entity-name="Uom">
>>>> +                    <entity-constraint name="uomTypeId"
>>>> operator="equals" value="CURRENCY_MEASURE"/>
>>>> +                    <entity-order-by field-name="abbreviation"/>
>>>> +                </entity-options>
>>>> +            </drop-down>
>>>> +        </field>
>>>> +        <field name="statusId" use-when="person==null"><hidden/></
>>>> field>
>>>> +        <field name="statusId" use-when="person!=null">
>>>> +            <drop-down allow-empty="false">
>>>> +                <entity-options description="${description}"  
>>>> entity-
>>>> name="StatusItem">
>>>> +                    <entity-constraint name="statusTypeId"
>>>> value="PARTY_STATUS"/>
>>>> +                    <entity-order-by field-name="sequenceId"/>
>>>> +                </entity-options>
>>>> +            </drop-down>
>>>> +        </field>
>>>> +        <field name="UserLogin" title="${uiLabelMap.UserLogin}"
>>>> title-area-style="group-label"><display description=" " also-
>>>> hidden="false"/></field>
>>>> +        <field name="USERNAME" title="$
>>>> {uiLabelMap.CommonUsername}"
>>>> tooltip="${uiLabelMap.CommonRequired}" widget-
>>>> style="required"><text
>>>> size="30" maxlength="250"/></field>
>>>> +        <field name="PASSWORD" title="$
>>>> {uiLabelMap.CommonPassword}"
>>>> tooltip="${uiLabelMap.CommonRequired}" widget-
>>>> style="required"><password size="15" maxlength="250"/></field>
>>>> +        <field name="CONFIRM_PASSWORD" title="$
>>>> {uiLabelMap.CommonPassword}" tooltip="* $
>>>> {uiLabelMap.CommonConfirm}"
>>>> widget-style="required"><password size="15" maxlength="250"/></
>>>> field>
>>>> +        <field name="VerifyCaptchaTitle" title="$
>>>> {uiLabelMap.VerifyCaptcha}" title-area-style="group-label"><display
>>>> description=" " also-hidden="false"/></field>
>>>> +        <field name="picOfcaptcha" title="$
>>>> {uiLabelMap.PicCaptcha}"><image value="/images/captchaImage.png"></
>>>> image></field>
>>>> +        <field name="reload" title=" "><image value="/images/feed-
>>>> icon-14x14.png"><sub-hyperlink target="newRegisterLogin"
>>>> description="reload image"/></image></field>
>>>> +        <field name="captcha" title="${uiLabelMap.VerifyCaptcha}"
>>>> tooltip="${uiLabelMap.CommonRequired}" widget-
>>>> style="required"><text
>>>> size="23" maxlength="30"/></field>
>>>> +        <field name="submitButton" title="$
>>>> {uiLabelMap.CommonSave}"
>>>> title-area-style="group-label"><submit button-type="button"/></
>>>> field>
>>>> +    </form>
>>>> +
>>>> </forms>
>>>>
>>>> Added: ofbiz/trunk/specialpurpose/myportal/widget/login.ftl
>>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/myportal/widget/login.ftl?rev=735965&view=auto
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> =
>>>> ===================================================================
>>>> --- ofbiz/trunk/specialpurpose/myportal/widget/login.ftl (added)
>>>> +++ ofbiz/trunk/specialpurpose/myportal/widget/login.ftl Tue Jan 20
>>>> 00:30:41 2009
>>>> @@ -0,0 +1,73 @@
>>>> +<#--
>>>> +Licensed to the Apache Software Foundation (ASF) under one
>>>> +or more contributor license agreements.  See the NOTICE file
>>>> +distributed with this work for additional information
>>>> +regarding copyright ownership.  The ASF licenses this file
>>>> +to you under the Apache License, Version 2.0 (the
>>>> +"License"); you may not use this file except in compliance
>>>> +with the License.  You may obtain a copy of the License at
>>>> +
>>>> +http://www.apache.org/licenses/LICENSE-2.0
>>>> +
>>>> +Unless required by applicable law or agreed to in writing,
>>>> +software distributed under the License is distributed on an
>>>> +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>>>> +KIND, either express or implied.  See the License for the
>>>> +specific language governing permissions and limitations
>>>> +under the License.
>>>> +-->
>>>> +
>>>> +<#if requestAttributes.uiLabelMap?exists><#assign uiLabelMap =
>>>> requestAttributes.uiLabelMap></#if>
>>>> +
>>>> +<#assign previousParams = sessionAttributes._PREVIOUS_PARAMS_?
>>>> if_exists>
>>>> +<#if previousParams?has_content>
>>>> +  <#assign previousParams = "?" + previousParams>
>>>> +</#if>
>>>> +
>>>> +<#assign username = requestParameters.USERNAME?
>>>> default((sessionAttributes.autoUserLogin.userLoginId)?default(""))>
>>>> +<#if username != "">
>>>> +  <#assign focusName = false>
>>>> +<#else>
>>>> +  <#assign focusName = true>
>>>> +</#if>
>>>> +
>>>> +<center>
>>>> +  <div class="screenlet login-screenlet" style="width: 22%;  
>>>> margin-
>>>> left: 5px; text-align: center;">
>>>> +    <div class="screenlet-title-bar">
>>>> +      <h3>${uiLabelMap.CommonRegistered}</h3>
>>>> +    </div>
>>>> +    <div class="screenlet-body">
>>>> +      <form method="post" action="<@ofbizUrl>login$
>>>> {previousParams?
>>>> if_exists}</@ofbizUrl>" name="loginform">
>>>> +        <table class="basic-table" cellspacing="0">
>>>> +          <tr>
>>>> +            <td class="label" style="width: 31%;">$
>>>> {uiLabelMap.CommonUsername}</td>
>>>> +            <td><input type="text" name="USERNAME" value="$
>>>> {username}" size="20"/></td>
>>>> +          </tr>
>>>> +          <tr>
>>>> +            <td class="label">${uiLabelMap.CommonPassword}</td>
>>>> +            <td><input type="password" name="PASSWORD" value=""
>>>> size="20"/></td>
>>>> +          </tr>
>>>> +          <tr>
>>>> +            <td colspan="2" align="center">
>>>> +              <input type="submit" value="$
>>>> {uiLabelMap.CommonLogin}"/>
>>>> +            </td>
>>>> +          </tr>
>>>> +        </table>
>>>> +        <input type="hidden" name="JavaScriptEnabled" value="N"/>
>>>> +        <br/>
>>>> +        <a href="<@ofbizUrl>forgotPassword${previousParams?
>>>> if_exists}</@ofbizUrl>">${uiLabelMap.CommonForgotYourPassword}?</a>
>>>> +        <br/>
>>>> +        <a href="<@ofbizUrl>newRegisterLogin${previousParams?
>>>> if_exists}</@ofbizUrl>">${uiLabelMap.NewRegistration}</a>
>>>> +      </form>
>>>> +    </div>
>>>> +  </div>
>>>> +</center>
>>>> +
>>>> +<script language="JavaScript" type="text/javascript">
>>>> +  document.loginform.JavaScriptEnabled.value = "Y";
>>>> +  <#if focusName>
>>>> +    document.loginform.USERNAME.focus();
>>>> +  <#else>
>>>> +    document.loginform.PASSWORD.focus();
>>>> +  </#if>
>>>> +</script>
>>>> \ No newline at end of file
>>>>
>>>> Propchange: ofbiz/trunk/specialpurpose/myportal/widget/login.ftl
>>>> ------------------------------------------------------------------------------
>>>>  svn:eol-style = native
>>>>
>>>> Propchange: ofbiz/trunk/specialpurpose/myportal/widget/login.ftl
>>>> ------------------------------------------------------------------------------
>>>>  svn:keywords = "Date Rev Author URL Id"
>>>>
>>>> Propchange: ofbiz/trunk/specialpurpose/myportal/widget/login.ftl
>>>> ------------------------------------------------------------------------------
>>>>  svn:mime-type = text/plain
>>>>
>>>>
>>>
>> --
>> Antwebsystems.com: Quality OFBiz services for competitive prices
>>
>


smime.p7s (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Split the framework/common component?

David E Jones-3

The specific thing about messages is pretty simple... they should like  
in the lowest level (most depended on) component that uses them. If  
they are used in the party and common components, then they should go  
in the common component. Looking at the common component it is  
frustrating to see a number of labels/messages that include the word  
"party" as the common component doesn't know anything about parties  
(and should remain lower level and not know anything about parties  
even if we do split some of it into the applications).

What to do with the common component is a bit of a tough call. I  
originally considered a lot of those data structures to be very  
generic and appropriate to put in a framework. There are lots of  
examples of low level tools including infrastructure for things like  
this, the Java APIs being a good example of one that includes things  
related to many of these.

Some entities should definitely stay in the framework, like the  
Status* and Enumeration* entities in common and the WebSite and  
related entities in webapp, and I still think most of the other ones  
should too. There may be specific cases, but for the most part I think  
they are where they should be.

I'll admit some are more dubious, so I'll gladly join in discussing  
specific entities. Some are really generic, but only used in one  
application component, like the CustomTimePeriod is only used in  
accounting, but it is a more generic concept so doesn't have to be  
only used there and could be reused for other things...

-David


On Jan 25, 2009, at 12:59 PM, Jacopo Cappellato wrote:

> I really think it is time to start to think about splitting the  
> common component into two components:
> 1) a common component to be placed into the applications folder and  
> loaded before the other ones
> 2) a common component that will stay in the framework folder
>
> All these labels, plus other ERP related artifacts, should then go  
> in #1
>
> In my opinion entities like Geo, CountryCode, KeywordThesaurus  
> should not appear in a framework only distro.
>
> But maybe I am off topic in this thread and I should create a new one.
>
> Jacopo
>
>
> On Jan 25, 2009, at 10:14 AM, [hidden email] wrote:
>
>> Hi Hans,
>>
>> it's ok to move it to the framework is they are more generics and  
>> they can be shared by all the components but in this case I think  
>> it's better to put the Common prefix on those labels.
>>
>> Thanks
>> Marco
>>
>>
>> Il giorno 25/gen/09, alle ore 02:54, Hans Bakker ha scritto:
>>
>>> Hi Marco,
>>>
>>> sure we can do this, however captcha itself is a framework  
>>> function, but
>>> at the moment only used in myportal... We will move the captcha  
>>> messages
>>> to the framwork....
>>>
>>> regards,
>>> Hans
>>>
>>> On Sat, 2009-01-24 at 22:22 +0100, [hidden email] wrote:
>>>> Hi Hans,
>>>>
>>>> I suggest to use the prefix MyPortal for those type of labels, I  
>>>> spent
>>>> a lot of days to cleanup all the wasted labels into OFBiz and I  
>>>> think
>>>> we cannot all use different standard to codify the labels.
>>>> And if it's possible do not use the underscore character in the  
>>>> labels
>>>> name could be more readable.
>>>>
>>>> In my opinion for example CaptchaMissingError could be
>>>> MyPortalCaptchaMissingError or something similar to that.
>>>>
>>>> If we do not follow this simple rule in two or three months the  
>>>> labels
>>>> will be completed wasted again.
>>>>
>>>> What others thinks about that ?
>>>>
>>>> Thanks
>>>> Marco
>>>>
>>>>
>>>> Il giorno 20/gen/09, alle ore 09:30, [hidden email] ha scritto:
>>>>
>>>>> Author: hansbak
>>>>> Date: Tue Jan 20 00:30:41 2009
>>>>> New Revision: 735965
>>>>>
>>>>> URL: http://svn.apache.org/viewvc?rev=735965&view=rev
>>>>> Log:
>>>>> first version of captcha, not perfect yet: multiple users
>>>>> registering at the same time, image should be stored in 'runtime'
>>>>> not working on windows. Another problem is what files to put
>>>>> where.....the captcha itself looks like a framework
>>>>> feature...however the registration process needs the party
>>>>> component....so let us know, we will correct it....
>>>>>
>>>>> Added:
>>>>> ofbiz/trunk/framework/common/src/org/ofbiz/common/Captcha.java
>>>>> (with props)
>>>>> ofbiz/trunk/specialpurpose/myportal/widget/login.ftl   (with  
>>>>> props)
>>>>> Modified:
>>>>> ofbiz/trunk/framework/common/widget/CommonMenus.xml
>>>>> ofbiz/trunk/specialpurpose/myportal/config/MyPortalUiLabels.xml
>>>>> ofbiz/trunk/specialpurpose/myportal/script/org/ofbiz/myportal/
>>>>> Events.xml
>>>>> ofbiz/trunk/specialpurpose/myportal/webapp/myportal/WEB-INF/
>>>>> controller.xml
>>>>> ofbiz/trunk/specialpurpose/myportal/widget/CommonScreens.xml
>>>>> ofbiz/trunk/specialpurpose/myportal/widget/MyPortalForms.xml
>>>>>
>>>>> Added: ofbiz/trunk/framework/common/src/org/ofbiz/common/
>>>>> Captcha.java
>>>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/src/org/ofbiz/common/Captcha.java?rev=735965&view=auto
>>>>> =
>>>>> =
>>>>> =
>>>>> =
Reply | Threaded
Open this post in threaded view
|

Re: Split the framework/common component?

Jacopo Cappellato-4
On Jan 26, 2009, at 7:11 AM, David E Jones wrote:

>
> The specific thing about messages is pretty simple... they should  
> like in the lowest level (most depended on) component that uses  
> them. If they are used in the party and common components, then they  
> should go in the common component. Looking at the common component  
> it is frustrating to see a number of labels/messages that include  
> the word "party" as the common component doesn't know anything about  
> parties (and should remain lower level and not know anything about  
> parties even if we do split some of it into the applications).
>
Yes, I totally agree with you.

> What to do with the common component is a bit of a tough call. I  
> originally considered a lot of those data structures to be very  
> generic and appropriate to put in a framework. There are lots of  
> examples of low level tools including infrastructure for things like  
> this, the Java APIs being a good example of one that includes things  
> related to many of these.
>

For sure we still need a common component for the framework, but in my  
opinion it should contain only framework related common artifacts  
(entities etc...) and not applications related common artifacts (that  
should be moved into the new common component in the applications  
folder).

> Some entities should definitely stay in the framework, like the  
> Status* and Enumeration* entities in common and the WebSite and  
> related entities in webapp, and I still think most of the other ones  
> should too. There may be specific cases, but for the most part I  
> think they are where they should be.
>

Well, in my opinion these entities would be good candidates for the  
new applications ' common component (unless they are used by other  
framework related entities, quite possible, I have  not checked this).
The main goal would be to have a framework as clean as possible, with  
no ERP/applications related entities in it (just user related and very  
tech entities).

Jacopo

> I'll admit some are more dubious, so I'll gladly join in discussing  
> specific entities. Some are really generic, but only used in one  
> application component, like the CustomTimePeriod is only used in  
> accounting, but it is a more generic concept so doesn't have to be  
> only used there and could be reused for other things...
>
> -David
>
>
> On Jan 25, 2009, at 12:59 PM, Jacopo Cappellato wrote:
>
>> I really think it is time to start to think about splitting the  
>> common component into two components:
>> 1) a common component to be placed into the applications folder and  
>> loaded before the other ones
>> 2) a common component that will stay in the framework folder
>>
>> All these labels, plus other ERP related artifacts, should then go  
>> in #1
>>
>> In my opinion entities like Geo, CountryCode, KeywordThesaurus  
>> should not appear in a framework only distro.
>>
>> But maybe I am off topic in this thread and I should create a new  
>> one.
>>
>> Jacopo
>>
>>
>> On Jan 25, 2009, at 10:14 AM, [hidden email] wrote:
>>
>>> Hi Hans,
>>>
>>> it's ok to move it to the framework is they are more generics and  
>>> they can be shared by all the components but in this case I think  
>>> it's better to put the Common prefix on those labels.
>>>
>>> Thanks
>>> Marco
>>>
>>>
>>> Il giorno 25/gen/09, alle ore 02:54, Hans Bakker ha scritto:
>>>
>>>> Hi Marco,
>>>>
>>>> sure we can do this, however captcha itself is a framework  
>>>> function, but
>>>> at the moment only used in myportal... We will move the captcha  
>>>> messages
>>>> to the framwork....
>>>>
>>>> regards,
>>>> Hans
>>>>
>>>> On Sat, 2009-01-24 at 22:22 +0100, [hidden email] wrote:
>>>>> Hi Hans,
>>>>>
>>>>> I suggest to use the prefix MyPortal for those type of labels, I  
>>>>> spent
>>>>> a lot of days to cleanup all the wasted labels into OFBiz and I  
>>>>> think
>>>>> we cannot all use different standard to codify the labels.
>>>>> And if it's possible do not use the underscore character in the  
>>>>> labels
>>>>> name could be more readable.
>>>>>
>>>>> In my opinion for example CaptchaMissingError could be
>>>>> MyPortalCaptchaMissingError or something similar to that.
>>>>>
>>>>> If we do not follow this simple rule in two or three months the  
>>>>> labels
>>>>> will be completed wasted again.
>>>>>
>>>>> What others thinks about that ?
>>>>>
>>>>> Thanks
>>>>> Marco
>>>>>
>>>>>
>>>>> Il giorno 20/gen/09, alle ore 09:30, [hidden email] ha  
>>>>> scritto:
>>>>>
>>>>>> Author: hansbak
>>>>>> Date: Tue Jan 20 00:30:41 2009
>>>>>> New Revision: 735965
>>>>>>
>>>>>> URL: http://svn.apache.org/viewvc?rev=735965&view=rev
>>>>>> Log:
>>>>>> first version of captcha, not perfect yet: multiple users
>>>>>> registering at the same time, image should be stored in 'runtime'
>>>>>> not working on windows. Another problem is what files to put
>>>>>> where.....the captcha itself looks like a framework
>>>>>> feature...however the registration process needs the party
>>>>>> component....so let us know, we will correct it....
>>>>>>
>>>>>> Added:
>>>>>> ofbiz/trunk/framework/common/src/org/ofbiz/common/Captcha.java
>>>>>> (with props)
>>>>>> ofbiz/trunk/specialpurpose/myportal/widget/login.ftl   (with  
>>>>>> props)
>>>>>> Modified:
>>>>>> ofbiz/trunk/framework/common/widget/CommonMenus.xml
>>>>>> ofbiz/trunk/specialpurpose/myportal/config/MyPortalUiLabels.xml
>>>>>> ofbiz/trunk/specialpurpose/myportal/script/org/ofbiz/myportal/
>>>>>> Events.xml
>>>>>> ofbiz/trunk/specialpurpose/myportal/webapp/myportal/WEB-INF/
>>>>>> controller.xml
>>>>>> ofbiz/trunk/specialpurpose/myportal/widget/CommonScreens.xml
>>>>>> ofbiz/trunk/specialpurpose/myportal/widget/MyPortalForms.xml
>>>>>>
>>>>>> Added: ofbiz/trunk/framework/common/src/org/ofbiz/common/
>>>>>> Captcha.java
>>>>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/src/org/ofbiz/common/Captcha.java?rev=735965&view=auto
>>>>>> =
>>>>>> =
>>>>>> =
>>>>>> =


smime.p7s (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Split the framework/common component?

Jacques Le Roux
Administrator
From: "Jacopo Cappellato" <[hidden email]>

> On Jan 26, 2009, at 7:11 AM, David E Jones wrote:
>
>>
>> The specific thing about messages is pretty simple... they should  like in the lowest level (most depended on) component that
>> uses  them. If they are used in the party and common components, then they  should go in the common component. Looking at the
>> common component  it is frustrating to see a number of labels/messages that include  the word "party" as the common component
>> doesn't know anything about  parties (and should remain lower level and not know anything about  parties even if we do split some
>> of it into the applications).
>>
>
> Yes, I totally agree with you.

From a practical point of view I would prefer Jacopo's solution. For instance take the label CommonGeoLocation. I agree it has
nothing to do in Framework. But on the other hand it's no more related to Party than Product (Facility) or Accouting (Fixed Asset).
So, from a logical point of view, it does not make sense to put them in Party (most depended on) and we could create a Common
application component where such artifacts (not only labels) could reside. I'm sure that at term it will prove useful, because it's
logical! Why searching in Party something common at the same level at several components ?

>> What to do with the common component is a bit of a tough call. I  originally considered a lot of those data structures to be very
>> generic and appropriate to put in a framework. There are lots of  examples of low level tools including infrastructure for things
>> like  this, the Java APIs being a good example of one that includes things  related to many of these.
>>
>
> For sure we still need a common component for the framework, but in my  opinion it should contain only framework related common
> artifacts  (entities etc...) and not applications related common artifacts (that  should be moved into the new common component in
> the applications  folder).

+1

>> Some entities should definitely stay in the framework, like the  Status* and Enumeration* entities in common and the WebSite and
>> related entities in webapp, and I still think most of the other ones  should too. There may be specific cases, but for the most
>> part I  think they are where they should be.
>>
>
> Well, in my opinion these entities would be good candidates for the  new applications ' common component (unless they are used by
> other  framework related entities, quite possible, I have  not checked this).
> The main goal would be to have a framework as clean as possible, with  no ERP/applications related entities in it (just user
> related and very  tech entities).

+1

My 2cts

Jacques

> Jacopo
>
>> I'll admit some are more dubious, so I'll gladly join in discussing  specific entities. Some are really generic, but only used in
>> one  application component, like the CustomTimePeriod is only used in  accounting, but it is a more generic concept so doesn't
>> have to be  only used there and could be reused for other things...
>>
>> -David
>>
>>
>> On Jan 25, 2009, at 12:59 PM, Jacopo Cappellato wrote:
>>
>>> I really think it is time to start to think about splitting the  common component into two components:
>>> 1) a common component to be placed into the applications folder and  loaded before the other ones
>>> 2) a common component that will stay in the framework folder
>>>
>>> All these labels, plus other ERP related artifacts, should then go  in #1
>>>
>>> In my opinion entities like Geo, CountryCode, KeywordThesaurus  should not appear in a framework only distro.
>>>
>>> But maybe I am off topic in this thread and I should create a new  one.
>>>
>>> Jacopo
>>>
>>>
>>> On Jan 25, 2009, at 10:14 AM, [hidden email] wrote:
>>>
>>>> Hi Hans,
>>>>
>>>> it's ok to move it to the framework is they are more generics and  they can be shared by all the components but in this case I
>>>> think  it's better to put the Common prefix on those labels.
>>>>
>>>> Thanks
>>>> Marco
>>>>
>>>>
>>>> Il giorno 25/gen/09, alle ore 02:54, Hans Bakker ha scritto:
>>>>
>>>>> Hi Marco,
>>>>>
>>>>> sure we can do this, however captcha itself is a framework  function, but
>>>>> at the moment only used in myportal... We will move the captcha  messages
>>>>> to the framwork....
>>>>>
>>>>> regards,
>>>>> Hans
>>>>>
>>>>> On Sat, 2009-01-24 at 22:22 +0100, [hidden email] wrote:
>>>>>> Hi Hans,
>>>>>>
>>>>>> I suggest to use the prefix MyPortal for those type of labels, I  spent
>>>>>> a lot of days to cleanup all the wasted labels into OFBiz and I  think
>>>>>> we cannot all use different standard to codify the labels.
>>>>>> And if it's possible do not use the underscore character in the  labels
>>>>>> name could be more readable.
>>>>>>
>>>>>> In my opinion for example CaptchaMissingError could be
>>>>>> MyPortalCaptchaMissingError or something similar to that.
>>>>>>
>>>>>> If we do not follow this simple rule in two or three months the  labels
>>>>>> will be completed wasted again.
>>>>>>
>>>>>> What others thinks about that ?
>>>>>>
>>>>>> Thanks
>>>>>> Marco
>>>>>>
>>>>>>
>>>>>> Il giorno 20/gen/09, alle ore 09:30, [hidden email] ha  scritto:
>>>>>>
>>>>>>> Author: hansbak
>>>>>>> Date: Tue Jan 20 00:30:41 2009
>>>>>>> New Revision: 735965
>>>>>>>
>>>>>>> URL: http://svn.apache.org/viewvc?rev=735965&view=rev
>>>>>>> Log:
>>>>>>> first version of captcha, not perfect yet: multiple users
>>>>>>> registering at the same time, image should be stored in 'runtime'
>>>>>>> not working on windows. Another problem is what files to put
>>>>>>> where.....the captcha itself looks like a framework
>>>>>>> feature...however the registration process needs the party
>>>>>>> component....so let us know, we will correct it....
>>>>>>>
>>>>>>> Added:
>>>>>>> ofbiz/trunk/framework/common/src/org/ofbiz/common/Captcha.java
>>>>>>> (with props)
>>>>>>> ofbiz/trunk/specialpurpose/myportal/widget/login.ftl   (with  props)
>>>>>>> Modified:
>>>>>>> ofbiz/trunk/framework/common/widget/CommonMenus.xml
>>>>>>> ofbiz/trunk/specialpurpose/myportal/config/MyPortalUiLabels.xml
>>>>>>> ofbiz/trunk/specialpurpose/myportal/script/org/ofbiz/myportal/
>>>>>>> Events.xml
>>>>>>> ofbiz/trunk/specialpurpose/myportal/webapp/myportal/WEB-INF/
>>>>>>> controller.xml
>>>>>>> ofbiz/trunk/specialpurpose/myportal/widget/CommonScreens.xml
>>>>>>> ofbiz/trunk/specialpurpose/myportal/widget/MyPortalForms.xml
>>>>>>>
>>>>>>> Added: ofbiz/trunk/framework/common/src/org/ofbiz/common/ Captcha.java
>>>>>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/src/org/ofbiz/common/Captcha.java?rev=735965&view=auto
>>>>>>> =
>>>>>>> =
>>>>>>> =
>>>>>>> =
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Split the framework/common component?

Jacques Le Roux
Administrator
In revision 738452 , I have commited last changes related to Geolocation.
I believe that one of the most importants things when coding is to chase similar blocks of code and try to merge them..
I have notably removed the method PartyWorker.findPartyLatestGeoPoint() and introduced instead GeoWorker.findLatestGeoPoint() (in
common/geo).
However, I have still to achieve the work. I'd like to merge in  common/geo also Groovy and FreeMarker files but (I guess for now)
PartyGeoLocation.groovy
All parameters could be set in screens and calling a parameterized couple of Groovy/FreeMarker files in common/geo.
The goal then would be to move them to a new an applications/common component where all shared (transversal like geo)
features/artifacts would be, as I suggested in r738452 commit.

What do you think ?

Jacques

From: "Jacques Le Roux" <[hidden email]>

> From: "Jacopo Cappellato" <[hidden email]>
>> On Jan 26, 2009, at 7:11 AM, David E Jones wrote:
>>
>>>
>>> The specific thing about messages is pretty simple... they should  like in the lowest level (most depended on) component that
>>> uses  them. If they are used in the party and common components, then they  should go in the common component. Looking at the
>>> common component  it is frustrating to see a number of labels/messages that include  the word "party" as the common component
>>> doesn't know anything about  parties (and should remain lower level and not know anything about  parties even if we do split
>>> some of it into the applications).
>>>
>>
>> Yes, I totally agree with you.
>
>>From a practical point of view I would prefer Jacopo's solution. For instance take the label CommonGeoLocation. I agree it has
> nothing to do in Framework. But on the other hand it's no more related to Party than Product (Facility) or Accouting (Fixed
> Asset).
> So, from a logical point of view, it does not make sense to put them in Party (most depended on) and we could create a Common
> application component where such artifacts (not only labels) could reside. I'm sure that at term it will prove useful, because
> it's logical! Why searching in Party something common at the same level at several components ?
>
>>> What to do with the common component is a bit of a tough call. I  originally considered a lot of those data structures to be
>>> very generic and appropriate to put in a framework. There are lots of  examples of low level tools including infrastructure for
>>> things like  this, the Java APIs being a good example of one that includes things  related to many of these.
>>>
>>
>> For sure we still need a common component for the framework, but in my  opinion it should contain only framework related common
>> artifacts  (entities etc...) and not applications related common artifacts (that  should be moved into the new common component
>> in the applications  folder).
>
> +1
>
>>> Some entities should definitely stay in the framework, like the  Status* and Enumeration* entities in common and the WebSite and
>>> related entities in webapp, and I still think most of the other ones  should too. There may be specific cases, but for the most
>>> part I  think they are where they should be.
>>>
>>
>> Well, in my opinion these entities would be good candidates for the  new applications ' common component (unless they are used by
>> other  framework related entities, quite possible, I have  not checked this).
>> The main goal would be to have a framework as clean as possible, with  no ERP/applications related entities in it (just user
>> related and very  tech entities).
>
> +1
>
> My 2cts
>
> Jacques
>
>> Jacopo
>>
>>> I'll admit some are more dubious, so I'll gladly join in discussing  specific entities. Some are really generic, but only used
>>> in one  application component, like the CustomTimePeriod is only used in  accounting, but it is a more generic concept so
>>> doesn't have to be  only used there and could be reused for other things...
>>>
>>> -David
>>>
>>>
>>> On Jan 25, 2009, at 12:59 PM, Jacopo Cappellato wrote:
>>>
>>>> I really think it is time to start to think about splitting the  common component into two components:
>>>> 1) a common component to be placed into the applications folder and  loaded before the other ones
>>>> 2) a common component that will stay in the framework folder
>>>>
>>>> All these labels, plus other ERP related artifacts, should then go  in #1
>>>>
>>>> In my opinion entities like Geo, CountryCode, KeywordThesaurus  should not appear in a framework only distro.
>>>>
>>>> But maybe I am off topic in this thread and I should create a new  one.
>>>>
>>>> Jacopo
>>>>
>>>>
>>>> On Jan 25, 2009, at 10:14 AM, [hidden email] wrote:
>>>>
>>>>> Hi Hans,
>>>>>
>>>>> it's ok to move it to the framework is they are more generics and  they can be shared by all the components but in this case I
>>>>> think  it's better to put the Common prefix on those labels.
>>>>>
>>>>> Thanks
>>>>> Marco
>>>>>
>>>>>
>>>>> Il giorno 25/gen/09, alle ore 02:54, Hans Bakker ha scritto:
>>>>>
>>>>>> Hi Marco,
>>>>>>
>>>>>> sure we can do this, however captcha itself is a framework  function, but
>>>>>> at the moment only used in myportal... We will move the captcha  messages
>>>>>> to the framwork....
>>>>>>
>>>>>> regards,
>>>>>> Hans
>>>>>>
>>>>>> On Sat, 2009-01-24 at 22:22 +0100, [hidden email] wrote:
>>>>>>> Hi Hans,
>>>>>>>
>>>>>>> I suggest to use the prefix MyPortal for those type of labels, I  spent
>>>>>>> a lot of days to cleanup all the wasted labels into OFBiz and I  think
>>>>>>> we cannot all use different standard to codify the labels.
>>>>>>> And if it's possible do not use the underscore character in the  labels
>>>>>>> name could be more readable.
>>>>>>>
>>>>>>> In my opinion for example CaptchaMissingError could be
>>>>>>> MyPortalCaptchaMissingError or something similar to that.
>>>>>>>
>>>>>>> If we do not follow this simple rule in two or three months the  labels
>>>>>>> will be completed wasted again.
>>>>>>>
>>>>>>> What others thinks about that ?
>>>>>>>
>>>>>>> Thanks
>>>>>>> Marco
>>>>>>>
>>>>>>>
>>>>>>> Il giorno 20/gen/09, alle ore 09:30, [hidden email] ha  scritto:
>>>>>>>
>>>>>>>> Author: hansbak
>>>>>>>> Date: Tue Jan 20 00:30:41 2009
>>>>>>>> New Revision: 735965
>>>>>>>>
>>>>>>>> URL: http://svn.apache.org/viewvc?rev=735965&view=rev
>>>>>>>> Log:
>>>>>>>> first version of captcha, not perfect yet: multiple users
>>>>>>>> registering at the same time, image should be stored in 'runtime'
>>>>>>>> not working on windows. Another problem is what files to put
>>>>>>>> where.....the captcha itself looks like a framework
>>>>>>>> feature...however the registration process needs the party
>>>>>>>> component....so let us know, we will correct it....
>>>>>>>>
>>>>>>>> Added:
>>>>>>>> ofbiz/trunk/framework/common/src/org/ofbiz/common/Captcha.java
>>>>>>>> (with props)
>>>>>>>> ofbiz/trunk/specialpurpose/myportal/widget/login.ftl   (with  props)
>>>>>>>> Modified:
>>>>>>>> ofbiz/trunk/framework/common/widget/CommonMenus.xml
>>>>>>>> ofbiz/trunk/specialpurpose/myportal/config/MyPortalUiLabels.xml
>>>>>>>> ofbiz/trunk/specialpurpose/myportal/script/org/ofbiz/myportal/
>>>>>>>> Events.xml
>>>>>>>> ofbiz/trunk/specialpurpose/myportal/webapp/myportal/WEB-INF/
>>>>>>>> controller.xml
>>>>>>>> ofbiz/trunk/specialpurpose/myportal/widget/CommonScreens.xml
>>>>>>>> ofbiz/trunk/specialpurpose/myportal/widget/MyPortalForms.xml
>>>>>>>>
>>>>>>>> Added: ofbiz/trunk/framework/common/src/org/ofbiz/common/ Captcha.java
>>>>>>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/src/org/ofbiz/common/Captcha.java?rev=735965&view=auto
>>>>>>>> =
>>>>>>>> =
>>>>>>>> =
>>>>>>>> =
>>
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: Split the framework/common component?

Jacques Le Roux
Administrator
OK, it seems that there is already a consensus around Jacopo's proposition. So I will switch common/geo to it ASAP

Jacques

From: "Jacques Le Roux" <[hidden email]>

> In revision 738452 , I have commited last changes related to Geolocation.
> I believe that one of the most importants things when coding is to chase similar blocks of code and try to merge them..
> I have notably removed the method PartyWorker.findPartyLatestGeoPoint() and introduced instead GeoWorker.findLatestGeoPoint() (in
> common/geo).
> However, I have still to achieve the work. I'd like to merge in  common/geo also Groovy and FreeMarker files but (I guess for now)
> PartyGeoLocation.groovy
> All parameters could be set in screens and calling a parameterized couple of Groovy/FreeMarker files in common/geo.
> The goal then would be to move them to a new an applications/common component where all shared (transversal like geo)
> features/artifacts would be, as I suggested in r738452 commit.
>
> What do you think ?
>
> Jacques
>
> From: "Jacques Le Roux" <[hidden email]>
>> From: "Jacopo Cappellato" <[hidden email]>
>>> On Jan 26, 2009, at 7:11 AM, David E Jones wrote:
>>>
>>>>
>>>> The specific thing about messages is pretty simple... they should  like in the lowest level (most depended on) component that
>>>> uses  them. If they are used in the party and common components, then they  should go in the common component. Looking at the
>>>> common component  it is frustrating to see a number of labels/messages that include  the word "party" as the common component
>>>> doesn't know anything about  parties (and should remain lower level and not know anything about  parties even if we do split
>>>> some of it into the applications).
>>>>
>>>
>>> Yes, I totally agree with you.
>>
>>>From a practical point of view I would prefer Jacopo's solution. For instance take the label CommonGeoLocation. I agree it has
>> nothing to do in Framework. But on the other hand it's no more related to Party than Product (Facility) or Accouting (Fixed
>> Asset).
>> So, from a logical point of view, it does not make sense to put them in Party (most depended on) and we could create a Common
>> application component where such artifacts (not only labels) could reside. I'm sure that at term it will prove useful, because
>> it's logical! Why searching in Party something common at the same level at several components ?
>>
>>>> What to do with the common component is a bit of a tough call. I  originally considered a lot of those data structures to be
>>>> very generic and appropriate to put in a framework. There are lots of  examples of low level tools including infrastructure for
>>>> things like  this, the Java APIs being a good example of one that includes things  related to many of these.
>>>>
>>>
>>> For sure we still need a common component for the framework, but in my  opinion it should contain only framework related common
>>> artifacts  (entities etc...) and not applications related common artifacts (that  should be moved into the new common component
>>> in the applications  folder).
>>
>> +1
>>
>>>> Some entities should definitely stay in the framework, like the  Status* and Enumeration* entities in common and the WebSite
>>>> and related entities in webapp, and I still think most of the other ones  should too. There may be specific cases, but for the
>>>> most part I  think they are where they should be.
>>>>
>>>
>>> Well, in my opinion these entities would be good candidates for the  new applications ' common component (unless they are used
>>> by other  framework related entities, quite possible, I have  not checked this).
>>> The main goal would be to have a framework as clean as possible, with  no ERP/applications related entities in it (just user
>>> related and very  tech entities).
>>
>> +1
>>
>> My 2cts
>>
>> Jacques
>>
>>> Jacopo
>>>
>>>> I'll admit some are more dubious, so I'll gladly join in discussing  specific entities. Some are really generic, but only used
>>>> in one  application component, like the CustomTimePeriod is only used in  accounting, but it is a more generic concept so
>>>> doesn't have to be  only used there and could be reused for other things...
>>>>
>>>> -David
>>>>
>>>>
>>>> On Jan 25, 2009, at 12:59 PM, Jacopo Cappellato wrote:
>>>>
>>>>> I really think it is time to start to think about splitting the  common component into two components:
>>>>> 1) a common component to be placed into the applications folder and  loaded before the other ones
>>>>> 2) a common component that will stay in the framework folder
>>>>>
>>>>> All these labels, plus other ERP related artifacts, should then go  in #1
>>>>>
>>>>> In my opinion entities like Geo, CountryCode, KeywordThesaurus  should not appear in a framework only distro.
>>>>>
>>>>> But maybe I am off topic in this thread and I should create a new  one.
>>>>>
>>>>> Jacopo
>>>>>
>>>>>
>>>>> On Jan 25, 2009, at 10:14 AM, [hidden email] wrote:
>>>>>
>>>>>> Hi Hans,
>>>>>>
>>>>>> it's ok to move it to the framework is they are more generics and  they can be shared by all the components but in this case
>>>>>> I think  it's better to put the Common prefix on those labels.
>>>>>>
>>>>>> Thanks
>>>>>> Marco
>>>>>>
>>>>>>
>>>>>> Il giorno 25/gen/09, alle ore 02:54, Hans Bakker ha scritto:
>>>>>>
>>>>>>> Hi Marco,
>>>>>>>
>>>>>>> sure we can do this, however captcha itself is a framework  function, but
>>>>>>> at the moment only used in myportal... We will move the captcha  messages
>>>>>>> to the framwork....
>>>>>>>
>>>>>>> regards,
>>>>>>> Hans
>>>>>>>
>>>>>>> On Sat, 2009-01-24 at 22:22 +0100, [hidden email] wrote:
>>>>>>>> Hi Hans,
>>>>>>>>
>>>>>>>> I suggest to use the prefix MyPortal for those type of labels, I  spent
>>>>>>>> a lot of days to cleanup all the wasted labels into OFBiz and I  think
>>>>>>>> we cannot all use different standard to codify the labels.
>>>>>>>> And if it's possible do not use the underscore character in the  labels
>>>>>>>> name could be more readable.
>>>>>>>>
>>>>>>>> In my opinion for example CaptchaMissingError could be
>>>>>>>> MyPortalCaptchaMissingError or something similar to that.
>>>>>>>>
>>>>>>>> If we do not follow this simple rule in two or three months the  labels
>>>>>>>> will be completed wasted again.
>>>>>>>>
>>>>>>>> What others thinks about that ?
>>>>>>>>
>>>>>>>> Thanks
>>>>>>>> Marco
>>>>>>>>
>>>>>>>>
>>>>>>>> Il giorno 20/gen/09, alle ore 09:30, [hidden email] ha  scritto:
>>>>>>>>
>>>>>>>>> Author: hansbak
>>>>>>>>> Date: Tue Jan 20 00:30:41 2009
>>>>>>>>> New Revision: 735965
>>>>>>>>>
>>>>>>>>> URL: http://svn.apache.org/viewvc?rev=735965&view=rev
>>>>>>>>> Log:
>>>>>>>>> first version of captcha, not perfect yet: multiple users
>>>>>>>>> registering at the same time, image should be stored in 'runtime'
>>>>>>>>> not working on windows. Another problem is what files to put
>>>>>>>>> where.....the captcha itself looks like a framework
>>>>>>>>> feature...however the registration process needs the party
>>>>>>>>> component....so let us know, we will correct it....
>>>>>>>>>
>>>>>>>>> Added:
>>>>>>>>> ofbiz/trunk/framework/common/src/org/ofbiz/common/Captcha.java
>>>>>>>>> (with props)
>>>>>>>>> ofbiz/trunk/specialpurpose/myportal/widget/login.ftl   (with  props)
>>>>>>>>> Modified:
>>>>>>>>> ofbiz/trunk/framework/common/widget/CommonMenus.xml
>>>>>>>>> ofbiz/trunk/specialpurpose/myportal/config/MyPortalUiLabels.xml
>>>>>>>>> ofbiz/trunk/specialpurpose/myportal/script/org/ofbiz/myportal/
>>>>>>>>> Events.xml
>>>>>>>>> ofbiz/trunk/specialpurpose/myportal/webapp/myportal/WEB-INF/
>>>>>>>>> controller.xml
>>>>>>>>> ofbiz/trunk/specialpurpose/myportal/widget/CommonScreens.xml
>>>>>>>>> ofbiz/trunk/specialpurpose/myportal/widget/MyPortalForms.xml
>>>>>>>>>
>>>>>>>>> Added: ofbiz/trunk/framework/common/src/org/ofbiz/common/ Captcha.java
>>>>>>>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/src/org/ofbiz/common/Captcha.java?rev=735965&view=auto
>>>>>>>>> =
>>>>>>>>> =
>>>>>>>>> =
>>>>>>>>> =
>>>
>>>
>>
>