随笔 - 571  文章 - 4  评论 - 253  阅读 - 72万

ADF_Data Binding系列2_使用URL Service Data Control

2015-02-16 Created By BaoXinjian

一、摘要


本文介绍通过XML Schema创建URL Data Control显示RSS需求

Step 1: Create a New Application and Project

Step 2: Create an XML Schema

Step 3: Create a URL Service Data Control

Step 4: Create a JSF Page

Step 5: Add the Data Control to the JSF Page

Step 6: Enhance the Layout

Step 7: Set the Labels

 

1: Create a New Application and Project


Step1.  创建custom application

 

Step2. 定义application属性参数

 

2: Create an XML Schema


Step1.  创建XML Schema

Setp2. 获取XML Schema文件

 

Step3. 创建XML Schema

Step4. 查看所创建的Schema文件结构

Step5. 查看详细内容

复制代码
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
             xmlns="http://www.example.org"
             targetNamespace="http://www.example.org"
             elementFormDefault="qualified">
   <xsd:element name="rss">
     <xsd:complexType>
       <xsd:sequence>
         <xsd:element name="channel" type="channel"></xsd:element>
       </xsd:sequence>
     </xsd:complexType>
   </xsd:element>
   <xsd:complexType name="channel">
     <xsd:sequence>
       <xsd:element name="lastBuildDate" type="xsd:string"></xsd:element>
       <xsd:element name="title" type="xsd:string"></xsd:element>
       <xsd:element name="link" type="xsd:string"></xsd:element>
       <xsd:element name="description" type="xsd:string"></xsd:element>
       <xsd:element name="managingEditor" type="xsd:string"></xsd:element>
       <xsd:element name="language" type="xsd:string"></xsd:element>
       <xsd:element name="item" type="item" minOccurs="0"        maxOccurs="100"></xsd:element>
     </xsd:sequence>
   </xsd:complexType>
   <xsd:complexType name="item">
     <xsd:sequence>
       <xsd:element name="title" type="xsd:string"></xsd:element>
       <xsd:element name="link" type="xsd:string"></xsd:element>
       <xsd:element name="description" type="xsd:string"></xsd:element>
       <xsd:element name="pubDate" type="xsd:string"></xsd:element>
     </xsd:sequence>
   </xsd:complexType>
 </xsd:schema>
复制代码

Step6. 文件保存位置

 

3: Create a URL Service Data Control


Step1.  创建URL Service Data Contorl

Step2.  定义Data Source

Step3. 定义Connection

Step4. 定义Data Format

Step5. 查看所创举爱你的URL Service Data Control信息

Step6.最终组件结构显示

 

4: Create a JSF Page


Step1.  创建Custom Project


 Step2.  创举爱你NewsPage

Step3. 查看所创建的组件结构

 

5: Add the Data Control to the JSF Page


Step1.  从Datacontorl中拖动数据到页面中

 

Step2.  运行测试显示数据结果如下

 

 

6: Enhance the Layout


Step1. 修改Link的显示文本

Step2.  创建Link的超链接

step3. 修改Link的宽度

step4. 运行测试,显示结果如下

 

7: Set the Labels


Step1.  修改栏位

 

Step2.  修改栏位Title

Step3. 显示栏位如下

 

Thanks and Regards

posted on   东方瀚海  阅读(610)  评论(0编辑  收藏  举报
编辑推荐:
· go语言实现终端里的倒计时
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
阅读排行:
· 周边上新:园子的第一款马克杯温暖上架
· Open-Sora 2.0 重磅开源!
· 分享 3 个 .NET 开源的文件压缩处理库,助力快速实现文件压缩解压功能!
· Ollama——大语言模型本地部署的极速利器
· DeepSeek如何颠覆传统软件测试?测试工程师会被淘汰吗?

点击右上角即可分享
微信分享提示