private void createPropertyModel() {
   try {
     String schemaName =
         (String) getPageSessionAttribute(AMServiceProfile.PG_SESSION_SUB_SCHEMA_NAME);
     SubConfigModel model = (SubConfigModel) getModel();
     propertySheetModel = new AMPropertySheetModel(model.getAddConfigPropertyXML(schemaName));
     propertySheetModel.clear();
   } catch (AMConsoleException e) {
     setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
   }
 }
  /**
   * Handles next button request.
   *
   * @param event Request invocation event.
   */
  public void handleButton1Request(RequestInvocationEvent event) throws ModelControlException {
    submitCycle = true;
    String subConfigName = (String) getDisplayFieldValue(ATTR_SUBCONFIG_NAME);
    SubConfigModel model = (SubConfigModel) getModel();

    try {
      AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTY_ATTRIBUTE);
      String schemaName =
          (String) getPageSessionAttribute(AMServiceProfile.PG_SESSION_SUB_SCHEMA_NAME);
      Map values = ps.getAttributeValues(model.getAttributeNames(schemaName));
      model.createSubConfig(subConfigName, schemaName, values);
      backToProfileViewBean();
    } catch (AMConsoleException e) {
      setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
      forwardTo();
    }
  }
  public void beginDisplay(DisplayEvent event) throws ModelControlException {
    super.beginDisplay(event);

    SubSchemaModel model = (SubSchemaModel) getModel();
    if (model.hasGlobalSubSchema()) {
      if (!submitCycle) {
        populateTableModel(model.getSubConfigurations());
      }
      resetButtonState(AMPropertySheetModel.TBL_SUB_CONFIG_BUTTON_DELETE);

      Map createable = model.getCreateableSubSchemaNames();
      if (createable.isEmpty()) {
        resetButtonState(AMPropertySheetModel.TBL_SUB_CONFIG_BUTTON_ADD);
      } else {
        SubConfigModel scModel = getSubConfigModel();
        boolean canCreate = false;
        for (Iterator i = createable.keySet().iterator(); i.hasNext() && !canCreate; ) {
          String name = (String) i.next();
          String plugin = scModel.getSelectableSubConfigNamesPlugin(name);
          if (plugin == null) {
            canCreate = true;
          } else {
            Set subconfigNames = scModel.getSelectableConfigNames(name);
            canCreate = (subconfigNames != null) && !subconfigNames.isEmpty();
          }
        }
        disableButton(AMPropertySheetModel.TBL_SUB_CONFIG_BUTTON_ADD, !canCreate);
      }
    }
    if (serviceName.equals("iPlanetAMAuthHTTPBasicService")) {
      CCRadioButton radio =
          (CCRadioButton) getChild("iplanet-am-auth-http-basic-module-configured");
      if ((radio.getValue() == null) || (radio.getValue().equals(""))) {
        String defaultModule = new String();
        String realmName = SMSEntry.getRootSuffix();
        if (realmName != null) {
          List moduleList = AMAuthUtils.getModuleInstancesForHttpBasic(realmName);
          if (!moduleList.isEmpty()) {
            defaultModule = (String) moduleList.get(0);
            radio.setValue(defaultModule);
          }
        }
      }
    }
  }
  public void beginDisplay(DisplayEvent event) throws ModelControlException {
    super.beginDisplay(event);
    SubConfigModel model = (SubConfigModel) getModel();
    String schemaName =
        (String) getPageSessionAttribute(AMServiceProfile.PG_SESSION_SUB_SCHEMA_NAME);

    if (!submitCycle) {
      AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTY_ATTRIBUTE);
      propertySheetModel.clear();

      try {
        ps.setAttributeValues(model.getServiceSchemaDefaultValues(schemaName), model);
      } catch (AMConsoleException a) {
        setInlineAlertMessage(CCAlert.TYPE_WARNING, "message.warning", "noproperties.message");
      }
    }

    Set subconfigNames = model.getSelectableConfigNames(schemaName);
    if ((subconfigNames != null) && !subconfigNames.isEmpty()) {
      CCDropDownMenu menu = (CCDropDownMenu) getChild(ATTR_SUBCONFIG_NAME);
      OptionList optList = this.createOptionList(subconfigNames);
      menu.setOptions(optList);
    }
  }