锘??xml version="1.0" encoding="utf-8" standalone="yes"?>久久久久亚洲Av片无码v,亚洲AV无码专区亚洲AV桃,亚洲国产模特在线播放http://www.tkk7.com/liaojiyong/category/14093.htmlzh-cnWed, 28 Feb 2007 06:49:24 GMTWed, 28 Feb 2007 06:49:24 GMT60瀹夎ofbiz+tomcat+oraclehttp://www.tkk7.com/liaojiyong/archive/2006/08/15/63641.htmlliaojiyongliaojiyongTue, 15 Aug 2006 03:31:00 GMThttp://www.tkk7.com/liaojiyong/archive/2006/08/15/63641.htmlhttp://www.tkk7.com/liaojiyong/comments/63641.htmlhttp://www.tkk7.com/liaojiyong/archive/2006/08/15/63641.html#Feedback0http://www.tkk7.com/liaojiyong/comments/commentRss/63641.htmlhttp://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><link>http://www.tkk7.com/liaojiyong/archive/2006/08/15/63639.html</link><dc:creator>liaojiyong</dc:creator><author>liaojiyong</author><pubDate>Tue, 15 Aug 2006 03:29:00 GMT</pubDate><guid>http://www.tkk7.com/liaojiyong/archive/2006/08/15/63639.html</guid><wfw:comment>http://www.tkk7.com/liaojiyong/comments/63639.html</wfw:comment><comments>http://www.tkk7.com/liaojiyong/archive/2006/08/15/63639.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/liaojiyong/comments/commentRss/63639.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/liaojiyong/services/trackbacks/63639.html</trackback:ping><description><![CDATA[1.1 閰嶇疆<br />榪欎竴鑺傚皢緇欏嚭瀹炰綋寮曟搸鍦╦buider涓崟鐙嬌鐢ㄧ殑閰嶇疆鍚戝<br />鏈枃鏄粠ofbiz緗戠珯鐨勶紙OFBiz Quick Start Guide by Brett G. Palmer錛夌殑鍩虹涓婂畬鎴愰厤緗?br /><br />1錛庝粠www.ofbiz.org涓笅杞給fbiz-XX-XX-complete.zip鍖咃紝鏈枃鐢ㄧ殑鏄痮fbiz-2.1.1-apps.zip<br />瑙e紑鏀懼埌鏌愪釜鐩綍涓嬶紝鏈枃鍦╦:\ofbiz,榪欎篃灝辨槸ofbiz.home鐨勫?br />2錛庡緩绔媕builder欏圭洰錛屽涓嬪浘鎵紺?br /><br /><br />3錛庡姞鍏ユ簮鏂囦歡錛?br />ofbiz.home/core/src/entiry<br />ofbiz.home/core/src/share<br /><br /><br />4錛庡姞鍏ユ墍鐢ㄥ埌鐨刯ar鏂囦歡<br />ofbiz.home/lib/common<br />ofbiz.home/lib/compile<br />ofbiz.home/lib/jasterreports<br />ofbiz.home/lib/jotm<br />ofbiz.home/lib/scripting<br />ofbiz.home/lib/share<br />ofbiz.home/lib/tyrex<br /><br /><br /><br />5錛庡皢閰嶇疆鏂囦歡絳夊鍏ュ伐紼?br />灝唎fbiz.home/commonapp/etc涓嬫墍鏈夋枃浠舵墦鍒皁fbiz_etc.jar鍖呭唴<br />jar cvf ofbiz_etc.jar *<br />灝唎fbiz.home/core/docs/xmldefs/ofbiz涓嬫墍鏈夋枃浠舵墦鍒皁fbiz_dtd.jar鍖呭唴<br />jar cvf ofbiz_dtd.jar *<br /><br />灝嗚繖涓や釜鍖呭紩鍏ュ伐紼嬨?br /><br />6錛庡皢ofbiz.home\setup\jrun4\servers\ofbiz\SERVER-INF\jndi.properties鏂囦歡鏀懼叆<br />ofbiz.home\lib\jotm\jotm.jar鍖呭唴<br /><br />7錛庨厤緗畂fbiz.home<br />鍦ㄩ」鐩畆un tab涓姞鍏m parameter:<br />-Dofbiz.home=j:\ofbiz<br /><br />8錛庡湪GenericDelegator.java涓紝灝嗕笅闈㈣鍙ユ敞閲婃帀銆?br />/* <br />// setup the Entity ECA Handler<br />try {<br />Class eecahClass = loader.loadClass(ECA_HANDLER_CLASS_NAME);<br />this.entityEcaHandler = (EntityEcaHandler) eecahClass.newInstance();<br />this.entityEcaHandler.setDelegator(this);<br />} catch (ClassNotFoundException e) {<br />Debug.logWarning(e, "EntityEcaHandler class with name " + ECA_HANDLER_CLASS_NAME + " was not found, Entity ECA Rules will be disabled");<br />} catch (InstantiationException e) {<br />Debug.logWarning(e, "EntityEcaHandler class with name " + ECA_HANDLER_CLASS_NAME + " could not be instantiated, Entity ECA Rules will be disabled");<br />} catch (IllegalAccessException e) {<br />Debug.logWarning(e, "EntityEcaHandler class with name " + ECA_HANDLER_CLASS_NAME + " could not be accessed (illegal), Entity ECA Rules will be disabled");<br />} catch (ClassCastException e) {<br />Debug.logWarning(e, "EntityEcaHandler class with name " + ECA_HANDLER_CLASS_NAME + " does not implement the EntityEcaHandler interface, Entity ECA Rules will be disabled");<br />}<br />*/<br /><br /><br />9錛庢祴璇曟枃浠禩est.java<br />package org.ofbiz.core;<br /><br />import org.ofbiz.core.entity.GenericDelegator;<br />import org.ofbiz.core.entity.GenericValue;<br />import org.ofbiz.core.util.UtilMisc;<br />import org.ofbiz.core.entity.*;<br /><br /><br />public class Test {<br />public static void main(String[] args) {<br />System.out.println("Entered testFindByPrimaryKey");<br />//Instantiate the delegator.<br />GenericDelegator delegator = GenericDelegator.getGenericDelegator("default");<br /><br /><br />// Find book by primary key<br />try {<br />GenericValue party= delegator.findByPrimaryKey("PartyType",<br />UtilMisc.toMap("partyTypeId", "PERSON"));<br />}<br />catch (GenericEntityException ex1) {<br />}<br />return;<br />}<br /><br />}<br /><br />10.ok<br /><img src ="http://www.tkk7.com/liaojiyong/aggbug/63639.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/liaojiyong/" target="_blank">liaojiyong</a> 2006-08-15 11:29 <a href="http://www.tkk7.com/liaojiyong/archive/2006/08/15/63639.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Ofbiz 鍏ラ棬鏁欑▼(杞?http://www.tkk7.com/liaojiyong/archive/2006/08/15/63638.htmlliaojiyongliaojiyongTue, 15 Aug 2006 03:25:00 GMThttp://www.tkk7.com/liaojiyong/archive/2006/08/15/63638.htmlhttp://www.tkk7.com/liaojiyong/comments/63638.htmlhttp://www.tkk7.com/liaojiyong/archive/2006/08/15/63638.html#Feedback0http://www.tkk7.com/liaojiyong/comments/commentRss/63638.htmlhttp://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禁止一区| 久久国产乱子伦免费精品| 亚洲一线产区二线产区区| 国产国拍亚洲精品福利 | 美女视频免费看一区二区| 国产精品久久久亚洲| 性感美女视频免费网站午夜|