// ============================================================ public static void convertNodeType(FXmlNode config) { // 读取类型信息 String type = config.get("type"); String typeName = config.get("type_name"); // 读取基本信息 String baseType = convertBaseType(type); String langType = convertDataType(type, typeName); // 检查是否设置过CS类型 String typeCs = config.get("type_cs"); if (!RString.isEmpty(typeCs)) { langType = typeCs; } config.set("type", type); config.set("base_type", baseType); config.set("lang_type", langType); }
protected void innerBuildCodeList(FXmlNodes config, String name, ISqlConnect connect) { // 去数据库去CodeList if (_logger.debugAble()) { _logger.debug(this, "buildItemNodes", "Find item nodes. (codelist={0})", name); } FSqlQuery sql = new FSqlQuery(connect, getClass(), SQL_CODE_LIST); sql.bindString("name", name); FDataset dataset = sql.fetchDataset(); for (FRow row : dataset) { FXmlNode itemNode = config.create(XListItem.NAME); itemNode.set(XListItem.PTY_VALUE, row.get(XListItem.PTY_VALUE)); itemNode.set(XListItem.PTY_LABEL, row.get(XListItem.PTY_LABEL)); } }
protected void innerBuildList(FXmlNodes config, String name) { // 通过列表取数据 XList xlist = get(name); if (xlist.hasChild()) { IXmlObjects xitems = xlist.children(); int count = xitems.count(); for (int n = 0; n < count; n++) { XListItem xitem = (XListItem) xitems.get(n); if (null != xitem) { FXmlNode itemNode = config.create(XListItem.NAME); itemNode.set(XListItem.PTY_VALUE, xitem.getValue()); itemNode.set(XListItem.PTY_LABEL, xitem.getLabel()); } } } }
@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); } }
@Override public FXmlNode buildListConfig(TListArgs args) { String name = args.name(); // 从缓冲管理器中查找列表对象 ICache cache = _cacheConsole.find(IListConsole.class, name); if (null != cache) { return (FXmlNode) cache.instance(); } // 创建节点 FXmlNode config = new FXmlNode("List"); config.set("name", name); if (name.startsWith("{") && name.endsWith("}")) { String code = name.substring(1, name.length() - 1); // 去数据库去CodeList if (null == args.sqlContext()) { ISqlConnection cnn = null; try { cnn = _databaseConsole.alloc(); innerBuildCodeList(config.nodes(), code, cnn); } finally { if (null != cnn) { _databaseConsole.free(cnn); } } } else { innerBuildCodeList(config.nodes(), code, args.sqlContext()); } } else { // 通过列表取数据 innerBuildList(config.nodes(), name); } // 向缓冲管理器中注册列表对象 cache = new FCache(config); cache.setTimeout(_cacheTimeout); _cacheConsole.register(IListConsole.class, name, cache); return config; }
// ============================================================ // <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 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); } } }