锘??xml version="1.0" encoding="utf-8" standalone="yes"?>久久久久亚洲Av片无码v,亚洲AV无码专区亚洲AV桃,亚洲国产模特在线播放 http://www.tkk7.com/liaojiyong/category/14093.htmlzh-cn Wed, 28 Feb 2007 06:49:24 GMT Wed, 28 Feb 2007 06:49:24 GMT 60 瀹夎ofbiz+tomcat+oracle http://www.tkk7.com/liaojiyong/archive/2006/08/15/63641.htmlliaojiyong liaojiyong Tue, 15 Aug 2006 03:31:00 GMT http://www.tkk7.com/liaojiyong/archive/2006/08/15/63641.html http://www.tkk7.com/liaojiyong/comments/63641.html http://www.tkk7.com/liaojiyong/archive/2006/08/15/63641.html#Feedback 0 http://www.tkk7.com/liaojiyong/comments/commentRss/63641.html http://www.tkk7.com/liaojiyong/services/trackbacks/63641.html 榪欎釜鏂囩珷鎻忚堪鐨勬槸瀹夎ofbiz鍦╫racle+tomcat鐜
ofbiz2.11鎻愪緵鐨勭己鐪佺殑webserver鏄痡etty,鐢變簬鎴戞瘮杈冧範(fàn)鎯痶omcat錛屽洜姝ゆ墦綆楁妸浠栬漿縐誨埌tomcat涓婃潵銆?
ofbiz2.11鎻愪緵鐨勫嵈鐪佺殑鏁版嵁搴撴槸hsql鐨勶紝鐢╳ebtools錛岃漿縐諱粬鐨勬暟鎹簱鏄潪甯告柟渚跨殑錛岃繖閲屾垜浠嬬粛濡備綍鎸夎鍒皁racle涓紝
鍚屾牱鐨勬柟娉曟垜涔熷湪mysql涓祴璇曢氳繃浜嗐?
1銆備笅杞給fbiz2.11
鍙互閫氳繃www.ofbiz.org涓嬭澆錛屼笉榪囬渶瑕佷唬鐞嗭紝涔熷彲浠ョ洿鎺ュ埌http://sf.net涓婇潰鏌ユ壘ofbiz欏圭洰涓嬭澆銆?
2銆備笅杞絫omcat
寤鴻浣跨敤tomcat4.1.24,鏇劇粡鍦ㄧ綉涓婄湅鍒拌繃鏈変漢浠嬬粛tomcat.4.1.7涔嬪墠鐨勭増鏈繍琛宱fbiz鏃訛紝taglib鐨勫鐞嗛潪甯告參錛?
涔嬪悗鐨勭増鏈氨娌℃湁榪欎釜闂浜嗐倀omcat鍙互鍒皐ww.apache.org澶勪笅杞姐?
3銆傚畨瑁卭racle
鐞嗚涓婃暟鎹簱鍙互鏄換浣曟敮鎸乯dbc鐨勬暟鎹簱錛屾垜浣跨敤鐨勬槸oracle8.17.
3.1寤虹珛oracle琛ㄧ┖闂?
createtablespaceofbiz
datafile'd:\orant\oradata\ofbiz.dbf'size2m
autoextendonnext2mmaxsizeunlimited;
3.2寤虹珛鐢ㄦ埛
createuserofbiz
identifiedbyofbiz
defaulttablespaceofbiz;
grantconnect,resourcetoofbiz;
嫻嬭瘯鐢ㄦ埛
connectofbiz/ofbiz;
4銆傚畨瑁卭fbiz
4.1璁劇疆鐜鍙橀噺
JAVA_HOME
ANT_HOME
CATALINA_HOME
OFBIZ_HOME
4.2鑷姩瀹夎
ofbiz宸茬粡鍑嗗浜嗕竴涓猘nt鑴氭湰錛屽畠鍙互鑷姩瀹夎ofbiz鍒般?
鍦∣FBIZ_HOME涓湁涓涓猙uild.xml,鎵цantinstall鍗沖彲銆?
浣嗘槸榪欎釜鑷姩鑴氭湰鏈夌殑鏃跺欐墽琛屾椂浼?xì)鍑洪敊锛佸鏋滃嚭閿欏Q岃鐪?銆?鎵嬪伐瀹夎銆?
4.3鎵嬪伐瀹夎
4銆?銆?
澶嶅埗OFBIZ_HOME\commonapp\etc\鐩綍涓嬮潰鐨勬墍鏈夋枃浠跺埌CATALINA_HOME\share\classes涓?
澶嶅埗OFBIZ_HOME\commonapp\lib\鐩綍涓?.jar鍒癈ATALINA_HOME\share\lib涓?
澶嶅埗OFBIZ_HOME\core\lib\鐩綍涓?.jar鍒癈ATALINA_HOME\share\lib涓?
澶嶅埗OFBIZ_HOME\lib\鐩綍涓?.jar鍒癈ATALINA_HOME\share\lib涓?
娉ㄦ剰OFBIZ_HOME\lib\涓殑jar鏂囦歡鏄寜鐩綍鍒嗛棬鍒被瀛樻斁鐨勶紝澶嶅埗鍒癈ATALINA_HOME\share\lib闇瑕佸幓鎺夋墍鏈夌洰褰曪紝鎶婃墍鏈塲ar閮芥斁鍒發(fā)ib鐩綍涓嬨?
4銆?銆?
緙栬緫CATALINA_HOME\share\classes\entityengine.xml
鏌ユ壘
helper-class="org.ofbiz.core.entity.GenericHelperDAO"
field-type-name="oracle"
check-on-start="true"
add-missing-on-start="true"
join-style="theta-oracle">
jdbc-driver="oracle.jdbc.driver.OracleDriver"
jdbc-uri="jdbc:oracle:thin:@127.0.0.1:1521:ofbiz"
jdbc-username="ofbiz"
jdbc-password="ofbiz"
isolation-level="ReadCommitted"/>
灝唈dbc閮ㄥ垎鏀規(guī)垚瀵瑰簲鐨勫弬鏁般?
鏌ユ壘
鏀規(guī)垚
4.3.3
澶嶅埗OFBIZ_HOME\setup\catalina41\bin涓殑ofbiz.bat鍒癈ATALINA_HOME\bin涓?
澶嶅埗OFBIZ_HOME\setup\catalina41\conf涓殑server.xml鍒癈ATALINA_HOME\conf涓?
娉ㄦ剰錛岃繖閲岀殑server.xml涔熷彲浠ヤ笉澶嶅埗錛岃繖閲岄潰灝辨槸閰嶇疆ofbiz鐨凜ontext錛屾墜宸ユ洿鏂板埌server.xml涓嵆鍙?
鍙﹀娉ㄦ剰錛宱fbiz榛樿ofbiz鍜宼omcat鍦ㄤ竴涓洰褰曚笅錛屽洜姝ゅ湪server.xml涓紝浠栫殑context璺緞閮芥槸鐢ㄧ殑鐩稿璺緞
渚嬪
鍦∣FBIZ_HOME\setup\catalina41\bin\runofbiz.bat
鍐呭濡備笅錛?
ofbiz.batrun
5.0榪愯runofbiz.bat
浠栭鍏堣皟鐢╫fbiz.bat璁劇疆鐜鍙橀噺錛岀劧鍚庡惎鍔╰omcat.
鍚姩tomcat鐨勬椂鍊欙紝ofbiz鐨凞atabaseUtils浼?xì)妫鏌ユ暟鎹簱涓槸鍚﹀凡緇忓瓨鍦ㄧ郴緇熺殑琛紝娌℃湁灝變細(xì)鑷姩鍒涘緩鐨勶紝涓鑸殑鍒涘緩榪囩▼涓嶄細(xì)鍑洪敊璇殑銆?
濡傛灉鏈夐敊璇駭鐢燂紝璇峰療鐪婥ATALINA_HOME\logs涓殑鏃ュ織鏂囦歡錛屼竴鑸兘鏄皯鏌愪釜jar,鐪嬪埌灝戝摢涓埌OFBIZ_HOME涓壘鍒板悗澶嶅埗鍒癈ATALINA_HOME\share\lib涓?
6.0濡傛灉寤虹珛琛ㄩ兘涓鍒囬『鍒╁氨鍙互鎵撳紑IE錛岀劧鍚庤緭鍏RL
http://localhost:8080/webtools/control/main
璁頒綇瑕佸厛鐢╳ebtools瀵煎叆鏁版嵁錛屽惁鍒欎綘涓嶈兘鐢╝dmin/ofbiz鐧婚檰鐨勶紒
鍦ㄨ繖閲宧ttp://localhost:8080/webtools/control/install
鐩存帴鐐筁oadData鎸夐挳
鎵ц瀹屾瘯鍚?
鍒拌繖閲?
http://localhost:8080/webtools/control/checkLogin/install
鐢╝dmin/ofbiz鐧婚檰錛岀櫥闄嗘垚鍔熻瘉鏄庡畨瑁呭畬姣曪紝涓嶆垚鍔熷氨瀵熺湅涓涓嬫棩蹇楁枃浠躲?
鍦?銆?銆?姝ヤ腑錛屽鏋滆瀹夎鍒板叾浠栫殑鏁版嵁搴擄紝鍙互淇敼鍏朵粬鏁版嵁搴撶殑jdbc榪炴帴閰嶇疆錛宱fbiz涓哄ぇ閮ㄥ垎鏀寔jdbc鐨勬暟鎹簱鎻愪緵鐨勪緥瀛愩?
鍚屾牱鐨勬柟娉曚篃鍙互瀹炴柦ofbiz鍒皉esin涓?涓嶈繃娌℃湁嫻嬭瘯!:)
嫻嬭瘯鐜
SERVER:PII300,512M
PIII733,256M
windows2000advanceserver
ofbiz2.11
oracle8.1.7
mysql4.0max
tomcat4.1.24
]]>ofbiz瀹炰綋寮曟搸緇撳悎jbuilder鐨勯厤緗?/title> http://www.tkk7.com/liaojiyong/archive/2006/08/15/63639.htmlliaojiyong liaojiyong Tue, 15 Aug 2006 03:29:00 GMT http://www.tkk7.com/liaojiyong/archive/2006/08/15/63639.html http://www.tkk7.com/liaojiyong/comments/63639.html http://www.tkk7.com/liaojiyong/archive/2006/08/15/63639.html#Feedback 0 http://www.tkk7.com/liaojiyong/comments/commentRss/63639.html http://www.tkk7.com/liaojiyong/services/trackbacks/63639.html 榪欎竴鑺傚皢緇欏嚭瀹炰綋寮曟搸鍦╦buider涓崟鐙嬌鐢ㄧ殑閰嶇疆鍚戝 鏈枃鏄粠ofbiz緗戠珯鐨勶紙OFBiz Quick Start Guide by Brett G. Palmer錛夌殑鍩虹涓婂畬鎴愰厤緗?br /> 1錛庝粠www.ofbiz.org涓笅杞給fbiz-XX-XX-complete.zip鍖咃紝鏈枃鐢ㄧ殑鏄痮fbiz-2.1.1-apps.zip 瑙e紑鏀懼埌鏌愪釜鐩綍涓嬶紝鏈枃鍦╦:\ofbiz,榪欎篃灝辨槸ofbiz.home鐨勫?br />2錛庡緩绔媕builder欏圭洰錛屽涓嬪浘鎵紺?br /> 3錛庡姞鍏ユ簮鏂囦歡錛?br />ofbiz.home/core/src/entiry ofbiz.home/core/src/share 4錛庡姞鍏ユ墍鐢ㄥ埌鐨刯ar鏂囦歡 ofbiz.home/lib/common ofbiz.home/lib/compile ofbiz.home/lib/jasterreports ofbiz.home/lib/jotm ofbiz.home/lib/scripting ofbiz.home/lib/share ofbiz.home/lib/tyrex 5錛庡皢閰嶇疆鏂囦歡絳夊鍏ュ伐紼?br />灝唎fbiz.home/commonapp/etc涓嬫墍鏈夋枃浠舵墦鍒皁fbiz_etc.jar鍖呭唴 jar cvf ofbiz_etc.jar * 灝唎fbiz.home/core/docs/xmldefs/ofbiz涓嬫墍鏈夋枃浠舵墦鍒皁fbiz_dtd.jar鍖呭唴 jar cvf ofbiz_dtd.jar * 灝嗚繖涓や釜鍖呭紩鍏ュ伐紼嬨?br /> 6錛庡皢ofbiz.home\setup\jrun4\servers\ofbiz\SERVER-INF\jndi.properties鏂囦歡鏀懼叆 ofbiz.home\lib\jotm\jotm.jar鍖呭唴 7錛庨厤緗畂fbiz.home 鍦ㄩ」鐩畆un tab涓姞鍏m parameter: -Dofbiz.home=j:\ofbiz 8錛庡湪GenericDelegator.java涓紝灝嗕笅闈㈣鍙ユ敞閲婃帀銆?br />/* // setup the Entity ECA Handler try { Class eecahClass = loader.loadClass(ECA_HANDLER_CLASS_NAME); this.entityEcaHandler = (EntityEcaHandler) eecahClass.newInstance(); this.entityEcaHandler.setDelegator(this); } catch (ClassNotFoundException e) { Debug.logWarning(e, "EntityEcaHandler class with name " + ECA_HANDLER_CLASS_NAME + " was not found, Entity ECA Rules will be disabled"); } catch (InstantiationException e) { Debug.logWarning(e, "EntityEcaHandler class with name " + ECA_HANDLER_CLASS_NAME + " could not be instantiated, Entity ECA Rules will be disabled"); } catch (IllegalAccessException e) { Debug.logWarning(e, "EntityEcaHandler class with name " + ECA_HANDLER_CLASS_NAME + " could not be accessed (illegal), Entity ECA Rules will be disabled"); } catch (ClassCastException e) { Debug.logWarning(e, "EntityEcaHandler class with name " + ECA_HANDLER_CLASS_NAME + " does not implement the EntityEcaHandler interface, Entity ECA Rules will be disabled"); } */ 9錛庢祴璇曟枃浠禩est.java package org.ofbiz.core; import org.ofbiz.core.entity.GenericDelegator; import org.ofbiz.core.entity.GenericValue; import org.ofbiz.core.util.UtilMisc; import org.ofbiz.core.entity.*; public class Test { public static void main(String[] args) { System.out.println("Entered testFindByPrimaryKey"); //Instantiate the delegator. GenericDelegator delegator = GenericDelegator.getGenericDelegator("default"); // Find book by primary key try { GenericValue party= delegator.findByPrimaryKey("PartyType", UtilMisc.toMap("partyTypeId", "PERSON")); } catch (GenericEntityException ex1) { } return; } } 10.ok ]]> Ofbiz 鍏ラ棬鏁欑▼(杞? http://www.tkk7.com/liaojiyong/archive/2006/08/15/63638.htmlliaojiyong liaojiyong Tue, 15 Aug 2006 03:25:00 GMT http://www.tkk7.com/liaojiyong/archive/2006/08/15/63638.html http://www.tkk7.com/liaojiyong/comments/63638.html http://www.tkk7.com/liaojiyong/archive/2006/08/15/63638.html#Feedback 0 http://www.tkk7.com/liaojiyong/comments/commentRss/63638.html http://www.tkk7.com/liaojiyong/services/trackbacks/63638.html 鍘熷垱 Ofbiz 鍏ラ棬鏁欑▼
1.Ofbiz 浠嬬粛錛?
Ofbiz(http://www.ofbiz.org) 鏄?Open Source 鐨勫晢鍔¤蔣浠剁郴緇燂紝鍏呭垎鍒╃敤浜嗗悇浼樼鐨勭殑Open Source 欏圭洰錛?
鍍?Tomcat, Ant, BeanShell, Jboss 絳夛紝鏋勫緩浜嗕竴涓己澶х殑緋葷粺騫沖彴錛孫fbiz 宸茬粡瀹屾垚浜嗗ぇ閮ㄥ垎鍟嗗姟綾昏蔣浠剁郴緇?
閮介渶瑕佺殑閮ㄤ歡錛屽儚鐢ㄦ埛璁よ瘉銆佸伐浣滄祦銆佸晢鍔¤鍒欏鐞嗙瓑錛孫fbiz 鐨勬牳蹇冩妧鏈湪浜?Entity Engine錛屽叾浠栫殑緇勪歡鍩烘湰閮?
鏄熀浜庡畠鐨勩傜畝鍗曟潵璇?Entity Engine 鐨勪富瑕佸姛鑳芥槸灝嗘暟鎹簱琛ㄥ垱寤恒佸璞′笌鏁版嵁琛ㄧ殑鏄犲皠銆佸璞$殑鏌ヨ絳夊仛浜嗗己澶?
灝佽錛屼綘鍙互鍦ㄤ竴涓畝鍗曠殑 XML 鏂囦歡涓畾涔夋暟鎹簱琛ㄧ粨鏋勶紝Ofbiz 浼?xì)鑷姩甯綘鍦ㄦ暟鎹簱寰忚〃锛岒q跺姩鎬佺敓鎴愭槧灝勫璞★紝
浣犲湪紼嬪簭涓彲浠ュ彧鑰冭檻瀵?Object 鐨勫鐞嗭紝Ofbiz 浼?xì)鑷姩閫氳繃浜嬪姟閫昏緫鏇存柊鍒版暟鎹簱涓侽fbiz 瀹gО鐨勪紭鐐逛箣涓鏄敤
寰堝皯鐨?Code 瀹屾垚澶嶆潅鐨勫鐞嗐?
2.Ofbiz 涓嬭澆涓庡畨瑁?
棣栧厛瑕佸畨瑁?J2SDK1.4錛屽埌 http://java.sun.com 涓婁笅杞斤紝瀹夎鍚庤瀹?JAVA_HOME 鐜鍙橀噺涓?J2SDK 鐨勫畨瑁呯洰褰曘?
璁塊棶緗戠珯 http://www.ofbiz.org錛屼笂闈㈡湁涓嬭澆鐨勮繛鎺ワ紝璇烽夋嫨 Complete 鍖咃紝鍥犱負(fù)榪欎釜鍖呬腑宸茬粡鍖呭惈浜嗚繍琛?Ofbiz
鐨勬墍鏈変笢瑗匡紝涓嬭澆涓嬫潵瑙e紑鍚庡氨鍙互榪愯浜嗐?
瑙e紑 Ofbiz 鍖呭埌涓涓洰褰曚笅錛屽亣璁炬槸 鈥淐:\ofbiz鈥濓紝璇ョ洰褰曚笅灝嗕細(xì)鏈?catalina 鍜?ofbiz 涓や釜鐩綍錛?catalina
鐩綍鏄?Tomcat 鐨勭洰褰曪紝Ofbiz 瀵瑰叾閰嶇疆鍋氫簡淇敼錛宱fbiz 鐩綍鏄?Ofbiz 鐨勭▼搴忎唬鐮佺洰褰曘傚湪鍛戒護(hù)琛岀姸鎬佷笅榪涘叆
鈥渃:\ofbiz\catalina\bin鈥?鐩綍錛岃繍琛屸?ofbiz run鈥濆懡浠わ紝灝卞彲浠ュ惎鍔?Ofbiz錛屽惎鍔ㄥ悗浣犲彲浠ョ敤嫻忚鍣ㄨ闂?
鈥渉ttp://localhost:8080/ecommerce鈥濓紝榪欏彲浠ヨ闂?Ofbiz 鐨勭數(shù)瀛愬晢鍔℃ā鍧楋紝閫氳繃欏甸潰涓婇潰鐨勮繛鎺ヤ綘鍙互璁塊棶鍒?
鍏朵粬妯″潡銆?
3.Ofbiz Schema 鐨勫垱寤?
Ofbiz 搴旂敤鍏ラ棬錛?
浠ヤ竴涓疄渚嬭鏄庯紝鍋囪鎴戜滑闇瑕佸緩涓涓鎴瘋祫鏂欒〃錛岃搗鍚嶄負(fù) StudyCustomer錛屽悇涓鍒嗗埆濡備笅錛?
StudyCustomer {
customerId Integer,
customerName String,
customerNote String,
}
鎴戜滑鏉ュ疄鐜板熀鏈殑鏁版嵁鎿嶄綔---澧?鍒?鏀?鏌ヨ錛屽叿浣撴楠ゅ涓嬶細(xì)
1.鍦?XML 鏂囦歡涓畾涔夋暟鎹?Schema錛?
闇瑕佺敤鍒頒笁涓枃浠訛紝涓涓槸鎴戜滑瑕佸緩鐨勯」鐩殑 entitymodel_xxx.xml 鍜?entityengine.xml錛岃繕鏈?
entitygroup.xml,
entitymodel_xxx.xml 鏄渶瑕佹垜浠嚜宸卞垱寤虹殑錛屽亣璁炬垜浠搗鍚嶄負(fù) entitymodel_study.xml錛屾斁鍦?
鈥渃:\ofbiz\ofbiz\commonapp\entitydef鈥濈洰褰曚笅錛?
entityengine.xml 鏄?Ofbiz 宸茬粡鏈夌殑錛屾斁鍦?鈥渃:\ofbiz\commonapp\etc鈥濈洰褰曚笅錛岀敤鏉ュ寘鍚垜浠?
瀹氫箟鐨?entitymodel 鏂囦歡銆?
entitygroup.xml 涔熸槸 Ofbiz 宸茬粡鏈夌殑錛岃窡 engityengine.xml 鍦ㄥ悓涓鐩綍涓嬶紝鎴戜滑闇瑕佹妸鎴戜滑鐨?
Schema 瀹氫箟鍔犲叆鍒拌鏂囦歡涓?
entitymodel_study.xml 鏂囦歡鐨勫畾涔夋牸寮忓涓嬶細(xì)
<!--================================================================================-->
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE entitymodel PUBLIC "-//OFBiz//DTD Entity Model//EN"
"http://www.ofbiz.org/dtds/entitymodel.dtd">
<entitymodel>
<title>Entity of an Open For Business Project Component</title>
<description>None</description>
<copyright>Copyright (c) 2002 The Open For Business Project - www.ofbiz.org</copyright>
<author>None</author>
<version>1.0</version>
<!-- ========================================================= -->
<!-- ======================== Data Model ===================== -->
<!-- The modules in this file are as follows: -->
<!-- - org.ofbiz.commonapp.study -->
<!-- ========================================================= -->
<!-- ========================================================= -->
<!-- org.ofbiz.commonapp.study -->
<!-- ========================================================= -->
<entity entity-name="StudyCustomer"
package-name="org.ofbiz.commonapp.study"
title="Study Customer Entity">
<field name="customerId" type="id-ne"></field>
<field name="customerName" type="long-varchar"></field>
<field name="customerNote" type="long-varchar"></field>
<prim-key field="customerId"/>
</entity>
</entitymodel>
<!--================================================================================-->
榪欎釜 XML 鏂囦歡涓殑 Tag 鍩烘湰鏄湅寰楁槑鐧界殑錛屽彧鏄?field 鐨?type 鏄?Ofbiz 宸茬粡棰勫畾涔夊ソ鐨勶紝榪?
鏄負(fù)浜嗕繚璇佹暟鎹簱闂寸殑榪佺Щ銆?
鍦?entityengine.xml 鍔犲叆鎴戜滑鍒氭墠瀹氫箟鐨勬枃浠訛紝鍔犲叆涓琛屽湪鍚堥傜殑浣嶇疆錛?
<resource loader="mainfile" location="entitymodel_study.xml"/>
鍏蜂綋鏀劇殑浣嶇疆鎴戜滑鍙互閫氳繃鏌ョ湅 entityengine.xml 鎵懼埌錛岄噷闈㈠凡緇忔湁鍔犲ソ鐨勫叾浠栨枃浠躲?
鍦?entitygroup.xml 鍔犲叆鎴戜滑鐨?Schema 瀹氫箟錛屽湪鍚庨潰鍔犲叆涓琛?
<entity-group group="org.ofbiz.commonapp" entity="StudyCustomer" />
榪欐牱鎴戜滑灝卞畾涔夊ソ浜?Schema錛岀幇鍦ㄦ妸 c:\ofbiz\commonapp\etc\entityengine.xml 鎷瘋礉鍒?
c:\ofbiz\catalina\shared\classes 鐩綍涓嬶紝榪欑偣瑕佸垏璁幫紝鎴戜互鍓嶅氨鍥犱負(fù)娌℃湁鎷瘋礉錛屾渶鍚?Schema
鎬庝箞涔熷垱寤轟笉浜嗐?
閲嶆柊鍚姩 Ofbiz錛岃闂?URL: http://localhost:8080/webtools錛岀偣鍑誨彸涓婃柟鐨?"Login" 閾炬帴錛?
鐢?admin/ofbiz 鐧誨綍錛岀櫥褰曡繘鍏ュ悗閫夋嫨閾炬帴鈥淐heck/Update Database鈥濓紝榪欐椂浼?xì)鍑虹?Check 鐨?Form錛?
璇ヨ〃鍗曞彲浠ュ彧媯(gè)楠?Schema 鏄惁鏀瑰彉錛岄粯璁ょ殑 GroupName 鏄渙rg.ofbiz.commonapp鈥濓紝榪欎釜涓嶉渶瑕佸彉錛?
鐐瑰嚮鈥淐heck Only鈥濇寜閽紝Ofbiz 浼?xì)妫楠屽彉鍔ㄦ儏鍐碉紝鏄劇ず鍑轟竴涓畬鏁寸殑鍒楄〃錛屼綘鍙互鏌ヤ竴涓嬫槸鍚︽湁鎴戜滑鍒氬緩鐨?
"StudyCustomer"錛屽鏋滄病鏈夛紝鍙兘鏄垜浠墠闈㈠畾涔夌殑鏈変簺闂錛屾鏌ヤ竴涓嬪啀閲嶆柊鍋氥?
鍦ㄦ鏌ュ埌浠ュ悗錛屽彲浠ュ啀閫夋嫨鈥淐heck and Add Missing鈥濓紝榪欐槸 Ofbiz 寰堝己澶х殑涓涓姛鑳斤紝浣犲湪 XML 涓柊
澧炰簡琛紝鎴栧湪鏌愪釜琛ㄤ腑鏂板浜嗘錛屽畠浼?xì)鑷姩鏄牉畡鍒版暟鎹簱涓Q岄伩鍏嶆垜浠幓鐩存帴鎿嶄綔鏁版嵁搴撱?
鐜板湪宸茬粡瀹屾垚浜?StudyCustomer Schema 鐨勫垱寤?濡傛灉鎯蟲楠屼竴涓嬫槸鍚︽湁琛ㄥ垱寤猴紝鎴戜滑鍙互鐢ㄧ紪杈戝櫒鎵撳紑
c:\ofbiz\data\ofbiz.script 錛屽湪閲岄潰鏌ヨ CREATE TABLE StudyCustomer 鐨勫瓧鏍鳳紝濡傛灉鍓嶉潰娌℃湁
闂錛屾垜浠彲浠ユ壘鍒扮殑銆?
4.濡備綍浣跨敤宸茬粡瀹氫箟鐨?Schema
濡備綍浣跨敤宸茬粡瀹氫箟鐨?Schema
Ofbiz 閬靛驚 MVC 鐨勮璁℃ā寮忥紝鍦?View 绔紝鍗?JSP 绔富瑕佷嬌鐢?Ofbiz 瀹氫箟鐨?Tag 鏉ユ樉紺烘垨
鎻愬彇鏁版嵁錛孋ontrol 鏄竴涓?Controller Servlet錛屾垜浠湪 Controller Servlet 鐨?URI mapping
閰嶇疆鏂囦歡涓畾涔夊悇 URL 搴旇鎸囧悜浠涔堢▼搴忥紝榪欐牱錛岄氳繃榪欎釜 mapping 閰嶇疆鏂囦歡錛屽彲浠ヤ繚璇佹垜浠悇涓〉闈?
鍙?qiáng)鍏蜂綋澶勭悊绋嬪簭涔嬮棿鐨勭嫭绔嬫э紝渚嬫垜浠彲浠ラ氳繃淇敼榪欎釜閰嶇疆鏂囦歡灝卞彲浠ユ敼鍙樻煇涓?Form 鐨?Post Action
鐨?URL錛岃屼笉闇瑕佷慨鏀瑰疄闄呯殑 HTML 鎴?JSP 浠g爜銆?
Ofbiz 涓畾涔変簡 Regions 鐨勬蹇碉紝鍗沖皢涓涓?HTML 欏甸潰鍒嗘垚鍑犱釜鍖哄煙錛屽儚 Top, Left, Right, Main
絳夛紝閫氳繃榪欎簺 Regions 鎴戜滑鍙互鏂逛究鐨勭粍鍚?UI 鐣岄潰錛屽茍涓斿彲浠ユ柟渚挎敼鍙樺悇閮ㄥ垎鎵澶勭殑浣嶇疆錛屽鎴戜滑鍙互
鎶婅彍鍗曞緢瀹規(guī)槗鐨勪粠涓婃柟縐誨埌涓嬫柟錛屽彧闇瑕佹敼鍙樹竴涓厤緗枃浠躲俁egions 綾諱技浜?HTML 涓殑 Frame錛屼絾瀹冩槸
閫氳繃涓涓〉闈㈡潵緇勫悎鐣岄潰錛孎rame 鏄氳繃鍑犱釜欏甸潰鏄劇ず鍦ㄤ笉鍚岀殑甯т腑錛孎rame 鐨勬帶鍒舵瘮杈冨鏉傦紝鑰屼笖闇瑕?
鏀瑰彉鐩稿叧鐨勭▼搴忋?
鍦?Ofbiz 涓紝鎴戜滑鍙互鐩存帴鍦?JSP 涓搷浣?Schema 瀹氫箟鐨?Object錛屽嵆鎴戜滑鍒氬畾涔夌殑 StudyCustomer錛?
紺轟緥濡備笅錛?
<%@ taglib uri="ofbizTags" prefix="ofbiz" %>
<%@ page import="java.util.*" %>
<%@ page import="org.ofbiz.core.util.*, org.ofbiz.core.pseudotag.*" %>
<%@ page import="org.ofbiz.core.entity.*" %>
<jsp:useBean id="delegator" type="org.ofbiz.core.entity.GenericDelegator" scope="request" />
<jsp:useBean id="security" type="org.ofbiz.core.security.Security" scope="request" />
<%if(security.hasEntityPermission("PARTYMGR", "_VIEW", session)) {%>
<%
try {
delegator.create("StudyCustomer",
UtilMisc.toMap("customerId","1","customerName","Cust1","customerNote","Customer Note 1"));
Iterator custs =
UtilMisc.toIterator(delegator.findAll("StudyCustomer",UtilMisc.toList("customerId","customerName","customerNote")));
while(custs.hasNext())
{
GenericValue cust = (GenericValue)custs.next();
out.println(cust.getString("customerId"));
out.println(cust.getString("customerName"));
out.println(cust.getString("customerNote"));
}
} catch(Exception e)
{
out.println(e.getMessage());
}
%>
<%}else{%>
<h3>You do not have permission to view this page. ("PARTYMGR_VIEW" or "PARTYMGR_ADMIN" needed)</h3>
<%}%>
榪欐紼嬪簭鎸哄鏄撶悊瑙o紝鍏堟槸閫氳繃 delegator 鍒涘緩涓涓?Object錛岃 Object 灝嗕細(xì)鐢?Ofbiz 鑷姩鍚屾鍒?
鏁版嵁搴撲腑銆傜劧鍚庨氳繃 delegator 鐨?findAll 鍙栧埌鎵鏈夊凡淇濆瓨鐨?Object錛屾渶鍚庨氳繃涓涓?Iterator 瀵硅薄
鏄劇ず鍑烘潵銆?
榪欎釜紼嬪簭璧峰悕涓?testofbiz.jsp錛屼負(fù)綆鍗曡搗瑙侊紝鎴戜滑鏀懼埌 Ofbiz 宸叉湁鐨勪竴涓?Webapp 鐨勭洰褰曚笅錛屾斁鍒?
c:\ofbiz\ofbiz\partymgr\webapp\party 鐩綍涓嬨傜劧鍚庢垜浠渶瑕佷慨鏀逛袱涓厤緗枃浠訛細(xì)controller.xml
鍜?regions.xml錛岃繖涓や釜鏂囦歡灝辨槸鎴戜滑涓婇潰鎻愬埌鐨?mapping 鍜?regions 閰嶇疆鏂囦歡銆?
榪欎袱涓枃浠墮兘鍦細(xì)c:\ofbiz\ofbiz\partymgr\webapp\WEB-INF 涓嬶紝鍦?controller.xml 涓姞鍏ヤ笅闈?
<request-map uri="testofbiz">
<description>Test Ofbiz</description>
<security https="false" auth="false"/>
<response name="success" type="view" value="testofbiz"/>
</request-map>
鍜?
<view-map name="testofbiz" type="region"/>
鍔犲叆浣嶇疆璇峰弬鐓?controller.xml 涓凡緇忔湁鐨勯厤緗傚湪 regions.xml 涓姞鍏ワ細(xì)
<define id='testofbiz' region='MAIN_REGION'>
<put section='title'>Test Ofbiz</put>
<put section='content' content='/party/testofbiz.jsp'/>
</define>
鍏蜂綋鍔犲叆浣嶇疆璇峰弬鑰冨凡鏈夌殑閰嶇疆銆?
閰嶇疆瀹屽悗錛岄噸鏂板惎鍔?ofbiz錛岀劧鍚庤闂?URL:
http://localhost:8080/partymgr/control/testofbiz
鐢變簬鎴戜滑鍦?testofbiz.jsp 紼嬪簭涓嬌鐢ㄤ簡 Ofbiz 鐨勫畨鍏ㄦ帶鍒舵満鍒訛紝緋葷粺浼?xì)鎻惤C虹幇鍦ㄦ病鏈夎闂?
鏉冮檺錛岄渶瑕佺櫥褰曪紝鐐瑰嚮鍙寵竟鐨勨淟ogin鈥?鐢?admin/ofbiz 鐧誨綍鍚庝細(xì)鐪嬪埌鎴戜滑紼嬪簭 testofbiz.jsp
鐨勮繍琛岀粨鏋溿傚鏋滈渶瑕佸鍔犳柊璁板綍錛岃淇敼
UtilMisc.toMap("customerId","1","customerName","Cust1","customerNote","Customer Note 1"));
涓殑鍚勪釜孌電殑鍊鹼紝鐒跺悗鍐嶈闂?http://localhost:8080/partymgr/control/testofbiz錛屽鏋滀笉淇敼
鑰岀洿鎺ヨ闂偅涓?URL 鏃訛紝緋葷粺浼?xì)鎻惤C?Primary key 鍐茬獊銆?
5.鎸夌収鏄劇ず涓庨昏緫鍒嗙鐨勫師鍒欎嬌鐢?Schema:
涓婄瘒璁蹭簡濡備綍鍦?JSP 涓嬌鐢ㄥ垱寤虹殑 Schema 瀵硅薄錛岃繖嬈℃垜浠潵璁茶堪涓涓嬪浣曟妸紼嬪簭
閫昏緫鏀懼埌 JavaBeans 涓紝鎶婃樉紺哄鐞嗘斁鍒?JSP 涓紝騫朵嬌鐢?controller.xml 灝嗕袱
閮ㄥ垎鏁村悎璧鋒潵銆?
棣栧厛鎴戜滑鏉ュ垱寤轟竴涓?JavaBeans錛屾潵瀹屾垚Add/Get/Delete/Update Schema 瀵硅薄
鐨勬搷浣滐紝紼嬪簭鏂囦歡鍚嶄負(fù) TestOfbiz.java錛屾斁緗湪
c:\ofbiz\ofbiz\testOfbiz\com\geeyo\ofbiz 鐩綍涓? 鍏蜂綋紼嬪簭濡備笅錛?
>=================================================================
package com.geeyo.ofbiz;
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.*;
import java.net.*;
import org.ofbiz.core.util.*;
import org.ofbiz.core.entity.*;
import org.ofbiz.core.service.*;
import org.ofbiz.core.security.*;
import org.ofbiz.core.stats.*;
public class TestOfbiz
{
public static void main(String[] args)
throws Exception
{
GenericDelegator delegator = GenericDelegator.getGenericDelegator("default");
delegator.create("StudyCustomer",UtilMisc.toMap("customerId","3","customerName","Kane3","customerNote","This is test customer.3"));
Iterator custs = UtilMisc.toIterator(delegator.findAll("StudyCustomer",UtilMisc.toList("customerId","customerName","customerNote")));
while(custs.hasNext())
{
GenericValue cust = (GenericValue)custs.next();
System.out.println(cust.getString("customerId"));
System.out.println(cust.getString("customerName"));
System.out.println(cust.getString("customerNote"));
}
}
public static String createNewRecord(HttpServletRequest request, HttpServletResponse response)
throws Exception
{
Map paras = UtilMisc.getParameterMap(request);
GenericDelegator delegator = GenericDelegator.getGenericDelegator("default");
delegator.create("StudyCustomer",paras);
return "success";
}
public static String lookAllRecords(HttpServletRequest request, HttpServletResponse response)
throws Exception
{
GenericDelegator delegator = GenericDelegator.getGenericDelegator("default");
Iterator custs = UtilMisc.toIterator(delegator.findAll("StudyCustomer",UtilMisc.toList("customerId","customerName","customerNote")));
Collection col = new ArrayList();
while(custs.hasNext())
{
GenericValue cust = (GenericValue)custs.next();
col.add(cust);
}
request.getSession().setAttribute("search_results",col);
return "success";
}
public static String findRecord(HttpServletRequest request, HttpServletResponse response)
throws Exception
{
String id = (String)request.getParameter("customerId");
GenericDelegator delegator = GenericDelegator.getGenericDelegator("default");
try {
GenericValue cust = delegator.findByPrimaryKey("StudyCustomer",UtilMisc.toMap("customerId",id));
request.getSession().setAttribute("edit_cust",cust);
} catch (GenericEntityException gee) {
Debug.logWarning(gee);
}
return "success";
}
public static String updateRecord(HttpServletRequest request, HttpServletResponse response)
throws Exception
{
Map paras = UtilMisc.getParameterMap(request);
GenericDelegator delegator = GenericDelegator.getGenericDelegator("default");
GenericValue cust = delegator.findByPrimaryKey("StudyCustomer",UtilMisc.toMap("customerId",paras.get("customerId")));
cust.setNonPKFields(paras);
cust.store();
request.getSession().setAttribute("edit_cust",cust);
return "success";
}
public static String removeRecord(HttpServletRequest request, HttpServletResponse response)
throws Exception
{
String strId = request.getParameter("id");
GenericDelegator delegator = GenericDelegator.getGenericDelegator("default");
GenericValue cust = delegator.findByPrimaryKey("StudyCustomer",UtilMisc.toMap("customerId",strId));
cust.remove();
return "success";
}
}
>=================================================================
紼嬪簭涓殑澶勭悊澶ч儴鍒嗗彲浠ョ湅鎳傜殑錛屽叾涓湁涓姛鑳斤紝鏄?
Map paras = UtilMisc.getParameterMap(request);
榪欐槸 Ofbiz 鐨勪竴涓湁瓚d絾闈炲父鏈夌敤鐨勫姛鑳斤紝瀹冩槸鎶?request 涓悇孌電殑鍚嶅瓧鍜屽兼槧灝勫埌涓涓?Map
瀵硅薄涓紝鐒跺悗浣跨敤
cust.setNonPKFields(paras);
灝卞彲浠ヨ祴緇?Object cust 鐨勫悇涓錛屽厤浜嗘垜浠嬌鐢?request.getParameter("name")鏉ュ彇鍚勪釜
鍊鹼紝鍦ㄥ煎緢澶氱殑鏃跺欒繖涓姛鑳藉彲浠ュぇ澶у噺灝戝啑浣欎唬鐮侀噺銆?
鍩烘湰紼嬪簭鐨勯昏緫鏄繖鏍風(fēng)殑錛?
1.浠?request 璇誨彇浼犳潵鐨勫?
顥?2.浣跨敤 delegator 鏉ュ鐞嗭紝Add/Update/Delete/Query
3.灝嗚繑鍥炵粨鏋滄斁鍒?Session 涓紶緇?JSP
鎴戝仛浜嗕釜 Ant build.xml 鏂囦歡鍙互甯姪緙栬瘧錛屾妸榪欎釜鏂囦歡鏀懼湪:
c:\ofbiz\ofbiz\testOfbiz\ 鐩綍涓嬶紝鐒跺悗鍦ㄥ懡浠よ紿楀彛涓嬭繘鍏ヨ鐩綍錛屾暡鍏?ant
鏉ョ紪璇戯紙闇瑕佷繚璇佸凡緇忓畨瑁?Ant錛夛紝緙栬瘧鍚庣殑 .class 浼?xì)鏀惧?
c:\ofbiz\ofbiz\testOfbiz\com\geeyo\ofbiz 涓嬶紝
鎷瘋礉 c:\ofbiz\ofbiz\testofbiz\com 鐩綍鍒?c:\ofbiz\ofbiz\partymgr\webapp\WEB-INF\classes
鐩綍涓嬨?
build.xml
>=============================================================================
<project name="TestOfbiz" default="dist" basedir=".">
<description>
Test ofbiz
</description>
<!--test cvs-->
<!-- set global properties for this build -->
<property name="src" location="."/>
<property name="build" location="."/>
<property name="lib_dir" location="c:/ofbiz/catalina/shared/lib"/>
<property name="lib1_dir" location="c:/ofbiz/catalina/common/lib"/>
<path id="project.class.path">
<fileset dir="${lib_dir}">
<include name="*.jar"/>
</fileset>
<fileset dir="${lib1_dir}">
<include name="*.jar"/>
</fileset>
</path>
<target name="init">
<!-- Create the time stamp -->
<tstamp/>
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build}"/>
</target>
<target name="compile" depends="init"
description="compile the source " >
<!-- Compile the java code from ${src} into ${build} -->
<javac srcdir="${src}" destdir="${build}">
<classpath refid="project.class.path"/>
</javac>
</target>
<target name="dist" depends="compile"
description="generate the distribution" >
<!-- Create the distribution directory -->
</target>
<target name="clean"
description="clean up" >
<!-- Delete the ${build} and ${dist} directory trees -->
</target>
</project>
>=============================================================================
鐒跺悗鎴戜滑鏉ュ垱寤?JSP 紼嬪簭錛孞SP 紼嬪簭鍏ㄩ儴鏀懼湪
c:\ofbiz\ofbiz\partymgr\webapp\party 涓嬮潰
1.listofbiz.jsp
>=============================================================================
<%@ taglib uri="ofbizTags" prefix="ofbiz" %>
<%@ page import="java.util.*, org.ofbiz.core.service.ModelService" %>
<%@ page import="org.ofbiz.core.util.*, org.ofbiz.core.pseudotag.*" %>
<%@ page import="org.ofbiz.core.entity.*" %>
<jsp:useBean id="security" type="org.ofbiz.core.security.Security" scope="request" />
<jsp:useBean id="delegator" type="org.ofbiz.core.entity.GenericDelegator" scope="request" />
<script language="JavaScript">
function confirmDelete()
{
return confirm("Are your sure to delete?");
}
</script>
<%if(security.hasEntityPermission("PARTYMGR", "_VIEW", session)) {%>
<table width="600" align="center">
<ofbiz:if name="search_results">
<tr><th>Id</th><th>Name</th><th>Note</th><th></th></tr>
<ofbiz:iterator name="cust" property="search_results">
<tr>
<td><ofbiz:entityfield attribute="cust" field="customerId"/></td>
<td><ofbiz:entityfield attribute="cust" field="customerName"/></td>
<td><ofbiz:entityfield attribute="cust" field="customerNote"/></td>
<td>
<a href='<ofbiz:url>/showtest?customerId=<ofbiz:entityfield attribute="cust" field="customerId"/></ofbiz:url>' class="buttontext">[Edit]</a>
<a href='<ofbiz:url>/removetest?customerId=<ofbiz:entityfield attribute="cust" field="customerId"/></ofbiz:url>' class="buttontext" onclick="return confirmDelete()">[Remove]</a>
</td>
</tr>
</ofbiz:iterator>
</ofbiz:if>
</table>
<table width="200" align="center">
<tr>
<td><a href='<ofbiz:url>/createTestForm</ofbiz:url>'>Create customer</a></td>
</tr>
</table>
<%}else{%>
<h3>You do not have permission to view this page. ("PARTYMGR_VIEW" or "PARTYMGR_ADMIN" needed)</h3>
<%}%>
>=============================================================================
涓婇潰紼嬪簭涓渶瑕佽鏄庣殑鏄?
<ofbiz:if name="search_results">
鍜?
<ofbiz:iterator name="cust" property="search_results">錛?
<ofbiz:if name="search_results"> 鏄敤鏉ユ楠屽湪 session 鎴?pageContext 瀵硅薄
涓槸鍚﹀寘鍚?search_results 瀵硅薄錛岃瀵硅薄鏄敱鎴戜滑鐨勭▼搴忔斁鍒?session 涓殑銆?
<ofbiz:iterator name="cust" property="search_results"> 鏄敤鏉ュ驚鐜鍙栧璞?
search_results錛堟槸涓?Collection 瀵硅薄錛変腑瀛樺偍鐨勫悇瀵硅薄錛屽茍璧嬬粰cust錛岀劧鍚庡湪寰幆浣?
涓紝鎴戜滑灝卞彲浠ョ敤 cust 瀵硅薄鏉ヨ鍙栧悇涓鐨勫間簡銆?
2.createofbiz.jsp
>=============================================================================
<%@ taglib uri="ofbizTags" prefix="ofbiz" %>
<%@ page import="java.util.*, org.ofbiz.core.service.ModelService" %>
<%@ page import="org.ofbiz.core.util.*, org.ofbiz.core.pseudotag.*" %>
<%@ page import="org.ofbiz.core.entity.*" %>
<jsp:useBean id="security" type="org.ofbiz.core.security.Security" scope="request" />
<jsp:useBean id="delegator" type="org.ofbiz.core.entity.GenericDelegator" scope="request" />
<%if(security.hasEntityPermission("PARTYMGR", "_VIEW", session)) {%>
<form method="post" action="<ofbiz:url>/createTest</ofbiz:url>" name="createofbiz">
<table width="300" align="center">
<tr>
<td>Id</td><td><input type="text" name="customerId" size="20"></td>
</tr>
<tr>
<td>Name</td><td><input type="text" name="customerName" size="20"></td>
</tr>
<tr>
<td>Note</td><td><input type="text" name="customerNote" size="30"></td>
</tr>
<tr>
<td></td>
<td><input type="submit"></td>
</tr>
</table>
</form>
<%}else{%>
<h3>You do not have permission to view this page. ("PARTYMGR_VIEW" or "PARTYMGR_ADMIN" needed)</h3>
<%}%>
>=============================================================================
榪欎釜紼嬪簭寰堝鏄撶悊瑙o紝闇瑕佹敞鎰忕殑鏄瘡涓枃鏈鐨勫悕瀛楋紝瑕佽窡 Schema StudyCustomer 鐨勫悇
涓涓鑷達(dá)紝浠ヤ嬌紼嬪簭涓窡瀹規(guī)槗澶勭悊銆?
3.showofbiz.jsp
>=============================================================================
<%@ taglib uri="ofbizTags" prefix="ofbiz" %>
<%@ page import="java.util.*, org.ofbiz.core.service.ModelService" %>
<%@ page import="org.ofbiz.core.util.*, org.ofbiz.core.pseudotag.*" %>
<%@ page import="org.ofbiz.core.entity.*" %>
<jsp:useBean id="security" type="org.ofbiz.core.security.Security" scope="request" />
<jsp:useBean id="delegator" type="org.ofbiz.core.entity.GenericDelegator" scope="request" />
<%if(security.hasEntityPermission("PARTYMGR", "_VIEW", session)) {%>
<form method="post" action="<ofbiz:url>/updateTest</ofbiz:url>" name="updateofbiz">
<table width="300" align="center">
<tr>
<td>Id</td><td><input type="text" name="customerId" size="20" value="<ofbiz:entityfield attribute="edit_cust" field="customerId"/>"></td>
</tr>
<tr>
<td>Name</td><td><input type="text" name="customerName" size="20" value="<ofbiz:entityfield attribute="edit_cust" field="customerName"/>"></td>
</tr>
<tr>
<td>Note</td><td><input type="text" name="customerNote" size="30" value="<ofbiz:entityfield attribute="edit_cust" field="customerNote"/>"></td>
</tr>
<tr>
<td></td>
<td><input type="submit"></td>
</tr>
</table>
</form>
<%}else{%>
<h3>You do not have permission to view this page. ("PARTYMGR_VIEW" or "PARTYMGR_ADMIN" needed)</h3>
<%}%>
>=============================================================================
榪欎釜紼嬪簭涓紝涓昏鏄氳繃
<ofbiz:entityfield attribute="edit_cust" field="customerId"/>
鎶婂彇鍒扮殑瀵硅薄鐨勬鏄劇ず鍑烘潵, 瀵硅薄 edit_cust 鏄垜浠湪紼嬪簭涓彇鍒板茍鏀懼埌 session 涓殑銆?
涓嬮潰鎴戜滑鏉ラ厤緗?controller.xml 鍜?regions.xml, 鍦?controller.xml 涓姞鍏?
>=============================================================================
<request-map uri="createTestForm">
<description>Show the create form</description>
<security https="false" auth="false"/>
<response name="success" type="view" value="createTestForm"/>
</request-map>
<request-map uri="testofbiz">
<description>Test Ofbiz</description>
<security https="false" auth="false"/>
<response name="success" type="view" value="testofbiz"/>
</request-map>
<request-map uri="listtest">
<description>List all records</description>
<security https="false" auth="false"/>
<event type="java" path="com.geeyo.ofbiz.TestOfbiz" invoke="lookAllRecords" />
<response name="success" type="view" value="listAllTest"/>
</request-map>
<request-map uri="showtest">
<description>Show records</description>
<security https="false" auth="false"/>
<event type="java" path="com.geeyo.ofbiz.TestOfbiz" invoke="findRecord" />
<response name="success" type="view" value="showTest"/>
</request-map>
<request-map uri="createTest">
<security https="true" auth="true"/>
<event type="java" path="com.geeyo.ofbiz.TestOfbiz" invoke="createNewRecord"/>
<response name="success" type="request" value="listtest"/>
<response name="error" type="view" value="createTestForm"/>
</request-map>
<request-map uri="updateTest">
<description>update a record</description>
<security https="false" auth="false"/>
<event type="java" path="com.geeyo.ofbiz.TestOfbiz" invoke="updateRecord" />
<response name="success" type="request" value="listtest"/>
</request-map>
<request-map uri="removetest">
<description>remove a record</description>
<security https="false" auth="false"/>
<event type="java" path="com.geeyo.ofbiz.TestOfbiz" invoke="removeRecord" />
<response name="success" type="request" value="listtest"/>
</request-map>
<view-map name="listAllTest" type="region"/>
<view-map name="createTestForm" type="region"/>
<view-map name="showTest" type="region"/>
>=============================================================================
鍦?regions.xml 涓姞鍏ワ細(xì)
>=============================================================================
<define id='createTestForm' region='MAIN_REGION'>
<put section='title'>Create Ofbiz</put>
<put section='content' content='/party/createofbiz.jsp'/>
</define>
<define id='listAllTest' region='MAIN_REGION'>
<put section='title'>List Ofbiz</put>
<put section='content' content='/party/listofbiz.jsp'/>
</define>
<define id='showTest' region='MAIN_REGION'>
<put section='title'>Show Ofbiz</put>
<put section='content' content='/party/showofbiz.jsp'/>
</define>
>=============================================================================
鐜板湪灝卞畬鎴愪簡錛屾垜浠噸鏂板惎鍔?Ofbiz錛岀劧鍚庣敤 IE 璁塊棶錛?
http://localhost:8080/partymgr/control/listtest錛岀敤admin/ofbiz 鐧誨綍鍚庡氨鍙互
鐪嬪埌鎴戜滑鍒氭墠鐨勫伐浣滄垚鏋滀簡錛屼綘鐜板湪鍙互澧炲姞/鍒犻櫎/淇敼璁板綍銆?
6.Ofbiz 閫氳繃 XML 鏉ュ畬鎴愭暟鎹簱鎿嶄綔錛堥潪甯稿己澶х殑鍔熻兘錛?
榪欐槸 Ofbiz 鐨勪竴涓潪甯稿己澶х殑鍔熻兘錛屽彲鑳介氳繃綆鍗曠殑 XML 鏂囦歡鏉ュ畬鎴愭暟鎹/鍒?鏀圭殑澶勭悊錛?
榪欎簺澶勭悊鍦ㄦ暟鎹簱搴旂敤涓槸闈炲父澶氱殑錛屽洜涓哄緢澶氶渶瑕佺淮鎶ょ殑鏁版嵁錛屾墍浠ュ啓紼嬪簭涔熸槸鏈鑺辨椂闂寸殑錛?
Ofbiz 鎶婅繖浜涙搷浣滈氳繃 XML 鏉ュ畬鎴愶紝涓嶈兘涓嶈鏄竴澶ч潻鍛?--浣挎垜浠笉鐢ㄥ啓紼嬪簭灝卞彲浠ュ畬鎴愬ぇ
閮ㄥ垎澶勭悊錛岃繖鏄瘡涓▼搴忓憳閮藉悜寰鐨勭粓鏋佺洰鏍囥?
鎴戜滑涓嬮潰涓句緥鏉ヨ榪頒竴涓嬶紝澶勭悊鐨勬暟鎹繕鏄埄鐢ㄦ垜浠墠闈㈠垱寤虹殑 StudyCustomer錛屼嬌鐢?XML
閰嶇疆鏂囦歡鏉ュ畬鎴愬墠闈㈢▼搴?TestOfbiz.java 鐨勫ぇ閮ㄥ垎鎿嶄綔銆?
鍦?c:\ofbiz\ofbiz\testOfbiz\com\geeyo\ofbiz 鐩綍涓嬪垱寤烘枃浠?TestOfbizServices.xml錛?
璇ユ枃浠剁殑鍐呭濡備笅錛?
>=================================================================
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE simple-methods PUBLIC "-//OFBiz//DTD Simple Methods//EN" "http://www.ofbiz.org/dtds/simple-methods.dtd">
<simple-methods>
<!-- TestOfbiz methods -->
<simple-method method-name="createNewRecord" short-description="Create a new record">
<check-permission permission="STUDYCUSTOMER" action="_CREATE"><fail-message message="Security Error: to run createRecord you must have the STUDYCUSTOMER_CREATE permission"/></check-permission> <check-errors/>
<make-value entity-name="StudyCustomer" value-name="newEntity"/>
<set-pk-fields map-name="parameters" value-name="newEntity"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<create-value value-name="newEntity"/>
</simple-method>
<simple-method method-name="updateRecord" short-description="Update a record">
<check-permission permission="STUDYCUSTOMER" action="_UPDATE"><fail-message message="Security Error: to run updateRecord you must have the STUDYCUSTOMER_UPDATE permission"/></check-permission>
<check-errors/>
<make-value entity-name="StudyCustomer" value-name="lookupPKMap"/>
<set-pk-fields map-name="parameters" value-name="lookupPKMap"/>
<find-by-primary-key entity-name="StudyCustomer" map-name="lookupPKMap" value-name="lookedUpValue"/>
<set-nonpk-fields map-name="parameters" value-name="lookedUpValue"/>
<store-value value-name="lookedUpValue"/>
</simple-method>
<simple-method method-name="findRecord" short-description="lookup a record">
<check-errors/>
<make-value entity-name="StudyCustomer" value-name="lookupPKMap"/>
<set-pk-fields map-name="parameters" value-name="lookupPKMap"/>
<find-by-primary-key entity-name="StudyCustomer" map-name="lookupPKMap" value-name="edit_cust"/>
<field-to-session field-name="edit_cust"/>
</simple-method>
<simple-method method-name="removeRecord" short-description="Delete a record">
<check-permission permission="STUDYCUSTOMER" action="_DELETE"><fail-message message="Security Error: to run deleteRecord you must have the STUDYCUSTOMER_DELETE permission"/></check-permission>
<check-errors/>
<make-value entity-name="StudyCustomer" value-name="lookupPKMap"/>
<set-pk-fields map-name="parameters" value-name="lookupPKMap"/>
<find-by-primary-key entity-name="StudyCustomer" map-name="lookupPKMap" value-name="lookedUpValue"/>
<remove-value value-name="lookedUpValue"/>
</simple-method>
<simple-method method-name="lookAllRecords" short-description="lookup suitable records">
<check-errors/>
<find-by-and entity-name="StudyCustomer" list-name="search_results"/>
<field-to-session field-name="search_results"/>
</simple-method>
</simple-methods>
>=================================================================
涓婇潰鐨?XML 鍩烘湰鏄笉鐢ㄨВ閲婄殑錛屽畾涔変簡
createNewRecord
updateRecord
lookAllRecords
removeRecord
findRecord
榪欏嚑涓柟娉曪紝鑰屼笖閮芥湁瀵圭敤鎴鋒潈闄愮殑媯(gè)鏌ワ紝榪欏嚑涓柟娉曞搴斾簬鍓嶉潰 TestOfbiz.java 涓殑鍑犱釜鏂規(guī)硶錛?
榪欐牱鏉ュ仛鏁版嵁搴撴搷浣滄樉鐒舵瘮鐢?Java 紼嬪簭鍐欒綆鍗曞緱澶氾紝
涓嬮潰榪橀渶瑕佸湪 controller.xml錛堝叿浣撴枃浠跺緱浣嶇疆璇峰弬鐓у墠闈㈢殑鏁欑▼錛夋洿鏀逛竴涓?mapping 鐨勮緗紝
鏇存敼濡備笅錛屼互鍓嶄嬌鐢?TestOfbiz.java 鏃剁殑閰嶇疆鎴戜互娉ㄩ噴鐨勬柟寮忎繚鐣欑潃浠ュ仛鍙傜収錛?
>=================================================================
<request-map uri="createTestForm">
<description>Show the create form</description>
<security https="false" auth="false"/>
<response name="success" type="view" value="createTestForm"/>
</request-map>
<request-map uri="listtest">
<description>List all records</description>
<security https="false" auth="false"/>
<event type="simple" path="com/geeyo/ofbiz/TestOfbizServices.xml" invoke="lookAllRecords" />
<response name="success" type="view" value="listAllTest"/>
</request-map>
<request-map uri="showtest">
<description>Show records</description>
<security https="false" auth="false"/>
<event type="simple" path="com/geeyo/ofbiz/TestOfbizServices.xml" invoke="findRecord" />
<response name="success" type="view" value="showTest"/>
</request-map>
<request-map uri="createTest">
<security https="true" auth="true"/>
<event type="simple" path="com/geeyo/ofbiz/TestOfbizServices.xml" invoke="createNewRecord"/>
<response name="success" type="request" value="listtest"/>
<response name="error" type="view" value="createTestForm"/>
</request-map>
<request-map uri="updateTest">
<description>update a record</description>
<security https="false" auth="false"/>
<event type="simple" path="com/geeyo/ofbiz/TestOfbizServices.xml" invoke="updateRecord" />
<response name="success" type="request" value="listtest"/>
</request-map>
<request-map uri="removetest">
<description>remove a record</description>
<security https="false" auth="false"/>
<event type="simple" path="com/geeyo/ofbiz/TestOfbizServices.xml" invoke="removeRecord" />
<response name="success" type="request" value="listtest"/>
</request-map>
<view-map name="listAllTest" type="region"/>
<view-map name="createTestForm" type="region"/>
<view-map name="testofbiz" type="region"/>
<view-map name="showTest" type="region"/>
>=================================================================
閰嶇疆璇ユ枃浠剁殑鏂規(guī)硶璇峰弬鐓у墠闈㈢殑鏁欑▼錛宺egions.xml 涓嶉渶鏀瑰姩銆?
閰嶇疆瀹屽悗璇風(fēng)敤鍓嶉潰璁茶繃鐨勬柟娉曡闂?URL: http://localhost:8080/partymgr/control/listtest
鐜板湪鎴戜滑鍙互鐪嬪埌錛孫fbiz 鍦?MVC 鏂歸潰鍋氬緱闈炲父濂斤紝鎴戜滑鍙互鎶婂悗绔殑澶勭悊紼嬪簭浠?java 鏀?
鎴愮敤 XMl 鎺у埗錛岃屽叾浠栭儴鍒嗭紙鍍?JSP錛変笉闇浠諱綍鏀瑰姩錛岃繖鍙互淇濊瘉鎴戜滑緋葷粺鍚勯儴鍒嗙殑鐙珛鎬с?
]]>
主站蜘蛛池模板:
亚洲精品成人无限看 |
免费精品国产自产拍观看 |
亚洲AV永久无码精品水牛影视 |
日韩精品无码免费视频 |
男人的天堂亚洲一区二区三区
|
女性无套免费网站在线看 |
亚洲综合欧美色五月俺也去
|
成人啪精品视频免费网站 |
亚洲伊人精品综合在合线 |
亚洲一级毛片免费在线观看 |
久久综合亚洲色一区二区三区 |
久久爰www免费人成 |
亚洲黄色网址大全 |
国产福利在线免费 |
亚洲中文字幕无码中文字 |
国产精品酒店视频免费看 |
精品国产亚洲一区二区三区在线观看
|
成人爽A毛片免费看 |
久久人午夜亚洲精品无码区 |
国产又粗又猛又爽又黄的免费视频 |
老司机午夜性生免费福利 |
亚洲日韩中文无码久久 |
精品熟女少妇a∨免费久久 |
亚洲欧洲另类春色校园网站 |
国产精品冒白浆免费视频 |
国产V片在线播放免费无码 |
亚洲午夜未满十八勿入 |
最近中文字幕mv免费高清电影 |
国产亚洲精品免费 |
亚洲AV午夜成人影院老师机影院 |
**一级毛片免费完整视 |
校园亚洲春色另类小说合集
|
日本zzzzwww大片免费 |
亚洲成a∨人片在无码2023 |
亚洲人成网站18禁止一区 |
久久国产乱子伦免费精品 |
亚洲一线产区二线产区区 |
国产国拍亚洲精品福利
|
美女视频免费看一区二区 |
国产精品久久久亚洲 |
性感美女视频免费网站午夜 |