public Form<?> fillFormForUser(Form<?> userEditForm, PlessUser userToEdit) { @SuppressWarnings("unchecked") Form<UserEditData> typedForm = (Form<UserEditData>) userEditForm; return typedForm.fill(new UserEditData(userToEdit.getEmail(), userToEdit.getUsername())); }
/** * Fille with existing data. */ public DynamicForm fill(Map value) { Form<Dynamic> form = super.fill(new Dynamic(value)); return new DynamicForm(form.data(), form.errors(), form.value()); }
/** * Fills the form with existing data. * @param value the map of values to fill in the form. * @return the modified form. */ public DynamicForm fill(Map<String, Object> value) { Form<Dynamic> form = super.fill(new Dynamic(value)); return new DynamicForm(form.rawData(), form.files(), form.errors(), form.value(), messagesApi, formatters, validatorFactory, config, lang().orElse(null)); }
@AddCSRFToken public static Result resetPassword(String email, String resetPasswordToken) { Form<PasswordResetData> form = new Form<>(PasswordResetData.class) .fill(new PasswordResetData(email, resetPasswordToken)); return passwordResetService().passwordResetPage(form); }
/** * Fills the form with existing data. * @param value the map of values to fill in the form. * @return the modified form. */ public DynamicForm fill(Map<String, Object> value) { Form<Dynamic> form = super.fill(new Dynamic(value)); return new DynamicForm(form.rawData(), form.files(), form.errors(), form.value(), messagesApi, formatters, validatorFactory, config, lang().orElse(null)); }
/** * Fills the form with existing data. * @param value the map of values to fill in the form. * @return the modified form. */ public DynamicForm fill(Map<String, Object> value) { Form<Dynamic> form = super.fill(new Dynamic(value)); return new DynamicForm(form.rawData(), form.files(), form.errors(), form.value(), messagesApi, formatters, validatorFactory, config, lang().orElse(null)); }
/** * Fille with existing data. */ public DynamicForm fill(Map value) { Form<Dynamic> form = super.fill(new Dynamic(value)); return new DynamicForm(form.data(), form.errors(), form.value()); }
@CheckValidToken public Result adminConfigurationAdd() { final Form<HerculesProjectForm> form = form(HerculesProjectForm.class).fill(new HerculesProjectForm()); return ok(views.html.admin.addproject.render(form, getProjectOptions(), getPatternOptions())); }
@CheckValidToken public Result adminProperties() { final Form<HerculesPropertiesForm> form = form(HerculesPropertiesForm.class). fill(HerculesPropertiesForm.toForm(configService.getConfig(AC.getAcHost()))); return ok(views.html.admin.properties.render(form)); }
@CheckValidToken public Result adminConfigurationEdit(final Long configId) { final String userId = AC.getUser().getOrNull(); final AcHost tenant = AC.getAcHost(); final Option<Project> result = adminService.getConfigById(userId, tenant, configId); if (result.isEmpty()) { return notFound(); } else { final Project herculesProject = result.get(); final Form<HerculesProjectForm> form = form(HerculesProjectForm.class).fill(HerculesProjectForm.toForm(herculesProject)); final JiraProject project = projectRetriever.getProject(userId, tenant, herculesProject.getProjectId()); return ok(views.html.admin.editproject.render(form, project, getPatternOptions())); } }