怎样让新建的Answer必须对某个字段进行过滤?
来源:互联网 发布:More 查看sql文件乱码 编辑:程序博客网 时间:2024/05/17 04:41
考虑如下的需求,当用户在使用Answer做即席查询的时候,怎么让他必须对某一个字段加过滤条件呢?
比如时间,如果不加则不让该请求执行,并同时给出一个提示信息。
下面我就以10G官方的SH demo为例,阐述实现步骤:
11G实现方法类似,具体请参见文末链接。
BIEE本身是提供了该功能的,我们需要做的就是使用javascript去实现一个validateAnalysisCriteria方法,并把我们的验证逻辑
添加进去即可!
默认情况下,该方法始终返回true,即通过验证(执行请求)。如果该方法返回false或者一条消息,则不执行该请求,同时在弹出的窗口中显示返回的消息!
1、新建一个QueryBlock.xml文件,将其放到 {OracleBI}\web\msgdb\custommessages目录(如果没有该目录请手工创建)下注意:放在customMessages下意味着该文件是与语言无关的,如果想和具体语言相关,请将该文件放到{OracleBI}\web\msgdb\目录对应的语言文件夹下,如中文:l_zh
2、创建myblocking.js 代码如下:将该脚本拷贝至{OracleBI}/web/app/res/b_mozilla 和{OracleBI}/oc4j_bi/j2ee/home/applications/analytics/analytics/res/b_mozilla
两个目录下(注,官方文档中关于此目录描述有误)
重启OBPIS和OC4J。
下面来测试一下吧!
Case 1 ,不选任何时间维上的字段,比如只选Prod Category,同时不设置过滤器
结果:正常执行
Case 2,选时间维上的任意字段,同时不设置过滤器
结果:提示“Please filter the Calendar Month Desc”
如下图所示:
Case 3:在Case 2的基础上,添加Calendar Month Desc过滤器,同时指定两个值
结果:提示“Please select 1 and only one Month ”
如下图所示:
Case4:在Case 3的基础上,将过滤值只指定为一个。
结果:执行成功
附相关函数:18.5.4 Validation Helper Functions
参考资料:
10G: Presentation Services Administration Guide 之Blocking Requests in Answers on page 56
11G:System Administrator's Guide 之 18.5.2 Blocking Analyses Based on Criteria
比如时间,如果不加则不让该请求执行,并同时给出一个提示信息。
下面我就以10G官方的SH demo为例,阐述实现步骤:
11G实现方法类似,具体请参见文末链接。
BIEE本身是提供了该功能的,我们需要做的就是使用javascript去实现一个validateAnalysisCriteria方法,并把我们的验证逻辑
添加进去即可!
默认情况下,该方法始终返回true,即通过验证(执行请求)。如果该方法返回false或者一条消息,则不执行该请求,同时在弹出的窗口中显示返回的消息!
1、新建一个QueryBlock.xml文件,将其放到 {OracleBI}\web\msgdb\custommessages目录(如果没有该目录请手工创建)下注意:放在customMessages下意味着该文件是与语言无关的,如果想和具体语言相关,请将该文件放到{OracleBI}\web\msgdb\目录对应的语言文件夹下,如中文:l_zh
2、创建myblocking.js 代码如下:将该脚本拷贝至{OracleBI}/web/app/res/b_mozilla 和{OracleBI}/oc4j_bi/j2ee/home/applications/analytics/analytics/res/b_mozilla
两个目录下(注,官方文档中关于此目录描述有误)
重启OBPIS和OC4J。
下面来测试一下吧!
Case 1 ,不选任何时间维上的字段,比如只选Prod Category,同时不设置过滤器
结果:正常执行
Case 2,选时间维上的任意字段,同时不设置过滤器
结果:提示“Please filter the Calendar Month Desc”
如下图所示:
Case 3:在Case 2的基础上,添加Calendar Month Desc过滤器,同时指定两个值
结果:提示“Please select 1 and only one Month ”
如下图所示:
Case4:在Case 3的基础上,将过滤值只指定为一个。
结果:执行成功
附相关函数:18.5.4 Validation Helper Functions
Validation Helper Function
Description
CriteriaValidator.getSubjectArea()
Returns the name of the subject area referenced by the analysis. It generally is used in a switch statement within the function before doing other validation. If the analysis is a set-based criteria, then it returns null.
CriteriaValidator.tableExists(sTable)
Returns True if the specified folder (table) has been added to the analysis by the content designer, and False if the folder was not added.
CriteriaValidator.columnExists(sTable, sColumn)
Returns True if the specified column has been added to the analysis by the content designer, and False if the column was not added.
CriteriaValidator.dependentColumnExists(sCheckTable, sCheckColumn, sDependentTable, sDependentColumn)
Checks to ensure that the dependentColumn exists if the checkColumn is present. It returns True if either the checkColumn is not present, or the checkColumn and the dependent column are present. If checkColumn and dependentColumn are null, then the folders are validated. If any column from checkTable is present, then a column from dependentTable must be present.
CriteriaValidator.filterExists(sFilterTable, sFilterColumn)
Returns True if a filter exists on the specified column, and False if no filter is present.
CriteriaValidator.dependentFilterExists(sCheckTable, sCheckColumn, sFilterTable, sFilterColumn)
Checks to ensure that the dependentFilter exists if the checkColumn is present in the projection list. It returns True if either the checkColumn is not present, or the checkColumn and the dependent filter are present.
CriteriaValidator.filterCount(sFilterTable, sFilterColumn)
Returns the number of filter values that are specified for the given logical column. If the filter value is "equals," "null," "notNull," or "in," then it returns the number of values chosen. If the column is not used in a filter, then it returns zero. If the column is prompted with no default, then it returns -1. For all other filter operators (such as "greater than," "begins with," and so on) it returns 999, because the number of values cannot be determined.
参考资料:
10G: Presentation Services Administration Guide 之Blocking Requests in Answers on page 56
11G:System Administrator's Guide 之 18.5.2 Blocking Analyses Based on Criteria
- 怎样让新建的Answer必须对某个字段进行过滤?
- NSArray数组 里面含有 NSMutableDictionary 字典 ,对NSMutableDictionary某个字段进行筛选过滤
- 对某张表按某个字段进行排名,相同的名词相同
- 使用函数分组对某个字段进行字符串的累加
- 对jsonarray中某个对象的某一个字段进行排序
- 对bean进行某个字符字段排序
- 如何编写一条SQL实现根据某个字段的条件对某个字段进行不同的update操作
- 对某个事物进行当前状态的判断,一般即做一字段(数值
- list集如何以某个字段对list进行排序
- java项目 List对某个字段进行排序
- 演示了通过存储过程来获取某个字段的值,并对该字段值进行了判断
- 用过滤器对jsp页面中的敏感字段进行过滤
- Mysql对某个表部分数据 某个字段进行字符替换
- Sphinx按某个字段搜索过滤
- php 提交字段太多,后台要对很多表进行更新,字段太多怎样处理
- C#以逗号拆分字符串,若字段中包含逗号(备注:包含逗号的字段必须有双引号引用)则对其进行拼接处理
- C#以逗号拆分字符串,若字段中包含逗号(备注:包含逗号的字段必须有双引号引用)则对其进行拼接处理
- 泛型列表根据某个字段进行排序的用法
- 收集点关于FS寄存器的资料
- java环境变量配置
- 趣题6:圆环
- Oracle数据库中序列(SEQUENCE)的用法详解
- 有限产能与无限产能
- 怎样让新建的Answer必须对某个字段进行过滤?
- 2012-06-21
- ecshop缩略图模糊不清以及产品页图模糊不清的方法
- WebSphere Integration Developer 7下开发一个Hello World ESB Java Service
- 关于 matlab 标定工具箱的使用
- tinyMCE编辑器用法
- Android JNI知识简介
- 交换两个变量的值,不使用第三个变量
- 交通系统的学习