Package org.fao.geonet.repository

Examples of org.fao.geonet.repository.UserRepository.save()


                .setUsername(username);
        user.getSecurity().setPassword(passwordHash);
        user.getEmailAddresses().add(email);
        user.getAddresses().add(new Address().setAddress(address).setCountry(country).setCity(city).setState(state).setZip(zip));

        userRepository.save(user);

        // The user is created as registereduser on the GUEST group, and not mapped on the specific optional
        // profile. Then the catalogue administrator could manage the created user.
        UserGroup userGroup = new UserGroup().setUser(user).setGroup(group).setProfile(Profile.RegisteredUser);
        context.getBean(UserGroupRepository.class).save(userGroup);
View Full Code Here


    // get site URL
    SettingInfo si = context.getBean(SettingInfo.class);
    String siteURL = si.getSiteUrl() + context.getBaseUrl();

        elUser.getSecurity().setPassword(PasswordUtil.encode(context, password));
        userRepository.save(elUser);

    // generate email details using customisable stylesheet
    //TODO: allow internationalised emails
    Element root = new Element("root");
    root.addContent(elUser.asXml());
View Full Code Here

                .setState(state)
                .setZip(zip);
        user.getEmailAddresses().clear();
        user.getEmailAddresses().add(email);

        userRepository.save(user);

    return new Element(Jeeves.Elem.RESPONSE);
  }
}
View Full Code Here

                throw new IllegalArgumentException("password is a required parameter for operation: " + Params.Operation.RESETPW);
            }

            // -- For adding new user
            if (operation.equals(Params.Operation.NEWUSER)) {
                user = userRepository.save(user);

        setUserGroups(user, params, context);
      } else if (operation.equals(Params.Operation.FULLUPDATE) || operation.equals(Params.Operation.EDITINFO)) {
                user = userRepository.save(user);
View Full Code Here

            if (operation.equals(Params.Operation.NEWUSER)) {
                user = userRepository.save(user);

        setUserGroups(user, params, context);
      } else if (operation.equals(Params.Operation.FULLUPDATE) || operation.equals(Params.Operation.EDITINFO)) {
                user = userRepository.save(user);

                //--- add groups
                groupRepository.deleteAllByIdAttribute(UserGroupId_.userId, Arrays.asList(user.getId()));

                setUserGroups(user, params, context);
View Full Code Here

                //--- add groups
                groupRepository.deleteAllByIdAttribute(UserGroupId_.userId, Arrays.asList(user.getId()));

                setUserGroups(user, params, context);
      } else if (operation.equals(Params.Operation.RESETPW)) {
             user = userRepository.save(user);
      } else {
                throw new IllegalArgumentException("unknown user update operation " + operation);
            }
    } else {
      throw new IllegalArgumentException("You don't have rights to do this");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.