コード例 #1
0
  private void populateHandlersTable(Set handlers) {
    tablePopulated = true;
    CCActionTableModel tblModel =
        (CCActionTableModel)
            propertySheetModel.getModel(WSAuthNServicesModelImpl.ATTRIBUTE_NAME_HANDLERS);
    tblModel.clearAll();
    boolean firstEntry = true;
    int counter = 0;

    for (Iterator iter = handlers.iterator(); iter.hasNext(); ) {
      String c = (String) iter.next();
      WSAuthHandlerEntry entry = new WSAuthHandlerEntry(c);

      if (entry.isValid()) {
        if (!firstEntry) {
          tblModel.appendRow();
        } else {
          firstEntry = false;
        }

        tblModel.setValue(TBL_HANDLERS_DATA_KEY, entry.strKey);
        tblModel.setValue(TBL_HANDLERS_DATA_CLASS, entry.strClass);
        tblModel.setValue(TBL_HANDLERS_HREF_ACTION, Integer.toString(counter));
      }
      counter++;
    }

    setPageSessionAttribute(
        WSAuthNServicesModelImpl.ATTRIBUTE_NAME_HANDLERS, (OrderedSet) handlers);
  }
コード例 #2
0
  private void populateTableModel(List subconfig) {
    CCActionTable tbl = (CCActionTable) getChild(AMPropertySheetModel.TBL_SUB_CONFIG);
    CCActionTableModel tblModel = (CCActionTableModel) tbl.getModel();
    tblModel.clearAll();

    if (subconfig != null) {
      SerializedField szCache = (SerializedField) getChild(SZ_CACHE);
      List cache = new ArrayList(subconfig.size());

      if (!subconfig.isEmpty()) {
        tblModel.clearAll();
        boolean firstEntry = true;

        for (Iterator iter = subconfig.iterator(); iter.hasNext(); ) {
          if (firstEntry) {
            firstEntry = false;
          } else {
            tblModel.appendRow();
          }
          SMSubConfig conf = (SMSubConfig) iter.next();
          tblModel.setValue(AMPropertySheetModel.TBL_SUB_CONFIG_DATA_NAME, conf.getName());
          tblModel.setValue(AMPropertySheetModel.TBL_SUB_CONFIG_HREF_NAME, conf.getName());
          tblModel.setValue(AMPropertySheetModel.TBL_SUB_CONFIG_DATA_TYPE, conf.getType());
          cache.add(conf);
        }
      }
      szCache.setValue((ArrayList) cache);
    }
  }
コード例 #3
0
  private void populateTableModel(List<SMSubConfig> subConfigs) {
    CCActionTable tbl = (CCActionTable) getChild(TBL_SUB_CONFIG);
    CCActionTableModel tblModel = (CCActionTableModel) tbl.getModel();
    tblModel.clearAll();

    if (CollectionUtils.isEmpty(subConfigs)) {
      return;
    }
    SerializedField szCache = (SerializedField) getChild(SZ_CACHE);
    List<SMSubConfig> cache = new ArrayList<>(subConfigs.size());
    boolean firstEntry = true;

    for (SMSubConfig conf : subConfigs) {
      if (firstEntry) {
        firstEntry = false;
      } else {
        tblModel.appendRow();
      }
      tblModel.setValue(TBL_SUB_CONFIG_DATA_NAME, conf.getName());
      tblModel.setValue(TBL_SUB_CONFIG_HREF_NAME, conf.getName());
      tblModel.setValue(TBL_SUB_CONFIG_DATA_TYPE, conf.getType());
      cache.add(conf);
    }
    szCache.setValue(cache);
  }
コード例 #4
0
  private void populateRequestHandlerListTable(Set handlers) {
    tablePopulated = true;
    CCActionTableModel tblModel =
        (CCActionTableModel)
            propertySheetModel.getModel(
                SCSAML2SOAPBindingModelImpl.ATTRIBUTE_NAME_REQUEST_HANDLER_LIST);

    tblModel.clearAll();
    boolean firstEntry = true;
    int counter = 0;

    for (Iterator iter = handlers.iterator(); iter.hasNext(); ) {
      String c = (String) iter.next();
      SAML2SOAPBindingRequestHandler entry = new SAML2SOAPBindingRequestHandler(c);

      if (entry.isValid()) {
        if (!firstEntry) {
          tblModel.appendRow();
        } else {
          firstEntry = false;
        }

        tblModel.setValue(TBL_REQUEST_HANDLER_LIST_DATA_KEY, entry.strKey);
        tblModel.setValue(TBL_REQUEST_HANDLER_LIST_DATA_CLASS, entry.strClass);
        tblModel.setValue(TBL_REQUEST_HANDLER_LIST_HREF_EDIT_ACTION, Integer.toString(counter));
        tblModel.setValue(
            TBL_REQUEST_HANDLER_LIST_LABEL_EDIT_ACTION,
            "soapBinding.service.table.requestHandlerList.action.edit.label");
        tblModel.setValue(TBL_REQUEST_HANDLER_LIST_HREF_DUP_ACTION, Integer.toString(counter));
        tblModel.setValue(
            TBL_REQUEST_HANDLER_LIST_LABEL_DUP_ACTION,
            "soapBinding.service.table.requestHandlerList.action.dup.label");
      }
      counter++;
    }

    setPageSessionAttribute(
        SCSAML2SOAPBindingModelImpl.ATTRIBUTE_NAME_REQUEST_HANDLER_LIST, (OrderedSet) handlers);
  }
コード例 #5
0
  private void populateTableModel(Set properties) {
    tblModel.clearAll();
    ServerSiteModel model = (ServerSiteModel) getModel();

    if ((properties == null) || properties.isEmpty()) {
      properties = new HashSet(2);
      properties.add("=");
    }

    int counter = 0;
    for (Iterator iter = properties.iterator(); iter.hasNext(); counter++) {
      if (counter > 0) {
        tblModel.appendRow();
      }
      String t = (String) iter.next();
      int idx = t.indexOf('=');
      String name = t.substring(0, idx).trim();
      String value = t.substring(idx + 1).trim();

      tblModel.setValue(TBL_DATA_NAME, name);
      tblModel.setValue(TBL_DATA_VALUE, value);
      tblModel.setSelectionVisible(counter, true);
    }
  }
コード例 #6
0
  public void populateVersionTable() throws SamFSException {
    CCActionTableModel model = getTableModel(VERSION_TABLE);
    model.clear();

    HttpSession session = RequestManager.getRequestContext().getRequest().getSession();
    HashMap myHashMap =
        (HashMap) session.getAttribute(Constants.SessionAttributes.VERSION_HIGHLIGHT);

    if (myHashMap == null) {
      // Start parsing the XML file

      try {
        SAXHandler.parseIt();
      } catch (SamFSException ex) {
        // Failed to parse version highlight XML file
        SamUtil.setErrorAlert(
            getParentViewBean(),
            ServerCommonViewBeanBase.CHILD_COMMON_ALERT,
            "VersionHighlight.error",
            ex.getSAMerrno(),
            ex.getMessage(),
            "");
        return;
      }

      // Retrieve the HashMap after parsing the XML file
      myHashMap = SAXHandler.getHashMap();

      // Save hashMap into Session
      session.setAttribute(Constants.SessionAttributes.VERSION_HIGHLIGHT, myHashMap);
    }

    for (int i = 0; i < myHashMap.size(); i++) {
      if (i > 0) {
        model.appendRow();
      }

      HighlightInfo highlightInfo = (HighlightInfo) myHashMap.get(new Integer(i));

      String featureType = highlightInfo.getFeatureType();
      featureType = featureType == null ? "" : featureType;

      // pre-populate blank images into the model,
      // overwrite them later if necessary
      model.setValue("FirstImage", Constants.Image.ICON_BLANK);
      model.setValue("SecondImage", Constants.Image.ICON_BLANK);
      model.setValue("ThirdImage", Constants.Image.ICON_BLANK);
      model.setValue("SupportText", "");

      // populate the feature name
      if (featureType.equals("summary")) {
        model.setValue(
            "NameText",
            new NonSyncStringBuffer("<b>")
                .append(SamUtil.getResourceString(highlightInfo.getFeatureName()))
                .append("</b>")
                .toString());
      } else {
        String heading = "---- ";
        if (featureType.equals("detail")) {
          heading = "-- ";
        }
        model.setValue(
            "NameText",
            new NonSyncStringBuffer(heading)
                .append(SamUtil.getResourceString(highlightInfo.getFeatureName()))
                .toString());
        model.setValue("SupportText", highlightInfo.getServerVersion());

        String[] versionInfoArray = highlightInfo.getVersionInfo().split("###");

        for (int j = 0; j < versionInfoArray.length; j++) {
          String[] versionInfo = versionInfoArray[j].split(",");

          if (versionInfo[0].equals("version.highlight.versionnumber.50")) {
            model.setValue("FirstImage", getImage(versionInfo[1]));
          } else if (versionInfo[0].equals("version.highlight.versionnumber.46")) {
            model.setValue("SecondImage", getImage(versionInfo[1]));
            model.setValue("FirstImage", Constants.Image.ICON_AVAILABLE);
          } else if (versionInfo[0].equals("version.highlight.versionnumber.45")) {
            model.setValue("ThirdImage", getImage(versionInfo[1]));
            model.setValue("FirstImage", Constants.Image.ICON_AVAILABLE);
            model.setValue("SecondImage", Constants.Image.ICON_AVAILABLE);
          } else {
            model.setValue("ThirdImage", Constants.Image.ICON_AVAILABLE);
            model.setValue("FirstImage", Constants.Image.ICON_AVAILABLE);
            model.setValue("SecondImage", Constants.Image.ICON_AVAILABLE);
          }
        }
      }
    }
  }