Presentation is loading. Please wait.

Presentation is loading. Please wait.

OFC321 InfoPath在企业解决方案中应用的最佳实践

Similar presentations


Presentation on theme: "OFC321 InfoPath在企业解决方案中应用的最佳实践"— Presentation transcript:

1 OFC321 InfoPath在企业解决方案中应用的最佳实践
2019年4月11日5时13分 OFC321 InfoPath在企业解决方案中应用的最佳实践 李婷 技术方案专员 专业解决方案部 微软有限公司 © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

2 今日议程 初识InfoPath Microsoft Office InfoPath 数据流 InfoPath的数据连接
2019年4月11日5时13分 今日议程 初识InfoPath Microsoft Office InfoPath 数据流 数据模型 “契约” 更新/绑定周期 Performance InfoPath的数据连接 数据连接模式 Data Adapter的体系结构 主数据和辅助数据 连接到数据库 InfoPath在企业级解决方案的应用 解决方案实施的场景 应用InfoPath的专业解决方案 DEMO © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

3 2019年4月11日5时13分 初识InfoPath © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

4 InfoPath是什么? InfoPath的应用场景 创建丰富的电子表单的工具 医药卫生行业——病人登记、病理管理、处方查询… …
2019年4月11日5时13分 InfoPath是什么? 创建丰富的电子表单的工具 InfoPath的应用场景 医药卫生行业——病人登记、病理管理、处方查询… … 保险银行业——保险单据… … 生产行业——订单审批、项目申报、报销单据… … 政府教育行业——个人信息、每月报表… … 与表单相关的场景… … © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

5 表单定义 InfoPath 表单模版 (XSN) 数据 (.XML) 视图 Schema (XSLT) (XSD) 解决方案定义 (XSF)
2019年4月11日5时13分 表单定义 InfoPath 表单模版 (XSN) 数据 (.XML) 解决方案定义 (XSF) 视图 (XSLT) Schema (XSD) 默认数据 (XML) 商务逻辑 (JS, DLL) URL or URN © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

6 2019年4月11日5时13分 InfoPath 数据流 © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

7 InfoPath “契约” XML数据总是正确的 XSLT 定义了从XML 到视图的映射 商务逻辑操作是针对DOM数据的
2019年4月11日5时13分 InfoPath “契约” XML数据总是正确的 通常用XML DOM存储当前数据 XML DOM 通常总是 “有效的” XSLT 定义了从XML 到视图的映射 视图仅仅是数据的显示形式 视图是多变的——所有的状态信息都存储在 DOM中 商务逻辑操作是针对DOM数据的 没有视图属性(除非做了这样的选择) 视图/控制状态是基于DOM的状态的 © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

8 Step 1: 向DOM中添加数据(演示) XML 可以来源于: 来自旧版本的模版么? 结果加载到DOM中 一个文件 一个数据连接
2019年4月11日5时13分 Step 1: 向DOM中添加数据(演示) XML 可以来源于: 一个文件 一个数据连接 template.xml 来自旧版本的模版么? upgrade.xsl (自动产生) OnVersionUpgrade 结果加载到DOM中 © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

9 Step 2: OnLoad 阶段 数据连接队列运行 声明的算法求值 执行 OnValidate 代码 声明的规则运行
2019年4月11日5时13分 Step 2: OnLoad 阶段 数据连接队列运行 声明的算法求值 执行 OnValidate 代码 声明的规则运行 OnLoad 代码运行 DOM 事件启动 © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

10 Step 3: 视图准备完毕 浏览应用到XML DOM的XSLT 输出为HTML HTML 投射到视图表面 视图展现外观
2019年4月11日5时13分 Step 3: 视图准备完毕 浏览应用到XML DOM的XSLT 输出为HTML HTML 投射到视图表面 视图展现外观 视图初始化并绑定控件 OnSwitchView 启动 此时视图可以同用户进行交换了 © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

11 更新/绑定周期 更新 XSL HTML 视图 XML DOM XSF 数据绑定 2019年4月11日5时13分
© 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

12 Step 4: 用户交互 XML DOM 用户做了一个编辑工作 这个改变反馈到DOM相应的部分 事件的顺序 阶段 1: 结构上进行整合
2019年4月11日5时13分 Step 4: 用户交互 用户做了一个编辑工作 这个改变反馈到DOM相应的部分 事件的顺序 阶段 1: 结构上进行整合 OnBeforeChange Schema 结构验证 阶段 2: 验证 OnValidate 声明的验证 Schema 数据类型验证 阶段 3: 侧面影响 OnAfterChange 声明的算法 XML DOM Node Node Node Source Node © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

13 Step 5: 浏览更新 原本实施的步骤为: 实际上实施的工作: 优化 (遵循契约) 将XSLT 重新应用到 XML DOM
2019年4月11日5时13分 Step 5: 浏览更新 原本实施的步骤为: 将XSLT 重新应用到 XML DOM 输出新的HTML 旧的HTML被新的HTML取代 视图进行显示、重新初始化,等等 实际上实施的工作: 优化 (遵循契约) 简化绑定:不需要视图更新 某范围内的重新应用 全部重新应用 © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

14 Performance Tip #1: 开始时间
2019年4月11日5时13分 Performance Tip #1: 开始时间 症状 可能有的诊断 应对策略 打开一个表单需要花费很长时间 有很多数据源队列等待加载 CLR 加载时间 XML 可能太大了 有过多的处理程序 加载的时候仅运行那些必要的队列 过滤查询的 XML 数据 关掉事件 © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

15 Performance Tip #2: 冻结的表单(演示)
2019年4月11日5时13分 Performance Tip #2: 冻结的表单(演示) 症状 可能有的诊断 应对策略 在打开或切换视图的时候,表单冻结了一段时间 视图中有过多的可编辑的控件 HTML 过大 (几兆字节) 使用过滤器或大纲/细节控件,减少 HTML 的大小 减少下拉菜单的数量 © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

16 Performance Tip #3: 慢速编辑(演示)
2019年4月11日5时13分 Performance Tip #3: 慢速编辑(演示) 症状 可能有的诊断 应对策略 在用户做了某个改动后,表单变慢了 (e.g. 比如在区域中录入,光标却还在区域之外) 编辑带来了太多的侧面影响 禁用视图更新 了解事件触发——使用其他的DOM 了解操作(“删除”,“插入”) © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

17 Performance Tip #4: 添加行(演示)
2019年4月11日5时13分 Performance Tip #4: 添加行(演示) 症状 可能的诊断 应对策略 这里的每个下拉列表都包含上千个选项,让我添加一行看看,wow,真够慢的,怎么会这样? 请记住,视图中的所有状态都是由HTML决定的,由XSLT进行输出。在本例中,每行包括1000个选项。这就意味着当我添加一行的时候,同时我也创建了一个巨大的HTML流,视图需要重新解释这个HTML流。 This can happen any time a change causes a big HTML diff. Drop-downs with lots of options are the worst offenders, simply because you don’t see the options so the scale problem isn’t as obvious. This scenario isn’t very far-fetched either – consider pulling a list of user names from Active Directory. It may be fine when the number of users is small, but grow exponentially worse when the org increases in size! We had one customer who had 40,000 items in a drop-down. Whether or not that’s slow, it’s a horrible user experience - can you imagine scrolling down half-way, then mis-clicking the mouse? Yikes! The solution here again is to understand the contract and “cheat” it – let get those thousands of options out of the HTML, so it’s not InfoPath’s job to manage them. Christopher Walker had a great idea which he blogged – to use a modal dialog with the options in it. I click this button and exactly the same data is passed to it as would show in the drop-down. I pick the value, it’s returned from the dialog and stuffed into the view. Since all of those options aren’t in the view, it’s much faster. In this case, I’m using an HTML dialog implemented in script in and DHTML, which I show using the ShowModalDialog() call in InfoPath’s OM. From managed code, with a trusted form, you can pop a Form instead. The next step here is to add filtering and grouping to the list – you can make the dialog as complex as you want, so you can make the experience far richer than I’m showing you. Suddenly, picking from 40,000 items isn’t as crazy an idea at all! 新添加一行需要好几秒钟的时间 HTML diff 很大 下拉菜单选项使HTML变得很臃肿 在有大量的选项的时候可以使用任务面板或对话模型的方式 © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

18 Performance Tip #5: 编辑 症状 可能有的诊断 应对策略 每次编辑都需要时间来”安置” HTML 的显示过于复杂
2019年4月11日5时13分 Performance Tip #5: 编辑 症状 可能有的诊断 应对策略 每次编辑都需要时间来”安置” HTML 的显示过于复杂 XSF中存在不必要的xmlToEdits 复杂的绑定依存 减少嵌套 (表格、节) 降低动态宽度 (%) 检查 XSF, 去除不需要的控件 © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

19 Performance Tip #6: 二进制数据(演示)
2019年4月11日5时13分 Performance Tip #6: 二进制数据(演示) 症状 可能的诊断 应对策略 一旦加入了文件、图片或数字签名,表单的打开/编辑/提交就会变得很慢 嵌入的文件和/或图形数据增加了XML文件的大小。 抗抵赖数据的签名(PNG图片)增加了XML文件的大小。 “分裂” 出文件或图片 (保存为共享) 用链接进行替换 创建较小的“签名视图 © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

20 其他的关于性能方面的提示 避免自定义 XSL 缩短视图的长度和降低它的复杂度
2019年4月11日5时13分 其他的关于性能方面的提示 避免自定义 XSL 设想现在 (及将来)可以在InfoPath中设计XSLT的优化渠道 缩短视图的长度和降低它的复杂度 简单视图(< 50k XSLT)一般会更快 使用多重视图 © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

21 2019年4月11日5时13分 InfoPath数据连接 © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

22 数据连接模式 基于XML的数据模型 Data Adapters 表单中的商务逻辑可以为自定义数据连接所用
2019年4月11日5时13分 数据连接模式 基于XML的数据模型 外部数据以XML文件的形式被引入进来 InfoPath的输出是一个XML文件 保存文件 提交文件或文件片断 Data Adapters 内置的对象,便于与外部数据连接 可以通过声明的规则或目标模块使用 表单中的商务逻辑可以为自定义数据连接所用 © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

23 Data Adapter 的体系结构 InfoPath Runtime Object Model Access Main DOM HTTP
2019年4月11日5时13分 Data Adapter 的体系结构 Query Data Adapters ADO XML File WSS List Web Service HTTP POST DAV (WSS) ADO Web Service Submit Data Adapters HwS Submit Adapters External Data Source Sec. DOM External Data Sources Query Adapters View Object Model Access Main DOM InfoPath Runtime © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

24 主数据和辅助数据 “Main DOM” 是InfoPath文档 辅助数据源是一些帮助性的数据 模式: 可以使用辅助数据源进行:
2019年4月11日5时13分 主数据和辅助数据 “Main DOM” 是InfoPath文档 辅助数据源是一些帮助性的数据 如下拉菜单和列表框中的选项 在会话的结尾不会予以保留 控件可以与辅助数据绑定(new in SP1) 模式: 可以使用辅助数据源进行: 数据校验 分段查询: 使用商务逻辑把需要的数据复制到main DOM 中 与自定义的控件进行交互 © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

25 连接到数据库 选择 数据库和 Web service dataset adapters 可以自动的跟踪及提交改动的数据。
2019年4月11日5时13分 连接到数据库 选择 ADO adapter Web Services adapter 面向SQLXML 的XML file adapter 在OnLoad和OnSubmitRequest 事件处理中应用自定义的商务逻辑 数据库和 Web service dataset adapters 可以自动的跟踪及提交改动的数据。 © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

26 InfoPath在企业级解决方案的应用

27 解决方案实施的场景 某公司需要一个处理人员费用报销的流程 员工填写报销单并提交 经理得到提示,进行批复:批准/拒绝
如果被拒绝,员工修改报销单,提交 经理批准后,员工可以以word的方式打开该报销单 经理可以在Excel中查看批准的单据

28 应用InfoPath的专业解决方案 Windows SharePoint Services Server Windows Server 雇员
2019年4月11日5时13分 应用InfoPath的专业解决方案 Windows SharePoint Services Server Windows Server 雇员 应用服务器 /财务数据库 经理 报销单 BizTalk Server © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

29 2019年4月11日5时13分 某公司人员费用报销系统 © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

30 资源 Office Online InfoPath MSDN InfoPath Developers Center
2019年4月11日5时13分 资源 Office Online InfoPath MSDN InfoPath Developers Center InfoPath Newsgroup microsoft.public.infopath InfoPath Team Blog © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

31 Office Online InfoPath MSDN InfoPath Developers Center
MSDN InfoPath Developers Center InfoPath Newsgroup microsoft.public.infopath InfoPath Team Blog

32

33


Download ppt "OFC321 InfoPath在企业解决方案中应用的最佳实践"

Similar presentations


Ads by Google