Пример #1
0
 public void toXml() throws Exception {
   XmlWriter w = m_board.getMLSSystem().getSystemXmlWriter();
   String elementName1 =
       m_isAgent ? MC.AGENT_ROSTER_METADATA_RESULT_TABLE : MC.OFFICE_ROSTER_METADATA_RESULT_TABLE;
   String elementName2 = m_isAgent ? MC.AGENT_ROSTER_RESULT_TABLE : MC.OFFICE_ROSTER_RESULT_TABLE;
   w.writeStartElement(elementName1);
   w.writeStartElement(elementName2);
   for (DataAggResultFieldType value : m_resultFieldTypeDict.values()) {
     w.WriteStartElement(MC.RESULT_FIELD);
     // w.WriteAttributeString(MC.NAME, value.ReferenceName);
     w.WriteElementString(MC.NAME, value.getSystemName());
     w.WriteElementString(MC.DISPLAY_NAME, value.getDisplayName());
     // w.WriteElementString(MC.STANDARD_NAME, value.StandardName);
     w.WriteElementString(MC.DATA_TYPE_ID, value.getDataTypeID());
     w.WriteElementString(MC.DATA_TYPE_DESCRIPTION, value.getDataTypeDescription());
     w.WriteElementString(MC.STANDARD, value.getIsStandard());
     w.WriteElementString(MC.DISPLAY_RULE, value.getDisplayRule());
     w.WriteElementString(MC.RETS_LONG_NAME, value.getRetsLongName());
     // w.WriteElementString(MC.VISIBLE_FLAG, value.VisibleFlag);
     w.writeEndElement();
   }
   w.writeEndElement();
   w.writeEndElement();
 }
Пример #2
0
  private String addToResultTable(DataAggResultFieldType resultFieldType) throws Exception {
    String result = "";
    String keyName = resultFieldType.getReferenceName();
    boolean bFound = false;
    try {
      if (m_resultFieldTypeDict.containsKey(keyName)) {
        DataAggResultFieldType existedType = m_resultFieldTypeDict.get(keyName);
        if (StringSupport.isNullOrEmpty(existedType.getDisplayName())
            && !StringSupport.isNullOrEmpty(resultFieldType.getDisplayName()))
          existedType.setDisplayName(resultFieldType.getDisplayName());

        return keyName;
      }

      m_resultFieldTypeDict.put(keyName, resultFieldType);
    } catch (ArgumentNullException exc) {
      System.out.println("Key is null");
    } catch (ArgumentException exc) {
      System.out.println("Key is already existed");
    }

    return keyName;
    ;
  }
Пример #3
0
  public void populateData() throws Exception {
    int groupSize = 1;
    // m_mlsEngine.getPropertyFieldGroups().Length;
    MLSCmaFields mlsCmaFields = m_engine.getCmaFields();
    String caption = "";
    String displayName = "";
    String typeID = "2";
    String displayRule = "";
    int[] resultFiled = getResultFields();
    for (int x = 0; x < resultFiled.length; x++) {
      CmaField cmaField = mlsCmaFields.getStdField(resultFiled[x]);
      if (cmaField != null) {
        if (resultFiled[x] != Tcs.Mls.TCSStandardResultFields.STDF_DEFTYPE_NODEFNAME)
          caption = cmaField.getCaption();
        else caption = "DEF type";
        displayName = cmaField.getDisplayName();
        if (StringSupport.isNullOrEmpty(displayName)) {
          displayName = Tcs.Mls.TCSStandardResultFields.getXmlName(resultFiled[x]);
          if (resultFiled[x] == Tcs.Mls.TCSStandardResultFields.STDF_STDFLASTMOD) {
            displayName = "Last Modified Date Time";
          }
        }

        if (StringSupport.isNullOrEmpty(displayName)) displayName = StringSupport.Trim(caption);

        typeID = String.valueOf(cmaField.type);
        displayRule = cmaField.getDisplayRule();
        if (StringSupport.isNullOrEmpty(displayRule)) {
          displayRule = Tcs.Mls.TCSStandardResultFields.getDisplayRule(resultFiled[x]);
          if (resultFiled[x] == Tcs.Mls.TCSStandardResultFields.STDF_STDFLASTMOD
              || resultFiled[x] == Tcs.Mls.TCSStandardResultFields.STDF_STDFSTATUSDATE)
            displayRule = "5";
        }

        if (StringSupport.isNullOrEmpty(displayRule)) displayRule = "4";

      } else {
        displayName = Tcs.Mls.TCSStandardResultFields.getXmlName(resultFiled[x]);
        typeID =
            String.valueOf(
                PropertyClass.getDataTypeID(
                    Tcs.Mls.TCSStandardResultFields.getDataType(resultFiled[x])));
        displayRule = Tcs.Mls.TCSStandardResultFields.getDisplayRule(resultFiled[x]);
        if (resultFiled[x] == Tcs.Mls.TCSStandardResultFields.STDF_STDFLASTMOD) {
          displayRule = "5";
          displayName = "Last Modified Date Time";
        }

        if (resultFiled[x] == Tcs.Mls.TCSStandardResultFields.STDF_STDFSTATUSDATE) {
          displayRule = "5";
        }
      }
      if (resultFiled[x] == Tcs.Mls.TCSStandardResultFields.STDF_STDFLASTMOD) {
        typeID = "7";
      }

      if (resultFiled[x] == Tcs.Mls.TCSStandardResultFields.STDF_STDFSTATUSDATE) {
        typeID = "3";
      }

      DataAggResultFieldType resultFieldType = new DataAggResultFieldType();
      resultFieldType.setSystemName(Tcs.Mls.TCSStandardResultFields.getXmlName(resultFiled[x]));
      resultFieldType.setReferenceName(resultFieldType.getSystemName().toUpperCase());
      resultFieldType.setDisplayName(displayName);
      resultFieldType.setDataTypeID(typeID);
      resultFieldType.setDataTypeDescription(
          PropertyClass.getDataTypeDescription(Integer.valueOf(typeID)));
      // if (x != TCSStandardResultFields.STDF_CMAFEATURE && x !=
      // TCSStandardResultFields.STDF_STDFROOMDIM)
      resultFieldType.setIsStandard("1");
      // else
      //    resultFieldType.IsStandard = "0";
      // resultFieldType.VisibleFlag = caption.Length == 0 ? "N" : "Y";
      resultFieldType.setDisplayRule(displayRule);
      resultFieldType.setRetsLongName(((cmaField != null) ? cmaField.retsLongName : ""));
      addToResultTable(resultFieldType);
    }
  }