Package mod.AccountDB.GUI.Templates

Examples of mod.AccountDB.GUI.Templates.AccountTemplateHandler


        String passwrd      = aReq.getParam(mParams.A_PASSWORD);
        String passwrdVerify = aReq.getParam(mParams.A_PASSWORDRE);

        // Create template
        AccountTemplateHandler tAccountTH = new AccountTemplateHandler(
            mServletProps.TemplateDir,
            "Person_New",
            mServletProps.DefaultStylesheet,
            "footer-url-not-needed-here");

        tAccountTH.startWithLanguage(
            language.equals(Language.GERMAN)
                ? Language.German
                : Language.English);

        // Remove the HTML params which will be edited in this form.
        removeParams(aReq);
        aReq.replaceParam(mParams.EXECUTE, mEvents.Subscribe_Person_Store);

        // Setup the form.
        tAccountTH.setAllFormOpentag(
            "<form action=\"" + aReq.getContextAndServletPath() + "\" method=\"POST\">",
            aReq.toHiddenParams());
        tAccountTH.setEditView(execute.equals(mEvents.Subscribe_Person_Store)); // Set new or edit view.

        // Add errors.
        if(! errors.isEmpty()) {
            Enumeration enu = errors.elements();
            while(enu.hasMoreElements()) {
                String[] tmp = (String[]) enu.nextElement();
                tAccountTH.addError(tmp[0], tmp[1]);
            }
        }

        // Add information.

        tAccountTH.setPersonTitleInput("50", title, true);
        tAccountTH.setPersonFirstNameInput("50", firstname, true);
        tAccountTH.setPersonSecondNameInput("50", secondname, true);
        tAccountTH.setPersonLastNameInput("50", lastname, true);

        tAccountTH.setPersonPhoneStateInput("50", phonestate, true);
        tAccountTH.setPersonPhoneTownInput("50", phonetown, true);
        tAccountTH.setPersonPhoneLocationInput("50", phonelocation, true);
        tAccountTH.setPersonPhoneDirectInput("50", phonedirect, true);
        tAccountTH.setPersonFaxDirectInput("50", faxdirect, true);

        tAccountTH.setPersonEmailInput("50", email, true);
        tAccountTH.setPersonHomepageInput("255", homepage, true);

        tAccountTH.setDepartmentInput("50", department, true);
        tAccountTH.setDepartmentLocationInput("50", location, true);
        tAccountTH.setDepartmentCompanyInput("50", company, true);

        tAccountTH.setPersonPasswordInput("50", passwrd,true);
        tAccountTH.setPersonPasswordVerifyInput("50", passwrdVerify, true);

        // Output.

        tAccountTH.execute();
        aWriter.println(tAccountTH.writeToString());

        // autocommitted
    }
View Full Code Here


        String username = aReq.getParam(Person_HtmlParam.INPUT_PERSON_USERNAME);
        String passwrd  = aReq.getParam(mParams.A_PASSWORD);

        removeParams(aReq);

        AccountTemplateHandler tAccountTH = new AccountTemplateHandler(
            mServletProps.TemplateDir,
            "UpdatePermissions",
            mServletProps.DefaultStylesheet,
            " ");
        tAccountTH.startWithLanguage(
            language.equals(Language.GERMAN)
                ? Language.German
                : Language.English);

        // Setup form.
        aReq.replaceParam(mParams.EXECUTE, mEvents.Subscribe_DoUpdatePermissions);
        tAccountTH.setAllFormOpentag(
            "<form action=\"" + aReq.getContextAndServletPath()+ "\" method=\"POST\">",
            aReq.toHiddenParams());

        tAccountTH.setPersonUsernameInput("50", username, true);
        tAccountTH.setPersonPasswordInput("50", passwrd, true);

        tAccountTH.execute();
        aWriter.println(tAccountTH.writeToString());

        // autocommitted
    }
View Full Code Here

        Vector errors = checkUser(username, passwrd, language);

        if(! errors.isEmpty()) {
            // Some data not correct.

            AccountTemplateHandler tAccountTH = new AccountTemplateHandler(
                mServletProps.TemplateDir,
                "UpdatePermissions",
                mServletProps.DefaultStylesheet,
                " ");
            tAccountTH.startWithLanguage(
                language.equals(Language.GERMAN)
                    ? Language.German
                    : Language.English);

            // Setup form.
            aReq.replaceParam(mParams.EXECUTE, mEvents.Subscribe_DoUpdatePermissions);
            tAccountTH.setAllFormOpentag(
                "<form action=\"" + aReq.getContextAndServletPath() + "\" method=\"POST\">",
                aReq.toHiddenParams());

            // Insert errors in form.
            Enumeration enu = errors.elements();
            while(enu.hasMoreElements()) {
                String[] tmp = (String[]) enu.nextElement();
                tAccountTH.addError(tmp[0], tmp[1]);
            }
            tAccountTH.setPersonUsernameInput("50", username, true);
            tAccountTH.setPersonPasswordInput("50", passwrd, true);
            tAccountTH.execute();

            aWriter.println(tAccountTH.writeToString());

            transactionRollback();
            return;
        } else {
            // Data correct.
View Full Code Here

TOP

Related Classes of mod.AccountDB.GUI.Templates.AccountTemplateHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.