// ============================================================ // <T>保存对照表。</T> // // @param map 对照表 // ============================================================ @Override public void saveMap(Map<String, String> map) { super.saveMap(map); map.put("ouid", RLong.toString(_ouid)); map.put("ovld", RBoolean.toString(_ovld)); map.put("guid", _guid); map.put("linkParentId", RLong.toString(_linkParentId)); map.put("linkId", RLong.toString(_linkId)); map.put("code", _code); map.put("name", _name); map.put("label", _label); map.put("departmentId", RInteger.toString(_departmentId)); map.put("departmentLabel", _departmentLabel); map.put("regionId", RInteger.toString(_regionId)); map.put("regionLabel", _regionLabel); map.put("level", RInteger.toString(_level)); map.put("leaderId", RLong.toString(_leaderId)); map.put("leaderLabel", _leaderLabel); map.put("leaderPhone", _leaderPhone); map.put("provinceId", RInteger.toString(_provinceId)); map.put("provinceLabel", _provinceLabel); map.put("cityId", RInteger.toString(_cityId)); map.put("cityLabel", _cityLabel); map.put("detailAddress", _detailAddress); map.put("locationLongitude", RDouble.toString(_locationLongitude)); map.put("locationLatitude", RDouble.toString(_locationLatitude)); map.put("departmentPhone", _departmentPhone); map.put("buildDate", _buildDate.format("YYYY-MM-DD HH24:MI:SS")); map.put("note", _note); map.put("createUserId", RLong.toString(_createUserId)); map.put("createDate", _createDate.format("YYYY-MM-DD HH24:MI:SS")); map.put("updateUserId", RLong.toString(_updateUserId)); map.put("updateDate", _updateDate.format("YYYY-MM-DD HH24:MI:SS")); }
// ============================================================ // <T>根据名称获得内容。</T> // // @param name 名称 // @return 内容 // ============================================================ @Override public String get(String name) { switch (name) { case "ouid": return Long.toString(_ouid); case "ovld": return RBoolean.toString(_ovld); case "guid": return _guid; case "user_id": return Long.toString(_userId); case "project_id": return Long.toString(_projectId); case "resource_id": return Long.toString(_resourceId); case "code": return _code; case "label": return _label; case "content": return _content; case "note": return _note; case "create_user_id": return Long.toString(_createUserId); case "create_date": return _createDate.toString(); case "update_user_id": return Long.toString(_updateUserId); case "update_date": return _updateDate.toString(); } return null; }
// ============================================================ // <T>加载行记录。</T> // // @param row 行记录 // ============================================================ @Override public void load(FRow row) { super.load(row); for (IStringPair pair : row) { // 获得名称 String name = pair.name(); if (RString.isEmpty(name)) { throw new FFatalError("Row format is invalid. (row={1})", row.dump()); } // 获得内容 String value = pair.value(); // 设置内容 switch (name) { case "ouid": __ouid = RLong.parse(value); _ouid = __ouid; break; case "ovld": __ovld = RBoolean.parse(value); _ovld = __ovld; break; case "guid": __guid = value; _guid = __guid; break; case "member_id": __memberId = RLong.parse(value); _memberId = __memberId; break; case "product_code": __productCode = value; _productCode = __productCode; break; case "time_section": __timeSection = value; _timeSection = __timeSection; break; case "pv": __pv = RInteger.parse(value); _pv = __pv; break; case "create_user_id": __createUserId = RLong.parse(value); _createUserId = __createUserId; break; case "create_date": __createDate.parse(value); _createDate.assign(__createDate); break; case "update_user_id": __updateUserId = RLong.parse(value); _updateUserId = __updateUserId; break; case "update_date": __updateDate.parse(value); _updateDate.assign(__updateDate); break; } } }
// ============================================================ // <T>根据名称获得内容。</T> // // @param name 名称 // @return 内容 // ============================================================ @Override public String get(String name) { switch (name) { case "ouid": return Long.toString(_ouid); case "ovld": return RBoolean.toString(_ovld); case "guid": return _guid; case "member_id": return Long.toString(_memberId); case "product_code": return _productCode; case "time_section": return _timeSection; case "pv": return RInteger.toString(_pv); case "create_user_id": return Long.toString(_createUserId); case "create_date": return _createDate.toString(); case "update_user_id": return Long.toString(_updateUserId); case "update_date": return _updateDate.toString(); } return null; }
// ============================================================ // <T>保存对照表。</T> // // @param map 对照表 // ============================================================ @Override public void saveMap(Map<String, String> map) { super.saveMap(map); map.put("ouid", RLong.toString(_ouid)); map.put("ovld", RBoolean.toString(_ovld)); map.put("guid", _guid); map.put("memberId", RLong.toString(_memberId)); map.put("productCode", _productCode); map.put("timeSection", _timeSection); map.put("pv", RInteger.toString(_pv)); map.put("createUserId", RLong.toString(_createUserId)); map.put("createDate", _createDate.format("YYYY-MM-DD HH24:MI:SS")); map.put("updateUserId", RLong.toString(_updateUserId)); map.put("updateDate", _updateDate.format("YYYY-MM-DD HH24:MI:SS")); }
// ============================================================ // <T>根据名称设置内容。</T> // // @param name 名称 // @param value 内容 // ============================================================ @Override public void set(String name, String value) { switch (name) { case "ouid": _ouid = RLong.parse(value); break; case "ovld": _ovld = RBoolean.parse(value); break; case "guid": _guid = value; break; case "user_id": _userId = RLong.parse(value); break; case "project_id": _projectId = RLong.parse(value); break; case "resource_id": _resourceId = RLong.parse(value); break; case "code": _code = value; break; case "label": _label = value; break; case "content": _content = value; break; case "note": _note = value; break; case "create_user_id": _createUserId = RLong.parse(value); break; case "create_date": _createDate.parse(value); break; case "update_user_id": _updateUserId = RLong.parse(value); break; case "update_date": _updateDate.parse(value); break; } }
// ============================================================ // <T>保存对照表。</T> // // @param map 对照表 // ============================================================ @Override public void saveMap(Map<String, String> map) { super.saveMap(map); map.put("ouid", RLong.toString(_ouid)); map.put("ovld", RBoolean.toString(_ovld)); map.put("guid", _guid); map.put("userId", RLong.toString(_userId)); map.put("projectId", RLong.toString(_projectId)); map.put("resourceId", RLong.toString(_resourceId)); map.put("code", _code); map.put("label", _label); map.put("content", _content); map.put("note", _note); map.put("createUserId", RLong.toString(_createUserId)); map.put("createDate", _createDate.format("YYYY-MM-DD HH24:MI:SS")); map.put("updateUserId", RLong.toString(_updateUserId)); map.put("updateDate", _updateDate.format("YYYY-MM-DD HH24:MI:SS")); }
@Override public void loadDefine(IWebContext context, IWebInput input, IWebOutput output) { FXmlNode configNode = input.config().findNode("WebTree"); String name = configNode.get("name"); String permission = input.get("permission"); IWebTreeConsole console = RAop.find(IWebTreeConsole.class); FXmlNode config = null; if (RBoolean.parse(permission)) { String userId = context.session().user().userId(); config = console.buildSimpleWithPermission(name, userId); } else { config = console.buildSimple(name); config.set("ID", name); } if (null != config) { output.config().assign(config); } }
// ============================================================ // <T>内部设置内容置信息。</T> // // @param name 名称 // @param value 内容 // ============================================================ public void innerSet(String name, String value) { if (RString.isEmpty(name)) { return; } else if (PTY_NAME.equalsIgnoreCase(name)) { setName(value); } else if (PTY_LABEL.equalsIgnoreCase(name)) { setLabel(value); } else if (PTY_IS_VALID.equalsIgnoreCase(name)) { setIsValid(RBoolean.parse(value)); } else if (PTY_NOTE.equalsIgnoreCase(name)) { setNote(value); } else if (PTY_FONT.equalsIgnoreCase(name)) { setFont(value); } else if (PTY_FONTSIZE.equalsIgnoreCase(name)) { setFontsize(value); } else if (PTY_FONTCOLOR.equalsIgnoreCase(name)) { setFontcolor(value); } }
// ============================================================ // <T>内部获得内容置信息。</T> // // @param name 名称 // @return 内容 // ============================================================ public String innerGet(String name) { if (RString.isEmpty(name)) { return null; } else if (PTY_NAME.equalsIgnoreCase(name)) { return getName(); } else if (PTY_LABEL.equalsIgnoreCase(name)) { return getLabel(); } else if (PTY_IS_VALID.equalsIgnoreCase(name)) { return RBoolean.toString(getIsValid()); } else if (PTY_NOTE.equalsIgnoreCase(name)) { return getNote(); } else if (PTY_FONT.equalsIgnoreCase(name)) { return getFont(); } else if (PTY_FONTSIZE.equalsIgnoreCase(name)) { return getFontsize(); } else if (PTY_FONTCOLOR.equalsIgnoreCase(name)) { return getFontcolor(); } return null; }
// ============================================================ // <T>根据名称设置内容。</T> // // @param name 名称 // @param value 内容 // ============================================================ @Override public void set(String name, String value) { switch (name) { case "ouid": _ouid = RLong.parse(value); break; case "ovld": _ovld = RBoolean.parse(value); break; case "guid": _guid = value; break; case "member_id": _memberId = RLong.parse(value); break; case "product_code": _productCode = value; break; case "time_section": _timeSection = value; break; case "pv": _pv = RInteger.parse(value); break; case "create_user_id": _createUserId = RLong.parse(value); break; case "create_date": _createDate.parse(value); break; case "update_user_id": _updateUserId = RLong.parse(value); break; case "update_date": _updateDate.parse(value); break; } }
// ============================================================ // <T>加载设置信息。</T> // // @param config 设置信息 // @param type 类型 // ============================================================ public void loadConfig(FXmlNode config, EXmlConfig type) { super.loadConfig(config, type); if (EXmlConfig.Full == type) { if (config.contains("name")) { setName(config.get(PTY_NAME)); } if (config.contains("alias")) { setAlias(config.get(PTY_ALIAS)); } if (config.contains("label")) { _label.unpack(config.get(PTY_LABEL)); } if (config.contains("is_valid")) { setIsValid(RBoolean.parse(config.get(PTY_IS_VALID))); } if (config.contains("attributes")) { setAttributes(config.get(PTY_ATTRIBUTES)); } if (config.contains("note")) { _note.unpack(config.get(PTY_NOTE)); } if (config.contains("access_query")) { setAccessQuery(config.get(PTY_ACCESS_QUERY)); } if (config.contains("access_insert")) { setAccessInsert(RBoolean.parse(config.get(PTY_ACCESS_INSERT))); } if (config.contains("access_update")) { setAccessUpdate(RBoolean.parse(config.get(PTY_ACCESS_UPDATE))); } if (config.contains("access_delete")) { setAccessDelete(RBoolean.parse(config.get(PTY_ACCESS_DELETE))); } if (config.contains("is_key")) { setIsKey(RBoolean.parse(config.get(PTY_IS_KEY))); } if (config.contains("is_null")) { setIsNull(RBoolean.parse(config.get(PTY_IS_NULL))); } if (config.contains("is_unique")) { setIsUnique(RBoolean.parse(config.get(PTY_IS_UNIQUE))); } if (config.contains("is_store")) { setIsStore(config.get(PTY_IS_STORE)); } if (config.contains("is_abstract")) { setIsAbstract(config.get(PTY_IS_ABSTRACT)); } if (config.contains("is_encrypt")) { setIsEncrypt(config.get(PTY_IS_ENCRYPT)); } if (config.contains("data_name")) { setDataName(config.get(PTY_DATA_NAME)); } if (config.contains("data_format")) { setDataFormat(config.get(PTY_DATA_FORMAT)); } if (config.contains("data_alias")) { setDataAlias(config.get(PTY_DATA_ALIAS)); } if (config.contains("data_type")) { setDataType(config.get(PTY_DATA_TYPE)); } if (config.contains("data_size")) { setDataSize(config.get(PTY_DATA_SIZE)); } if (config.contains("data_refer")) { setDataRefer(config.get(PTY_DATA_REFER)); } if (config.contains("data_code")) { setDataCode(config.get(PTY_DATA_CODE)); } if (config.contains("data_uniques")) { setDataUniques(config.get(PTY_DATA_UNIQUES)); } if (config.contains("group")) { setGroup(config.get(PTY_GROUP)); } if (config.contains("data_default")) { setDataDefault(config.get(PTY_DATA_DEFAULT)); } if (config.contains("data_insert")) { setDataInsert(config.get(PTY_DATA_INSERT)); } if (config.contains("data_update")) { setDataUpdate(config.get(PTY_DATA_UPDATE)); } if (config.contains("index_names")) { setIndexNames(config.get(PTY_INDEX_NAMES)); } } else if (EXmlConfig.Simple == type) { if (config.contains("name")) { setName(config.get(PTY_NAME)); } if (config.contains("alias")) { setAlias(config.get(PTY_ALIAS)); } if (config.contains("label")) { setLabel(config.get(PTY_LABEL)); } if (config.contains("is_valid")) { setIsValid(RBoolean.parse(config.get(PTY_IS_VALID))); } if (config.contains("attributes")) { setAttributes(config.get(PTY_ATTRIBUTES)); } if (config.contains("note")) { setNote(config.get(PTY_NOTE)); } if (config.contains("access_query")) { setAccessQuery(config.get(PTY_ACCESS_QUERY)); } if (config.contains("access_insert")) { setAccessInsert(RBoolean.parse(config.get(PTY_ACCESS_INSERT))); } if (config.contains("access_update")) { setAccessUpdate(RBoolean.parse(config.get(PTY_ACCESS_UPDATE))); } if (config.contains("access_delete")) { setAccessDelete(RBoolean.parse(config.get(PTY_ACCESS_DELETE))); } if (config.contains("is_key")) { setIsKey(RBoolean.parse(config.get(PTY_IS_KEY))); } if (config.contains("is_null")) { setIsNull(RBoolean.parse(config.get(PTY_IS_NULL))); } if (config.contains("is_unique")) { setIsUnique(RBoolean.parse(config.get(PTY_IS_UNIQUE))); } if (config.contains("is_store")) { setIsStore(config.get(PTY_IS_STORE)); } if (config.contains("is_abstract")) { setIsAbstract(config.get(PTY_IS_ABSTRACT)); } if (config.contains("is_encrypt")) { setIsEncrypt(config.get(PTY_IS_ENCRYPT)); } if (config.contains("data_name")) { setDataName(config.get(PTY_DATA_NAME)); } if (config.contains("data_format")) { setDataFormat(config.get(PTY_DATA_FORMAT)); } if (config.contains("data_alias")) { setDataAlias(config.get(PTY_DATA_ALIAS)); } if (config.contains("data_type")) { setDataType(config.get(PTY_DATA_TYPE)); } if (config.contains("data_size")) { setDataSize(config.get(PTY_DATA_SIZE)); } if (config.contains("data_refer")) { setDataRefer(config.get(PTY_DATA_REFER)); } if (config.contains("data_code")) { setDataCode(config.get(PTY_DATA_CODE)); } if (config.contains("data_uniques")) { setDataUniques(config.get(PTY_DATA_UNIQUES)); } if (config.contains("group")) { setGroup(config.get(PTY_GROUP)); } if (config.contains("data_default")) { setDataDefault(config.get(PTY_DATA_DEFAULT)); } if (config.contains("data_insert")) { setDataInsert(config.get(PTY_DATA_INSERT)); } if (config.contains("data_update")) { setDataUpdate(config.get(PTY_DATA_UPDATE)); } if (config.contains("index_names")) { setIndexNames(config.get(PTY_INDEX_NAMES)); } } else if (EXmlConfig.Value == type) { if (config.contains("name")) { setName(config.get(PTY_NAME)); } if (config.contains("alias")) { setAlias(config.get(PTY_ALIAS)); } if (config.contains("label")) { setLabel(config.get(PTY_LABEL)); } if (config.contains("is_valid")) { setIsValid(RBoolean.parse(config.get(PTY_IS_VALID))); } if (config.contains("attributes")) { setAttributes(config.get(PTY_ATTRIBUTES)); } if (config.contains("note")) { setNote(config.get(PTY_NOTE)); } if (config.contains("access_query")) { setAccessQuery(config.get(PTY_ACCESS_QUERY)); } if (config.contains("access_insert")) { setAccessInsert(RBoolean.parse(config.get(PTY_ACCESS_INSERT))); } if (config.contains("access_update")) { setAccessUpdate(RBoolean.parse(config.get(PTY_ACCESS_UPDATE))); } if (config.contains("access_delete")) { setAccessDelete(RBoolean.parse(config.get(PTY_ACCESS_DELETE))); } if (config.contains("is_key")) { setIsKey(RBoolean.parse(config.get(PTY_IS_KEY))); } if (config.contains("is_null")) { setIsNull(RBoolean.parse(config.get(PTY_IS_NULL))); } if (config.contains("is_unique")) { setIsUnique(RBoolean.parse(config.get(PTY_IS_UNIQUE))); } if (config.contains("is_store")) { setIsStore(config.get(PTY_IS_STORE)); } if (config.contains("is_abstract")) { setIsAbstract(config.get(PTY_IS_ABSTRACT)); } if (config.contains("is_encrypt")) { setIsEncrypt(config.get(PTY_IS_ENCRYPT)); } if (config.contains("data_name")) { setDataName(config.get(PTY_DATA_NAME)); } if (config.contains("data_format")) { setDataFormat(config.get(PTY_DATA_FORMAT)); } if (config.contains("data_alias")) { setDataAlias(config.get(PTY_DATA_ALIAS)); } if (config.contains("data_type")) { setDataType(config.get(PTY_DATA_TYPE)); } if (config.contains("data_size")) { setDataSize(config.get(PTY_DATA_SIZE)); } if (config.contains("data_refer")) { setDataRefer(config.get(PTY_DATA_REFER)); } if (config.contains("data_code")) { setDataCode(config.get(PTY_DATA_CODE)); } if (config.contains("data_uniques")) { setDataUniques(config.get(PTY_DATA_UNIQUES)); } if (config.contains("group")) { setGroup(config.get(PTY_GROUP)); } if (config.contains("data_default")) { setDataDefault(config.get(PTY_DATA_DEFAULT)); } if (config.contains("data_insert")) { setDataInsert(config.get(PTY_DATA_INSERT)); } if (config.contains("data_update")) { setDataUpdate(config.get(PTY_DATA_UPDATE)); } if (config.contains("index_names")) { setIndexNames(config.get(PTY_INDEX_NAMES)); } } else if (EXmlConfig.Default == type) { if (RString.isEmpty(getDataFormat())) { if (config.contains("data_format")) { setDataFormat(config.get(PTY_DATA_FORMAT)); } } if (RString.isEmpty(getGroup())) { if (config.contains("group")) { setGroup(config.get(PTY_GROUP)); } } if (RString.isEmpty(getDataInsert())) { if (config.contains("data_insert")) { setDataInsert(config.get(PTY_DATA_INSERT)); } } if (RString.isEmpty(getIndexNames())) { if (config.contains("index_names")) { setIndexNames(config.get(PTY_INDEX_NAMES)); } } } }
// ============================================================ // <T>加载行记录。</T> // // @param row 行记录 // ============================================================ @Override public void load(FRow row) { super.load(row); for (IStringPair pair : row) { // 获得名称 String name = pair.name(); if (RString.isEmpty(name)) { throw new FFatalError("Row format is invalid. (row={1})", row.dump()); } // 获得内容 String value = pair.value(); // 设置内容 switch (name) { case "ouid": __ouid = RLong.parse(value); _ouid = __ouid; break; case "ovld": __ovld = RBoolean.parse(value); _ovld = __ovld; break; case "guid": __guid = value; _guid = __guid; break; case "link_parent_id": __linkParentId = RLong.parse(value); _linkParentId = __linkParentId; break; case "link_id": __linkId = RLong.parse(value); _linkId = __linkId; break; case "code": __code = value; _code = __code; break; case "name": __name = value; _name = __name; break; case "label": __label = value; _label = __label; break; case "department_id": __departmentId = RInteger.parse(value); _departmentId = __departmentId; break; case "department_label": __departmentLabel = value; _departmentLabel = __departmentLabel; break; case "region_id": __regionId = RInteger.parse(value); _regionId = __regionId; break; case "region_label": __regionLabel = value; _regionLabel = __regionLabel; break; case "level": __level = RInteger.parse(value); _level = __level; break; case "leader_id": __leaderId = RLong.parse(value); _leaderId = __leaderId; break; case "leader_label": __leaderLabel = value; _leaderLabel = __leaderLabel; break; case "leader_phone": __leaderPhone = value; _leaderPhone = __leaderPhone; break; case "province_id": __provinceId = RInteger.parse(value); _provinceId = __provinceId; break; case "province_label": __provinceLabel = value; _provinceLabel = __provinceLabel; break; case "city_id": __cityId = RInteger.parse(value); _cityId = __cityId; break; case "city_label": __cityLabel = value; _cityLabel = __cityLabel; break; case "detail_address": __detailAddress = value; _detailAddress = __detailAddress; break; case "location_longitude": __locationLongitude = RDouble.parse(value); _locationLongitude = __locationLongitude; break; case "location_latitude": __locationLatitude = RDouble.parse(value); _locationLatitude = __locationLatitude; break; case "department_phone": __departmentPhone = value; _departmentPhone = __departmentPhone; break; case "build_date": __buildDate.parse(value); _buildDate.assign(__buildDate); break; case "note": __note = value; _note = __note; break; case "create_user_id": __createUserId = RLong.parse(value); _createUserId = __createUserId; break; case "create_date": __createDate.parse(value); _createDate.assign(__createDate); break; case "update_user_id": __updateUserId = RLong.parse(value); _updateUserId = __updateUserId; break; case "update_date": __updateDate.parse(value); _updateDate.assign(__updateDate); break; } } }
// ============================================================ // <T>保存设置信息。</T> // // @param config 设置信息 // @param type 类型 // ============================================================ public void saveConfig(FXmlNode config, EXmlConfig type) { config.setName(NAME); super.saveConfig(config, type); if (EXmlConfig.Full == type) { if (RString.isNotEmpty(getName())) { config.set(PTY_NAME, getName()); } String label = _label.pack().toString(); if (RString.isNotEmpty(label)) { config.set(PTY_LABEL, label); } if (RBoolean.parse(getIsValid())) { config.set(PTY_IS_VALID, RBoolean.toString(getIsValid())); } String note = _note.pack().toString(); if (RString.isNotEmpty(note)) { config.set(PTY_NOTE, note); } if (RString.isNotEmpty(getFont())) { config.set(PTY_FONT, getFont()); } if (RString.isNotEmpty(getFontsize())) { config.set(PTY_FONTSIZE, getFontsize()); } if (RString.isNotEmpty(getFontcolor())) { config.set(PTY_FONTCOLOR, getFontcolor()); } } else if (EXmlConfig.Simple == type) { if (RString.isNotEmpty(getName())) { config.set(PTY_NAME, getName()); } if (RString.isNotEmpty(getLabel())) { config.set(PTY_LABEL, getLabel()); } if (RString.isNotEmpty(getNote())) { config.set(PTY_NOTE, getNote()); } if (RString.isNotEmpty(getFont())) { config.set(PTY_FONT, getFont()); } if (RString.isNotEmpty(getFontsize())) { config.set(PTY_FONTSIZE, getFontsize()); } if (RString.isNotEmpty(getFontcolor())) { config.set(PTY_FONTCOLOR, getFontcolor()); } } else if (EXmlConfig.Value == type) { String sName = getName(); if (RString.isNotEmpty(sName)) { config.set(PTY_NAME, sName); } String sLabel = getLabel(); if (RString.isNotEmpty(sLabel)) { config.set(PTY_LABEL, sLabel); } Boolean bIsValid = getIsValid(); if (RBoolean.parse(bIsValid)) { config.set(PTY_IS_VALID, RBoolean.toString(bIsValid)); } String sNote = getNote(); if (RString.isNotEmpty(sNote)) { config.set(PTY_NOTE, sNote); } String sFont = getFont(); if (RString.isNotEmpty(sFont)) { config.set(PTY_FONT, sFont); } String sFontsize = getFontsize(); if (RString.isNotEmpty(sFontsize)) { config.set(PTY_FONTSIZE, sFontsize); } String sFontcolor = getFontcolor(); if (RString.isNotEmpty(sFontcolor)) { config.set(PTY_FONTCOLOR, sFontcolor); } } else if (EXmlConfig.Default == type) { String sFont = getFont(); if (RString.isNotEmpty(sFont)) { config.set(PTY_FONT, sFont); } String sFontsize = getFontsize(); if (RString.isNotEmpty(sFontsize)) { config.set(PTY_FONTSIZE, sFontsize); } String sFontcolor = getFontcolor(); if (RString.isNotEmpty(sFontcolor)) { config.set(PTY_FONTCOLOR, sFontcolor); } } }
// ============================================================ // <T>加载设置信息。</T> // // @param config 设置信息 // @param type 类型 // ============================================================ public void loadConfig(FXmlNode config, EXmlConfig type) { super.loadConfig(config, type); if (EXmlConfig.Full == type) { if (config.contains("name")) { setName(config.get(PTY_NAME)); } if (config.contains("label")) { _label.unpack(config.get(PTY_LABEL)); } if (config.contains("is_valid")) { setIsValid(RBoolean.parse(config.get(PTY_IS_VALID))); } if (config.contains("note")) { _note.unpack(config.get(PTY_NOTE)); } if (config.contains("font")) { setFont(config.get(PTY_FONT)); } if (config.contains("fontsize")) { setFontsize(config.get(PTY_FONTSIZE)); } if (config.contains("fontcolor")) { setFontcolor(config.get(PTY_FONTCOLOR)); } } else if (EXmlConfig.Simple == type) { if (config.contains("name")) { setName(config.get(PTY_NAME)); } if (config.contains("label")) { setLabel(config.get(PTY_LABEL)); } if (config.contains("note")) { setNote(config.get(PTY_NOTE)); } if (config.contains("font")) { setFont(config.get(PTY_FONT)); } if (config.contains("fontsize")) { setFontsize(config.get(PTY_FONTSIZE)); } if (config.contains("fontcolor")) { setFontcolor(config.get(PTY_FONTCOLOR)); } } else if (EXmlConfig.Value == type) { if (config.contains("name")) { setName(config.get(PTY_NAME)); } if (config.contains("label")) { setLabel(config.get(PTY_LABEL)); } if (config.contains("is_valid")) { setIsValid(RBoolean.parse(config.get(PTY_IS_VALID))); } if (config.contains("note")) { setNote(config.get(PTY_NOTE)); } if (config.contains("font")) { setFont(config.get(PTY_FONT)); } if (config.contains("fontsize")) { setFontsize(config.get(PTY_FONTSIZE)); } if (config.contains("fontcolor")) { setFontcolor(config.get(PTY_FONTCOLOR)); } } else if (EXmlConfig.Default == type) { if (RString.isEmpty(getFont())) { if (config.contains("font")) { setFont(config.get(PTY_FONT)); } } if (RString.isEmpty(getFontsize())) { if (config.contains("fontsize")) { setFontsize(config.get(PTY_FONTSIZE)); } } if (RString.isEmpty(getFontcolor())) { if (config.contains("fontcolor")) { setFontcolor(config.get(PTY_FONTCOLOR)); } } } }
// ============================================================ // <T>以布尔值方式,获得数据内容。</T> // // @return 数据内容 // ============================================================ public boolean asBoolean() { return RBoolean.parse(_value); }
// ============================================================ // <T>根据名称获得内容。</T> // // @param name 名称 // @return 内容 // ============================================================ @Override public String get(String name) { switch (name) { case "ouid": return Long.toString(_ouid); case "ovld": return RBoolean.toString(_ovld); case "guid": return _guid; case "link_parent_id": return Long.toString(_linkParentId); case "link_id": return Long.toString(_linkId); case "code": return _code; case "name": return _name; case "label": return _label; case "department_id": return RInteger.toString(_departmentId); case "department_label": return _departmentLabel; case "region_id": return RInteger.toString(_regionId); case "region_label": return _regionLabel; case "level": return RInteger.toString(_level); case "leader_id": return Long.toString(_leaderId); case "leader_label": return _leaderLabel; case "leader_phone": return _leaderPhone; case "province_id": return RInteger.toString(_provinceId); case "province_label": return _provinceLabel; case "city_id": return RInteger.toString(_cityId); case "city_label": return _cityLabel; case "detail_address": return _detailAddress; case "location_longitude": return RDouble.toString(_locationLongitude); case "location_latitude": return RDouble.toString(_locationLatitude); case "department_phone": return _departmentPhone; case "build_date": return _buildDate.toString(); case "note": return _note; case "create_user_id": return Long.toString(_createUserId); case "create_date": return _createDate.toString(); case "update_user_id": return Long.toString(_updateUserId); case "update_date": return _updateDate.toString(); } return null; }
// ============================================================ // <T>根据名称设置内容。</T> // // @param name 名称 // @param value 内容 // ============================================================ @Override public void set(String name, String value) { switch (name) { case "ouid": _ouid = RLong.parse(value); break; case "ovld": _ovld = RBoolean.parse(value); break; case "guid": _guid = value; break; case "link_parent_id": _linkParentId = RLong.parse(value); break; case "link_id": _linkId = RLong.parse(value); break; case "code": _code = value; break; case "name": _name = value; break; case "label": _label = value; break; case "department_id": _departmentId = RInteger.parse(value); break; case "department_label": _departmentLabel = value; break; case "region_id": _regionId = RInteger.parse(value); break; case "region_label": _regionLabel = value; break; case "level": _level = RInteger.parse(value); break; case "leader_id": _leaderId = RLong.parse(value); break; case "leader_label": _leaderLabel = value; break; case "leader_phone": _leaderPhone = value; break; case "province_id": _provinceId = RInteger.parse(value); break; case "province_label": _provinceLabel = value; break; case "city_id": _cityId = RInteger.parse(value); break; case "city_label": _cityLabel = value; break; case "detail_address": _detailAddress = value; break; case "location_longitude": _locationLongitude = RDouble.parse(value); break; case "location_latitude": _locationLatitude = RDouble.parse(value); break; case "department_phone": _departmentPhone = value; break; case "build_date": _buildDate.parse(value); break; case "note": _note = value; break; case "create_user_id": _createUserId = RLong.parse(value); break; case "create_date": _createDate.parse(value); break; case "update_user_id": _updateUserId = RLong.parse(value); break; case "update_date": _updateDate.parse(value); break; } }
// ============================================================ // <T>内部设置内容置信息。</T> // // @param name 名称 // @param value 内容 // ============================================================ public void innerSet(String name, String value) { if (RString.isEmpty(name)) { return; } else if (PTY_NAME.equalsIgnoreCase(name)) { setName(value); } else if (PTY_ALIAS.equalsIgnoreCase(name)) { setAlias(value); } else if (PTY_LABEL.equalsIgnoreCase(name)) { setLabel(value); } else if (PTY_IS_VALID.equalsIgnoreCase(name)) { setIsValid(RBoolean.parse(value)); } else if (PTY_ATTRIBUTES.equalsIgnoreCase(name)) { setAttributes(value); } else if (PTY_NOTE.equalsIgnoreCase(name)) { setNote(value); } else if (PTY_ACCESS_QUERY.equalsIgnoreCase(name)) { setAccessQuery(value); } else if (PTY_ACCESS_INSERT.equalsIgnoreCase(name)) { setAccessInsert(RBoolean.parse(value)); } else if (PTY_ACCESS_UPDATE.equalsIgnoreCase(name)) { setAccessUpdate(RBoolean.parse(value)); } else if (PTY_ACCESS_DELETE.equalsIgnoreCase(name)) { setAccessDelete(RBoolean.parse(value)); } else if (PTY_IS_KEY.equalsIgnoreCase(name)) { setIsKey(RBoolean.parse(value)); } else if (PTY_IS_NULL.equalsIgnoreCase(name)) { setIsNull(RBoolean.parse(value)); } else if (PTY_IS_UNIQUE.equalsIgnoreCase(name)) { setIsUnique(RBoolean.parse(value)); } else if (PTY_IS_STORE.equalsIgnoreCase(name)) { setIsStore(value); } else if (PTY_IS_ABSTRACT.equalsIgnoreCase(name)) { setIsAbstract(value); } else if (PTY_IS_ENCRYPT.equalsIgnoreCase(name)) { setIsEncrypt(value); } else if (PTY_DATA_NAME.equalsIgnoreCase(name)) { setDataName(value); } else if (PTY_DATA_FORMAT.equalsIgnoreCase(name)) { setDataFormat(value); } else if (PTY_DATA_ALIAS.equalsIgnoreCase(name)) { setDataAlias(value); } else if (PTY_DATA_TYPE.equalsIgnoreCase(name)) { setDataType(value); } else if (PTY_DATA_SIZE.equalsIgnoreCase(name)) { setDataSize(value); } else if (PTY_DATA_REFER.equalsIgnoreCase(name)) { setDataRefer(value); } else if (PTY_DATA_CODE.equalsIgnoreCase(name)) { setDataCode(value); } else if (PTY_DATA_UNIQUES.equalsIgnoreCase(name)) { setDataUniques(value); } else if (PTY_GROUP.equalsIgnoreCase(name)) { setGroup(value); } else if (PTY_DATA_DEFAULT.equalsIgnoreCase(name)) { setDataDefault(value); } else if (PTY_DATA_INSERT.equalsIgnoreCase(name)) { setDataInsert(value); } else if (PTY_DATA_UPDATE.equalsIgnoreCase(name)) { setDataUpdate(value); } else if (PTY_INDEX_NAMES.equalsIgnoreCase(name)) { setIndexNames(value); } }
// ============================================================ // <T>保存设置信息。</T> // // @param config 设置信息 // @param type 类型 // ============================================================ public void saveConfig(FXmlNode config, EXmlConfig type) { config.setName(NAME); super.saveConfig(config, type); if (EXmlConfig.Full == type) { if (RString.isNotEmpty(getName())) { config.set(PTY_NAME, getName()); } if (RString.isNotEmpty(getAlias())) { config.set(PTY_ALIAS, getAlias()); } String label = _label.pack().toString(); if (RString.isNotEmpty(label)) { config.set(PTY_LABEL, label); } if (RBoolean.parse(getIsValid())) { config.set(PTY_IS_VALID, RBoolean.toString(getIsValid())); } if (RString.isNotEmpty(getAttributes())) { config.set(PTY_ATTRIBUTES, getAttributes()); } String note = _note.pack().toString(); if (RString.isNotEmpty(note)) { config.set(PTY_NOTE, note); } if (RString.isNotEmpty(getAccessQuery())) { config.set(PTY_ACCESS_QUERY, getAccessQuery()); } if (RBoolean.parse(getAccessInsert())) { config.set(PTY_ACCESS_INSERT, RBoolean.toString(getAccessInsert())); } if (RBoolean.parse(getAccessUpdate())) { config.set(PTY_ACCESS_UPDATE, RBoolean.toString(getAccessUpdate())); } if (RBoolean.parse(getAccessDelete())) { config.set(PTY_ACCESS_DELETE, RBoolean.toString(getAccessDelete())); } if (RBoolean.parse(getIsKey())) { config.set(PTY_IS_KEY, RBoolean.toString(getIsKey())); } if (RBoolean.parse(getIsNull())) { config.set(PTY_IS_NULL, RBoolean.toString(getIsNull())); } if (RBoolean.parse(getIsUnique())) { config.set(PTY_IS_UNIQUE, RBoolean.toString(getIsUnique())); } if (RString.isNotEmpty(getIsStore())) { config.set(PTY_IS_STORE, getIsStore()); } if (RString.isNotEmpty(getIsAbstract())) { config.set(PTY_IS_ABSTRACT, getIsAbstract()); } if (RString.isNotEmpty(getIsEncrypt())) { config.set(PTY_IS_ENCRYPT, getIsEncrypt()); } if (RString.isNotEmpty(getDataName())) { config.set(PTY_DATA_NAME, getDataName()); } if (RString.isNotEmpty(getDataFormat())) { config.set(PTY_DATA_FORMAT, getDataFormat()); } if (RString.isNotEmpty(getDataAlias())) { config.set(PTY_DATA_ALIAS, getDataAlias()); } if (RString.isNotEmpty(getDataType())) { config.set(PTY_DATA_TYPE, getDataType()); } if (RString.isNotEmpty(getDataSize())) { config.set(PTY_DATA_SIZE, getDataSize()); } if (RString.isNotEmpty(getDataRefer())) { config.set(PTY_DATA_REFER, getDataRefer()); } if (RString.isNotEmpty(getDataCode())) { config.set(PTY_DATA_CODE, getDataCode()); } if (RString.isNotEmpty(getDataUniques())) { config.set(PTY_DATA_UNIQUES, getDataUniques()); } if (RString.isNotEmpty(getGroup())) { config.set(PTY_GROUP, getGroup()); } if (RString.isNotEmpty(getDataDefault())) { config.set(PTY_DATA_DEFAULT, getDataDefault()); } if (RString.isNotEmpty(getDataInsert())) { config.set(PTY_DATA_INSERT, getDataInsert()); } if (RString.isNotEmpty(getDataUpdate())) { config.set(PTY_DATA_UPDATE, getDataUpdate()); } if (RString.isNotEmpty(getIndexNames())) { config.set(PTY_INDEX_NAMES, getIndexNames()); } } else if (EXmlConfig.Simple == type) { if (RString.isNotEmpty(getName())) { config.set(PTY_NAME, getName()); } if (RString.isNotEmpty(getAlias())) { config.set(PTY_ALIAS, getAlias()); } if (RString.isNotEmpty(getLabel())) { config.set(PTY_LABEL, getLabel()); } if (RBoolean.parse(getIsValid())) { config.set(PTY_IS_VALID, RBoolean.toString(getIsValid())); } if (RString.isNotEmpty(getAttributes())) { config.set(PTY_ATTRIBUTES, getAttributes()); } if (RString.isNotEmpty(getNote())) { config.set(PTY_NOTE, getNote()); } if (RString.isNotEmpty(getAccessQuery())) { config.set(PTY_ACCESS_QUERY, getAccessQuery()); } if (RBoolean.parse(getAccessInsert())) { config.set(PTY_ACCESS_INSERT, RBoolean.toString(getAccessInsert())); } if (RBoolean.parse(getAccessUpdate())) { config.set(PTY_ACCESS_UPDATE, RBoolean.toString(getAccessUpdate())); } if (RBoolean.parse(getAccessDelete())) { config.set(PTY_ACCESS_DELETE, RBoolean.toString(getAccessDelete())); } if (RBoolean.parse(getIsKey())) { config.set(PTY_IS_KEY, RBoolean.toString(getIsKey())); } if (RBoolean.parse(getIsNull())) { config.set(PTY_IS_NULL, RBoolean.toString(getIsNull())); } if (RBoolean.parse(getIsUnique())) { config.set(PTY_IS_UNIQUE, RBoolean.toString(getIsUnique())); } if (RString.isNotEmpty(getIsStore())) { config.set(PTY_IS_STORE, getIsStore()); } if (RString.isNotEmpty(getIsAbstract())) { config.set(PTY_IS_ABSTRACT, getIsAbstract()); } if (RString.isNotEmpty(getIsEncrypt())) { config.set(PTY_IS_ENCRYPT, getIsEncrypt()); } if (RString.isNotEmpty(getDataName())) { config.set(PTY_DATA_NAME, getDataName()); } if (RString.isNotEmpty(getDataFormat())) { config.set(PTY_DATA_FORMAT, getDataFormat()); } if (RString.isNotEmpty(getDataAlias())) { config.set(PTY_DATA_ALIAS, getDataAlias()); } if (RString.isNotEmpty(getDataType())) { config.set(PTY_DATA_TYPE, getDataType()); } if (RString.isNotEmpty(getDataSize())) { config.set(PTY_DATA_SIZE, getDataSize()); } if (RString.isNotEmpty(getDataRefer())) { config.set(PTY_DATA_REFER, getDataRefer()); } if (RString.isNotEmpty(getDataCode())) { config.set(PTY_DATA_CODE, getDataCode()); } if (RString.isNotEmpty(getDataUniques())) { config.set(PTY_DATA_UNIQUES, getDataUniques()); } if (RString.isNotEmpty(getGroup())) { config.set(PTY_GROUP, getGroup()); } if (RString.isNotEmpty(getDataDefault())) { config.set(PTY_DATA_DEFAULT, getDataDefault()); } if (RString.isNotEmpty(getDataInsert())) { config.set(PTY_DATA_INSERT, getDataInsert()); } if (RString.isNotEmpty(getDataUpdate())) { config.set(PTY_DATA_UPDATE, getDataUpdate()); } if (RString.isNotEmpty(getIndexNames())) { config.set(PTY_INDEX_NAMES, getIndexNames()); } } else if (EXmlConfig.Value == type) { String sName = getName(); if (RString.isNotEmpty(sName)) { config.set(PTY_NAME, sName); } String sAlias = getAlias(); if (RString.isNotEmpty(sAlias)) { config.set(PTY_ALIAS, sAlias); } String sLabel = getLabel(); if (RString.isNotEmpty(sLabel)) { config.set(PTY_LABEL, sLabel); } Boolean bIsValid = getIsValid(); if (RBoolean.parse(bIsValid)) { config.set(PTY_IS_VALID, RBoolean.toString(bIsValid)); } String sAttributes = getAttributes(); if (RString.isNotEmpty(sAttributes)) { config.set(PTY_ATTRIBUTES, sAttributes); } String sNote = getNote(); if (RString.isNotEmpty(sNote)) { config.set(PTY_NOTE, sNote); } String sAccessQuery = getAccessQuery(); if (RString.isNotEmpty(sAccessQuery)) { config.set(PTY_ACCESS_QUERY, sAccessQuery); } Boolean bAccessInsert = getAccessInsert(); if (RBoolean.parse(bAccessInsert)) { config.set(PTY_ACCESS_INSERT, RBoolean.toString(bAccessInsert)); } Boolean bAccessUpdate = getAccessUpdate(); if (RBoolean.parse(bAccessUpdate)) { config.set(PTY_ACCESS_UPDATE, RBoolean.toString(bAccessUpdate)); } Boolean bAccessDelete = getAccessDelete(); if (RBoolean.parse(bAccessDelete)) { config.set(PTY_ACCESS_DELETE, RBoolean.toString(bAccessDelete)); } Boolean bIsKey = getIsKey(); if (RBoolean.parse(bIsKey)) { config.set(PTY_IS_KEY, RBoolean.toString(bIsKey)); } Boolean bIsNull = getIsNull(); if (RBoolean.parse(bIsNull)) { config.set(PTY_IS_NULL, RBoolean.toString(bIsNull)); } Boolean bIsUnique = getIsUnique(); if (RBoolean.parse(bIsUnique)) { config.set(PTY_IS_UNIQUE, RBoolean.toString(bIsUnique)); } String sIsStore = getIsStore(); if (RString.isNotEmpty(sIsStore)) { config.set(PTY_IS_STORE, sIsStore); } String sIsAbstract = getIsAbstract(); if (RString.isNotEmpty(sIsAbstract)) { config.set(PTY_IS_ABSTRACT, sIsAbstract); } String sIsEncrypt = getIsEncrypt(); if (RString.isNotEmpty(sIsEncrypt)) { config.set(PTY_IS_ENCRYPT, sIsEncrypt); } String sDataName = getDataName(); if (RString.isNotEmpty(sDataName)) { config.set(PTY_DATA_NAME, sDataName); } String sDataFormat = getDataFormat(); if (RString.isNotEmpty(sDataFormat)) { config.set(PTY_DATA_FORMAT, sDataFormat); } String sDataAlias = getDataAlias(); if (RString.isNotEmpty(sDataAlias)) { config.set(PTY_DATA_ALIAS, sDataAlias); } String sDataType = getDataType(); if (RString.isNotEmpty(sDataType)) { config.set(PTY_DATA_TYPE, sDataType); } String sDataSize = getDataSize(); if (RString.isNotEmpty(sDataSize)) { config.set(PTY_DATA_SIZE, sDataSize); } String sDataRefer = getDataRefer(); if (RString.isNotEmpty(sDataRefer)) { config.set(PTY_DATA_REFER, sDataRefer); } String sDataCode = getDataCode(); if (RString.isNotEmpty(sDataCode)) { config.set(PTY_DATA_CODE, sDataCode); } String sDataUniques = getDataUniques(); if (RString.isNotEmpty(sDataUniques)) { config.set(PTY_DATA_UNIQUES, sDataUniques); } String sGroup = getGroup(); if (RString.isNotEmpty(sGroup)) { config.set(PTY_GROUP, sGroup); } String sDataDefault = getDataDefault(); if (RString.isNotEmpty(sDataDefault)) { config.set(PTY_DATA_DEFAULT, sDataDefault); } String sDataInsert = getDataInsert(); if (RString.isNotEmpty(sDataInsert)) { config.set(PTY_DATA_INSERT, sDataInsert); } String sDataUpdate = getDataUpdate(); if (RString.isNotEmpty(sDataUpdate)) { config.set(PTY_DATA_UPDATE, sDataUpdate); } String sIndexNames = getIndexNames(); if (RString.isNotEmpty(sIndexNames)) { config.set(PTY_INDEX_NAMES, sIndexNames); } } else if (EXmlConfig.Default == type) { String sDataFormat = getDataFormat(); if (RString.isNotEmpty(sDataFormat)) { config.set(PTY_DATA_FORMAT, sDataFormat); } String sGroup = getGroup(); if (RString.isNotEmpty(sGroup)) { config.set(PTY_GROUP, sGroup); } String sDataInsert = getDataInsert(); if (RString.isNotEmpty(sDataInsert)) { config.set(PTY_DATA_INSERT, sDataInsert); } String sIndexNames = getIndexNames(); if (RString.isNotEmpty(sIndexNames)) { config.set(PTY_INDEX_NAMES, sIndexNames); } } }
// ============================================================ // <T>加载行记录。</T> // // @param row 行记录 // ============================================================ @Override public void load(FRow row) { super.load(row); for (IStringPair pair : row) { // 获得名称 String name = pair.name(); if (RString.isEmpty(name)) { throw new FFatalError("Row format is invalid. (row={1})", row.dump()); } // 获得内容 String value = pair.value(); // 设置内容 switch (name) { case "ouid": __ouid = RLong.parse(value); _ouid = __ouid; break; case "ovld": __ovld = RBoolean.parse(value); _ovld = __ovld; break; case "guid": __guid = value; _guid = __guid; break; case "user_id": __userId = RLong.parse(value); _userId = __userId; break; case "project_id": __projectId = RLong.parse(value); _projectId = __projectId; break; case "resource_id": __resourceId = RLong.parse(value); _resourceId = __resourceId; break; case "code": __code = value; _code = __code; break; case "label": __label = value; _label = __label; break; case "content": __content = value; _content = __content; break; case "note": __note = value; _note = __note; break; case "create_user_id": __createUserId = RLong.parse(value); _createUserId = __createUserId; break; case "create_date": __createDate.parse(value); _createDate.assign(__createDate); break; case "update_user_id": __updateUserId = RLong.parse(value); _updateUserId = __updateUserId; break; case "update_date": __updateDate.parse(value); _updateDate.assign(__updateDate); break; } } }