【正文】
E_DIR./services)。 $result = $scexecute(39。authUser39。,$user)。 } Data Access Object 1)定義一個DAO類,處理數(shù)據(jù)庫相關(guān)的查詢或更新操作即CURD。典型的一個DAO類會返回一個dataModel給業(yè)務(wù)類,該數(shù)據(jù)模型會和模版文件一起render 視圖。 class UserDAO extends UranApp_Db_BaseDAO { public function authUser($userInfo) { //here call db for validing user login $ = $userInfogetEmail()。 $password = $userInfogetPassword()。 //call db $sql = $thisdbInstancequoteInto(select * from user where user_name=?,$)。 $result = $thisdbInstancequery($sql)。 $rows = $resultfetch()。 //populate user object from rows if(empty($rows)){ $userInfo = null。 }else{ $userInfosetEmail($rows[39。_addr39。])。 } return $userInfo。 } } 2) 在業(yè)務(wù)處理函數(shù)中調(diào)用相關(guān)的dao類獲取相關(guān)的業(yè)務(wù)數(shù)據(jù)。 class UserService extends UranApp_Service_AbstractService { public function getDAOClassName() { return UserDAO。 } public function authUser($userInfo) { return $thisgetDefaultDAOClass()authUser($userInfo)。 } } 數(shù)據(jù)模型綁定與視圖輸出 把數(shù)據(jù)模型綁定到視圖對象中,然后調(diào)用相應(yīng)的模版文件進行視圖輸出。 1)在action函數(shù)中綁定數(shù)據(jù)模型到視圖對象中。 public function loginAction() { $user = new UserInfo()。 //get form data from request object $usersetEmail($this_getParam())。 $usersetPassword($this_getParam(pass))。 //call authUser to handle user login $sc=UranApp_Service_ServiceContainer::instance(UserService,MODULE_DIR./services)。 $result = $scexecute(39。authUser39。,$user)。 $thisviewuser = $result。 //following code can omit,as default page which name is the same //as action name $thisrender(login)。 }2)在模版中使用模型數(shù)據(jù)輸出視圖。: input class=inputtext id= name= value={$usergetEmail()} / 5. 主要模塊及組件類圖 核心業(yè)務(wù)類庫圖 主要模塊序列圖 Ajax 相關(guān)技術(shù). 為了提高頁面刷新速度,系統(tǒng)大量使用了ajax效果。開發(fā)人員只需要引用相關(guān)的js文件,,然后簡單調(diào)用callout(requestUrl,in_id)即可實現(xiàn)。 效果演示截圖: 1) Click the ‘Share Link’ on wall page, then popup the dialog below: 2) Input share link url, eg. and click attach button, then ajax request will be send. 3) Ajax response will be shown: 分頁技術(shù) 為了防止頁面一次加載大量數(shù)據(jù),使用了分頁技術(shù)僅僅獲取部分數(shù)據(jù)顯示。例如wall 模塊,默認每頁顯示5條,頁面底部最多顯示10個頁面的頁碼。When click page 10 or last page, will continue to show the rest page: 下拉筐模糊參照查詢當用戶在下來筐中輸入字符,系統(tǒng)會自動彈出下拉筐方便用戶進行 選擇。 頁面布局及風格 1) Hidden or display the page content. After click: 2) Drag page content to another place.Before drag: After drag: 6. 其它文檔 1. Apache 集群配置文檔。 2. Mysql 集群配置文檔。 3. MogileFS 分布式文件系統(tǒng)配置文檔。 4. Uran 應(yīng)用系統(tǒng)安裝文檔?! HC Confidential 31/31