Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    XML tag generates strange JS DataSource representation - data source i18n problem

    Hi
    I'm trying to use technique described in distro DOCS for server side data source localization.
    I'm using 8.0 Power version.

    I'm generating my dataSource XML server side as JSP ( web.xml modified). When pointing browser to dataSource url I get following XML representation:

    Code:
     
     <!--
    
     -->
    <DataSource xmlns:c="http://java.sun.com/jstl/core"
    	tableName='TB_NAME'
    	ID='MONITOR'
    	serverType="sql"
        serverConstructor="web.monitor.MonitorDataSource"
    >
    	<fields>
    		<field name="ID"  title="Id Zapytania" primaryKey="true"  type="sequence"></field>
    		<field name="FIRM_CODE"  length="20" type="text"></field>
    		<field name="NIP_TS" title="Data wprowadzenia" required="true" type="datetime"></field>
    		<field name="PASSPORTNO" title="Dowód" length="15" type="text"></field>
    		<field name="REGNO" title="REGON" length="15" type="text"></field>
    		<field name="TAXNO" title="NIP" length="10" type="text"></field>
    
    		<field name="PESEL" title="PESEL" length="11" type="text"></field>
    		<field name="SEARCH_EXTERNAL"   title="Zapytanie zewnętrzne" length="1" type="text">
                <valueMap>
                    <value ID="Y">Tak</value>
                    <value ID="N">Nie</value>
                </valueMap>
            </field>
            <field name="SEARCH_EXTERNAL_REASON"   title="Powód wewnętrzny" length="50" type="text"></field>
    
    		<field name="QUESTION_USR" title="PytajÄ…cy" length="50" type="text"></field>
    		<field name="QUESTION_SOURCE" title="Źródło zapytania" length="20" type="text"></field>
    		<field name="QUESTION_BRAND"  title="Brand" length="15" type="text">
                <valueMap>
                    <value ID="BRAND0">0</value>
                    <value ID="BRAND1">1</value>
                </valueMap>
    
            </field>
    
            <field name="EXISTS_SUSPECTED_DOC"  title="Odpowiedź" length="1" type="enum">
                <valueMap>
                    <value ID="Y">Zgoda</value>
                    <value ID="N">Zakaz</value>
                </valueMap>
            </field>
    
            <field name="SUSPECTED_DOC_LIST_TYPE"  title="Odpowiedź szczegol‚owa" length="2000" type="text" />
            <!--
            
            -->
    	</fields>
    
       
        <operationBindings>
            <binding operationType="fetch" operationId="fetch_without_count" skipRowCount="true">
                <whereClause>
    
                     <![CDATA[
    
                     $defaultWhereClause
                    and
                    #if($dateFrom)
                        NIP_TS >= $dateFrom
                        and
                    #end
                    #if($dateTo)
                        NIP_TS <= $dateTo
                        and
                    #end
                    '1' = '1'
    
                      ]]>
                </whereClause>
            </binding>
        </operationBindings>
    
    </DataSource>
    after embedding to JSP page like this:

    Code:
     <isomorphic:XML>
            <jsp:include page="/sc/ds/V_VERIFICATIONS_HISTORY_UNION.ds.xml"/>
        </isomorphic:XML>
    I get following JS representation - which I think is not right


    Code:
     
    isc.DataSource.create({
        serverConstructor:"web.monitor.MonitorDataSource",
        serverType:"sql",
        c:"http://java.sun.com/jstl/core",
        fields:{
            ID:{
                name:"ID",
                primaryKey:true,
                title:"Id Zapytania",
                type:"sequence"
            },
            FIRM_CODE:{
                length:20,
                name:"FIRM_CODE",
                type:"text"
            },
            NIP_TS:{
                name:"NIP_TS",
                required:true,
                title:"Data wprowadzenia",
                type:"datetime"
            },
            PASSPORTNO:{
                length:15,
                name:"PASSPORTNO",
                title:"Dowód",
                type:"text"
            },
            REGNO:{
                length:15,
                name:"REGNO",
                title:"REGON",
                type:"text"
            },
            TAXNO:{
                length:10,
                name:"TAXNO",
                title:"NIP",
                type:"text"
            },
            PESEL:{
                length:11,
                name:"PESEL",
                title:"PESEL",
                type:"text"
            },
            SEARCH_EXTERNAL:{
                length:1,
                name:"SEARCH_EXTERNAL",
                title:"Zapytanie zewnętrzne",
                type:"text",
                valueMap:{
                    Y:"Tak",
                    N:"Nie"
                }
            },
            SEARCH_EXTERNAL_REASON:{
                length:50,
                name:"SEARCH_EXTERNAL_REASON",
                title:"Powód wewnętrzny",
                type:"text"
            },
            QUESTION_USR:{
                length:50,
                name:"QUESTION_USR",
                title:"Pytający",
                type:"text"
            },
            QUESTION_SOURCE:{
                length:20,
                name:"QUESTION_SOURCE",
                title:"Źródło zapytania",
                type:"text"
            },
            QUESTION_BRAND:{
                length:15,
                name:"QUESTION_BRAND",
                title:"Brand",
                type:"text",
                valueMap:{
                    BRAND0:"0",
                    BRAND1:"1"
                }
            },
            EXISTS_SUSPECTED_DOC:{
                length:1,
                name:"EXISTS_SUSPECTED_DOC",
                title:"Odpowiedź",
                type:"enum",
                valueMap:{
                    Y:"Zgoda",
                    N:"Zakaz"
                }
            },
            SUSPECTED_DOC_LIST_TYPE:{
                length:2000,
                name:"SUSPECTED_DOC_LIST_TYPE",
                title:"Odpowiedź szczegółowa",
                type:"text"
            },
            RECORD_TYPE:{
                hidden:true,
                length:4,
                name:"RECORD_TYPE",
                type:"text"
            }
        },
      
        operationBindings:[
            {
                operationId:"fetch_without_count",
                operationType:"fetch",
                skipRowCount:"true",
                whereClause:"\n                 \n\n                 $defaultWhereClause\n                and\n                #if($dateFrom)\n                    NIP_TS >= $dateFrom\n                    and\n                #end\n                #if($dateTo)\n                    NIP_TS <= $dateTo\n                    and\n                #end\n                '1' = '1'\n\n                  \n            "
            }
        ]
    })
    Notice fields property is messed up. Is there anything wrong with my code?

    Thanks for reading.
    lkc

    #2
    There's nothing with that fields representation - it's not the documented format, but it does work.

    Comment

    Working...
    X