<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    向左走,向右走
    不斷追求進步
    posts - 24,comments - 23,trackbacks - 0

    剛剛參加完公司的i.frame的培訓,現在總結一下

    1. web.xml 文件中并沒有太多的變化,注意一下要配置多個struts-config-***.xml
    2. i.frame 比struts多了command-config-***.xml,是以plugin的方式和sturts一起工作的,配置在struts-default.xml文件
    <plug-in className="com.ncs.iframe.base.ejb.command.action.CommandPlugIn">
    ??? <set-property property="config"
    ????? value="/WEB-INF/command/command-config-default.xml"/>
    ??? <set-property property="config/custdir"
    ????? value="/WEB-INF/command/command-config-custdir.xml"/>
    ??? </plug-in>

    ? 而command-config-default.xml 的作用就是定義類似BM的東西,不過這里叫commoand罷了
    ? <command-config>
    ? <command-mappings>
    ??? <command name="/custdir/searchprocess"
    ????? type="com.ncs.iframe.sample.custdir.command.SCDCustomerCommand"
    ????? service="searchCustomer">
    ????? <param name="name" type="java.lang.String"/>
    ????? <result name="result" type="java.util.ArrayList"/>
    ??? </command>
    ?</command-mappings>
    </command-config>

    其中/custdir/searchprocess 表示custdir模塊下的searchprocess 這個action,type表示action指向的command, service為要執行的方法,定義在command里面.

    可是, command又怎么調用DAO呢???
    別著急, 輪到pfw出場了,汗!

    2. pfw

    pfw-config.xml的一般定義如下:
    <pfw-config>
    ? <database id="iconnect">
    ??? <!-- use either one-->
    ??? <!-- for BEA -->
    ??? <!-- <data-source jndi="iconnectDS" /> -->
    ??? <!-- for Tomcat -->
    ??? <data-source jndi="java:comp/env/jdbc/iconnectDS" />
    ??? <mapping href="/WEB-INF/pfw/pfw-mapping-custdir.xml" />
    ??? <mapping href="/WEB-INF/pfw/pfw-mapping-iextend.xml" />
    ??? <mapping href="/WEB-INF/pfw/pfw-itrust-aa-sql.xml" />
    ? </database>
    </pfw-config>

    定義了一個jndi,這個需要在服務器配置. 其他的就是映射到了幾個子模塊的pfw配置,提供一個看看(很恐怖, 太長了):
    作用: 提供DAO到數據庫的映射. 包含SQL語句
    <pfw-mapping>?
    ? <map-class id="com.ncs.iframe.sample.custdir.to.SCDCustomerTO">
    ??? <db-table name="TBL_SAMPLE_CUSTOMER"/>
    ??? <field name="customerID" type="java.lang.String">
    ????? <sql name="CUSTOMER_ID" type="CHAR"/>
    ??? </field>
    ??? <field name="name" type="java.lang.String">
    ????? <sql name="NAME" type="CHAR"/>
    ??? </field>
    ??? <field name="telMain" type="java.lang.String">
    ????? <sql name="TEL_MAIN" type="CHAR"/>
    ??? </field>
    ??? <field name="industry.codeId" type="java.lang.String">
    ????? <sql name="INDUSTRY_CD" type="CHAR"/>
    ??? </field>
    ??? <field name="remarks" type="java.lang.String">
    ????? <sql name="REMARKS" type="CHAR"/>
    ??? </field>
    ??? <field name="version" type="java.lang.Integer">
    ????? <sql name="VERSION" type="INTEGER"/>
    ??? </field>
    ?<field name="updatedDt" type="java.sql.Timestamp">
    ??<sql name="UPDATED_DT" type="TIMESTAMP"/>
    ?</field>
    ??? <primary-key name="CUSTOMER_ID"/>
    ??? <version name="UPDATED_DT"/>
    ??? <cache-group name="TBL_SAMPLE_CUSTOMER"/>
    ? </map-class>
    ? <!-- Start of param-map -->
    ? <param-map id="/custdir/getSearchCustomerCountParams">
    ??? <property name="name" sqlType="CHAR"/>
    ? </param-map>
    ? <param-map id="/custdir/getSearchCustomerParams">
    ??? <property name="name" sqlType="CHAR"/>
    ??? <property name="sortOrder" sqlType="CHAR"/>
    ??? <property name="orderType" sqlType="CHAR"/>
    ? </param-map>
    ? <!-- Start of result-map -->
    ? <result-map id="/custdir/getSearchCustomerResults"
    ??? mapClassId="com.ncs.iframe.sample.custdir.to.SCDCustomerTO">
    ? </result-map>
    ? <!-- Start of map-sql -->
    ? <map-sql id="/custdir/searchCustomer" type="query"
    ??? param-map="/custdir/getSearchCustomerParams"
    ??? result-map="/custdir/getSearchCustomerResults"> <![CDATA[
    ??????? select CUSTOMER_ID, NAME, TEL_MAIN, VERSION, UPDATED_DT
    ????????? from TBL_SAMPLE_CUSTOMER
    ????????? <dynamic prepend="where">
    ??????????? <isNotEmpty property="name">
    ????????????? NAME like '%#name#%'
    ??????????? </isNotEmpty>
    ????????? </dynamic>
    ????????? <dynamic prepend="order by">
    ??????????? <isNotEmpty property="sortOrder">
    ??????????? #sortOrder# #orderType#
    ?????????? </isNotEmpty>
    ????????? </dynamic>
    ??????? ]]>
    ?????? <cache-group name="TBL_SAMPLE_CUSTOMER"/>
    ? </map-sql>
    ? <map-sql id="/custdir/getMatchingCustomerCount" type="query"
    ??? param-map="/custdir/getSearchCustomerCountParams"
    ??? result-class="java.lang.Integer"> <![CDATA[
    ??????? select count(NAME)
    ????????? from TBL_SAMPLE_CUSTOMER
    ????????? <dynamic prepend="where">
    ??????????? <isNotEmpty property="name">
    ????????????? NAME like '%#name#%'
    ??????????? </isNotEmpty>
    ????????? </dynamic>
    ??????? ]]> <cache-group name="TBL_SAMPLE_CUSTOMER"/> </map-sql>
    ? <map-sql id="/custdir/getExactMatchingCustomerCount" type="query"
    ??? param-map="/custdir/getSearchCustomerCountParams"
    ??? result-class="java.lang.Integer"> <![CDATA[
    ??????? select count(NAME)
    ????????? from TBL_SAMPLE_CUSTOMER
    ??????? where NAME = '#name#'
    ??????? ]]> <cache-group name="TBL_SAMPLE_CUSTOMER"/> </map-sql>
    ? <map-sql id="/custdir/getAllCustomerList" type="query"
    ??? result-map="/custdir/getSearchCustomerResults"> <![CDATA[
    ??????? select CUSTOMER_ID, NAME, TEL_MAIN, VERSION
    ????????? from TBL_SAMPLE_CUSTOMER
    ??????? order by NAME
    ??????? ]]> </map-sql>
    ? <!-- Start of testing pfw -->
    ? <param-map id="/test/getCustomerParams">
    ??? <property name="custId" sqlType="CHAR"/>
    ? </param-map>
    ? <result-map id="/test/getCustomerResults"
    ??? mapClassId="com.ncs.iframe.sample.custdir.to.SCDCustomerTO">
    ? </result-map>
    ? <map-sql id="/test/getCustomer" type="query"
    ??? param-map="/test/getCustomerParams" result-map="/test/getCustomerResults"> <![CDATA[
    ??????? select CUSTOMER_ID, NAME, TEL_MAIN, INDUSTRY_CD, REMARKS, VERSION, UPDATED_DT, TMP_DATE, TMP_INT, TMP_DBL
    ????????? from TBL_SAMPLE_CUSTOMER
    ????????? <dynamic prepend="where">
    ??????????? <isNotEmpty property="name">
    ??? CUSTOMER_ID = '%#custId#%'
    ??????????? </isNotEmpty>
    ????????? </dynamic>
    ??????? ]]>
    ??????? <cache-group name="TBL_SAMPLE_CUSTOMER"/>
    ?? </map-sql>
    ? <!--- Declarative SQL to showcase Stored-procedure -->
    ? <param-map id="/test/proce_getCustomerParams">
    ??? <property name="In_version" sqlType="INTEGER" storedProcType="IN" />
    ??? <property name="customerID" sqlType="CHAR" storedProcType="INOUT"/>
    ??? <property name="name" sqlType="CHAR" storedProcType="OUT"/>
    ??? <property name="telMain" sqlType="CHAR" storedProcType="OUT"/>
    ??? <property name="industry.codeId" sqlType="CHAR" storedProcType="OUT"/>
    ??? <property name="remarks" sqlType="CHAR" storedProcType="OUT"/>
    ??? <property name="version" sqlType="INTEGER" storedProcType="OUT"/>
    ? </param-map>
    ? <result-map id="/test/proce_getCustomerResults"
    ??? mapClassId="com.ncs.iframe.sample.custdir.to.SCDCustomerTO">
    ? </result-map>
    ? <!-- ALL output (out, INOUT) must be delaredin the result-map
    ????? with the same result-map -->
    ? <map-sql id="/test/proce_getCustomer" type="stored_procedure"
    ??? param-map="/test/proce_getCustomerParams"
    ??? result-map="/test/proce_getCustomerResults"> <![CDATA[
    ???????? { call
    ?? PROCE_GET_CUSTDIR(##In_version##,##customerID##,##name##,##telMain##, ##industry.codeId##, ##remarks##, ##version##)
    ???????? }
    ??????? ]]> </map-sql>
    ? <!--
    ???? begin
    ?? PROCE_GET_CUSTDIR(##In_version##,##customerID##,##name##,##telMain##, ##industry.codeId##, ##remarks##, ##version##);
    ???????? end;
    ??? -->
    ? <param-map id="/test/getSearchCustomerParams">
    ??? <property name="name" sqlType="CHAR" storedProcType="IN" />
    ??? <property name="sortOrder" sqlType="CHAR" storedProcType="IN" />
    ??? <property name="resultSet" sqlType="OTHER" storedProcType="OUT"
    ????? storedProcTypeClass="com.ncs.iframe.sample.OracleStoredProcTypeClass"/>
    ? </param-map>
    ? <!-- Start of result-map -->
    ? <result-map id="/test/getSearchCustomerResults"
    ??? mapClassId="com.ncs.iframe.sample.custdir.to.SCDCustomerTO">
    ? </result-map>
    ? <!-- Start of map-sql -->
    ? <map-sql id="/test/searchCustomer" type="stored_procedure"
    ??? param-map="/test/getSearchCustomerParams"
    ??? result-map="/test/getSearchCustomerResults"> <![CDATA[
    ???????? { call
    ?? PROCE_SEARCH_CUSTDIR(##name##,##sortOrder##,##resultSet##)
    ???????? }
    ??????? ]]>
    ?? </map-sql>
    </pfw-mapping>

    汗啊, 以后就要手這些了, 想起來就害怕.

    posted on 2006-05-09 23:28 Oliver Zhang 閱讀(712) 評論(2)  編輯  收藏

    FeedBack:
    # re: i.frame總結
    2009-07-30 10:17 | Jawf
    這是公司的東西,你可不能拿出來share噢。  回復  更多評論
      
    # re: i.frame總結[未登錄]
    2009-08-14 14:53 | me
    注意涉嫌泄密啊  回復  更多評論
      

    只有注冊用戶登錄后才能發表評論。


    網站導航:
     
    主站蜘蛛池模板: 亚洲电影免费观看| 国产AV无码专区亚洲精品| 亚洲视频一区在线观看| 国产好大好硬好爽免费不卡| 亚洲午夜未满十八勿入网站2| 9久久免费国产精品特黄| 国产精品亚洲玖玖玖在线观看| 免费无码AV一区二区| 亚洲无码日韩精品第一页| 黄色视屏在线免费播放| 亚洲午夜无码久久久久| 91av免费观看| 精品亚洲成A人无码成A在线观看 | 国产v片免费播放| 成人精品国产亚洲欧洲| 亚洲AⅤ永久无码精品AA | 中文字幕成人免费视频| 91亚洲国产在人线播放午夜| 最近中文字幕大全中文字幕免费| 精品亚洲国产成AV人片传媒| 成年黄网站色大免费全看| 亚洲一久久久久久久久| 免费一级毛片在播放视频| 东北美女野外bbwbbw免费| 午夜亚洲AV日韩AV无码大全| 100000免费啪啪18免进| 亚洲成av人片在www鸭子| 国产亚洲美女精品久久久2020| 国内精品免费在线观看| 亚洲另类图片另类电影| 免费看国产一级片| 久久免费观看国产精品88av| 亚洲国产综合在线| 免费国产综合视频在线看| 国产一区二区免费视频| 亚洲va在线va天堂成人| 久久久久亚洲av成人无码电影| 人妻无码久久一区二区三区免费 | 国产黄片不卡免费| 911精品国产亚洲日本美国韩国| 好吊妞在线新免费视频|