SSHI注解框架操作手冊_第1頁
SSHI注解框架操作手冊_第2頁
SSHI注解框架操作手冊_第3頁
SSHI注解框架操作手冊_第4頁
SSHI注解框架操作手冊_第5頁
已閱讀5頁,還剩16頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領

文檔簡介

1、 級別:秘密文檔編號:項目編號_年份_文檔類型_文檔序號sshi注解框架操作手冊版本:v1.0湖南省賽寶軟件服務有限公司all right reserved (c) 2010-2011xxxxxxxxxx系統-操作手冊 版本:v1.0目錄更新歷史1前言2第一章 軟件的安裝與常用配置31.1、軟件安裝環(huán)境要求31.1.1、軟件環(huán)境31.1.2、硬件環(huán)境31.2、軟件的安裝指導31.2.1、服務器端安裝31.2.2、客戶端安裝31.3、數據庫初始化31.3.1、數據庫管理系統的安裝31.3.2、數據庫安裝及數據導入31.4、用戶權限設置(軟件授權與許可)31.5、軟件使用特點及慣例3第二章 技術框

2、架42.1、web層:struts2+conversion注解插件42.2、持久層:hibernate+ibatis42.2、ioc:spring42.4、頁面ui:extjs44第三章 項目整體結構53.1、代碼結構5第四章 codefly使用說明64.1、使用說明6湖南省賽寶軟件服務有限公司 page: 19更新歷史版本號作者(日期)評審者(日期)批準者(日期)說明1.1李鴻翼 2011-7-26初評稿前言為了讓用戶初步了解如何使用sshi 框架,以及該程序的一些主要特征,我們特撰寫了此操作手冊。手冊根據程序的菜單組織章節(jié),每個菜單為一個章節(jié),共有4個章節(jié),涵蓋了sshi 框架軟件的所有功

3、能及一些理論知識。如果本手冊能促使軟件使用者更加熟練使用sshi 框架,手冊的編撰者便感到非常欣慰了。本手冊由李鴻翼編寫,第一章為軟件的安裝配置權限控制信息,新的功能模塊從第二章開始。由于編者水平有限,時間緊張,手冊中一定存在疏漏和不足,懇請廣大用戶批評指證。 編 者:李鴻翼 2011 年 7月 26日第一章 軟件的安裝與常用配置1.1、軟件安裝環(huán)境要求1.1.1、軟件環(huán)境eclipse jdk6tomcat71.1.2、硬件環(huán)境 無1.2、軟件的安裝指導 無1.2.1、服務器端安裝 無1.2.2、客戶端安裝 bs系統此處為從瀏覽器如何訪問,cs系統則為實際如何安裝客戶端軟件1.3、數據庫初始

4、化1.3.1、數據庫管理系統的安裝 無1.3.2、數據庫安裝及數據導入 無1.4、用戶權限設置(軟件授權與許可) 無1.5、軟件使用特點及慣例 無1.6、基礎知識學習網站技術部共享工具:29 html : javacript : 第二章 技術框架后臺調用架構:2.1、web層:struts2+conversion注解插件l url action匹配規(guī)則:xtgl/user!add.action - xtgl包下的useraction里的add方法 l 在action里如何使用service: 使用resource注解 如: resource(name=”xxxservic

5、eimpl”) name的值為具體實現類名(首字母小寫)2.2、持久層:hibernate+ibatis 略2.2、ioc:spring 略2.3、頁面ui:extjs41.extjs開發(fā)包: bulid目錄是ext壓縮后的代碼。docs目錄包含ext文檔,特別重要的是api。examples目錄包含官方演示實例local目錄包含多國語言的資源文件,其中是簡體中文 pkgs目錄是ext各部分功能的打包 resource目錄包含ext的所有圖片和樣式 src目錄是未壓縮的源碼bootstrap.js是ext的引導文件,可以自動切換ext-all.js和ext-all-debug.jsext-al

6、l.js文件是核心庫,必須引入ext-all-debug是ext-all.js的調試版本2.如何建立一個hello word.解壓引入到eclipse.3.extjs基本概念 panel面板 : 面板是一塊空白區(qū)域,里面可以放各種組件,支持extjs的各種布局。layout布局 : 布局是指組件在一個容器中的擺放方式。componenet組件 : 組件是可以重用的特定功能。如簡單的按鈕,數據表格等。window窗體: 它并不是一個真正的windows窗口,繼承于面板,本質是一個css層,所以不可能拖拽到瀏覽器外 。dialog對話框 : 普通對話框、選擇對話框、輸入對話框,其本質也是一個css

7、格式化好的層。4.json對象json對象以”開始,以”結束,屬性名和值以”:”分割,屬性間用“,”分割。例如: var person = name :tom,age:23,books : name : java,name : .net屬性值可以是字符串,數字,數組,也可以是json對象。 5.常用函數 ext.onready(function(); 當頁面元素加載完畢后,執(zhí)行function。ext.getcmp(id); 通過id獲取組件。ext.get(id) 通過id獲取dom元素,與document.getelementbyid()一樣。5布局l accordion(折疊布局)見ac

8、cordion.htmll border布局分為east,south,west,north,center5個部分。任何border布局必須含有一個region:center位置如果有west或者east必須指定寬度,剩下的就是center寬度。如果有north或者south必須制定高度,剩下的高度就是center高度 見border.hmtll hbox水平盒子布局按水平方向擺放,寬度用flex或者width表示。width為固定寬度,flex為減去width寬度后的百分比 見hbox.html l vbox垂直盒子布局 6.表單ext.form.formpanela) 表單基本組件見file

9、dtypes.htmlb) 表單驗證 vtype7ajax請求ext.ajax.request( url: page.php, /請求連接地址 params: id: 1 /傳遞參數 , success: function(response) /請求成功后執(zhí)行方法 var text = response.responsetext; / process server response here );補充例子:局部更新頁面方法 ext.onready(function() var loader = ext.get(info).getloader(); loader.startautorefresh

10、(1000, url : index.html, renderer :function(loader,resp,req) ); );8.數據模型model 數據實體模型代表數據實體。定義實體,常用配置:fields,定義實體有哪些字段,定義一些方法。ext.define(user, extend: ext.data.model, fields: name: name, type: string, name: age, type: int, name: phone, type: string, name: alive, type: boolean, defaultvalue: true , ch

11、angename: function() var oldname = this.get(name), newname = oldname + the barbarian; this.set(name, newname); );創(chuàng)建實體:var user = ext.create(user, name : conan, age : 24, phone: 555-555-5555);user.changename();user.get(name); /returns conan the barbarianassociations模型關聯,不常用ext.define(post, extend: ex

12、t.data.model, fields: id, user_id, belongsto: user, hasmany : model: comment, name: comments);ext.define(comment, extend: ext.data.model, fields: id, user_id, post_id, belongsto: post);ext.define(user, extend: ext.data.model, fields: id, hasmany: post, model: comment, name: comments );validations 驗證

13、ext.define(user, extend: ext.data.model, fields: name: name, type: string, name: age, type: int, name: phone, type: string, name: gender, type: string, name: username, type: string, name: alive, type: boolean, defaultvalue: true , validations: type: presence, field: age, type: length, field: name, m

14、in: 2, type: inclusion, field: gender, list: male, female, type: exclusion, field: username, list: admin, operator, type: format, field: username, matcher: /(a-z+)0-92,3/ );var instance = ext.create(user, name: ed, gender: male, username: edspencer);var errors = instance.validate();store 數據集 保存model

15、對象的客戶端緩存,提供了數據的過濾,排序,查找。var store = ext.create(ext.data.store, autoload: true, model: user, proxy: type: ajax, url : users.json, reader: type: json, root: users );proxy 數據代理用來處理數據的獲取和保存。types of proxythere are two main types of proxy -clientandserver. the client proxies save their data locally and i

16、nclude the following subclasses: localstorageproxy- saves its data to localstorage if the browser supports it sessionstorageproxy- saves its data to sessionstorage if the browsers supports it memoryproxy- holds data in memory only, any data is lost when the page is refreshedthe server proxies save t

17、heir data by sending requests to some remote server. these proxies include: ajax- sends requests to a server on the same domain jsonp- uses json-p to send requests to a server on a different domain direct- usesext.direct.managerto send requestsproxies operate on the principle that all operations per

18、formed are either create, read, update or delete. these four operations are mapped to the methodscreate,read,updateanddestroyrespectively. each proxy subclass implements these functions.base class for any client-side storage. used as a superclass formemoryandweb storageproxies. do not use directly,

19、use one of the subclasses instead.exy.memory讀取數據到內存,頁面刷新,數據丟失。/this is the model we will be using in the storeext.define(user, extend: ext.data.model, fields: name: id, type: int, name: name, type: string, name: phone, type: string, mapping: phonenumber );/this data does not line up to ou

20、r model fields - the phone field is called phonenumbervar data = users: id: 1, name: ed spencer, phonenumber: 555 1234 , id: 2, name: abe elias, phonenumber: 666 1234 ;/note how we set the root in the reader to match the data structure abovevar store = ext.create(ext.data.store, autoload: true, mode

21、l: user, data : data, proxy: type: memory, reader: type: json, root: users );其他客戶端proxy ,不常用,想了解去官網查看。exy.ajaxext.define(user, extend: ext.data.model, fields: id, name, email);/the store contains the ajaxproxy as an inline configurationvar store = ext.create(ext.data.store, model: user, p

22、roxy: type: ajax, url : users.json );store.load();其他服務器端不常用。readerwriter 數據讀寫器用于讀取原始數據到model實體模型,或者將model實體模型格式化為指定的數據格式reader 將代理讀取到的原始數據按照不同規(guī)則解析,將解析后的數據放到模型對象中,常見的是json.ext.define(user, extend: ext.data.model, fields: id, name, email);var store = ext.create(ext.data.store, model: user, proxy: type

23、: ajax, url : users.json, reader: type: json );簡單數據格式 id: 1, name: ed spencer, email: ed , id: 2, name: abe elias, email: abe 自定義數據格式reader: type: json, root: users users: id: 1, name: ed spencer, email: ed , id: 2, name: abe elias, email: abe 定位讀取位置:resordreader: type : json, root : users, record:

24、user total: 122, offset: 0, users: id: ed-spencer-1, value: 1, user: id: 1, name: ed spencer, email: ed writer 將代理提交到服務端數據進行編碼,常見的是json. 了解下就可以了。9.grid組件ext.grid.panel主要由兩部分組成:處理數據的store,用于渲染表頭的columnsext.create(ext.data.store, storeid:simpsonsstore, fields:name, email, phone, data:items: name: lisa

25、, email:lisa, phone:555-111-1224 , name: bart, email:bart, phone:555-222-1234 , name: homer, email:home, phone:555-222-1244 , name: marge, email:marge, phone:555-222-1254 , proxy: type: memory, reader: type: json, root: items );ext.create(ext.grid.panel, title: simpsons, store: ext.data.storemanager

26、.lookup(simpsonsstore), columns: header: name, dataindex: name , header: email, dataindex: email, flex: 1 , header: phone, dataindex: phone , height: 200, width: 400, renderto: ext.getbody()10.tree組件第三章 項目整體結構3.1、代碼結構 l 項目按模塊劃分l 每個模塊對應三層結構mapper:持久層 下面的包按該模塊涉及到實體劃分 以dao為后綴的是hibernate的dao接口層 以daoimpl

27、為后綴的是dao的實現類 以mapper為后綴的是ibatis接口service:業(yè)務層 以service為后綴的是hibernate的業(yè)務層接口 以serviceimpl為后綴的是業(yè)務層接口的實現類web:控制層 以action為后綴是struts2的actionl 三層接口和類的名稱嚴格按照以上后綴編寫l 下面為實際例子中代碼結構示意圖: action 代碼說明:public void add() 新增一個實體public void updateui() 返回要修改的實體,傳遞到修改界面public void update() 修改實體public void delete() 刪除實體pu

28、blic void pagequerybyhibernate() 分頁查詢getresponse().setcharacterencoding(utf-8); /設置為utf-8編碼extjspage.setstart(start); /前端傳遞過來 開始記錄extjspage.setlimit(limit); /前端傳遞過來 每頁顯示幾條記錄extjspage.settotalcount(this.userservice.queryusercount(); /設置記錄總數量stringbuilder wherehql = new stringbuilder(); /構造where條件語句li

29、nkedlist params = new linkedlist(); /構造where條件參數值if (null != user.getaddress() & !user.getaddress().equals() wherehql.append( o.address like ?);params.add(% + user.getaddress() + %);extjspage.setresult(this.userservice.queryusers(start, limit,wherehql.tostring(), params.toarray(); jsonutils.write(extjspage, getresponse().getwriter(); /把封裝分頁結果傳遞給前臺starti

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經權益所有人同意不得將文件中的內容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
  • 6. 下載文件中如有侵權或不適當內容,請與我們聯系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論