use of com.emc.metalnx.modelattribute.user.profile.UserProfileForm in project metalnx-web by irods-contrib.
the class UserProfileController method showCreateForm.
@RequestMapping(value = "/create/")
public String showCreateForm(Model model) {
UserProfileForm userProfileForm = new UserProfileForm();
List<DataGridGroup> groups = groupService.findAll();
groupIdsList = new ArrayList<String>();
model.addAttribute("userProfileForm", userProfileForm);
model.addAttribute("groups", groups);
model.addAttribute("groupsOnProfileList", new String[0]);
model.addAttribute("resultSize", groups.size());
model.addAttribute("foundGroups", groups.size() > 0);
model.addAttribute("requestMapping", "/users/profile/create/action/");
return "userProfile/userProfileForm";
}
use of com.emc.metalnx.modelattribute.user.profile.UserProfileForm in project metalnx-web by irods-contrib.
the class UserProfileController method showModifyForm.
@RequestMapping(value = "/modify/{profileId}/")
public String showModifyForm(Model model, @PathVariable String profileId) {
UserProfile userProfile = userProfileService.findById(Long.valueOf(profileId));
List<DataGridGroup> groups = groupService.findAll();
UserProfileForm userProfileForm = new UserProfileForm();
if (userProfile != null) {
userProfileForm.setProfileId(String.valueOf(userProfile.getProfileId()));
userProfileForm.setProfileName(userProfile.getProfileName());
userProfileForm.setDescription(userProfile.getDescription());
int groupsQuantity = userProfile.getGroups().size(), i = 0;
String[] groupsOnProfileList = new String[groupsQuantity];
for (DataGridGroup group : userProfile.getGroups()) {
groupsOnProfileList[i++] = String.valueOf(group.getId());
}
model.addAttribute("groupsOnProfileList", groupsOnProfileList);
groupIdsList = new ArrayList<String>(Arrays.asList(groupsOnProfileList));
}
model.addAttribute("userProfileForm", userProfileForm);
model.addAttribute("groups", groups);
model.addAttribute("resultSize", groups.size());
model.addAttribute("foundGroups", groups.size() > 0);
model.addAttribute("requestMapping", "/users/profile/modify/action/");
return "userProfile/userProfileForm";
}
Aggregations