本文整理汇总了Python中com.jythonui.server.holder.Holder.getXMLTransformer方法的典型用法代码示例。如果您正苦于以下问题:Python Holder.getXMLTransformer方法的具体用法?Python Holder.getXMLTransformer怎么用?Python Holder.getXMLTransformer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jythonui.server.holder.Holder
的用法示例。
在下文中一共展示了Holder.getXMLTransformer方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: getVar
# 需要导入模块: from com.jythonui.server.holder import Holder [as 别名]
# 或者: from com.jythonui.server.holder.Holder import getXMLTransformer [as 别名]
def getVar(map,dialogname,xml,listv):
""" Set map with values read from xml string for dialog form.
Retrieves values from XML string and set values to the map (key->value).
Retrieves values only for list of keys (not for all found in XML string)
Args:
map : A map being set. Can be empty or contains some values already. In case of
conflict new value will overwrite existing value.
dialogname : Dialog name where form is available.
xml : XML string to be analyzed.
listv : List of keys to be set to the map. Only keys found in the list are set.
Others are ignored.
"""
iXml = Holder.getXMLTransformer();
v = DialogVariables();
iXml.fromXML(dialogname,v,xml);
for vname in listv :
val = v.getValue(vname)
if val == None or val.getValue() == None:
map[vname] = None
continue
if val.getType() == TT.STRING :
map[vname] = val.getValueS()
continue
if val.getType() == TT.BIGDECIMAL :
b = val.getValueBD()
map[vname] = con.BigDecimalToDecimal(b)
continue
if val.getType() == TT.BOOLEAN :
b = val.getValueB()
map[vname] = b
continue
if val.getType() == TT.INT :
map[vname] = val.getValue()
continue
if val.getType() == TT.DATE :
map[vname] = con.toJDate(val.getValue())
continue
if val.getType() == TT.DATETIME :
map[vname] = con.toJDateTime(val.getValue())
continue