protected String manageUserDetail(
      final String user, final Model model, final HttpServletRequest request)
      throws CMSItemNotFoundException {
    final CustomerData customerData = companyB2BCommerceFacade.getCustomerDataForUid(user);
    model.addAttribute("customerData", customerData);
    storeCmsPageInModel(model, getContentPageForLabelOrId(ORGANIZATION_MANAGEMENT_CMS_PAGE));
    setUpMetaDataForContentPage(
        model, getContentPageForLabelOrId(ORGANIZATION_MANAGEMENT_CMS_PAGE));
    final List<Breadcrumb> breadcrumbs =
        myCompanyBreadcrumbBuilder.createManageUserDetailsBreadcrumb(user);
    model.addAttribute("breadcrumbs", breadcrumbs);

    if (!customerData.getUnit().isActive()) {
      GlobalMessages.addInfoMessage(model, "text.parentunit.disabled.warning");
    }
    model.addAttribute("metaRobots", "no-index,no-follow");
    return ControllerConstants.Views.Pages.MyCompany.MyCompanyManageUserDetailPage;
  }
  public String editUser(final String user, final Model model) throws CMSItemNotFoundException {
    if (!model.containsAttribute("b2BCustomerForm")) {
      final CustomerData customerData = companyB2BCommerceFacade.getCustomerDataForUid(user);
      final B2BCustomerForm b2bCustomerForm = new B2BCustomerForm();
      b2bCustomerForm.setUid(customerData.getUid());
      b2bCustomerForm.setTitleCode(customerData.getTitleCode());
      b2bCustomerForm.setFirstName(customerData.getFirstName());
      b2bCustomerForm.setLastName(customerData.getLastName());
      b2bCustomerForm.setEmail(customerData.getDisplayUid());
      b2bCustomerForm.setParentB2BUnit(
          b2bCommerceUserFacade.getParentUnitForCustomer(customerData.getUid()).getUid());
      b2bCustomerForm.setActive(customerData.isActive());
      b2bCustomerForm.setApproverGroups(customerData.getApproverGroups());
      b2bCustomerForm.setApprovers(customerData.getApprovers());
      b2bCustomerForm.setRoles(customerData.getRoles());
      model.addAttribute(b2bCustomerForm);
    }

    model.addAttribute("titleData", getUserFacade().getTitles());
    model.addAttribute("roles", populateRolesCheckBoxes(companyB2BCommerceFacade.getUserGroups()));

    storeCmsPageInModel(model, getContentPageForLabelOrId(ORGANIZATION_MANAGEMENT_CMS_PAGE));
    setUpMetaDataForContentPage(
        model, getContentPageForLabelOrId(ORGANIZATION_MANAGEMENT_CMS_PAGE));
    final List<Breadcrumb> breadcrumbs =
        myCompanyBreadcrumbBuilder.createManageUserDetailsBreadcrumb(user);
    breadcrumbs.add(
        new Breadcrumb(
            String.format(
                "/my-company/organization-management/manage-users/edit?user=%s", urlEncode(user)),
            getMessageSource()
                .getMessage(
                    "text.company.manageusers.edit",
                    new Object[] {user},
                    "Edit {0} User",
                    getI18nService().getCurrentLocale()),
            null));
    model.addAttribute("breadcrumbs", breadcrumbs);
    model.addAttribute("metaRobots", "no-index,no-follow");
    return ControllerConstants.Views.Pages.MyCompany.MyCompanyManageUserAddEditFormPage;
  }