Package net.sourceforge.stripes.examples.bugzooky.biz

Examples of net.sourceforge.stripes.examples.bugzooky.biz.Person


    /** The URL the user was trying to access (null if the login page was accessed directly). */
    public void setTargetUrl(String targetUrl) { this.targetUrl = targetUrl; }
   
    public Resolution login() {
        PersonManager pm = new PersonManager();
        Person person = pm.getPerson(this.username);

        if (person == null) {
            ValidationError error = new LocalizableError("usernameDoesNotExist");
            getContext().getValidationErrors().add("username", error);
            return getContext().getSourcePageResolution();
        }
        else if (!person.getPassword().equals(password)) {
            ValidationError error = new LocalizableError("incorrectPassword");
            getContext().getValidationErrors().add("password", error);
            return getContext().getSourcePageResolution();
        }
        else {
View Full Code Here


    public Resolution saveChanges() {
        PersonManager pm = new PersonManager();

        // Apply any changes to existing people (and create new ones)
        for (Person person : people) {
            Person realPerson;
            if (person.getId() == null) {
                realPerson = new Person();
            }
            else {
                realPerson = pm.getPerson(person.getId());
            }

            realPerson.setEmail(person.getEmail());
            realPerson.setFirstName(person.getFirstName());
            realPerson.setLastName(person.getLastName());
            realPerson.setUsername(person.getUsername());

            if (person.getPassword() != null) {
                realPerson.setPassword(person.getPassword());
            }
           
            pm.saveOrUpdate(realPerson);
        }
View Full Code Here

        return new ForwardResolution("/bugzooky/Login.jsp");
    }

    public Resolution login() {
        PersonManager pm = new PersonManager();
        Person person = pm.getPerson(this.username);

        if (person == null) {
            ValidationError error = new LocalizableError("usernameDoesNotExist");
            getContext().getValidationErrors().add("username", error);
            return getContext().getSourcePageResolution();
        }
        else if (!person.getPassword().equals(password)) {
            ValidationError error = new LocalizableError("incorrectPassword");
            getContext().getValidationErrors().add("password", error);
            return getContext().getSourcePageResolution();
        }
        else {
View Full Code Here

     * @param errors The validation errors for this request. If the input string cannot be parsed,
     *            then we will add a new {@link ValidationError} to this collection and return null.
     */
    public Person convert(String input, Class<? extends Person> targetType,
            Collection<ValidationError> errors) {
        Person person = null;

        try {
            int id = Integer.valueOf(input);
            PersonManager personManager = new PersonManager();
            person = personManager.getPerson(id);
View Full Code Here

TOP

Related Classes of net.sourceforge.stripes.examples.bugzooky.biz.Person

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.