PDA

View Full Version : Ext.data.Record against DominoViewXMLReader



becomcs
2 Feb 2008, 1:12 PM
Hi.

I inspect Ext.data.Record specs for a week and finaly I achieve to read view entries without
dominoviewxmlreader.

here is the readviewentries

<?xml version="1.0" encoding="UTF-8"?>
<viewentries toplevelentries="61">
<viewentry position="1" unid="371BA76D8C26DF1AC1257027002E42C1" noteid="C0E" children="1" descendants="1" siblings="61">
<entrydata columnnumber="0" name="$9">
<text>HIGHTEC</text></entrydata>
<entrydata columnnumber="1" name="$11">
</entrydata>
<entrydata columnnumber="2" name="$10">
<text>LENZBURG</text></entrydata>
<entrydata columnnumber="3" name="$4">
</entrydata>
<entrydata columnnumber="4" name="Statut">
<text>Actif</text></entrydata>
<entrydata columnnumber="5" name="CurrentStatutDate">
<text></text></entrydata>
<entrydata columnnumber="6" name="Agrement_FOUR_SURV">
<text></text></entrydata>
</viewentry>
<viewentry position="1.1" unid="A4D2F303CD9374C1C12573D2008325C2" noteid="203A" siblings="1" response="true">
<entrydata columnnumber="0" name="$9">
<text> 18 - ELECTRONIQUE</text></entrydata>
<entrydata columnnumber="1" name="$11">
</entrydata>
<entrydata columnnumber="2" name="$10">
<text>01 - Composants électroniques</text></entrydata>
<entrydata columnnumber="3" name="$4">
</entrydata>
<entrydata columnnumber="4" name="Statut">
<text>Validé</text></entrydata>
<entrydata columnnumber="5" name="CurrentStatutDate">
<text>14/01/98</text></entrydata>
<entrydata columnnumber="6" name="Agrement_FOUR_SURV">
<text>C2</text></entrydata>
</viewentry>
<viewentry position="2" unid="346D5960F11E862BC1257088004E65AE" noteid="BEE" children="2" descendants="2" siblings="61">
<entrydata columnnumber="0" name="$9">
<text>HELLENIC AEROSPACE INDUSTRY</text></entrydata>
<entrydata columnnumber="1" name="$11">
</entrydata>
<entrydata columnnumber="2" name="$10">
<text>SCHIMATARI</text></entrydata>
<entrydata columnnumber="3" name="$4">
</entrydata>
<entrydata columnnumber="4" name="Statut">
<text>Actif</text></entrydata>
<entrydata columnnumber="5" name="CurrentStatutDate">
<text></text></entrydata>
<entrydata columnnumber="6" name="Agrement_FOUR_SURV">
<text></text></entrydata>
</viewentry>
<viewentry position="2.1" unid="51FD3A2EA314804BC12573D2008324D2" noteid="2026" siblings="2" response="true">
<entrydata columnnumber="0" name="$9">
<text> 17 - EQUIPEMENTS</text></entrydata>
<entrydata columnnumber="1" name="$11">
</entrydata>
<entrydata columnnumber="2" name="$10">
<text>99 - Equipements Autres</text></entrydata>
<entrydata columnnumber="3" name="$4">
</entrydata>
<entrydata columnnumber="4" name="Statut">
<text>Validé</text></entrydata>
<entrydata columnnumber="5" name="CurrentStatutDate">
<text>19/03/2007</text></entrydata>
<entrydata columnnumber="6" name="Agrement_FOUR_SURV">
<text>C2</text></entrydata>
</viewentry>
<viewentry position="2.2" unid="9ABE3D6D1CBC904FC12573D2008324BC" noteid="2022" siblings="2" response="true">
<entrydata columnnumber="0" name="$9">
<text> 23 - RECHANGES, REPARATIONS, MAINTENANCE</text></entrydata>
<entrydata columnnumber="1" name="$11">
</entrydata>
<entrydata columnnumber="2" name="$10">
<text>03 - Sous-traitance de réparation d&apos;équipements</text></entrydata>
<entrydata columnnumber="3" name="$4">
</entrydata>
<entrydata columnnumber="4" name="Statut">
<text>Validé</text></entrydata>
<entrydata columnnumber="5" name="CurrentStatutDate">
<text>21/10/2005</text></entrydata>
<entrydata columnnumber="6" name="Agrement_FOUR_SURV">
<text>C2</text></entrydata>
</viewentry>
<viewentry position="3" unid="6404D1B04DDFCADFC1256B1000694CB1" noteid="F0A" children="1" descendants="1" siblings="61">
<entrydata columnnumber="0" name="$9">
<text>HANIER PLAISANCE SA</text></entrydata>
<entrydata columnnumber="1" name="$11">
</entrydata>
<entrydata columnnumber="2" name="$10">
<text>VILLEJUIF</text></entrydata>
<entrydata columnnumber="3" name="$4">
</entrydata>
<entrydata columnnumber="4" name="Statut">
<text>Actif</text></entrydata>
<entrydata columnnumber="5" name="CurrentStatutDate">
<text></text></entrydata>
<entrydata columnnumber="6" name="Agrement_FOUR_SURV">
<text></text></entrydata>
</viewentry>
<viewentry position="3.1" unid="4ECF18D24E123BF2C12573D20083404F" noteid="218A" siblings="1" response="true">
<entrydata columnnumber="0" name="$9">
<text> 21 - PRESTATIONS / PROCEDES</text></entrydata>
<entrydata columnnumber="1" name="$11">
</entrydata>
<entrydata columnnumber="2" name="$10">
<text>05 - Traitements de surface</text></entrydata>
<entrydata columnnumber="3" name="$4">
</entrydata>
<entrydata columnnumber="4" name="Statut">
<text>Validé</text></entrydata>
<entrydata columnnumber="5" name="CurrentStatutDate">
<text>29/06/92</text></entrydata>
<entrydata columnnumber="6" name="Agrement_FOUR_SURV">
<text>C2</text></entrydata>
</viewentry>
<viewentry position="4" unid="3130F0CEA5F29884C12571C3002B4E15" noteid="BCA" children="1" descendants="1" siblings="61">
<entrydata columnnumber="0" name="$9">
<text>GROUPEMENT SEGULA TECHNOLOGIES</text></entrydata>
<entrydata columnnumber="1" name="$11">
</entrydata>
<entrydata columnnumber="2" name="$10">
<text>PRINGY</text></entrydata>
<entrydata columnnumber="3" name="$4">
</entrydata>
<entrydata columnnumber="4" name="Statut">
<text>Actif</text></entrydata>
<entrydata columnnumber="5" name="CurrentStatutDate">
<text></text></entrydata>
<entrydata columnnumber="6" name="Agrement_FOUR_SURV">
<text></text></entrydata>
</viewentry>
<viewentry position="4.1" unid="46D10D357429FACAC12573D20083240D" noteid="2012" siblings="1" response="true">
<entrydata columnnumber="0" name="$9">
<text> 13 - Piéces mécaniques et chaudronnées de petites dimensions</text></entrydata>
<entrydata columnnumber="1" name="$11">
</entrydata>
<entrydata columnnumber="2" name="$10">
<text>99 - Piéces mécaniques et chaudronnées de petites dimensions - Autres</text></entrydata>
<entrydata columnnumber="3" name="$4">
</entrydata>
<entrydata columnnumber="4" name="Statut">
<text>Validé</text></entrydata>
<entrydata columnnumber="5" name="CurrentStatutDate">
<text>07/08/2006</text></entrydata>
<entrydata columnnumber="6" name="Agrement_FOUR_SURV">
<text></text></entrydata>
</viewentry>
<viewentry position="5" unid="236CAADDBEB5BAA5C1256B1000694C8F" noteid="B02" children="2" descendants="2" siblings="61">
<entrydata columnnumber="0" name="$9">
<text>GROUPE DELAGE AERO</text></entrydata>
<entrydata columnnumber="1" name="$11">
</entrydata>
<entrydata columnnumber="2" name="$10">
<text>PIERREFITTE</text></entrydata>
<entrydata columnnumber="3" name="$4">
</entrydata>
<entrydata columnnumber="4" name="Statut">
<text>Actif</text></entrydata>
<entrydata columnnumber="5" name="CurrentStatutDate">
<text></text></entrydata>
<entrydata columnnumber="6" name="Agrement_FOUR_SURV">
<text></text></entrydata>
</viewentry>
<viewentry position="5.1" unid="AFC438F1BA05FB26C12573D200831EB1" noteid="1FBA" siblings="2" response="true">
<entrydata columnnumber="0" name="$9">
<text> 13 - Pièces mécaniques et chaudronnées de petites dimensions</text></entrydata>
<entrydata columnnumber="1" name="$11">
</entrydata>
<entrydata columnnumber="2" name="$10">
<text>04 - Canalisations rigides</text></entrydata>
<entrydata columnnumber="3" name="$4">
</entrydata>
<entrydata columnnumber="4" name="Statut">
<text>Validé</text></entrydata>
<entrydata columnnumber="5" name="CurrentStatutDate">
<text>15/12/99</text></entrydata>
<entrydata columnnumber="6" name="Agrement_FOUR_SURV">
<text>C2</text></entrydata>
</viewentry>
<viewentry position="5.2" unid="372E7E3E40D08C00C12573D200831EC7" noteid="1FBE" siblings="2" response="true">
<entrydata columnnumber="0" name="$9">
<text> 13 - Piéces mécaniques et chaudronnées de petites dimensions</text></entrydata>
<entrydata columnnumber="1" name="$11">
</entrydata>
<entrydata columnnumber="2" name="$10">
<text>99 - Autres</text></entrydata>
<entrydata columnnumber="3" name="$4">
</entrydata>
<entrydata columnnumber="4" name="Statut">
<text>Validé</text></entrydata>
<entrydata columnnumber="5" name="CurrentStatutDate">
<text>19/03/2007</text></entrydata>
<entrydata columnnumber="6" name="Agrement_FOUR_SURV">
<text>C2</text></entrydata>
</viewentry>
<viewentry position="6" unid="142647438CDC76D5C1257027002E3F40" noteid="A16" children="1" descendants="1" siblings="61">
<entrydata columnnumber="0" name="$9">
<text>GLENAIR FRANCE</text></entrydata>
<entrydata columnnumber="1" name="$11">
</entrydata>
<entrydata columnnumber="2" name="$10">
<text>TOULOUSE</text></entrydata>
<entrydata columnnumber="3" name="$4">
</entrydata>
<entrydata columnnumber="4" name="Statut">
<text>Actif</text></entrydata>
<entrydata columnnumber="5" name="CurrentStatutDate">
<text></text></entrydata>
<entrydata columnnumber="6" name="Agrement_FOUR_SURV">
<text></text></entrydata>
</viewentry>
<viewentry position="6.1" unid="CD184103FF554C24C12573D20083188F" noteid="1F6E" siblings="1" response="true">
<entrydata columnnumber="0" name="$9">
<text> 21 - PRESTATIONS / PROCEDES</text></entrydata>
<entrydata columnnumber="1" name="$11">
</entrydata>
<entrydata columnnumber="2" name="$10">
<text>12 - Mécanique générale</text></entrydata>
<entrydata columnnumber="3" name="$4">
</entrydata>
<entrydata columnnumber="4" name="Statut">
<text>Validé</text></entrydata>
<entrydata columnnumber="5" name="CurrentStatutDate">
<text>14/09/98</text></entrydata>
<entrydata columnnumber="6" name="Agrement_FOUR_SURV">
<text>C2</text></entrydata>
</viewentry>
<viewentry position="7" unid="05D641583BDFD014C1257027002E3DB9" noteid="952" children="1" descendants="1" siblings="61">
<entrydata columnnumber="0" name="$9">
<text>GEORGE INDUSTRIES INC</text></entrydata>
<entrydata columnnumber="1" name="$11">
</entrydata>
<entrydata columnnumber="2" name="$10">
<text>ENDICOTT</text></entrydata>
<entrydata columnnumber="3" name="$4">
</entrydata>
<entrydata columnnumber="4" name="Statut">
<text>Actif</text></entrydata>
<entrydata columnnumber="5" name="CurrentStatutDate">
<text></text></entrydata>
<entrydata columnnumber="6" name="Agrement_FOUR_SURV">
<text></text></entrydata>
</viewentry>
<viewentry position="7.1" unid="19F4990BBFECEA40C12573D200830DBF" noteid="1EEA" siblings="1" response="true">
<entrydata columnnumber="0" name="$9">
<text> 21 - PRESTATIONS / PROCEDES</text></entrydata>
<entrydata columnnumber="1" name="$11">
</entrydata>
<entrydata columnnumber="2" name="$10">
<text>12 - Mécanique générale</text></entrydata>
<entrydata columnnumber="3" name="$4">
</entrydata>
<entrydata columnnumber="4" name="Statut">
<text>Validé</text></entrydata>
<entrydata columnnumber="5" name="CurrentStatutDate">
<text>06/12/2004</text></entrydata>
<entrydata columnnumber="6" name="Agrement_FOUR_SURV">
<text>C2</text></entrydata>
</viewentry>
<viewentry position="8" unid="61094575E5AD9589C12570CE004E6EB6" noteid="ECE" children="1" descendants="1" siblings="61">
<entrydata columnnumber="0" name="$9">
<text>GARLOCK France</text></entrydata>
<entrydata columnnumber="1" name="$11">
</entrydata>
<entrydata columnnumber="2" name="$10">
<text>SAINT-ETIENNE</text></entrydata>
<entrydata columnnumber="3" name="$4">
</entrydata>
<entrydata columnnumber="4" name="Statut">
<text>Actif</text></entrydata>
<entrydata columnnumber="5" name="CurrentStatutDate">
<text></text></entrydata>
<entrydata columnnumber="6" name="Agrement_FOUR_SURV">
<text></text></entrydata>
</viewentry>
<viewentry position="8.1" unid="7E888FA0EE91FA39C12573D200833EDB" noteid="2172" siblings="1" response="true">
<entrydata columnnumber="0" name="$9">
<text> 15 - PRODUITS TECHNIQUES</text></entrydata>
<entrydata columnnumber="1" name="$11">
</entrydata>
<entrydata columnnumber="2" name="$10">
<text>06 - Etanchéité polymères</text></entrydata>
<entrydata columnnumber="3" name="$4">
</entrydata>
<entrydata columnnumber="4" name="Statut">
<text>Validé</text></entrydata>
<entrydata columnnumber="5" name="CurrentStatutDate">
<text>08/11/2005</text></entrydata>
<entrydata columnnumber="6" name="Agrement_FOUR_SURV">
<text>C2</text></entrydata>
</viewentry>
<viewentry position="9" unid="51CCD0911F041250C1256B1000694CA5" noteid="DE6" children="1" descendants="1" siblings="61">
<entrydata columnnumber="0" name="$9">
<text>FORGEAVIA</text></entrydata>
<entrydata columnnumber="1" name="$11">
</entrydata>
<entrydata columnnumber="2" name="$10">
<text>BIESLES</text></entrydata>
<entrydata columnnumber="3" name="$4">
</entrydata>
<entrydata columnnumber="4" name="Statut">
<text>Actif</text></entrydata>
<entrydata columnnumber="5" name="CurrentStatutDate">
<text></text></entrydata>
<entrydata columnnumber="6" name="Agrement_FOUR_SURV">
<text></text></entrydata>
</viewentry>
<viewentry position="9.1" unid="7BF50D55C1F3301BC12573D200833712" noteid="20FA" siblings="1" response="true">
<entrydata columnnumber="0" name="$9">
<text> 11 - MATIERE ET BRUTS DE FORGE</text></entrydata>
<entrydata columnnumber="1" name="$11">
</entrydata>
<entrydata columnnumber="2" name="$10">
<text>02 - Forgés pièces fixes</text></entrydata>
<entrydata columnnumber="3" name="$4">
</entrydata>
<entrydata columnnumber="4" name="Statut">
<text>Validé</text></entrydata>
<entrydata columnnumber="5" name="CurrentStatutDate">
<text>27/10/99</text></entrydata>
<entrydata columnnumber="6" name="Agrement_FOUR_SURV">
<text>C2</text></entrydata>
</viewentry>
<viewentry position="10" unid="147C8CA230FC08D1C1256B730034DBE4" noteid="A1A" children="2" descendants="2" siblings="61">
<entrydata columnnumber="0" name="$9">
<text>FONDERIES DU VAL RICARD</text></entrydata>
<entrydata columnnumber="1" name="$11">
</entrydata>
<entrydata columnnumber="2" name="$10">
<text>BOLBEC</text></entrydata>
<entrydata columnnumber="3" name="$4">
</entrydata>
<entrydata columnnumber="4" name="Statut">
<text>Actif</text></entrydata>
<entrydata columnnumber="5" name="CurrentStatutDate">
<text></text></entrydata>
<entrydata columnnumber="6" name="Agrement_FOUR_SURV">
<text></text></entrydata>
</viewentry>
<viewentry position="10.1" unid="206C3416A762082FC12573D2008318AF" noteid="1F72" siblings="2" response="true">
<entrydata columnnumber="0" name="$9">
<text> 11 - MATIERE ET BRUTS DE FORGE</text></entrydata>
<entrydata columnnumber="1" name="$11">
</entrydata>
<entrydata columnnumber="2" name="$10">
<text>03 - 1/2 produits/barres, tôles, tubes</text></entrydata>
<entrydata columnnumber="3" name="$4">
</entrydata>
<entrydata columnnumber="4" name="Statut">
<text>Validé</text></entrydata>
<entrydata columnnumber="5" name="CurrentStatutDate">
<text>21/10/2005</text></entrydata>
<entrydata columnnumber="6" name="Agrement_FOUR_SURV">
<text>C2</text></entrydata>
</viewentry>
<viewentry position="10.2" unid="064F485EA19163EEC12573D2008318C5" noteid="1F76" siblings="2" response="true">
<entrydata columnnumber="0" name="$9">
<text> 12 - Bruts de fonderie (hors aubage)</text></entrydata>
<entrydata columnnumber="1" name="$11">
</entrydata>
<entrydata columnnumber="2" name="$10">
<text>99 - Autres</text></entrydata>
<entrydata columnnumber="3" name="$4">
</entrydata>
<entrydata columnnumber="4" name="Statut">
<text>Validé</text></entrydata>
<entrydata columnnumber="5" name="CurrentStatutDate">
<text>20/03/2007</text></entrydata>
<entrydata columnnumber="6" name="Agrement_FOUR_SURV">
<text>C2</text></entrydata>
</viewentry>
<viewentry position="11" unid="1615E8F2A43434B7C1256B1000694DDB" noteid="A46" children="1" descendants="1" siblings="61">
<entrydata columnnumber="0" name="$9">
<text>FLUOROTECHNIQUE</text></entrydata>
<entrydata columnnumber="1" name="$11">
</entrydata>
<entrydata columnnumber="2" name="$10">
<text>MONTREUIL</text></entrydata>
<entrydata columnnumber="3" name="$4">
</entrydata>
<entrydata columnnumber="4" name="Statut">
<text>Actif</text></entrydata>
<entrydata columnnumber="5" name="CurrentStatutDate">
<text></text></entrydata>
<entrydata columnnumber="6" name="Agrement_FOUR_SURV">
<text></text></entrydata>
</viewentry>
<viewentry position="11.1" unid="DFDC21EC912763B2C12573D200831A5A" noteid="1F8A" siblings="1" response="true">
<entrydata columnnumber="0" name="$9">
<text> 21 - PRESTATIONS / PROCEDES</text></entrydata>
<entrydata columnnumber="1" name="$11">
</entrydata>
<entrydata columnnumber="2" name="$10">
<text>05 - Traitements de surface</text></entrydata>
<entrydata columnnumber="3" name="$4">
</entrydata>
<entrydata columnnumber="4" name="Statut">
<text>Validé</text></entrydata>
<entrydata columnnumber="5" name="CurrentStatutDate">
<text>21/10/2005</text></entrydata>
<entrydata columnnumber="6" name="Agrement_FOUR_SURV">
<text>C2</text></entrydata>
</viewentry>
<viewentry position="12" unid="742906A7D20302AFC1257027002E3B80" noteid="101A" children="1" descendants="1" siblings="61">
<entrydata columnnumber="0" name="$9">
<text>FIRADEC</text></entrydata>
<entrydata columnnumber="1" name="$11">
</entrydata>
<entrydata columnnumber="2" name="$10">
<text>ST NAZAIRE</text></entrydata>
<entrydata columnnumber="3" name="$4">
</entrydata>
<entrydata columnnumber="4" name="Statut">
<text>Actif</text></entrydata>
<entrydata columnnumber="5" name="CurrentStatutDate">
<text></text></entrydata>
<entrydata columnnumber="6" name="Agrement_FOUR_SURV">
<text></text></entrydata>
</viewentry>
<viewentry position="12.1" unid="42D12F9DE3E4073FC12573D200834788" noteid="2206" siblings="1" response="true">
<entrydata columnnumber="0" name="$9">
<text> 18 - ELECTRONIQUE</text></entrydata>
<entrydata columnnumber="1" name="$11">
</entrydata>
<entrydata columnnumber="2" name="$10">
<text>01 - Composants électroniques</text></entrydata>
<entrydata columnnumber="3" name="$4">
</entrydata>
<entrydata columnnumber="4" name="Statut">
<text>Validé</text></entrydata>
<entrydata columnnumber="5" name="CurrentStatutDate">
<text>10/06/2001</text></entrydata>
<entrydata columnnumber="6" name="Agrement_FOUR_SURV">
<text>C2</text></entrydata>
</viewentry>
<viewentry position="13" unid="652780962D6159C2C1257027002E3A8E" noteid="F16" children="2" descendants="2" siblings="61">
<entrydata columnnumber="0" name="$9">
<text>FEDERAL MOGUL SYSTEMS PROTECTION GROUP</text></entrydata>
<entrydata columnnumber="1" name="$11">
</entrydata>
<entrydata columnnumber="2" name="$10">
<text>CREPY EN VALOIS</text></entrydata>
<entrydata columnnumber="3" name="$4">
</entrydata>
<entrydata columnnumber="4" name="Statut">
<text>Actif</text></entrydata>
<entrydata columnnumber="5" name="CurrentStatutDate">
<text></text></entrydata>
<entrydata columnnumber="6" name="Agrement_FOUR_SURV">
<text></text></entrydata>
</viewentry>
<viewentry position="13.1" unid="AF5DBFF01EC9CC38C12573D200834089" noteid="218E" siblings="2" response="true">
<entrydata columnnumber="0" name="$9">
<text> 18 - ELECTRONIQUE</text></entrydata>
<entrydata columnnumber="1" name="$11">
</entrydata>
<entrydata columnnumber="2" name="$10">
<text>01 - Composants électroniques</text></entrydata>
<entrydata columnnumber="3" name="$4">
</entrydata>
<entrydata columnnumber="4" name="Statut">
<text>Validé</text></entrydata>
<entrydata columnnumber="5" name="CurrentStatutDate">
<text>18/04/2000</text></entrydata>
<entrydata columnnumber="6" name="Agrement_FOUR_SURV">
<text>C2</text></entrydata>
</viewentry>
<viewentry position="13.2" unid="2541E7FC32BB70C2C12573D2008340A0" noteid="2192" siblings="2" response="true">
<entrydata columnnumber="0" name="$9">
<text> 18 - ELECTRONIQUE</text></entrydata>
<entrydata columnnumber="1" name="$11">
</entrydata>
<entrydata columnnumber="2" name="$10">
<text>02 - Harnais et composants de cablage</text></entrydata>
<entrydata columnnumber="3" name="$4">
</entrydata>
<entrydata columnnumber="4" name="Statut">
<text>Validé</text></entrydata>
<entrydata columnnumber="5" name="CurrentStatutDate">
<text>01/08/2007</text></entrydata>
<entrydata columnnumber="6" name="Agrement_FOUR_SURV">
<text>C2</text></entrydata>
</viewentry>
</viewentries>


here is the js code based on XML grid exemple


/*
* Ext JS Library 2.0 Alpha 1
* Copyright(c) 2006-2007, Ext JS, LLC.
* licensing@extjs.com
*
* http://extjs.com/license
*/

Ext.onReady(function(){


var ViewEntry = Ext.data.Record.create([
//
// set up the fields mapping into the xml doc
// The first needs mapping, the others are very basic
{name: 'Nom', mapping: 'entrydata:nth(1)/text'},
{name: '11', mapping: 'entrydata:nth(2)/text'},
{name: 'Site', mapping: 'entrydata:nth(3)/text'},
{name: '13', mapping: 'entrydata:nth(4)/text'},
{name: 'Statut', mapping: 'entrydata:nth(5)/text'},
{name: 'CurrentStatutDate', mapping: 'entrydata:nth(6)/text'},
{name: 'Surveillant', mapping: 'entrydata:nth(7)/text'}
]);

stop;

var myReader = new Ext.data.XmlReader({
// records will have an "Item" tag
record: 'viewentry',
id: '@unid',
totalRecords: '@total'
}, ViewEntry);

// create the Data Store
var ds = new Ext.data.Store({
// load using HTTP
url: 'ListeOfficielle.xml',

// the return will be XML, so lets set up a reader
reader: myReader
});

var cm = new Ext.grid.ColumnModel([
{header: "Nom", width: 120, dataIndex: 'Nom'},
{header: "11", width: 180, dataIndex: '11'},
{header: "Site", width: 115, dataIndex: 'Site'},
{header: "13", width: 100, dataIndex: '13'},
{header: "Statut", width: 100, dataIndex: 'Statut'},
{header: "CurrentStatutDate", width: 100, dataIndex: 'CurrentStatutDate'},
{header: "Surveillant", width: 100, dataIndex: 'Surveillant'}
]);
cm.defaultSortable = true;

// create the grid
var grid = new Ext.grid.GridPanel({
ds: ds,
cm: cm,
renderTo:'example-grid',
width:540,
height:200
});

ds.load();
});


I use &preformat readviewentries command option to greatly simplify Ext.data.Record setting.

Is'nt a potential improvement to design a Ext.data.Record factory or a Ext.data.DominoRecord in place of a DominoViewXMLReader?

Zakaroonikov
2 Feb 2008, 6:04 PM
I may be wrong here but with Ext.nd's approach the data store is build without prior knowledge of the structure of the data feed. If you are after only 1 specific view then your approach is far more efficient as you do not need to send off an ajax request to first read the ?ReadDesign to build up the column/record structures before creating the store.

With Ext.nd way you can build an entire application with multiple views and only have to specify the URL to the views you want to see in the grid.

As for preformat, I use that too as it removes a lot of headaches with date/time operations

RWaters
2 Feb 2008, 6:53 PM
Zakaroonikov is correct. The main complexity behind our translation of views into an Ext.data.Store is that we make it totally generic, it has to read in the columns so that it can automatically create the ColumnModel for you.

If you want to go through the process of building custom ColumnModels for each and every view, and updating them whenever someone wants to change a view or add a column, it will be more efficient at runtime.

One of the main goals of the Ext.nd project is to create a simple drop-in solution that requires no design changes and little configuration for the developer.

galdaka
3 Feb 2008, 4:34 AM
Hi.

I inspect Ext.data.Record specs for a week and finaly I achieve to read view entries without
dominoviewxmlreader.

here is the readviewentries

<?xml version="1.0" encoding="UTF-8"?>
<viewentries toplevelentries="61">
<viewentry position="1" unid="371BA76D8C26DF1AC1257027002E42C1" noteid="C0E" children="1" descendants="1" siblings="61">
<entrydata columnnumber="0" name="$9">
<text>HIGHTEC</text></entrydata>
<entrydata columnnumber="1" name="$11">
</entrydata>
<entrydata columnnumber="2" name="$10">
<text>LENZBURG</text></entrydata>
<entrydata columnnumber="3" name="$4">
</entrydata>
<entrydata columnnumber="4" name="Statut">
<text>Actif</text></entrydata>
<entrydata columnnumber="5" name="CurrentStatutDate">
<text></text></entrydata>
<entrydata columnnumber="6" name="Agrement_FOUR_SURV">
<text></text></entrydata>
</viewentry>
<viewentry position="1.1" unid="A4D2F303CD9374C1C12573D2008325C2" noteid="203A" siblings="1" response="true">
<entrydata columnnumber="0" name="$9">
<text> 18 - ELECTRONIQUE</text></entrydata>
<entrydata columnnumber="1" name="$11">
</entrydata>
<entrydata columnnumber="2" name="$10">
<text>01 - Composants électroniques</text></entrydata>
<entrydata columnnumber="3" name="$4">
</entrydata>
<entrydata columnnumber="4" name="Statut">
<text>Validé</text></entrydata>
<entrydata columnnumber="5" name="CurrentStatutDate">
<text>14/01/98</text></entrydata>
<entrydata columnnumber="6" name="Agrement_FOUR_SURV">
<text>C2</text></entrydata>
</viewentry>
<viewentry position="2" unid="346D5960F11E862BC1257088004E65AE" noteid="BEE" children="2" descendants="2" siblings="61">
<entrydata columnnumber="0" name="$9">
<text>HELLENIC AEROSPACE INDUSTRY</text></entrydata>
<entrydata columnnumber="1" name="$11">
</entrydata>
<entrydata columnnumber="2" name="$10">
<text>SCHIMATARI</text></entrydata>
<entrydata columnnumber="3" name="$4">
</entrydata>
<entrydata columnnumber="4" name="Statut">
<text>Actif</text></entrydata>
<entrydata columnnumber="5" name="CurrentStatutDate">
<text></text></entrydata>
<entrydata columnnumber="6" name="Agrement_FOUR_SURV">
<text></text></entrydata>
</viewentry>
<viewentry position="2.1" unid="51FD3A2EA314804BC12573D2008324D2" noteid="2026" siblings="2" response="true">
<entrydata columnnumber="0" name="$9">
<text> 17 - EQUIPEMENTS</text></entrydata>
<entrydata columnnumber="1" name="$11">
</entrydata>
<entrydata columnnumber="2" name="$10">
<text>99 - Equipements Autres</text></entrydata>
<entrydata columnnumber="3" name="$4">
</entrydata>
<entrydata columnnumber="4" name="Statut">
<text>Validé</text></entrydata>
<entrydata columnnumber="5" name="CurrentStatutDate">
<text>19/03/2007</text></entrydata>
<entrydata columnnumber="6" name="Agrement_FOUR_SURV">
<text>C2</text></entrydata>
</viewentry>
<viewentry position="2.2" unid="9ABE3D6D1CBC904FC12573D2008324BC" noteid="2022" siblings="2" response="true">
<entrydata columnnumber="0" name="$9">
<text> 23 - RECHANGES, REPARATIONS, MAINTENANCE</text></entrydata>
<entrydata columnnumber="1" name="$11">
</entrydata>
<entrydata columnnumber="2" name="$10">
<text>03 - Sous-traitance de réparation d&apos;équipements</text></entrydata>
<entrydata columnnumber="3" name="$4">
</entrydata>
<entrydata columnnumber="4" name="Statut">
<text>Validé</text></entrydata>
<entrydata columnnumber="5" name="CurrentStatutDate">
<text>21/10/2005</text></entrydata>
<entrydata columnnumber="6" name="Agrement_FOUR_SURV">
<text>C2</text></entrydata>
</viewentry>
<viewentry position="3" unid="6404D1B04DDFCADFC1256B1000694CB1" noteid="F0A" children="1" descendants="1" siblings="61">
<entrydata columnnumber="0" name="$9">
<text>HANIER PLAISANCE SA</text></entrydata>
<entrydata columnnumber="1" name="$11">
</entrydata>
<entrydata columnnumber="2" name="$10">
<text>VILLEJUIF</text></entrydata>
<entrydata columnnumber="3" name="$4">
</entrydata>
<entrydata columnnumber="4" name="Statut">
<text>Actif</text></entrydata>
<entrydata columnnumber="5" name="CurrentStatutDate">
<text></text></entrydata>
<entrydata columnnumber="6" name="Agrement_FOUR_SURV">
<text></text></entrydata>
</viewentry>
<viewentry position="3.1" unid="4ECF18D24E123BF2C12573D20083404F" noteid="218A" siblings="1" response="true">
<entrydata columnnumber="0" name="$9">
<text> 21 - PRESTATIONS / PROCEDES</text></entrydata>
<entrydata columnnumber="1" name="$11">
</entrydata>
<entrydata columnnumber="2" name="$10">
<text>05 - Traitements de surface</text></entrydata>
<entrydata columnnumber="3" name="$4">
</entrydata>
<entrydata columnnumber="4" name="Statut">
<text>Validé</text></entrydata>
<entrydata columnnumber="5" name="CurrentStatutDate">
<text>29/06/92</text></entrydata>
<entrydata columnnumber="6" name="Agrement_FOUR_SURV">
<text>C2</text></entrydata>
</viewentry>
<viewentry position="4" unid="3130F0CEA5F29884C12571C3002B4E15" noteid="BCA" children="1" descendants="1" siblings="61">
<entrydata columnnumber="0" name="$9">
<text>GROUPEMENT SEGULA TECHNOLOGIES</text></entrydata>
<entrydata columnnumber="1" name="$11">
</entrydata>
<entrydata columnnumber="2" name="$10">
<text>PRINGY</text></entrydata>
<entrydata columnnumber="3" name="$4">
</entrydata>
<entrydata columnnumber="4" name="Statut">
<text>Actif</text></entrydata>
<entrydata columnnumber="5" name="CurrentStatutDate">
<text></text></entrydata>
<entrydata columnnumber="6" name="Agrement_FOUR_SURV">
<text></text></entrydata>
</viewentry>
<viewentry position="4.1" unid="46D10D357429FACAC12573D20083240D" noteid="2012" siblings="1" response="true">
<entrydata columnnumber="0" name="$9">
<text> 13 - Piéces mécaniques et chaudronnées de petites dimensions</text></entrydata>
<entrydata columnnumber="1" name="$11">
</entrydata>
<entrydata columnnumber="2" name="$10">
<text>99 - Piéces mécaniques et chaudronnées de petites dimensions - Autres</text></entrydata>
<entrydata columnnumber="3" name="$4">
</entrydata>
<entrydata columnnumber="4" name="Statut">
<text>Validé</text></entrydata>
<entrydata columnnumber="5" name="CurrentStatutDate">
<text>07/08/2006</text></entrydata>
<entrydata columnnumber="6" name="Agrement_FOUR_SURV">
<text></text></entrydata>
</viewentry>
<viewentry position="5" unid="236CAADDBEB5BAA5C1256B1000694C8F" noteid="B02" children="2" descendants="2" siblings="61">
<entrydata columnnumber="0" name="$9">
<text>GROUPE DELAGE AERO</text></entrydata>
<entrydata columnnumber="1" name="$11">
</entrydata>
<entrydata columnnumber="2" name="$10">
<text>PIERREFITTE</text></entrydata>
<entrydata columnnumber="3" name="$4">
</entrydata>
<entrydata columnnumber="4" name="Statut">
<text>Actif</text></entrydata>
<entrydata columnnumber="5" name="CurrentStatutDate">
<text></text></entrydata>
<entrydata columnnumber="6" name="Agrement_FOUR_SURV">
<text></text></entrydata>
</viewentry>
<viewentry position="5.1" unid="AFC438F1BA05FB26C12573D200831EB1" noteid="1FBA" siblings="2" response="true">
<entrydata columnnumber="0" name="$9">
<text> 13 - Pièces mécaniques et chaudronnées de petites dimensions</text></entrydata>
<entrydata columnnumber="1" name="$11">
</entrydata>
<entrydata columnnumber="2" name="$10">
<text>04 - Canalisations rigides</text></entrydata>
<entrydata columnnumber="3" name="$4">
</entrydata>
<entrydata columnnumber="4" name="Statut">
<text>Validé</text></entrydata>
<entrydata columnnumber="5" name="CurrentStatutDate">
<text>15/12/99</text></entrydata>
<entrydata columnnumber="6" name="Agrement_FOUR_SURV">
<text>C2</text></entrydata>
</viewentry>
<viewentry position="5.2" unid="372E7E3E40D08C00C12573D200831EC7" noteid="1FBE" siblings="2" response="true">
<entrydata columnnumber="0" name="$9">
<text> 13 - Piéces mécaniques et chaudronnées de petites dimensions</text></entrydata>
<entrydata columnnumber="1" name="$11">
</entrydata>
<entrydata columnnumber="2" name="$10">
<text>99 - Autres</text></entrydata>
<entrydata columnnumber="3" name="$4">
</entrydata>
<entrydata columnnumber="4" name="Statut">
<text>Validé</text></entrydata>
<entrydata columnnumber="5" name="CurrentStatutDate">
<text>19/03/2007</text></entrydata>
<entrydata columnnumber="6" name="Agrement_FOUR_SURV">
<text>C2</text></entrydata>
</viewentry>
<viewentry position="6" unid="142647438CDC76D5C1257027002E3F40" noteid="A16" children="1" descendants="1" siblings="61">
<entrydata columnnumber="0" name="$9">
<text>GLENAIR FRANCE</text></entrydata>
<entrydata columnnumber="1" name="$11">
</entrydata>
<entrydata columnnumber="2" name="$10">
<text>TOULOUSE</text></entrydata>
<entrydata columnnumber="3" name="$4">
</entrydata>
<entrydata columnnumber="4" name="Statut">
<text>Actif</text></entrydata>
<entrydata columnnumber="5" name="CurrentStatutDate">
<text></text></entrydata>
<entrydata columnnumber="6" name="Agrement_FOUR_SURV">
<text></text></entrydata>
</viewentry>
<viewentry position="6.1" unid="CD184103FF554C24C12573D20083188F" noteid="1F6E" siblings="1" response="true">
<entrydata columnnumber="0" name="$9">
<text> 21 - PRESTATIONS / PROCEDES</text></entrydata>
<entrydata columnnumber="1" name="$11">
</entrydata>
<entrydata columnnumber="2" name="$10">
<text>12 - Mécanique générale</text></entrydata>
<entrydata columnnumber="3" name="$4">
</entrydata>
<entrydata columnnumber="4" name="Statut">
<text>Validé</text></entrydata>
<entrydata columnnumber="5" name="CurrentStatutDate">
<text>14/09/98</text></entrydata>
<entrydata columnnumber="6" name="Agrement_FOUR_SURV">
<text>C2</text></entrydata>
</viewentry>
<viewentry position="7" unid="05D641583BDFD014C1257027002E3DB9" noteid="952" children="1" descendants="1" siblings="61">
<entrydata columnnumber="0" name="$9">
<text>GEORGE INDUSTRIES INC</text></entrydata>
<entrydata columnnumber="1" name="$11">
</entrydata>
<entrydata columnnumber="2" name="$10">
<text>ENDICOTT</text></entrydata>
<entrydata columnnumber="3" name="$4">
</entrydata>
<entrydata columnnumber="4" name="Statut">
<text>Actif</text></entrydata>
<entrydata columnnumber="5" name="CurrentStatutDate">
<text></text></entrydata>
<entrydata columnnumber="6" name="Agrement_FOUR_SURV">
<text></text></entrydata>
</viewentry>
<viewentry position="7.1" unid="19F4990BBFECEA40C12573D200830DBF" noteid="1EEA" siblings="1" response="true">
<entrydata columnnumber="0" name="$9">
<text> 21 - PRESTATIONS / PROCEDES</text></entrydata>
<entrydata columnnumber="1" name="$11">
</entrydata>
<entrydata columnnumber="2" name="$10">
<text>12 - Mécanique générale</text></entrydata>
<entrydata columnnumber="3" name="$4">
</entrydata>
<entrydata columnnumber="4" name="Statut">
<text>Validé</text></entrydata>
<entrydata columnnumber="5" name="CurrentStatutDate">
<text>06/12/2004</text></entrydata>
<entrydata columnnumber="6" name="Agrement_FOUR_SURV">
<text>C2</text></entrydata>
</viewentry>
<viewentry position="8" unid="61094575E5AD9589C12570CE004E6EB6" noteid="ECE" children="1" descendants="1" siblings="61">
<entrydata columnnumber="0" name="$9">
<text>GARLOCK France</text></entrydata>
<entrydata columnnumber="1" name="$11">
</entrydata>
<entrydata columnnumber="2" name="$10">
<text>SAINT-ETIENNE</text></entrydata>
<entrydata columnnumber="3" name="$4">
</entrydata>
<entrydata columnnumber="4" name="Statut">
<text>Actif</text></entrydata>
<entrydata columnnumber="5" name="CurrentStatutDate">
<text></text></entrydata>
<entrydata columnnumber="6" name="Agrement_FOUR_SURV">
<text></text></entrydata>
</viewentry>
<viewentry position="8.1" unid="7E888FA0EE91FA39C12573D200833EDB" noteid="2172" siblings="1" response="true">
<entrydata columnnumber="0" name="$9">
<text> 15 - PRODUITS TECHNIQUES</text></entrydata>
<entrydata columnnumber="1" name="$11">
</entrydata>
<entrydata columnnumber="2" name="$10">
<text>06 - Etanchéité polymères</text></entrydata>
<entrydata columnnumber="3" name="$4">
</entrydata>
<entrydata columnnumber="4" name="Statut">
<text>Validé</text></entrydata>
<entrydata columnnumber="5" name="CurrentStatutDate">
<text>08/11/2005</text></entrydata>
<entrydata columnnumber="6" name="Agrement_FOUR_SURV">
<text>C2</text></entrydata>
</viewentry>
<viewentry position="9" unid="51CCD0911F041250C1256B1000694CA5" noteid="DE6" children="1" descendants="1" siblings="61">
<entrydata columnnumber="0" name="$9">
<text>FORGEAVIA</text></entrydata>
<entrydata columnnumber="1" name="$11">
</entrydata>
<entrydata columnnumber="2" name="$10">
<text>BIESLES</text></entrydata>
<entrydata columnnumber="3" name="$4">
</entrydata>
<entrydata columnnumber="4" name="Statut">
<text>Actif</text></entrydata>
<entrydata columnnumber="5" name="CurrentStatutDate">
<text></text></entrydata>
<entrydata columnnumber="6" name="Agrement_FOUR_SURV">
<text></text></entrydata>
</viewentry>
<viewentry position="9.1" unid="7BF50D55C1F3301BC12573D200833712" noteid="20FA" siblings="1" response="true">
<entrydata columnnumber="0" name="$9">
<text> 11 - MATIERE ET BRUTS DE FORGE</text></entrydata>
<entrydata columnnumber="1" name="$11">
</entrydata>
<entrydata columnnumber="2" name="$10">
<text>02 - Forgés pièces fixes</text></entrydata>
<entrydata columnnumber="3" name="$4">
</entrydata>
<entrydata columnnumber="4" name="Statut">
<text>Validé</text></entrydata>
<entrydata columnnumber="5" name="CurrentStatutDate">
<text>27/10/99</text></entrydata>
<entrydata columnnumber="6" name="Agrement_FOUR_SURV">
<text>C2</text></entrydata>
</viewentry>
<viewentry position="10" unid="147C8CA230FC08D1C1256B730034DBE4" noteid="A1A" children="2" descendants="2" siblings="61">
<entrydata columnnumber="0" name="$9">
<text>FONDERIES DU VAL RICARD</text></entrydata>
<entrydata columnnumber="1" name="$11">
</entrydata>
<entrydata columnnumber="2" name="$10">
<text>BOLBEC</text></entrydata>
<entrydata columnnumber="3" name="$4">
</entrydata>
<entrydata columnnumber="4" name="Statut">
<text>Actif</text></entrydata>
<entrydata columnnumber="5" name="CurrentStatutDate">
<text></text></entrydata>
<entrydata columnnumber="6" name="Agrement_FOUR_SURV">
<text></text></entrydata>
</viewentry>
<viewentry position="10.1" unid="206C3416A762082FC12573D2008318AF" noteid="1F72" siblings="2" response="true">
<entrydata columnnumber="0" name="$9">
<text> 11 - MATIERE ET BRUTS DE FORGE</text></entrydata>
<entrydata columnnumber="1" name="$11">
</entrydata>
<entrydata columnnumber="2" name="$10">
<text>03 - 1/2 produits/barres, tôles, tubes</text></entrydata>
<entrydata columnnumber="3" name="$4">
</entrydata>
<entrydata columnnumber="4" name="Statut">
<text>Validé</text></entrydata>
<entrydata columnnumber="5" name="CurrentStatutDate">
<text>21/10/2005</text></entrydata>
<entrydata columnnumber="6" name="Agrement_FOUR_SURV">
<text>C2</text></entrydata>
</viewentry>
<viewentry position="10.2" unid="064F485EA19163EEC12573D2008318C5" noteid="1F76" siblings="2" response="true">
<entrydata columnnumber="0" name="$9">
<text> 12 - Bruts de fonderie (hors aubage)</text></entrydata>
<entrydata columnnumber="1" name="$11">
</entrydata>
<entrydata columnnumber="2" name="$10">
<text>99 - Autres</text></entrydata>
<entrydata columnnumber="3" name="$4">
</entrydata>
<entrydata columnnumber="4" name="Statut">
<text>Validé</text></entrydata>
<entrydata columnnumber="5" name="CurrentStatutDate">
<text>20/03/2007</text></entrydata>
<entrydata columnnumber="6" name="Agrement_FOUR_SURV">
<text>C2</text></entrydata>
</viewentry>
<viewentry position="11" unid="1615E8F2A43434B7C1256B1000694DDB" noteid="A46" children="1" descendants="1" siblings="61">
<entrydata columnnumber="0" name="$9">
<text>FLUOROTECHNIQUE</text></entrydata>
<entrydata columnnumber="1" name="$11">
</entrydata>
<entrydata columnnumber="2" name="$10">
<text>MONTREUIL</text></entrydata>
<entrydata columnnumber="3" name="$4">
</entrydata>
<entrydata columnnumber="4" name="Statut">
<text>Actif</text></entrydata>
<entrydata columnnumber="5" name="CurrentStatutDate">
<text></text></entrydata>
<entrydata columnnumber="6" name="Agrement_FOUR_SURV">
<text></text></entrydata>
</viewentry>
<viewentry position="11.1" unid="DFDC21EC912763B2C12573D200831A5A" noteid="1F8A" siblings="1" response="true">
<entrydata columnnumber="0" name="$9">
<text> 21 - PRESTATIONS / PROCEDES</text></entrydata>
<entrydata columnnumber="1" name="$11">
</entrydata>
<entrydata columnnumber="2" name="$10">
<text>05 - Traitements de surface</text></entrydata>
<entrydata columnnumber="3" name="$4">
</entrydata>
<entrydata columnnumber="4" name="Statut">
<text>Validé</text></entrydata>
<entrydata columnnumber="5" name="CurrentStatutDate">
<text>21/10/2005</text></entrydata>
<entrydata columnnumber="6" name="Agrement_FOUR_SURV">
<text>C2</text></entrydata>
</viewentry>
<viewentry position="12" unid="742906A7D20302AFC1257027002E3B80" noteid="101A" children="1" descendants="1" siblings="61">
<entrydata columnnumber="0" name="$9">
<text>FIRADEC</text></entrydata>
<entrydata columnnumber="1" name="$11">
</entrydata>
<entrydata columnnumber="2" name="$10">
<text>ST NAZAIRE</text></entrydata>
<entrydata columnnumber="3" name="$4">
</entrydata>
<entrydata columnnumber="4" name="Statut">
<text>Actif</text></entrydata>
<entrydata columnnumber="5" name="CurrentStatutDate">
<text></text></entrydata>
<entrydata columnnumber="6" name="Agrement_FOUR_SURV">
<text></text></entrydata>
</viewentry>
<viewentry position="12.1" unid="42D12F9DE3E4073FC12573D200834788" noteid="2206" siblings="1" response="true">
<entrydata columnnumber="0" name="$9">
<text> 18 - ELECTRONIQUE</text></entrydata>
<entrydata columnnumber="1" name="$11">
</entrydata>
<entrydata columnnumber="2" name="$10">
<text>01 - Composants électroniques</text></entrydata>
<entrydata columnnumber="3" name="$4">
</entrydata>
<entrydata columnnumber="4" name="Statut">
<text>Validé</text></entrydata>
<entrydata columnnumber="5" name="CurrentStatutDate">
<text>10/06/2001</text></entrydata>
<entrydata columnnumber="6" name="Agrement_FOUR_SURV">
<text>C2</text></entrydata>
</viewentry>
<viewentry position="13" unid="652780962D6159C2C1257027002E3A8E" noteid="F16" children="2" descendants="2" siblings="61">
<entrydata columnnumber="0" name="$9">
<text>FEDERAL MOGUL SYSTEMS PROTECTION GROUP</text></entrydata>
<entrydata columnnumber="1" name="$11">
</entrydata>
<entrydata columnnumber="2" name="$10">
<text>CREPY EN VALOIS</text></entrydata>
<entrydata columnnumber="3" name="$4">
</entrydata>
<entrydata columnnumber="4" name="Statut">
<text>Actif</text></entrydata>
<entrydata columnnumber="5" name="CurrentStatutDate">
<text></text></entrydata>
<entrydata columnnumber="6" name="Agrement_FOUR_SURV">
<text></text></entrydata>
</viewentry>
<viewentry position="13.1" unid="AF5DBFF01EC9CC38C12573D200834089" noteid="218E" siblings="2" response="true">
<entrydata columnnumber="0" name="$9">
<text> 18 - ELECTRONIQUE</text></entrydata>
<entrydata columnnumber="1" name="$11">
</entrydata>
<entrydata columnnumber="2" name="$10">
<text>01 - Composants électroniques</text></entrydata>
<entrydata columnnumber="3" name="$4">
</entrydata>
<entrydata columnnumber="4" name="Statut">
<text>Validé</text></entrydata>
<entrydata columnnumber="5" name="CurrentStatutDate">
<text>18/04/2000</text></entrydata>
<entrydata columnnumber="6" name="Agrement_FOUR_SURV">
<text>C2</text></entrydata>
</viewentry>
<viewentry position="13.2" unid="2541E7FC32BB70C2C12573D2008340A0" noteid="2192" siblings="2" response="true">
<entrydata columnnumber="0" name="$9">
<text> 18 - ELECTRONIQUE</text></entrydata>
<entrydata columnnumber="1" name="$11">
</entrydata>
<entrydata columnnumber="2" name="$10">
<text>02 - Harnais et composants de cablage</text></entrydata>
<entrydata columnnumber="3" name="$4">
</entrydata>
<entrydata columnnumber="4" name="Statut">
<text>Validé</text></entrydata>
<entrydata columnnumber="5" name="CurrentStatutDate">
<text>01/08/2007</text></entrydata>
<entrydata columnnumber="6" name="Agrement_FOUR_SURV">
<text>C2</text></entrydata>
</viewentry>
</viewentries>


here is the js code based on XML grid exemple


/*
* Ext JS Library 2.0 Alpha 1
* Copyright(c) 2006-2007, Ext JS, LLC.
* licensing@extjs.com
*
* http://extjs.com/license
*/

Ext.onReady(function(){


var ViewEntry = Ext.data.Record.create([
//
// set up the fields mapping into the xml doc
// The first needs mapping, the others are very basic
{name: 'Nom', mapping: 'entrydata:nth(1)/text'},
{name: '11', mapping: 'entrydata:nth(2)/text'},
{name: 'Site', mapping: 'entrydata:nth(3)/text'},
{name: '13', mapping: 'entrydata:nth(4)/text'},
{name: 'Statut', mapping: 'entrydata:nth(5)/text'},
{name: 'CurrentStatutDate', mapping: 'entrydata:nth(6)/text'},
{name: 'Surveillant', mapping: 'entrydata:nth(7)/text'}
]);

stop;

var myReader = new Ext.data.XmlReader({
// records will have an "Item" tag
record: 'viewentry',
id: '@unid',
totalRecords: '@total'
}, ViewEntry);

// create the Data Store
var ds = new Ext.data.Store({
// load using HTTP
url: 'ListeOfficielle.xml',

// the return will be XML, so lets set up a reader
reader: myReader
});

var cm = new Ext.grid.ColumnModel([
{header: "Nom", width: 120, dataIndex: 'Nom'},
{header: "11", width: 180, dataIndex: '11'},
{header: "Site", width: 115, dataIndex: 'Site'},
{header: "13", width: 100, dataIndex: '13'},
{header: "Statut", width: 100, dataIndex: 'Statut'},
{header: "CurrentStatutDate", width: 100, dataIndex: 'CurrentStatutDate'},
{header: "Surveillant", width: 100, dataIndex: 'Surveillant'}
]);
cm.defaultSortable = true;

// create the grid
var grid = new Ext.grid.GridPanel({
ds: ds,
cm: cm,
renderTo:'example-grid',
width:540,
height:200
});

ds.load();
});


I use &preformat readviewentries command option to greatly simplify Ext.data.Record setting.

Is'nt a potential improvement to design a Ext.data.Record factory or a Ext.data.DominoRecord in place of a DominoViewXMLReader?

I will test your code. I think that is a good idea if you want to create more complicated and detailed views.

Two questions:

1) When you use 'ListeOfficielle.xml', I supose that I can replace this url for ?ReadViewEntries url, no?

2) I don

becomcs
3 Feb 2008, 10:32 AM
Hi.



1) When you use 'ListeOfficielle.xml', I supose that I can replace this url for ?ReadViewEntries url, no?


Yes

[QUOTE]
2) I don

RWaters
3 Feb 2008, 1:15 PM
I design code with a 'columnmap' and 'entrymap' set in a factory based on readdesign command. So code could be use for any view.

Not sure I follow exactly. Though if you're making a separate call to readdesign it sounds like you're doing the exact same thing.

becomcs
4 Feb 2008, 3:10 AM
In DominoViewXMLReader.getViewColumnValue there is three domquery request to get value



// try text
type = 'text';
data = q.select(type,entryDataNodes[i]);

if (data.length == 0) {
type = 'datetime';
data = q.select(type,entryDataNodes[i]);
}

if (data.length == 0) {
type = 'number';
data = q.select(type,entryDataNodes[i]);
}

// now get the data
oValue = this.getValue(entryDataNodes[i], type);


the goal is to make only one domquery to improve perfs.