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

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)

文檔簡介

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

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

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

4、化1.3.1、數(shù)據(jù)庫管理系統(tǒng)的安裝 無1.3.2、數(shù)據(jù)庫安裝及數(shù)據(jù)導(dǎo)入 無1.4、用戶權(quán)限設(shè)置(軟件授權(quán)與許可) 無1.5、軟件使用特點(diǎn)及慣例 無1.6、基礎(chǔ)知識學(xué)習(xí)網(wǎng)站技術(shù)部共享工具:29 html : javacript : 第二章 技術(shù)框架后臺調(diào)用架構(gòu):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的值為具體實現(xiàn)類名(首字母小寫)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的引導(dǎo)文件,可以自動切換ext-all.js和ext-all-debug.jsext-al

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

7、格式化好的層。4.json對象json對象以”開始,以”結(jié)束,屬性名和值以”:”分割,屬性間用“,”分割。例如: var person = name :tom,age:23,books : name : java,name : .net屬性值可以是字符串,數(shù)字,數(shù)組,也可以是json對象。 5.常用函數(shù) ext.onready(function(); 當(dāng)頁面元素加載完畢后,執(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 /傳遞參數(shù) , success: function(response) /請求成功后執(zhí)行方法 var text = response.responsetext; / process server response here );補(bǔ)充例子:局部更新頁面方法 ext.onready(function() var loader = ext.get(info).getloader(); loader.startautorefresh

10、(1000, url : index.html, renderer :function(loader,resp,req) ); );8.數(shù)據(jù)模型model 數(shù)據(jù)實體模型代表數(shù)據(jù)實體。定義實體,常用配置: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模型關(guān)聯(lián),不常用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 數(shù)據(jù)集 保存model

15、對象的客戶端緩存,提供了數(shù)據(jù)的過濾,排序,查找。var store = ext.create(ext.data.store, autoload: true, model: user, proxy: type: ajax, url : users.json, reader: type: json, root: users );proxy 數(shù)據(jù)代理用來處理數(shù)據(jù)的獲取和保存。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讀取數(shù)據(jù)到內(nèi)存,頁面刷新,數(shù)據(jù)丟失。/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 ,不常用,想了解去官網(wǎng)查看。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();其他服務(wù)器端不常用。readerwriter 數(shù)據(jù)讀寫器用于讀取原始數(shù)據(jù)到model實體模型,或者將model實體模型格式化為指定的數(shù)據(jù)格式reader 將代理讀取到的原始數(shù)據(jù)按照不同規(guī)則解析,將解析后的數(shù)據(jù)放到模型對象中,常見的是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 );簡單數(shù)據(jù)格式 id: 1, name: ed spencer, email: ed , id: 2, name: abe elias, email: abe 自定義數(shù)據(jù)格式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 將代理提交到服務(wù)端數(shù)據(jù)進(jìn)行編碼,常見的是json. 了解下就可以了。9.grid組件ext.grid.panel主要由兩部分組成:處理數(shù)據(jù)的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組件第三章 項目整體結(jié)構(gòu)3.1、代碼結(jié)構(gòu) l 項目按模塊劃分l 每個模塊對應(yīng)三層結(jié)構(gòu)mapper:持久層 下面的包按該模塊涉及到實體劃分 以dao為后綴的是hibernate的dao接口層 以daoimpl

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

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

29、nkedlist params = new linkedlist(); /構(gòu)造where條件參數(shù)值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(); /把封裝分頁結(jié)果傳遞給前臺starti

溫馨提示

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

評論

0/150

提交評論