spark的自留地(ofbiz/eclipse rcp/shark/opentaps)

            BlogJava :: 首頁 :: 聯系 :: 聚合  :: 管理
            54 Posts :: 0 Stories :: 112 Comments :: 0 Trackbacks

          #

          到阿里工作快一年了,這一年回顧來最主要的成果還是在這里成功了推行了自己的領域建模方法與對應的技術框架。總是想同更多的同學分享一下。

          為了幫助更多人了解如何應用領域建模知識在實際項目中,我在InfoQ中發表了一篇題為“大型網站復雜業務持續重構之道——全程領域建模實踐”的文章。為了增加趣味性,我用了個故事來展開內容,請大家不要對號入座(特別是老板們)。請有興趣了解這一話題的同學可以閱讀一下

          原文在
          http://www.infoq.com/cn/articles/sb-complex-business-continuity-refact
          posted @ 2012-03-28 15:07 shanghai_spark 閱讀(367) | 評論 (0)編輯 收藏

          默認Opentaps是基于derby的安裝,這個在實際生產環境是不太可能會使用的。往往我們會實際需要使用Oracle作為生產數據庫。很多人問我怎么去修改Opentaps與Oracle的支持。修改方法如下:

          1、編輯 framework/entity/config/entityengine.xml,修改default delegate為 localoracle

          <delegator name="default" entity-model-reader="main" entity-group-reader="main" entity-eca-reader="main" distributed-cache-clear-enabled="false">
          <group-map group-name="org.ofbiz" datasource-name="localoracle"/>
          <group-map group-name="org.ofbiz.olap" datasource-name="localoracle"/>
          <group-map group-name="org.ofbiz.tenant" datasource-name="localoracle"/>
          <group-map group-name="org.opentaps.analytics" datasource-name="localoracle"/>
          <group-map group-name="org.opentaps.testing" datasource-name="localoracle"/>
          </delegator>


          2、修改同個文件中的的localoracle 的datasource節點
              <datasource name="localoracle"
                      helper
          -class="org.ofbiz.entity.datasource.GenericHelperDAO"
                      schema
          -name="OFBIZ"
                      field
          -type-name="oracle"
                      check
          -on-start="true"
                      add
          -missing-on-start="true"
                      alias
          -view-columns="false"
                      join
          -style="ansi">
                  
          <read-data reader-name="seed"/>
                  
          <read-data reader-name="seed-initial"/>
                  
          <read-data reader-name="demo"/>
                  
          <read-data reader-name="ext"/>
                  
          <inline-jdbc
                          jdbc
          -driver="oracle.jdbc.driver.OracleDriver"
                          jdbc
          -uri="jdbc:oracle:thin:@127.0.0.1:1521:orcl"
                          jdbc
          -username="ofbiz"
                          jdbc
          -password="ofbiz"
                          pool
          -minsize="2"
                          pool
          -maxsize="250"
                          time
          -between-eviction-runs-millis="600000"/>
              
          </datasource>

          3、將{ORACLE_HOME}\product\10.2.0\db_1\jdbc\lib目錄下的ojdbc14.jar拷貝到framework/entity/lib/jdbc目錄下

          4、重新運行ant run-install生成數據庫對象

          5、現在Oracle數據庫已經就緒OK啦


          posted @ 2012-03-07 10:56 shanghai_spark 閱讀(791) | 評論 (0)編輯 收藏

          我一直期望可以提供一個高性能、高定制性的電子商務套件,它不應局限于傳統的ERP應用或簡單的線上商城應用。而是應將線上發生的產品展示、線上營銷、在線客戶服務與線下的倉儲發貨、經營分析、關鍵客戶識別有機結合起來。

          開始Opentaps開發已經兩年多了,對它的理解也越來越深。做為一個完整的ERP套件來說我覺得它足夠應付我們的日常業務:客戶、訂單、倉儲、采購、財務等。并且它從應用層和開發層都已經提供了足夠的支持與擴展空間。

          我始終覺得Ofbiz提供的ecommerce模塊過于簡單,或者說它與我們國人想象中的電子商城有比較大的差距。如果我們在這之上來開發的話可以需要付出很多的effort才可能達到我們想要的效果。當然opentaps也提供了另一個選擇gracious,但從個人角度來說我并不喜歡這個模塊,它為用戶提供的定制選項太少了,只能作為有經驗的開發者定制自己應用的一個基礎。

          在為Opentaps開發Magento開發Integration Feature時,我接觸到了Magento這個最廣泛被使用的電子商務套件。不過當時只是淺嘗即止并未做太多的功能研究,最近這些日子里我在不斷深入了解了這個產品后越來越嘆服其功能的強大。我想我想要的所有功能應該都被包括在這個產品已完成的feature中了。但同樣我更期望是一個完整的線上線下相貫通的網絡商城運營方案,離這樣的要求Magento在財務結算、倉儲管理、采購管理這些ERP功能方面又明顯的偏弱。

          我想Opentaps與Magento的整合可能不應僅限與原來所提供的產品、訂單信息的貫通,或許我們應該嘗試提供更密切的信息聯系。至少第一步應該要把客戶資料信息進行雙向的同步,然后是庫存信息。

          考慮更遠一點的話,在Magento或Opentaps中引入在線客服與呼叫中心的Feature也是一個非常讓人振奮的事情。發展到這一步,我們就可以簡單的集成這兩個優秀開源產品來為我們的線上線下提供全方面的服務了。

          在以后的文章里,我會繼續在這個方面做更多的設計與實現工作。如果有童鞋對此話題感興趣,可以把你的想法告訴我看是否可以一起來做點事。


          BTW: 現在opentaps已完成的magento整合內容可以在這里找到 http://www.opentaps.org/docs/index.php/Opentaps_Magento_Integration
          posted @ 2011-03-01 09:42 shanghai_spark 閱讀(5809) | 評論 (5)編輯 收藏

          現在google,yahoo這些免費的群組都在大陸不好用,打算自己裝個群組系統給自己的team用。用萬能的google出Simple Groupware,看了特性描述好象還不錯。那就先裝上它試試吧。

          1、安裝apache、mysql、php

          yum install mysql mysql-devel mysql-server php php-cli httpd


          2、安裝php所需的支持的包

          yum install php-zlib php-gd php-mysql php-mbstring


          3、啟動mysqld與httpd服務

          4、創建/var/www/html/sgs目錄,并在該目錄下下載Simple Groupware installer文件后解壓,這樣在/var/www/html/sgs目錄下存在sgs_installer.php文件

          5、打開瀏覽器訪問http://your_server/sgs/sgs_installer.php選擇你要的版本上面的Install,然后按照屏幕提示作下去就好啦


          posted @ 2011-02-17 22:43 shanghai_spark 閱讀(1987) | 評論 (2)編輯 收藏

          打算在自己申請的Free Amazon EC2上放個Magento,看了下Magento的幫助也整理內容如下:

          1、安裝apache、mysql、php

          yum install mysql mysql-devel mysql-server php php-cli httpd

          2、安裝php所需的支持的包

          yum install php-dom php-mcrypt php-gd

          3、創建magento數據庫

          4、下載magento full release package并解壓到/var/www/html下,并設置目錄權限為777

          5、通過瀏覽器訪問安裝magento http://localhost/magento
          posted @ 2011-02-11 12:14 shanghai_spark 閱讀(1921) | 評論 (0)編輯 收藏

          現在在用一個20寸的廈新電視機在做我的顯示器,它是寬屏的,最高可以支持1344x768的分辨率??墒茄b了Fedora 14以后,只能發現最高支持的分辨率是1024x768。字體看起來都是扁扁的,很不爽!

          得想個法把這個分辨率調整過來:

          1) 打開一個Terminal窗口,切換到root身份后運行

          Xorg -configure :1

          這個命令會在/root下生成一個叫xorg.conf.new的文件,我們運行以下命令把它移到/etc/X11下
          mv /root/xorg.conf.new /etc/X11/xorg.conf

          2) reboot系統

          3)在終端中輸入 gtf 1344 768 60 -x 命令, 這樣就會在終端中顯示一些內容. 類似下面的:
          # 1344x768 @ 60.00 Hz (GTF) hsync: 47.70 kHz; pclk: 83.95 MHz
            Modeline 
          "1344x768_60.00"  83.95  1344 1408 1552 1760  768 769 772 795  -HSync +Vsync

          把它復制到 /etc/X11/xorg.conf中的[Moniter]段中,復制后的文件中[Moniter]段如下:
          Section "Monitor"
                  Identifier   
          "Monitor0"
                  VendorName   
          "Monitor Vendor"
                  ModelName    
          "Monitor Model"
                  # 1344x768 @ 
          60.00 Hz (GTF) hsync: 47.70 kHz; pclk: 83.95 MHz
                  Modeline 
          "1344x768_60.00"  83.95  1344 1408 1552 1760  768 769 772 795  -HSync +Vsync
          EndSection

          4) reboot系統后就會在System->Preferences->Moniters中發現1344x768的選項啦!

          5) 收工!

          posted @ 2011-02-10 16:29 shanghai_spark 閱讀(5115) | 評論 (4)編輯 收藏

          在Opentaps 1.4版本我將AOP由原來的AspectJ替換為現在Aspectwerkz。結果我自己就首先在64bit的windows系統下遇到ant編譯出錯,現在把解決方法列在這里

          將opentaps/opentaps-common/build-aspects.xml中的weave任務內容替換為以下內容(其實就是把原來的ant的替換jar內容任務分成兩部來執行):

          <!-- ================================================================== --> 
                  
          <!-- Weave advice into target jars                                      --> 
                  
          <!-- ================================================================== --> 
                  
          <target name="weave" depends="detect-dependencies" if="processRequired"> 
                    
          <echo message="[build] =========== Start Building Aspect (Weave) ============="/> 
                    
          <java classname="org.codehaus.aspectwerkz.compiler.AspectWerkzC" fork="true"> 
                      
          <jvmarg value="-Daspectwerkz.definition.file=${aopConfig}"/> 
                      
          <jvmarg value="-Daspectwerkz.transform.filter=no"/> 
                      
          <!-- <jvmarg value="-Daspectwerkz.transform.verbose=true"/> --> 
                      
          <!-- <jvmarg value="-Daspectwerkz.transform.details=true"/> --> 
                      
          <arg value="-verify"/> 
                      
          <classpath refid="local.class.path" /> 
                      
          <classpath> 
                        
          <pathelement path="${build.dir}/classes/common"/> 
                      
          </classpath> 
                      
          <!-- below is the jars to post-process --> 
                      
          <arg value="${ofbiz.dir}/framework/entity/build/lib/ofbiz-entity.jar"/> 
                    
          </java> 
                    
          <java classname="org.codehaus.aspectwerkz.compiler.AspectWerkzC" fork="true"> 
                      
          <jvmarg value="-Daspectwerkz.definition.file=${aopConfig}"/> 
                      
          <jvmarg value="-Daspectwerkz.transform.filter=no"/> 
                      
          <!-- <jvmarg value="-Daspectwerkz.transform.verbose=true"/> --> 
                      
          <!-- <jvmarg value="-Daspectwerkz.transform.details=true"/> --> 
                      
          <arg value="-verify"/> 
                      
          <classpath refid="local.class.path" /> 
                      
          <classpath> 
                        
          <pathelement path="${build.dir}/classes/common"/> 
                      
          </classpath> 
                      
          <!-- below is the jars to post-process, if these jar not effect each other you can put them in same pos, else please seperate them into another task --> 
                      
          <arg value="${ofbiz.dir}/framework/common/build/lib/ofbiz-common.jar"/> 
                    
          </java> 
                    
          <java classname="org.codehaus.aspectwerkz.compiler.AspectWerkzC" fork="true"> 
                      
          <jvmarg value="-Daspectwerkz.definition.file=${aopConfig}"/> 
                      
          <jvmarg value="-Daspectwerkz.transform.filter=no"/> 
                      
          <!-- <jvmarg value="-Daspectwerkz.transform.verbose=true"/> --> 
                      
          <!-- <jvmarg value="-Daspectwerkz.transform.details=true"/> --> 
                      
          <arg value="-verify"/> 
                      
          <classpath refid="local.class.path" /> 
                      
          <classpath> 
                        
          <pathelement path="${build.dir}/classes/common"/> 
                      
          </classpath> 
                      
          <!-- below is the jars to post-process --> 
                      
          <arg value="${ofbiz.dir}/applications/order/build/lib/ofbiz-order.jar"/> 
                    
          </java> 
                    
          <jar jarfile="${lib.dir}/${name}.jar" update="true" basedir="${build.dir}/classes/common" includes="org/opentaps/aspect/secas/**" /> 
                      
          <!-- put aop.xml into target jar META-INF dir --> 
                       
          <mkdir dir="${build.dir}/classes/META-INF" /> 
                       
          <copy file="${aopConfig}" tofile="${build.dir}/classes/META-INF/aop.xml" overwrite="true"/> 
                     
          <!-- create new jar with aop.xml, then copy it to orign location, using these for avoid unable rename error on windows 64bit system--> 
                         
          <zip destfile="${lib.dir}/ofbiz-entity.jar"> 
                         
          <zipfileset src="${ofbiz.dir}/framework/entity/build/lib/ofbiz-entity.jar"/> 
                         
          <fileset dir="${build.dir}/classes/"> 
                           
          <include name="META-INF/aop.xml"/> 
                         
          </fileset> 
                         
          </zip> 
                     
          <delete file="${ofbiz.dir}/framework/entity/build/lib/ofbiz-entity.jar" failonerror="false"/> 
                         
          <move file="${lib.dir}/ofbiz-entity.jar" tofile="${ofbiz.dir}/framework/entity/build/lib/ofbiz-entity.jar"/> 

                         
          <zip destfile="${lib.dir}/ofbiz-common.jar"> 
                         
          <zipfileset src="${ofbiz.dir}/framework/common/build/lib/ofbiz-common.jar"/> 
                         
          <fileset dir="${build.dir}/classes/"> 
                           
          <include name="META-INF/aop.xml"/> 
                         
          </fileset> 
                         
          </zip> 
                     
          <delete file="${ofbiz.dir}/framework/common/build/lib/ofbiz-common.jar" failonerror="false"/> 
                         
          <move file="${lib.dir}/ofbiz-common.jar" tofile="${ofbiz.dir}/framework/common/build/lib/ofbiz-common.jar"/> 

                     
          <zip destfile="${lib.dir}/ofbiz-order.jar"> 
                         
          <zipfileset src="${ofbiz.dir}/applications/order/build/lib/ofbiz-order.jar"/> 
                         
          <fileset dir="${build.dir}/classes/"> 
                           
          <include name="META-INF/aop.xml"/> 
                         
          </fileset> 
                         
          </zip> 
                     
          <delete file="${ofbiz.dir}/applications/order/build/lib/ofbiz-order.jar" failonerror="false"/> 
                         
          <move file="${lib.dir}/ofbiz-order.jar" tofile="${ofbiz.dir}/applications/order/build/lib/ofbiz-order.jar"/> 

                       
          <echo message="[build] =========== Done Building Aspect (Weave) =============="/> 
                     
          </target>


          以上方法已經在opentaps wiki [http://www.opentaps.org/docs/index.php/General_Installation_of_Opentaps#Build_Aspect_class_Errors] 中加上過了。
          posted @ 2011-02-09 22:18 shanghai_spark 閱讀(1632) | 評論 (0)編輯 收藏

          OFBIZ為我們提供了POS模塊,它已經可以滿足我們日常收銀的大部分要求了。但是美中不足的是它沒有提供庫存查詢功能。我也沒看出來OFBIZ有近期實現此功能的計劃,所以打算自己做一個。

          首先研究一下POS模塊的代碼結構:

          1、POS模塊同其它模塊的實現方式有所區別,它用了XUL技術來定制展示的界面。所有屏幕文件使用XUL格式定義于screens目錄之下

          2、按鈕事件與java代碼映射關系,記錄在config\buttonevents.xml下

          3、資源文件存放在XuiLabels_[locale].properties與config\PosUiLabels.xml中

          了解結構后,加上庫存查詢功能就很簡單了,我是這樣做的:

          1、在screens/default/menu/mgrmain.xml中增加一個mgrInquiryInventory庫存查詢按鈕,它會出現在POS的“經理”界面中的

          2、在buttonevents.xml中加上以下行,映射事件代碼
          <event button-name="mgrInquiryInventory" class-name="org.ofbiz.pos.event.ManagerEvents" method-name="inquiryInventory" disable-lock="false"/>


          3、在ManagerEvents.java中加入inquiryInventory方法代碼(我是使用了一個ShowInventory的XPage來展現當前選中項的庫存分布)

          4、完工。

          算了算,包括閱讀代碼和編寫這些東東總共也就花了七八個小時的effort,不知道為什么ofbiz就不肯加上這個功能呢?或者pos模塊不再發展了?





          posted @ 2011-02-08 11:29 shanghai_spark 閱讀(2293) | 評論 (4)編輯 收藏

          原來opentaps中的entity model文件中大量使用了floating-point來定義數值內容,現在我們要使用fixed-point來替換它們,以保證它的java type使用BigDecimal而不是Double.

          這樣就有了這次的替換任務,把所有model文件中的floating-point替換成為fixed-point。

          方法對我來說有三:
          1, 在eclipse或其它ide中查找出所有的包括floating-point文件來手工修改
          2, 在UltraEdit或其它文本編程器中進行批量文件內容替換
          3, 嘗試一下linux的下的sed命令?

          評估一下,3肯定是一個最有效率的選擇。那么說干就干,let's go!

          命令如下:

          sed -"s/floating-point/fixed-point/g" `find . -name "*.xml"|xargs grep floating-point -rl`

          一句話就搞掂了,真棒!
          posted @ 2010-08-14 17:16 shanghai_spark 閱讀(1428) | 評論 (0)編輯 收藏

          莫名其妙,日志中老是有無法連接oracle的異常
          java.sql.SQLException: Io 異常: The Network Adapter could not establish the connection

          先用oracle用戶登錄到服務器上
          sqlplus /nolog

          conn 
          / as sysdba

          運行了一些sql,一切正常呀,奇怪!

          仔細想想,可能是lsnrctl的問題,打開listener.ora在下面插入以下內容:
              (SID_DESC=
               (GLOBAL_DBNAME 
          = ORCL)
               (ORACLE_HOME 
          = /oracle/10g)
               (SID_NAME 
          = ORCL)
              )
          完成后的listener.ora如下
          SID_LIST_LISTENER =
            (SID_LIST 
          =
              (SID_DESC 
          =
                (SID_NAME 
          = PLSExtProc)
                (ORACLE_HOME 
          = /oracle/10g)
                (PROGRAM 
          = extproc)
              )
              (SID_DESC
          =
               (GLOBAL_DBNAME 
          = ORCL)
               (ORACLE_HOME 
          = /oracle/10g)
               (SID_NAME 
          = ORCL)
              )
            )

          LISTENER 
          =
            (DESCRIPTION_LIST 
          =
              (DESCRIPTION 
          =
                (ADDRESS 
          = (PROTOCOL = IPC)(KEY = EXTPROC1))
                (ADDRESS 
          = (PROTOCOL = TCP)(HOST = localhost.localdomain)(PORT = 1521))
              )
            )

          保存后,重啟lsnrctl服務后就可以正常聯接了。


          posted @ 2010-08-12 17:39 shanghai_spark 閱讀(472) | 評論 (0)編輯 收藏

          僅列出標題
          共6頁: 1 2 3 4 5 6 下一頁 
          主站蜘蛛池模板: 辽源市| 当雄县| 平塘县| 安龙县| 鞍山市| 东城区| 连山| 阜平县| 虎林市| 秀山| 红河县| 丹江口市| 邛崃市| 赤峰市| 屏山县| 南城县| 牟定县| 安远县| 大英县| 香河县| 芜湖市| 茶陵县| 大化| 柳林县| 崇仁县| 邓州市| 璧山县| 谢通门县| 衢州市| 西平县| 宣恩县| 临桂县| 中江县| 德州市| 丰城市| 新闻| 泸定县| 确山县| 正蓝旗| 云浮市| 岳西县|