標籤:
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
ADF_Data Binding系列2_使用URL Service Data Control