Package com.apress.progwt.server.web.domain

Examples of com.apress.progwt.server.web.domain.CreateUserRequestCommand


    private InvitationService invitationService;

    @Override
    protected Object formBackingObject(HttpServletRequest req)
            throws Exception {
        CreateUserRequestCommand com = new CreateUserRequestCommand();
       
        com.setEmail(req.getParameter("email"));
        com.setRandomkey(req.getParameter("secretkey"));

        return com;
    }
View Full Code Here


    @Override
    protected ModelAndView onSubmit(HttpServletRequest request,
            HttpServletResponse response, Object command,
            BindException errors) throws Exception {

        CreateUserRequestCommand comm = (CreateUserRequestCommand) command;

        log.debug("SUBMIT " + comm.isOpenID());

        User u = userService.createUser(comm);

        invitationService.saveSignedUpUser(comm.getRandomkey(), u);

        String successStr = "Thanks " + u.getUsername()
                + " your account is setup and you're ready to login!";

        log.info("returning message " + successStr + " to "
View Full Code Here

    protected ModelAndView handleRequestInternal(HttpServletRequest req,
            HttpServletResponse arg1) throws Exception {

        if (userService.nowAcceptingSignups()) {
            Map<String, Object> model = new HashMap<String, Object>();
            CreateUserRequestCommand comm = new CreateUserRequestCommand();

            Calendar c = Calendar.getInstance();
            c.get(Calendar.DAY_OF_WEEK_IN_MONTH);
            String secretKey = CryptUtils.hashString(invitationService
                    .getSalt()
View Full Code Here

    public void validate(Object command, Errors errors) {

        ValidationUtils.rejectIfEmptyOrWhitespace(errors, "randomkey",
                "required");

        CreateUserRequestCommand comm = (CreateUserRequestCommand) command;

        log.info(comm.getOpenIDusername() + " " + comm.getUsername()
                + " " + comm.getRandomkey());

        boolean standard = comm.isStandard();
        boolean openID = comm.isOpenID();

        if (standard && openID) {
            errors.rejectValue("username", "invalid.username.both");
            errors.rejectValue("openIDusername", "invalid.username.both");
        }
        if (!standard && !openID) {
            errors.rejectValue("username", "invalid.username.oneorother");
            errors.rejectValue("openIDusername",
                    "invalid.username.oneorother");
        }

        if (standard) {
            doStandardValidation(comm, errors);
        } else if (openID) {
            doOpenIDValidation(comm, errors);
        }

        if (!invitationService.isKeyValid(comm.getRandomkey())) {
            errors.rejectValue("randomkey", "invalid");
        }
        MailingListEntry entry = invitationService.getEntryForKey(comm
                .getRandomkey());
        if (entry != null && entry.getSignedUpUser() != null) {
            errors.rejectValue("randomkey", "invalid.randomkey.exists");
        }
View Full Code Here

TOP

Related Classes of com.apress.progwt.server.web.domain.CreateUserRequestCommand

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.