/**
   * make the structure of the advanced menu
   *
   * @param httpServletRequest
   * @param httpServletResponse
   */
  public void memberMenuStructure(
      HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) {

    DhtmlxMenu dhtmlxMenu = new DhtmlxMenu();

    SimpleMembershipUpdateContainer simpleMembershipUpdateContainer =
        SimpleMembershipUpdateContainer.retrieveFromSession();

    {
      DhtmlxMenuItem memberDetailsMenuItem = new DhtmlxMenuItem();
      memberDetailsMenuItem.setId("memberDetails");
      memberDetailsMenuItem.setText(
          simpleMembershipUpdateContainer.getText().getMemberMenuDetailsLabel());
      memberDetailsMenuItem.setTooltip(
          simpleMembershipUpdateContainer.getText().getMemberMenuDetailsTooltip());
      dhtmlxMenu.addDhtmlxItem(memberDetailsMenuItem);
    }

    {
      DhtmlxMenuItem memberEnabledMenuItem = new DhtmlxMenuItem();
      memberEnabledMenuItem.setId("enabledDisabled");
      memberEnabledMenuItem.setText(
          simpleMembershipUpdateContainer.getText().getMemberMenuEnabledDisabled());
      memberEnabledMenuItem.setTooltip(
          simpleMembershipUpdateContainer.getText().getMemberMenuEnabledDisabledTooltip());
      dhtmlxMenu.addDhtmlxItem(memberEnabledMenuItem);
    }

    GrouperUiUtils.printToScreen(
        "<?xml version=\"1.0\"?>\n" + dhtmlxMenu.toXml(), HttpContentType.TEXT_XML, false, false);

    throw new ControllerDone();
  }
  /**
   * make the structure of the advanced menu
   *
   * @param httpServletRequest
   * @param httpServletResponse
   */
  public void advancedMenuStructure(
      HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) {

    // get the text to add to html if showing details
    GuiHideShow showGroupDetails =
        GuiHideShow.retrieveHideShow("simpleMembershipUpdateGroupDetails", true);

    // get the text to add to html if showing multi delete
    GuiHideShow showMultiDelete =
        GuiHideShow.retrieveHideShow("simpleMembershipUpdateDeleteMultiple", true);

    // get the text to add to html if showing member filter
    GuiHideShow showMemberFilter =
        GuiHideShow.retrieveHideShow("simpleMembershipUpdateMemberFilter", true);

    SimpleMembershipUpdateContainer simpleMembershipUpdateContainer =
        SimpleMembershipUpdateContainer.retrieveFromSession();

    DhtmlxMenu dhtmlxMenu = new DhtmlxMenu();

    final Subject loggedInSubject = GrouperUiFilter.retrieveSubjectLoggedIn();

    Group group = null;
    GrouperSession grouperSession = null;
    boolean canInviteOthers = false;
    try {

      grouperSession = GrouperSession.start(loggedInSubject);

      group = new SimpleMembershipUpdate().retrieveGroup(grouperSession);

      UIGroupPrivilegeResolver resolver =
          UIGroupPrivilegeResolverFactory.getInstance(
              grouperSession,
              GrouperUiFilter.retrieveSessionMediaResourceBundle(),
              group,
              grouperSession.getSubject());
      canInviteOthers = resolver.canInviteExternalPeople();
    } finally {
      GrouperSession.stopQuietly(grouperSession);
    }

    {
      DhtmlxMenuItem multiDeleteMenuItem = new DhtmlxMenuItem();
      multiDeleteMenuItem.setId("multiDelete");
      multiDeleteMenuItem.setType("checkbox");
      if (showMultiDelete.isShowing()) {
        multiDeleteMenuItem.setChecked(showMultiDelete.isShowing());
      }
      multiDeleteMenuItem.setText(
          simpleMembershipUpdateContainer.getText().getAdvancedMenuDeleteMultiple());
      multiDeleteMenuItem.setTooltip(
          simpleMembershipUpdateContainer.getText().getAdvancedMenuDeleteMultipleTooltip());
      dhtmlxMenu.addDhtmlxItem(multiDeleteMenuItem);
    }

    {
      // see if we can invite
      if (canInviteOthers
          && GrouperUiConfig.retrieveConfig()
              .propertyValueBoolean("inviteExternalPeople.link-from-lite-ui", false)) {
        DhtmlxMenuItem memberInviteMenuItem = new DhtmlxMenuItem();
        memberInviteMenuItem.setId("inviteLink");
        memberInviteMenuItem.setText(TagUtils.navResourceString("ui-lite.invite-menu"));
        memberInviteMenuItem.setTooltip(TagUtils.navResourceString("ui-lite.invite-menuTooltip"));
        // memberInviteMenuItem.setHref("grouper.html?operation=InviteExternalSubjects.inviteExternalSubject&groupId=" + group.getUuid());
        // memberInviteMenuItem.setHref("http://localhost:8091/grouper/grouperUi/appHtml/grouper.html?operation=InviteExternalSubjects.inviteExternalSubject&groupId=0e0262d9be924774914052c12f0e7fd2");
        dhtmlxMenu.addDhtmlxItem(memberInviteMenuItem);
      }
    }

    {
      DhtmlxMenuItem groupDetailsMenuItem = new DhtmlxMenuItem();
      groupDetailsMenuItem.setId("showGroupDetails");
      groupDetailsMenuItem.setType("checkbox");
      if (showGroupDetails.isShowing()) {
        groupDetailsMenuItem.setChecked(showGroupDetails.isShowing());
      }
      groupDetailsMenuItem.setText(
          simpleMembershipUpdateContainer.getText().getAdvancedMenuShowGroupDetails());
      groupDetailsMenuItem.setTooltip(
          simpleMembershipUpdateContainer.getText().getAdvancedMenuShowGroupDetailsTooltip());
      dhtmlxMenu.addDhtmlxItem(groupDetailsMenuItem);
    }

    {
      DhtmlxMenuItem memberFilterMenuItem = new DhtmlxMenuItem();
      memberFilterMenuItem.setId("showMemberFilter");
      memberFilterMenuItem.setType("checkbox");
      if (showMemberFilter.isShowing()) {
        memberFilterMenuItem.setChecked(showMemberFilter.isShowing());
      }
      memberFilterMenuItem.setText(
          simpleMembershipUpdateContainer.getText().getAdvancedMenuShowMemberFilter());
      memberFilterMenuItem.setTooltip(
          simpleMembershipUpdateContainer.getText().getAdvancedMenuShowMemberFilterTooltip());
      dhtmlxMenu.addDhtmlxItem(memberFilterMenuItem);
    }

    DhtmlxMenuItem importExportMenuItem = new DhtmlxMenuItem();
    importExportMenuItem.setId("importExport");
    importExportMenuItem.setText(
        simpleMembershipUpdateContainer.getText().getAdvancedMenuImportExport());
    importExportMenuItem.setTooltip(
        simpleMembershipUpdateContainer.getText().getAdvancedMenuImportExportTooltip());
    dhtmlxMenu.addDhtmlxItem(importExportMenuItem);

    DhtmlxMenuItem exportMenuItem = new DhtmlxMenuItem();
    exportMenuItem.setId("export");
    exportMenuItem.setText(simpleMembershipUpdateContainer.getText().getAdvancedMenuExport());
    exportMenuItem.setTooltip(
        simpleMembershipUpdateContainer.getText().getAdvancedMenuExportTooltip());
    importExportMenuItem.addDhtmlxItem(exportMenuItem);

    {
      DhtmlxMenuItem exportSubjectIdsMenuItem = new DhtmlxMenuItem();
      exportSubjectIdsMenuItem.setId("exportSubjectIds");
      exportSubjectIdsMenuItem.setText(
          simpleMembershipUpdateContainer.getText().getAdvancedMenuExportSubjectIds());
      exportSubjectIdsMenuItem.setTooltip(
          simpleMembershipUpdateContainer.getText().getAdvancedMenuExportSubjectIdsTooltip());
      exportMenuItem.addDhtmlxItem(exportSubjectIdsMenuItem);
    }

    {
      DhtmlxMenuItem exportAllMenuItem = new DhtmlxMenuItem();
      exportAllMenuItem.setId("exportAll");
      exportAllMenuItem.setText(
          simpleMembershipUpdateContainer.getText().getAdvancedMenuExportAll());
      exportAllMenuItem.setTooltip(
          simpleMembershipUpdateContainer.getText().getAdvancedMenuExportAllTooltip());
      exportMenuItem.addDhtmlxItem(exportAllMenuItem);
    }

    {
      DhtmlxMenuItem importMenuItem = new DhtmlxMenuItem();
      importMenuItem.setId("import");
      importMenuItem.setText(simpleMembershipUpdateContainer.getText().getAdvancedMenuImport());
      importMenuItem.setTooltip(
          simpleMembershipUpdateContainer.getText().getAdvancedMenuImportTooltip());
      importExportMenuItem.addDhtmlxItem(importMenuItem);
    }

    GrouperUiUtils.printToScreen(
        "<?xml version=\"1.0\"?>\n" + dhtmlxMenu.toXml(), HttpContentType.TEXT_XML, false, false);
    throw new ControllerDone();
  }