外观
finHtmlReporting
原文: https://finproducts.atlassian.net/wiki/spaces/JIDD3/pages/34793259114/FIN+5.3.1+finHtmlReporting 中文整理基于 FIN 5.3.1
finHtmlReporting
HTML 报告扩展
classes
| CustomHelpers | handlebars.java 的附加辅助工具 |
| HFilter | hfilter 的 fantom 端口 https://bitbucket.org/brianfrank/haystack-java/ |
| HFilterHelpers | 使用 hfilter 的 handlebar 辅助程序 |
| HZincDeserializer | zinc deserializer |
| HZincReader | zinc reader |
| HandleBarLib | |
| HtmlAlarmEmailFormatter | 报警摘要/即时邮件的自定义电子邮件格式化器 |
| HtmlNoteEmailFormatter | |
| ImageUtil | |
| IsHelper | handlebar 帮助器 "is" 的作用类似于 "if",比较工具 <pre 语法: {{is param1 param2 操作符}}...{{else}}...{{/is}} |
| ToAbrrHelper | {{toAbbr}} |
| Util |
CustomHelpers
class CustomHelpers : Obj
handlebars.java 的附加辅助工具
构造函数
| make |
字段
| cache | |
| context | |
| files | |
| proj | |
| renderEmail |
方法
| addCommas | {{addCommas}} |
| after | {{after}} |
| any | {{any}} |
| axon | {{轴突查询}}..{{/轴突}} |
| before | {{before}} |
| eachIndex | {{eachIndex}} |
| eachProperty | {{eachProperty}} |
| embedImg | 用于嵌入图像并构建 HTML 邮件内联图像的助手 |
| empty | {{empty}} |
| first | {{first}} |
| fitSize | |
| inArray | {{inArray}} |
| isEmail | |
| join | {{join}} |
| last | {{last}} |
| length | 返回数组长度的辅助器 语法 {{length ["a","b","c"] }} 返回 3 |
| math | {{math a + b}} 做简单的数学 |
| numberToTickerImages | {{numberToTickerImages 4104}} 或 {{numberToTickerImages 4104 small }} |
| ratio | {{ratio data parent "dataProp" mult}} |
| sort | {{sort}} |
| toExponential | {{toExponential}} |
| toFixed | {{toFixed}} |
| toFloat | {{toFloat}} |
| toPrecision | {{toPrecision}} |
| withAfter | {{withAfter}} |
| withBefore | {{withBefore}} |
| withFirst | {{withFirst}} |
| withLast | {{withLast}} |
| withSort | {{withSort}} |
插槽详情
addCommas
Str addCommas(Obj? context, Options? options)
{{addCommas}}
为数字添加逗号。
参数:无
after
Str after(对象? context, 选项? options)
{{之后}}
在指定数量之后返回集合中的所有项。
参数:count int - 要从开头省略的项目数量。(必填)
any
Str any(Obj? context, Options? options)
{{any}}
如果集合不为空,则有条件地渲染一个块。空的相反
参数:无
axon
Str 轴突(对象?上下文,选项?选项)
{{轴突查询}}..{{/轴突}}
评估轴突查询并遍历返回结果
before
Str before(对象? context, 选项? options)
{{之前}}
返回集合中指定数量之前的所有项目。与 after 相反。
参数:count int - 要从末尾省略的项目数量。(必填)
cache
映射缓存 := [:]
context
上下文?上下文 := null
eachIndex
Str eachIndex(对象? 上下文, 选项? 选项)
{{eachIndex}}
当前默认的 Handlebars 循环助手 {{each}} 的实现将索引(从 0 开始的索引)添加到循环上下文中。
参数:无
eachProperty
Str eachProperty(对象? 上下文, 选项? 选项)
{{eachProperty}}
使用对象中每个属性的键和值来渲染一个块。
参数:无
embedImg
Str embedImg(对象? 上下文, 选项? 选项)
用于嵌入图像并构建 HTML 邮件内联图像的助手
语法: {{embedImg url_or_@id 最大宽度? 最大高度?}}
例子:<pre  或 
将输出:
empty
Str empty(Obj? context, Options? options)
{{empty}}
如果集合为空,则有条件地渲染一个块。
参数:无
files
映射文件 := [:]
first
Str first(Obj? context, Options? options)
{{first}}
返回集合中的第一个项目。
参数:无
fitSize
static Buf fitSize(Buf inBuf, Int 最大宽度, Int 最大高度)
inArray
Str inArray(对象? 上下文, 选项? 选项)
{{inArray}}
如果指定的值在集合中,则有条件地渲染一个块。
参数:value 字符串 整数 - 用于测试的值。(必填)
isEmail
Str isEmail(对象? 上下文, 选项? 选项)
join
Str join(对象? 上下文, 选项? 选项)
{{join}}
将集合的所有元素使用指定的分隔符连接成一个字符串。
参数:separator string - 用作项目之间分隔符的字符串。(可选)
last
Str last(对象? context, 选项? options)
{{last}}
返回集合中的最后一项。与 first 相反。
参数:无
length
字符串长度(对象数组)
返回数组长度的辅助器 语法 {{length ["a","b","c"]}} 返回 3
make
new make()
math
Str math(Obj? context, Options? options)
{{math a + b}} 做简单的数学
numberToTickerImages
字符串 numberToTickerImages(对象? 上下文, 选项? 选项)
{{numberToTickerImages 4104}} 或 {{numberToTickerImages 4104 small}}
proj
Proj? proj := null
ratio
Str 比例(对象? 上下文, 选项? 选项)
{{ratio data parent "dataProp" mult}}
返回当前值与最大值的比率
renderEmail
布尔型 renderEmail := 假
sort
Str sort(Obj? context, Options? options)
{{排序}}
返回已排序的集合。参数:无
toExponential
字符串 toExponential(对象? 上下文, 选项? 选项)
{{toExponential}}
以指数表示法返回数字,小数点前有一位数字,小数点后四舍五入到指定的位数。
参数:fractions 整数 - 指定小数点后位数的整数。(可选)
toFixed
Str toFixed(对象? 上下文, 选项? 选项)
{{toFixed}}
精确返回小数点后的数字。如有必要,数字会被四舍五入,小数部分会补零以确保其具有指定的长度。
参数:digits int - 小数点后显示的位数。(可选)
toFloat
字符串 转浮点数(对象?上下文, 选项?选项)
{{toFloat}}
返回一个浮点数。
参数:无
toPrecision
Str toPrecision(对象? 上下文, 选项? 选项)
{{toPrecision}}
以定点或指数表示法返回数字,四舍五入到指定的有效位数。
参数:precision int - 数字的位数。如果省略,则返回整个数字(不进行任何格式化)。(可选)
withAfter
Str withAfter(对象? 上下文, 选项? 选项)
{{withAfter}}
在块内使用集合中指定数量之后的所有物品。
参数:count int - 要从开头省略的项目数量。(必填)
withBefore
Str withBefore(Obj? context, Options? options)
{{withBefore}}
在块内使用集合中指定计数之前的所有项。与 withAfter 相反。
参数:count int - 要从末尾省略的项目数量。(必填)
withFirst
Str withFirst(Obj? context, Options? options)
{{withFirst}}
在块中使用集合中的第一个项目。
参数:无
withLast
Str withLast(Obj? context, Options? options)
{{withLast}}
在块内使用集合中的最后一项。与 withFirst 相反。
参数:无
withSort
Str withSort(Obj? context, Options? options)
{{withSort}}
在块内使用排序集合。
参数:field string - 要排序的字段或属性的字符串名称。(可选)
HFilter
抽象类 HFilter : Obj
hfilter 的 fantom 端口 https://bitbucket.org/brianfrank/haystack-java/
具有改进的查找规则
ahuRef->ahu //// Try and find every record that has a ahuRef, and see if he is an ahu
foo -> curVal > 10 //// If foo looks like this {"curVal":8,"ahu","jason"}. Then this would return true
foo -> curVal > 10 //// [{"curVal":3,"ahu","jason"},{"curVal":12,"ahu","jason"}]. This would return true,
because one of the objects in the list is > 10
If foo is a list without any keys, it will just return false. [1,23,5,5,6,6,7] This would return false构造函数
| make |
字段
| log |
方法
| and | |
| eq | |
| equals | |
| filter | 如果没有传入 pather,使用默认 pather,通过 hfilter 过滤数据集 |
| ge | |
| gt | |
| has | |
| hashCode | |
| include | |
| le | |
| lt | |
| missing | |
| ne | |
| or | |
| parse | 将字符串解码为 HFilter 返回 null 或抛出 |
| toStr |
插槽详情
and
HFilter 和(HFilter 那个)
eq
static HFilter eq(Str path, JSONObject val)
equals
虚拟重写 Bool equals(Obj? that)
filter
静态列表 过滤(对象 数据集, 字符串 查询, 路径器? 路径器)
如果没有传入 pather,使用默认 pather,通过 hfilter 过滤数据集
ge
static HFilter ge(Str path, JSONObject val)
gt
静态 HFilter gt(Str 路径, JSONObject 值)
has
static HFilter has(Str path)
hashCode
整数 hashCode()
include
抽象 Bool include(JSONObject dict, Pather pather)
le
static HFilter le(Str path, JSONObject val)
log
const static Log log := Log.get(HFilter.name())
lt
static HFilter lt(Str path, JSONObject val)
make
new make()
missing
static HFilter missing(Str path)
ne
static HFilter ne(Str path, JSONObject val)
or
HFilter 或 (HFilter 那个)
parse
static HFilter? 解析(Str s)
将字符串解码为 HFilter 返回 null 或抛出
toStr
虚拟重写 Str toStr()
HFilterHelpers
class HFilterHelpers : Obj
使用 hfilter 的 handlebar 辅助程序
构造函数
| make |
字段
| log |
方法
| hFilterEach | {{hFilterEach 数据 表达式}}..{{/hFilterEach}} |
插槽详情
hFilterEach
Str hFilterEach(Obj? context, Options? options)
{{hFilterEach 数据 表达式}}..{{/hFilterEach}}
使用 hfilter 过滤集合
示例: {{ hFilterEach this "sheMale and subObject- foo" }} 名字: {{lastName}} {{/hFilterEach}}
log
const static Log log := Log.get(HFilterHelpers.name())
make
new make()
HZincDeserializer
const class HZincDeserializer : Obj
zinc 反序列化器
字段
| log |
方法
| ReadEscapeCharacter | |
| ReadNumber | |
| ReadRefVal | |
| ReadStringLiteral | |
| ReadStringVal | |
| ReadURIVal | |
| ReadWordValue |
插槽详情
ReadEscapeCharacter
static Obj? 读取转义字符(StringCursor cursor)
ReadNumber
static Obj? 读取数字(StringCursor 光标)
ReadRefVal
static Obj? 读取引用值(StringCursor cursor)
ReadStringLiteral
static Obj? 读取字符串字面量(StringCursor cursor)
ReadStringVal
static Obj? ReadStringVal(StringCursor cursor)
ReadURIVal
static Obj? 读取URI值(StringCursor cursor)
ReadWordValue
static Obj? 读取字值(StringCursor cursor, Bool isFilter)
log
const static Log log := Log.get(HZincDeserializer.name())
HZincReader
类 HZincReader : Obj
锌读写器
构造函数
| make |
字段
| _result | |
| cursor | |
| log |
方法
| read | 解析表达式 |
| readFilterParens | |
| readFilterPath | |
| readValue |
插槽详情
_结果
HFilter? _result := null
cursor
字符串光标 cursor
log
const static Log log := Log.get(HZincReader.name())
make
new make(Str filter)
read
HFilter?读取()
解析表达式
readFilterParens
HFilter?读取筛选括号()
readFilterPath
Str 读取过滤路径()
readValue
对象?读取值()
HandleBarLib
const class HandleBarLib : Obj
方法
| addReport | |
| finEmail | 用于发送电子邮件的辅助功能 |
| finHtmlTemplate | 使用 handlebars.java 引擎从 handlebars 模板生成字符串 |
| finSaveAs | 支持将文本内容保存到路径(URI)文件的功能 |
插槽详情
addReport
@Axon 静态 Void addReport(Ref? templateId, Obj? headerId, Str? dataStr, Bool? addFile, Str? fileUri, Bool? addEmail, Str? address, Str? topic, Str? format, Obj? localeStrs := null)
finEmail
@Axon 静态 Void finEmail(Str toPerson, Str p_subject, Obj? content)
用于发送电子邮件的辅助功能
finHtmlTemplate
@Axon 静态 Obj? finHtmlTemplate(Obj noteTemplate, Obj data, Bool renderEmail := false, Proj? projCtx := null)
使用 handlebars.java 引擎从 handlebars 模板生成字符串
@noteTemplate:一个具有属性“tpl”的标签,该属性保存模板、bin ID 或表示模板的字符串
@data:一个字典、网格或字符串,……将被传递给 handlebar 进行字符串生成
@renderEmail :为 true 时返回多部分邮件正文。默认值为 false,返回字符串
finSaveAs
@Axon 静态文件 finSaveAs(Uri path, Str? content)
支持将文本内容保存到路径(URI)文件的功能
HtmlAlarmEmailFormatter
class HtmlAlarmEmailFormatter : HtmlNoteEmailFormatter
报警摘要/即时邮件的自定义电子邮件格式化器
构造函数
| make |
方法
| groupDigestItems | |
| toItem |
插槽详情
groupDigestItems
受保护的虚方法重写 Obj groupDigestItems(Dict[] items)
make
new make()
toItem
受保护的虚拟重写 Str:Obj? toItem(Dict item)
HtmlNoteEmailFormatter
class HtmlNoteEmailFormatter : EmailTopicFormatter
构造函数
| make |
字段
| proj | |
| query |
方法
| body | |
| getUser | |
| groupDigestItems | |
| prepareData | |
| toData | |
| toItem |
插槽详情
body
虚拟重写 Obj body(Dict[] items)
getUser
受保护的虚拟 Dict? getUser(Ref? id)
groupDigestItems
受保护的虚拟 Obj groupDigestItems(Dict[] items)
make
new make()
prepareData
受保护的虚拟 Str:Obj?[] prepareData(Dict[] items)
proj
项目?项目
query
受保护的 Str 查询 := ...
toData
受保护的虚拟 Str:Obj? toData(Dict[] items, Dict rec, Bool isDigest)
toItem
受保护的虚方法 Str:Obj? toItem(Dict item)
ImageUtil
class ImageUtil : Obj
方法
| getSize | |
| resize |
插槽详情
getSize
静态 Str:Int getSize(File f)
resize
静态 文件 调整大小(文件 f, 整数 宽度, 整数 高度)
IsHelper
类 IsHelper : Obj, Helper
handlebar helper "is" acts like "if", comparison utility
Syntax: {{is param1 param2 operand}}...{{else}}...{{/is}}
Given one argument, is acts exactly like if: {{#is x}}..{{else}}..{{/is}}
Given two arguments, is compares the two are equal
(a non-strict, == comparison, so 5 == '5' is true)
{{#is x y}} ... {{else}} ... {{/is}}
Given three arguments, the 3rd argument becomes the comparator.
{{#is x y "not"}} ... {{else}} ... {{/is}}
{{#is 5 2 ">="}} ... {{else}} ... {{/is}}
Several comparators are built-in:
== (same as not providing a comparator)
!=
not (alias for !=)
===
!==
>
>=
<
<=
in (check a value exists in either a comma-separated string, or an array)字段
| name |
方法
| apply |
插槽详情
apply
虚拟重写 CharSequence? apply(Obj? context, Options? options)
name
const static Str name := "is"
ToAbrrHelper
class ToAbrrHelper : Obj, Helper
{{toAbbr}}
根据数值以缩写格式返回数字。数字会被四舍五入到特定的小数位。
参数:digits int - 小数点后显示的位数。(可选)
默认:2
字段
| name |
方法
| apply |
插槽详情
apply
虚拟重写 CharSequence? apply(Obj? context, Options? options)
name
const static Str name := "toAbbr"
Util
const class Util : Obj
方法
| downloadTemp | |
| getCurrentForecast |
插槽详情
downloadTemp
静态文件?downloadTemp(字符串 url)
getCurrentForecast
static [Str:Obj]? getCurrentForecast(Ref siteRef, Proj proj)