Google Search

自訂搜尋

2009年3月31日 星期二

[APEX] 讀書心得 - Part I (Application Builder Concepts)

花了三天時間終於完成了第一個應用系統, 內含收貨資料維護, 出貨資料維護和出貨庫存報表. 其中出貨資料維護是用 Master-Detail的 Form去設計. 使用後的感覺是, Schema也就是Table/Index/...的建立還是要透過APEX的畫面自行設計&建立, 懂關聯式資料的人都可以上手. 之後進到WEB畫面的建構部份才是真正的挑戰. 如前文所提, 我也K了不少文件和安裝範例程式來看, 總算完成第一個應用程式(正請老婆大人驗收中).
感覺是APEX的底層設計考慮不少Layer的觀念很像Java 的 MVC(Model & View & Control)觀念, 所以有些設定要想一下他的原理才能夠瞭解, 知道如何修改.
下面是我K了官網上的文件後, 先將整個WEB產生的架構整理如下, 看一下在去K厚厚的原文書會比較有幫助.







.

Item #ItemSub ItemDescription

.

1.1PagePage"the basic building block of an application,contain user interface elements, such as tabs, lists, buttons, items, and regions."

.

1.2PagePage Rendering"lists user interface controls and logic that are executed when a page is rendered. Page Rendering is the process of generating a page from the database
Show Page is the page rendering process. It assembles all the page attributes (including regions, items, and buttons) into a viewable HTML page."

.

1.3PagePage Processing"Lists logic controls (such as computations and processes) that are evaluated and executed when the page is processed.
Accept Page performs page processing. It performs any computations, validations, processes, and branching.
When you request a page using a URL, the engine is running Show Page. When you submit a page, the Application Express engine is running Accept Page or performing page processing during which it saves the submitted values in the session cache and then performs any computations, validations, or processes."

.

1.4ConditionConditionA small unit of logic that helps you control the display of regions, items, buttons, and tabs as well as the execution of processes, computations, and validations.

.

1.4.1Condition TypeCurrent page in Expression 1"3,100,203
If the current page is 100, then this condition evaluates to true and the condition passes."

.

1.4.2Condition TypeExists (SQL query returns at least one row)"SELECT 1 FROM employees WHERE department_id = :P101_DEPTNO"

.

1.4.3Condition TypePL/SQL ExpressionNVL(:MY_ITEM,'NO') = 'YES'

.

1.5Session State ManagementSessionA session is a logical construct that establishes persistence (or stateful behavior) across page views

.

1.5.1Session State ManagementReferencing Session State"1. SQL --> :MY_ITEM --> Standard bind variable syntax for items whose names are no longer than 30 characters. Use this syntax for references within a SQL query and within PL/SQL.
2. PL/SQL --> V('MY_ITEM') --> PL/SQL syntax referencing the item value using the V function.
3. PL/SQL --> NV('MY_NUMERIC_ITEM') --> Standard PL/SQL syntax referencing the numeric item value using the NV function.
4. Static text (exact) --> &MY_ITEM. --> Static text. Exact substitution."

.

1.5.2Session State ManagementSetting Session StateWhen a user submits a page, the Application Express engine automatically stores values typed into fields (items) in session state.

.

1.5.3Session State ManagementClearing Session State"Uses standard f?p syntax to clear the cache
1. Clearing Cache by Item
2. Clearing Cache by Page
3. Clearing Cache for an Entire Application
4. Clearing Cache for the Current User Session"

.

1.6Understanding URL SyntaxUnderstanding URL Syntax"The URL that displays for each page identifies the location of Oracle Application Express, the address of Oracle Application Express, the application ID, the page number, and the session ID.
Using f?p Syntax:
f?p=App:Page:Session:Request:Debug:ClearCache:itemNames:itemValues:PrinterFriendly

.

1.7Substitution StringsSubstitution Strings"You can use substitution strings within a page template or region source to replace a character string with another value. As you design your application and enable users to edit items, you use substitution strings to pass information.
You can use substitution strings in Application Builder in the following ways:
* Include a substitution string within a template to reference component values
* Reference page or application items using &ITEM. syntax
* Use built-in substitution strings to achieve a specific type of functionality

.






沒有留言: