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); } }
protected int[] getResultFields() throws Exception { return m_isAgent ? Tcs.Mls.TCSStandardResultFields.getAgentRosterResultFields() : Tcs.Mls.TCSStandardResultFields.getOfficeRosterResultFields(); }