Package cn.edu.zju.acm.onlinejudge.form

Examples of cn.edu.zju.acm.onlinejudge.form.ContestForm


        ActionForward forward = this.checkContestAdminPermission(mapping, context, isProblemset, false);
        if (forward != null) {
            return forward;
        }

        ContestForm contestForm = (ContestForm) form;

        if (contestForm.getId() == null) {
            AbstractContest contest = context.getContest();
            contestForm.populate(contest);
            return this.handleSuccess(mapping, context);
        } else {
            ContestPersistence persistence = PersistenceManager.getInstance().getContestPersistence();
            AbstractContest contest = contestForm.toContest();
            persistence.updateContest(contest, context.getUserSecurity().getId());
            ContestManager.getInstance().refreshContest(contest.getId());

            ActionMessages messages = new ActionMessages();
            messages.add("message", new ActionMessage("onlinejudge.editContest.success"));
View Full Code Here


        if (forward != null) {
            return forward;
        }

        ContestPersistence contestPersistence = PersistenceManager.getInstance().getContestPersistence();
        ContestForm contestForm = (ContestForm) form;
        if (contestForm == null || contestForm.getId() == null) {
            return this.handleSuccess(mapping, context, "failure");
        }

        context.setAttribute("ContestForm", contestForm);

        // create user profile
        AbstractContest contest = contestForm.toContest();

        contestPersistence.createContest(contest, context.getUserProfile().getId());
        ContestManager.getInstance().refreshContest(contest.getId());

        ActionMessages messages = new ActionMessages();
View Full Code Here

TOP

Related Classes of cn.edu.zju.acm.onlinejudge.form.ContestForm

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.