Package play.data

Examples of play.data.DynamicForm


        return ok(views.html.system.ldap.index.render(currentUser(), breadcrumbs(), ldapSettingsForm));
    }

    public Result apiTestLdapConnection() {
        final DynamicForm dynamicForm = form().bindFromRequest("url", "systemUsername", "systemPassword", "ldapType", "useStartTls", "trustAllCertificates");
        final Map<String, String> formData = dynamicForm.data();
        LdapConnectionTestResponse result;
        try {
            final LdapTestConnectionRequest request = getLdapTestConnectionRequest(formData);
            request.testConnectOnly = true;
            result = ldapSettingsService.testLdapConfiguration(request);
View Full Code Here


        }
        return ok(Json.toJson(result));
    }

    public Result apiTestLdapLogin() {
        final DynamicForm dynamicForm = form().bindFromRequest(
                "url", "systemUsername", "systemPassword", "ldapType", "useStartTls", "trustAllCertificates",
                "searchBase", "searchPattern", "principal", "password");
        final Map<String, String> formData = dynamicForm.data();

        LdapConnectionTestResponse result;
        try {
            final LdapTestConnectionRequest request = getLdapTestConnectionRequest(formData);
            // also try to login, don't just test the connection
View Full Code Here

        flash("success", "Successfully changed the password for user " + user.getFullName());
        return redirect(routes.UsersController.index());
    }

    public Result resetPermissions(String username) {
        final DynamicForm requestForm = Form.form().bindFromRequest();

        boolean isAdmin = false;
        final String field = requestForm.get("permissiontype");
        if (field != null && field.equalsIgnoreCase("admin")) {
            isAdmin = true;
        }
        final User user = userService.load(username);
View Full Code Here

        try {
            HttpPost request = new HttpPost(baseRestUrl + "/login");
            //{"email":"admin@dspace.org","password":"s3cret"}
            //StringEntity params =new StringEntity("{\"email\":\"admin@dspace.org\",\"password\":\"s3cret\"} ");
            DynamicForm requestData = Form.form().bindFromRequest();
            String email = requestData.get("email");
            String password = requestData.get("password");
            StringEntity params =new StringEntity("{\"email\":\"" + email + "\",\"password\":\"" + password + "\"}");
            request.addHeader("content-type", "application/json");
            request.setEntity(params);
            HttpResponse response = httpClient.execute(request);
View Full Code Here

            return internalServerError(e.getMessage());
        }
    }

    public static Html navbar() {
        DynamicForm requestData = Form.form().bindFromRequest();

        List<String> appVersionNames;
        List<String> androidVersions;
        List<String> packageNames;
        try (Connection connection = DB.getConnection()) {
View Full Code Here

    @Transactional
    @IsCreatable(ResourceType.ISSUE_LABEL)
    public static Result newLabel(String ownerName, String projectName) {
        Project project = Project.findByOwnerAndProjectName(ownerName, projectName);

        DynamicForm labelForm = form().bindFromRequest();
        String categoryName = labelForm.get("categoryName");

        IssueLabelCategory category = new IssueLabelCategory();
        category.project = project;
        category.name = categoryName;

        if (category.exists()) {
            category = IssueLabelCategory.findBy(category);
        } else {
            category.isExclusive = Boolean.parseBoolean(labelForm.get("categoryIsExclusive"));
            category.save();
        }

        IssueLabel label = new IssueLabel();
        label.project = project;
        label.name = labelForm.get("labelName");
        label.color = labelForm.get("labelColor");
        label.category = category;

        if (label.exists()) {
            return noContent();
        } else {
View Full Code Here

     */
    @Transactional
    @IsAllowed(value = Operation.DELETE, resourceType = ResourceType.ISSUE_LABEL)
    public static Result delete(String ownerName, String projectName, Long id) {
        // _method must be 'delete'
        DynamicForm bindedForm = form().bindFromRequest();
        if (!bindedForm.get("_method").toLowerCase()
                .equals("delete")) {
            return badRequest(ErrorViews.BadRequest.render("_method must be 'delete'."));
        }

        IssueLabel label = IssueLabel.finder.byId(id);
View Full Code Here

        // render(message: String, sender: String, errorMessage: String, isSent: Boolean)
        return ok(lostPassword.render("site.resetPasswordEmail.title", null, null, false));
    }

    public static Result requestResetPasswordEmail(){
        DynamicForm requestData = form().bindFromRequest();
        String loginId = requestData.get("loginId");
        String emailAddress = requestData.get("emailAddress");

        Logger.debug("request reset password email by [" + loginId + ":" + emailAddress + "]");

        User targetUser = User.findByLoginId(loginId);
View Full Code Here

    public static Result resetPasswordForm(String hashString){
        return ok(resetPassword.render("title.resetPassword", form(User.class), hashString));
    }

    public static Result resetPassword(){
        DynamicForm requestData = form().bindFromRequest();
        String hashString = requestData.get("hashString");
        String newPassword = requestData.get("password");

        if(PasswordReset.isValidResetHash(hashString)){
            PasswordReset.resetPassword(hashString, newPassword);
            Logger.debug("Password was reset");
        } else {
View Full Code Here

  }

  public Promise<Result> loginPost() {
   
    // Form data
    final DynamicForm requestData = Form.form().bindFromRequest();
    final String openID = requestData.get("openID");
   
    final Promise<String> redirectUrlPromise =
        openIdClient.redirectURL(openID, routes.OpenIDController.openIDCallback().absoluteURL(request()));

    final Promise<Result> resultPromise = redirectUrlPromise.map(url -> {
View Full Code Here

TOP

Related Classes of play.data.DynamicForm

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.