Java Code Examples for play.data.Form#form()
The following examples show how to use
play.data.Form#form() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LessonVersionController.java From judgels with GNU General Public License v2.0 | 5 votes |
@Transactional(readOnly = true) @AddCSRFToken public Result viewVersionLocalChanges(long lessonId) throws LessonNotFoundException { Lesson lesson = lessonService.findLessonById(lessonId); if (!LessonControllerUtils.isPartnerOrAbove(lessonService, lesson)) { return notFound(); } boolean isClean = !lessonService.userCloneExists(IdentityUtils.getUserJid(), lesson.getJid()); Form<VersionCommitForm> versionCommitForm = Form.form(VersionCommitForm.class); return showViewVersionLocalChanges(versionCommitForm, lesson, isClean); }
Example 2
Source File: LessonStatementController.java From judgels with GNU General Public License v2.0 | 5 votes |
@Transactional(readOnly = true) @AddCSRFToken public Result listStatementMediaFiles(long lessonId) throws LessonNotFoundException { Lesson lesson = lessonService.findLessonById(lessonId); Form<UploadFileForm> uploadFileForm = Form.form(UploadFileForm.class); boolean isAllowedToUploadMediaFiles = LessonControllerUtils.isAllowedToUploadStatementResources(lessonService, lesson); List<FileInfo> mediaFiles = lessonService.getStatementMediaFiles(IdentityUtils.getUserJid(), lesson.getJid()); return showListStatementMediaFiles(uploadFileForm, lesson, mediaFiles, isAllowedToUploadMediaFiles); }
Example 3
Source File: LessonController.java From judgels with GNU General Public License v2.0 | 5 votes |
@Transactional(readOnly = true) @AddCSRFToken public Result createLesson() { Form<LessonCreateForm> lessonCreateForm = Form.form(LessonCreateForm.class); return showCreateLesson(lessonCreateForm); }
Example 4
Source File: ProblemController.java From judgels with GNU General Public License v2.0 | 5 votes |
@Transactional(readOnly = true) @AddCSRFToken public Result createProblem() { Form<ProblemCreateForm> problemCreateForm = Form.form(ProblemCreateForm.class); return showCreateProblem(problemCreateForm); }
Example 5
Source File: ProblemVersionController.java From judgels with GNU General Public License v2.0 | 5 votes |
@Transactional(readOnly = true) @AddCSRFToken public Result viewVersionLocalChanges(long problemId) throws ProblemNotFoundException { Problem problem = problemService.findProblemById(problemId); if (!ProblemControllerUtils.isPartnerOrAbove(problemService, problem)) { return notFound(); } boolean isClean = !problemService.userCloneExists(IdentityUtils.getUserJid(), problem.getJid()); Form<VersionCommitForm> versionCommitForm = Form.form(VersionCommitForm.class); return showViewVersionLocalChanges(versionCommitForm, problem, isClean); }
Example 6
Source File: ProblemStatementController.java From judgels with GNU General Public License v2.0 | 5 votes |
@Transactional(readOnly = true) @AddCSRFToken public Result listStatementMediaFiles(long problemId) throws ProblemNotFoundException { Problem problem = problemService.findProblemById(problemId); Form<UploadFileForm> uploadFileForm = Form.form(UploadFileForm.class); boolean isAllowedToUploadMediaFiles = ProblemControllerUtils.isAllowedToUploadStatementResources(problemService, problem); List<FileInfo> mediaFiles = problemService.getStatementMediaFiles(IdentityUtils.getUserJid(), problem.getJid()); return showListStatementMediaFiles(uploadFileForm, problem, mediaFiles, isAllowedToUploadMediaFiles); }
Example 7
Source File: ProgrammingProblemPartnerController.java From judgels with GNU General Public License v2.0 | 5 votes |
@Transactional(readOnly = true) @AddCSRFToken public Result addPartner(long problemId) throws ProblemNotFoundException { Problem problem = problemService.findProblemById(problemId); if (!ProblemControllerUtils.isAuthorOrAbove(problem)) { return notFound(); } Form<ProblemPartnerUsernameForm> usernameForm = Form.form(ProblemPartnerUsernameForm.class); Form<ProblemPartnerUpsertForm> problemForm = Form.form(ProblemPartnerUpsertForm.class); Form<ProgrammingPartnerUpsertForm> programmingForm = Form.form(ProgrammingPartnerUpsertForm.class); return showAddPartner(usernameForm, problemForm, programmingForm, problem); }
Example 8
Source File: ProgrammingProblemGradingController.java From judgels with GNU General Public License v2.0 | 5 votes |
@Transactional(readOnly = true) @AddCSRFToken public Result listGradingHelperFiles(long problemId) throws ProblemNotFoundException { Problem problem = problemService.findProblemById(problemId); if (!ProgrammingProblemControllerUtils.isAllowedToManageGrading(problemService, problem)) { return notFound(); } Form<UploadFileForm> uploadFileForm = Form.form(UploadFileForm.class); List<FileInfo> helperFiles = programmingProblemService.getGradingHelperFiles(IdentityUtils.getUserJid(), problem.getJid()); return showListGradingHelperFiles(uploadFileForm, problem, helperFiles); }
Example 9
Source File: ProgrammingProblemController.java From judgels with GNU General Public License v2.0 | 5 votes |
@Transactional(readOnly = true) @AddCSRFToken public Result createProgrammingProblem() { if (!ProblemControllerUtils.wasProblemJustCreated()) { return badRequest(); } Form<ProgrammingProblemCreateForm> form = Form.form(ProgrammingProblemCreateForm.class); return showCreateProgrammingProblem(form); }
Example 10
Source File: BundleProblemPartnerController.java From judgels with GNU General Public License v2.0 | 5 votes |
@Transactional(readOnly = true) @AddCSRFToken public Result addPartner(long problemId) throws ProblemNotFoundException { Problem problem = problemService.findProblemById(problemId); if (!ProblemControllerUtils.isAuthorOrAbove(problem)) { return notFound(); } Form<ProblemPartnerUsernameForm> usernameForm = Form.form(ProblemPartnerUsernameForm.class); Form<ProblemPartnerUpsertForm> problemForm = Form.form(ProblemPartnerUpsertForm.class); Form<BundlePartnerUpsertForm> bundleForm = Form.form(BundlePartnerUpsertForm.class); return showAddPartner(usernameForm, problemForm, bundleForm, problem); }
Example 11
Source File: OutputOnlyGradingEngineAdapter.java From judgels with GNU General Public License v2.0 | 4 votes |
@Override public Form<?> createEmptyForm() { return Form.form(OutputOnlyGradingConfigForm.class); }
Example 12
Source File: JophielClientController.java From judgels with GNU General Public License v2.0 | 4 votes |
@AddCSRFToken public Result login() { Form<LoginForm> form = Form.form(LoginForm.class); return showLogin(form); }
Example 13
Source File: InteractiveGradingEngineAdapter.java From judgels with GNU General Public License v2.0 | 4 votes |
@Override public Form<?> createEmptyForm() { return Form.form(InteractiveGradingConfigForm.class); }
Example 14
Source File: FunctionalGradingEngineAdapter.java From judgels with GNU General Public License v2.0 | 4 votes |
@Override public Form<?> createEmptyForm() { return Form.form(FunctionalGradingConfigForm.class); }
Example 15
Source File: ItemShortAnswerConfAdapter.java From judgels with GNU General Public License v2.0 | 4 votes |
@Override public Form generateForm() { return Form.form(ItemShortAnswerConfForm.class); }
Example 16
Source File: OutputOnlyWithSubtasksGradingEngineAdapter.java From judgels with GNU General Public License v2.0 | 4 votes |
@Override public Form<?> createEmptyForm() { return Form.form(OutputOnlyWithSubtasksGradingConfigForm.class); }
Example 17
Source File: BatchGradingEngineAdapter.java From judgels with GNU General Public License v2.0 | 4 votes |
@Override public Form<?> createEmptyForm() { return Form.form(BatchGradingConfigForm.class); }
Example 18
Source File: ItemEssayConfAdapter.java From judgels with GNU General Public License v2.0 | 4 votes |
@Override public Form generateForm() { return Form.form(ItemEssayConfForm.class); }
Example 19
Source File: InteractiveWithSubtasksGradingEngineAdapter.java From judgels with GNU General Public License v2.0 | 4 votes |
@Override public Form<?> createEmptyForm() { return Form.form(InteractiveWithSubtasksGradingConfigForm.class); }
Example 20
Source File: BatchWithSubtasksGradingEngineAdapter.java From judgels with GNU General Public License v2.0 | 4 votes |
@Override public Form<?> createEmptyForm() { return Form.form(BatchWithSubtasksGradingConfigForm.class); }