際際滷

際際滷Share a Scribd company logo
GWT Frameworky


Ujorm 1.20 v prosted鱈 Ext GWT
           (Sencha)




 Google User Groups, Praha 9.6.2011, Autor: Pavel Ponec
vod

Ujorm je "lehko-ton叩転n鱈" framework se silnou typovou
kontrolou postavenou na Java <generik叩ch>, kter箪 nab鱈z鱈
(prostednictv鱈m sv箪ch modul哲) slu転by:

   perzitence objekt哲 do rela鱈ch datab叩z鱈 (ORM slu転by)
   integrace s Ext GWT projektu Sencha (d叩le jen GXT)
   API + serializace objekt哲 do/z textov箪ch form叩t哲

Ujorm pracuje s objekty implementuj鱈c鱈 2 interface:
Ujo + Property
Motivace
Pro pou転鱈t Ujorm ?
  v箪et Properties (podoba s Enum + PropertyDescriptor)
     peklepy odhal鱈 kompil叩tor
     dostupn叩 meta-data
     vhodn辿 pro data binding
  nadstandardn鱈 typov叩 kontrola
  bezpen箪 refactoring zdrojov辿ho k坦du
  snadn叩 tvorba generick箪ch komponent
  pou転鱈v叩n鱈 UjoProperty je z叩bavn辿 :)

spora zdroj哲:
  炭spora asu
  炭spora finann鱈ch n叩klad哲
  vy邸邸鱈 produktivita
Ujorm pro GXT
Dva moduly:
     Ujo-gxt-core
        nabz鱈 klientskou verzi UJO objekt哲 (Cujo)
        cache Property vlastnost鱈 (mandatory, length)
        podpora pro mapov叩n鱈 klientsk箪ch UJO objekt哲 na serverov辿
        n叩stroj pro automatizovanou konverzi klientsk箪ch objekt哲
        na serverov辿 (dom辿nov辿 objekty, db dotazy)
Ujorm pro GXT
Dva moduly:
     Ujo-gxt-core
        nabz鱈 klientskou verzi UJO objekt哲 (Cujo)
        cache Property vlastnost鱈 (mandatory, length)
        podpora pro mapov叩n鱈 klientsk箪ch UJO objekt哲 na serverov辿
        n叩stroj pro automatizovanou konverzi klientsk箪ch objekt哲
        na serverov辿 (dom辿nov辿 objekty, db dotazy)

     Ujo-gxt-crud
        grafick辿 komponenty podporuj鱈c鱈 DB operace:
            Create
            Read
            Update
            Delete
Class model Ujo + Property
Instance Ujo
   obsahuje data
   nab鱈z鱈 seznam Properties
   m哲転e splovat specifikaci
JavaBeans (ale nemus鱈)
Class model Ujo + Property
Instance Ujo
...

Instance UjoProperty
   poskytuje meta-data
       n叩zev a
       typ property
       defaultn鱈 hodnotu
       defaultn鱈 smr azen鱈
   nab鱈z鱈 etzen鱈 s jinou UjoProperty
   a r哲zn辿 u転iten辿 metody
   vetn metod pro ten鱈 a z叩pis
   statick叩 nemnn叩 instance
(immutable object)
GXT: ModelData
ModelData je datov箪 model grafick箪ch GXT komponent
- jedna instance reprezentuje nap鱈klad: jeden 叩dek tabulky
GXT: ModelData
ModelData je datov箪 model grafick箪ch GXT komponent
- p鱈kladem pou転it鱈 je jeden 叩dek tabulky


Ujorm: Cujo
Cujo je klientsk叩 verze rozhran鱈 Ujo pro GXT
Cujo je potomkem ModelData !
P鱈klad implementace Cujo/Ujo
Uk叩zka implementace Cujo pomoc鱈 abstraktn鱈 t鱈dy:

  public class Employee extends AbstractCujo implements Serializable {

   /** Property List */
   private static final CujoPropertyList pList = list(Employee.class);




  
   @Override public CujoPropertyList readProperties() {
   return pList;
   }
P鱈klad implementace Cujo/Ujo
Uk叩zka implementace Cujo pomoc鱈 abstraktn鱈 t鱈dy:

  public class Employee extends AbstractCujo implements Serializable {

   /** Property List */
   private static final CujoPropertyList pList = list(Employee.class);

   /** Unique key */
   public static final CujoProperty<Employee, Long> ID = pList.newProperty("id", Long.class);
   /** User name */
   public static final CujoProperty<Employee, String> NAME
   = pList.newProperty("name", String.class);
   /** Hourly wage */
   public static final CujoProperty<Employee, Double> WAGE = pList.newPropertyDef("wage", 0.0);
   /** A reference to Company */
   public static final CujoProperty<Employee, Company> COMPANY
   = pList.newProperty("company", Company.class);
  
   @Override public CujoPropertyList readProperties() {
   return pList;
   }
Uk叩zka pr叩ce s daty
Jak zapsat hodnoty ?

 GXT: ModelData



ModelData person = new ModelData();

// Write:
person.set("ID", 7L);
person.set("NAME", "Pavel");
person.set("WAGE", 20.00);
person.set("COMPANY", new Company());
Uk叩zka pr叩ce s daty
Jak zapsat hodnoty ?

 GXT: ModelData                         Ujorm: Cujo
                                       
                                       import static Employee.*
                                       import static Company.CITY;
ModelData person = new ModelData();     Employee person = new Employee();

// Write:                               // Write:
person.set("ID", 7L);                   person.set(ID, 7L);
person.set("NAME", "Pavel");            person.set(NAME, "Pavel");
person.set("WAGE", 20.00);              person.set(WAGE, 20.00);
person.set("COMPANY", new Company());   person.set(COMPANY, new Company());
Uk叩zka pr叩ce s daty
Jak na鱈st data ?

 GXT: ModelData                            Ujorm: Cujo
                                          
                                          import static Employee.*
                                          import static Company.CITY;
ModelData person = new ModelData();        Employee person = new Employee();

// Write:                                  // Write:
person.set("ID", 7L);                      person.set(ID, 7L);
person.set("NAME", "Pavel");               person.set(NAME, "Pavel");
person.set("WAGE", 20.00);                 person.set(WAGE, 20.00);
person.set("COMPANY", new Company());      person.set(COMPANY, new Company());


// Read:
                                           Ujorm:
Long id = person.get("ID");
String name = person.get("NAME");
double wage = person.get("WAGE");
Company address = person.get("COMPANY");
Uk叩zka pr叩ce s daty
Jak na鱈st data ?

 GXT: ModelData                            Ujorm: Cujo
                                          
                                          import static Employee.*
                                          import static Company.CITY;
ModelData person = new ModelData();        Employee person = new Employee();

// Write:                                  // Write:
person.set("ID", 7L);                      person.set(ID, 7L);
person.set("NAME", "Pavel");               person.set(NAME, "Pavel");
person.set("WAGE", 20.00);                 person.set(WAGE, 20.00);
person.set("COMPANY", new Company());      person.set(COMPANY, new Company());


// Read:                                   // Read:
Long id = person.get("ID");                Long id = person.get(ID);
String name = person.get("NAME");          String name = person.get(NAME);
double wage = person.get("WAGE");          double wage = person.get(WAGE);
Company address = person.get("COMPANY");   Company address = person.get(COMPANY);
Uk叩zka pr叩ce s daty
Jak na atributy relan鱈ch objekt哲 ?

 GXT: ModelData                 Ujorm: Cujo
                                                
                                                import static Employee.*
                                                import static Company.CITY;
ModelData person = new ModelData();              Employee person = new Employee();

// Write:                                        // Write:
person.set("ID", 7L);                            person.set(ID, 7L);
person.set("NAME", "Pavel");                     person.set(NAME, "Pavel");
person.set("WAGE", 20.00);                       person.set(WAGE, 20.00);
person.set("COMPANY", new Company());            person.set(COMPANY, new Company());
person.set("COMPANY.CITY", "Prague"); // No

// Read:                                         // Read:
Long id = person.get("ID");                      Long id = person.get(ID);
String name = person.get("NAME");                String name = person.get(NAME);
double wage = person.get("WAGE");                double wage = person.get(WAGE);
Company address = person.get("COMPANY");         Company address = person.get(COMPANY);
String cn = person.get("COMPANY.CITY"); // No
Uk叩zka pr叩ce s daty
Jak na atributy relan鱈ch objekt哲 ?

 GXT: ModelData                 Ujorm: Cujo
                                                
                                                import static Employee.*
                                                import static Company.CITY;
ModelData person = new ModelData();              Employee person = new Employee();

// Write:                                        // Write:
person.set("ID", 7L);                            person.set(ID, 7L);
person.set("NAME", "Pavel");                     person.set(NAME, "Pavel");
person.set("WAGE", 20.00);                       person.set(WAGE, 20.00);
person.set("COMPANY", new Company());            person.set(COMPANY, new Company());
person.set("COMPANY.CITY", "Prague"); // No      person.set(COMPANY.add(CITY), "Prague";

// Read:                                         // Read:
Long id = person.get("ID");                      Long id = person.get(ID);
String name = person.get("NAME");                String name = person.get(NAME);
double wage = person.get("WAGE");                double wage = person.get(WAGE);
Company address = person.get("COMPANY");         Company address = person.get(COMPANY);
String cn = person.get("COMPANY.CITY"); // No   String cn = person.get(COMPANY.add(CITY);
Kopie hodnot


           Jak pepsat hodnoty
      z jednoho objektu do druh辿ho





                 ?
Kopie hodnot
Jak pepsat hodnoty do druh辿ho objektu ?

ModelData (GXT):



ModelData emplA = findEmployee();
ModelData emplB = new ModelData();

for (String p : emplA.getPropertyNames())
{
 Object o = emplA.get(p);
 emplB.set(p, o);
}
GWT.log("Employee B: " + emplB);
Kopie hodnot
Jak pepsat hodnoty do druh辿ho objektu ?

ModelData (GXT):              Cujo (Ujorm):
                                            

                                            
ModelData emplA = findEmployee();            Cujo emplA= findEmployee();
ModelData emplB = new ModelData();           Cujo emplB= employee1.createInstance();

for (String p : emplA.getPropertyNames())   for (CujoProperty p : emplA.readProperties())
{                                            {
 Object o = emplA.get(p);                 p.copy(emplA, emplB);
 emplB.set(p, o);                        }
}                                            
GWT.log("Employee B: " + emplB);             GWT.log("Employee B: " + emplB);
Obnova defaultn鱈ch hodnot


        Jak obnovit defaultn鱈 hodnoty
                 v objektu
                      




    
                    ?
Obnova defaultn鱈ch hodnot
Jak obnovit defaultn鱈 hodnoty objektu ?

ModelData (GXT):



ModelData employee = findEmployee();

for (String p : employee1.getPropertyNames())
{
 Object o = employee1.get(p);
  p.set(p, null); // ??

}
GWT.log("Employee: " + employee);
Obnova defaultn鱈ch hodnot
Jak obnovit defaultn鱈 hodnoty objektu ?

ModelData (GXT):



ModelData employee = findEmployee();

for (String p : employee1.getPropertyNames())
{
 Object o = employee1.get(p);
  p.set(p, null); // ??
  p.set(p, getDefaultForProperty(p));
}
GWT.log("Employee: " + employee);
Obnova defaultn鱈ch hodnot
Jak obnovit defaultn鱈 hodnoty objektu ?

ModelData (GXT):               Cujo (Ujorm):
                                                

                                                
ModelData employee = findEmployee();             Cujo employee = findEmployee();

for (String p : employee1.getPropertyNames())   for (CujoProperty p : employee.readProperties())
{                                                {
 Object o = employee1.get(p);                    p.set(p, p.getDefault());
  p.set(p, null); // ??
  p.set(p, getDefaultForProperty(p));         }
}                                                
GWT.log("Employee: " + employee);                GWT.log("Employee: " + employee);
Criterion
Test platnosti (validace) objektu v run-time

ModelData (GXT):        Cujo (Ujorm):
                        import static org.ujorm.gxt.client.cquery.COperator.*;

                        CCriterion<Employee> validWage, validStreet,validator;

                        validWage = CCriterion.where(WAGE, GT, 10.0);
                        validStreet = CCriterion.where(COMPANY.add(CITY), "Prague");




       ?
                        validator = validWage.or(validStreet);

                        Employee employee = findEmployee();
                        boolean isValid = validator.evaluate(employee);

                        GXT.log("Is valid: " + isValid + " for " + employee);
Mapov叩n鱈 klientsk箪ch objekt哲

Serverov叩 strana: Ujo   Klientsk叩 strana: Cujo
Criterion v datab叩zov辿m dotazu
Jak sestavit DB dotaz pro GRID na stran klienta ?

  import static CEmployee.*;

  CujoProperty[] gridColumns = new CujoProperty[]
   { NAME
   , WAGE
   , COMPANY.add(CCompany.NAME)
   , COMPANY.add(CCompany.CITY)
   };

  CQuery<CEmployee> query = CQuery.newInstance(CEmployee.class, gridColumns);
  query.setCriterion(CCriterion.where(COMPANY.add(CCompany.CITY), "Prague"));
  
  
  grid = new Grid<CUJO>(createStore(query) query.getColumnModel();
Referenn鱈 aplikace Ujorm:
   eCall
   ZEI
   Inspectime (funkn鱈 demo: http://inspectime.com)
禽看岳温噛霞油
   

  ?
GWT Frameworky: Ujorm

      Dkuji za pozornost
 Odkazy:
   Ujorm: http://ujorm.org
   Ext GWT: http://www.sencha.com/products/extgwt/
   Referenn鱈 demo aplikace: http://inspectime.com
   Tato prezentace: http://ujorm.org/gxt
   Download: http://sourceforge.net/projects/ujoframework/
   Maven repository: groupId=org.ujoframework,artifactId:ujo-*




            Google User Groups, Praha 9.6.2011, Autor: Pavel Ponec

More Related Content

Gwt frameworky GXT + UJORM

  • 1. GWT Frameworky Ujorm 1.20 v prosted鱈 Ext GWT (Sencha) Google User Groups, Praha 9.6.2011, Autor: Pavel Ponec
  • 2. vod Ujorm je "lehko-ton叩転n鱈" framework se silnou typovou kontrolou postavenou na Java <generik叩ch>, kter箪 nab鱈z鱈 (prostednictv鱈m sv箪ch modul哲) slu転by: perzitence objekt哲 do rela鱈ch datab叩z鱈 (ORM slu転by) integrace s Ext GWT projektu Sencha (d叩le jen GXT) API + serializace objekt哲 do/z textov箪ch form叩t哲 Ujorm pracuje s objekty implementuj鱈c鱈 2 interface: Ujo + Property
  • 3. Motivace Pro pou転鱈t Ujorm ? v箪et Properties (podoba s Enum + PropertyDescriptor) peklepy odhal鱈 kompil叩tor dostupn叩 meta-data vhodn辿 pro data binding nadstandardn鱈 typov叩 kontrola bezpen箪 refactoring zdrojov辿ho k坦du snadn叩 tvorba generick箪ch komponent pou転鱈v叩n鱈 UjoProperty je z叩bavn辿 :) spora zdroj哲: 炭spora asu 炭spora finann鱈ch n叩klad哲 vy邸邸鱈 produktivita
  • 4. Ujorm pro GXT Dva moduly: Ujo-gxt-core nabz鱈 klientskou verzi UJO objekt哲 (Cujo) cache Property vlastnost鱈 (mandatory, length) podpora pro mapov叩n鱈 klientsk箪ch UJO objekt哲 na serverov辿 n叩stroj pro automatizovanou konverzi klientsk箪ch objekt哲 na serverov辿 (dom辿nov辿 objekty, db dotazy)
  • 5. Ujorm pro GXT Dva moduly: Ujo-gxt-core nabz鱈 klientskou verzi UJO objekt哲 (Cujo) cache Property vlastnost鱈 (mandatory, length) podpora pro mapov叩n鱈 klientsk箪ch UJO objekt哲 na serverov辿 n叩stroj pro automatizovanou konverzi klientsk箪ch objekt哲 na serverov辿 (dom辿nov辿 objekty, db dotazy) Ujo-gxt-crud grafick辿 komponenty podporuj鱈c鱈 DB operace: Create Read Update Delete
  • 6. Class model Ujo + Property Instance Ujo obsahuje data nab鱈z鱈 seznam Properties m哲転e splovat specifikaci JavaBeans (ale nemus鱈)
  • 7. Class model Ujo + Property Instance Ujo ... Instance UjoProperty poskytuje meta-data n叩zev a typ property defaultn鱈 hodnotu defaultn鱈 smr azen鱈 nab鱈z鱈 etzen鱈 s jinou UjoProperty a r哲zn辿 u転iten辿 metody vetn metod pro ten鱈 a z叩pis statick叩 nemnn叩 instance (immutable object)
  • 8. GXT: ModelData ModelData je datov箪 model grafick箪ch GXT komponent - jedna instance reprezentuje nap鱈klad: jeden 叩dek tabulky
  • 9. GXT: ModelData ModelData je datov箪 model grafick箪ch GXT komponent - p鱈kladem pou転it鱈 je jeden 叩dek tabulky Ujorm: Cujo Cujo je klientsk叩 verze rozhran鱈 Ujo pro GXT Cujo je potomkem ModelData !
  • 10. P鱈klad implementace Cujo/Ujo Uk叩zka implementace Cujo pomoc鱈 abstraktn鱈 t鱈dy: public class Employee extends AbstractCujo implements Serializable { /** Property List */ private static final CujoPropertyList pList = list(Employee.class); @Override public CujoPropertyList readProperties() { return pList; }
  • 11. P鱈klad implementace Cujo/Ujo Uk叩zka implementace Cujo pomoc鱈 abstraktn鱈 t鱈dy: public class Employee extends AbstractCujo implements Serializable { /** Property List */ private static final CujoPropertyList pList = list(Employee.class); /** Unique key */ public static final CujoProperty<Employee, Long> ID = pList.newProperty("id", Long.class); /** User name */ public static final CujoProperty<Employee, String> NAME = pList.newProperty("name", String.class); /** Hourly wage */ public static final CujoProperty<Employee, Double> WAGE = pList.newPropertyDef("wage", 0.0); /** A reference to Company */ public static final CujoProperty<Employee, Company> COMPANY = pList.newProperty("company", Company.class); @Override public CujoPropertyList readProperties() { return pList; }
  • 12. Uk叩zka pr叩ce s daty Jak zapsat hodnoty ? GXT: ModelData ModelData person = new ModelData(); // Write: person.set("ID", 7L); person.set("NAME", "Pavel"); person.set("WAGE", 20.00); person.set("COMPANY", new Company());
  • 13. Uk叩zka pr叩ce s daty Jak zapsat hodnoty ? GXT: ModelData Ujorm: Cujo import static Employee.* import static Company.CITY; ModelData person = new ModelData(); Employee person = new Employee(); // Write: // Write: person.set("ID", 7L); person.set(ID, 7L); person.set("NAME", "Pavel"); person.set(NAME, "Pavel"); person.set("WAGE", 20.00); person.set(WAGE, 20.00); person.set("COMPANY", new Company()); person.set(COMPANY, new Company());
  • 14. Uk叩zka pr叩ce s daty Jak na鱈st data ? GXT: ModelData Ujorm: Cujo import static Employee.* import static Company.CITY; ModelData person = new ModelData(); Employee person = new Employee(); // Write: // Write: person.set("ID", 7L); person.set(ID, 7L); person.set("NAME", "Pavel"); person.set(NAME, "Pavel"); person.set("WAGE", 20.00); person.set(WAGE, 20.00); person.set("COMPANY", new Company()); person.set(COMPANY, new Company()); // Read: Ujorm: Long id = person.get("ID"); String name = person.get("NAME"); double wage = person.get("WAGE"); Company address = person.get("COMPANY");
  • 15. Uk叩zka pr叩ce s daty Jak na鱈st data ? GXT: ModelData Ujorm: Cujo import static Employee.* import static Company.CITY; ModelData person = new ModelData(); Employee person = new Employee(); // Write: // Write: person.set("ID", 7L); person.set(ID, 7L); person.set("NAME", "Pavel"); person.set(NAME, "Pavel"); person.set("WAGE", 20.00); person.set(WAGE, 20.00); person.set("COMPANY", new Company()); person.set(COMPANY, new Company()); // Read: // Read: Long id = person.get("ID"); Long id = person.get(ID); String name = person.get("NAME"); String name = person.get(NAME); double wage = person.get("WAGE"); double wage = person.get(WAGE); Company address = person.get("COMPANY"); Company address = person.get(COMPANY);
  • 16. Uk叩zka pr叩ce s daty Jak na atributy relan鱈ch objekt哲 ? GXT: ModelData Ujorm: Cujo import static Employee.* import static Company.CITY; ModelData person = new ModelData(); Employee person = new Employee(); // Write: // Write: person.set("ID", 7L); person.set(ID, 7L); person.set("NAME", "Pavel"); person.set(NAME, "Pavel"); person.set("WAGE", 20.00); person.set(WAGE, 20.00); person.set("COMPANY", new Company()); person.set(COMPANY, new Company()); person.set("COMPANY.CITY", "Prague"); // No // Read: // Read: Long id = person.get("ID"); Long id = person.get(ID); String name = person.get("NAME"); String name = person.get(NAME); double wage = person.get("WAGE"); double wage = person.get(WAGE); Company address = person.get("COMPANY"); Company address = person.get(COMPANY); String cn = person.get("COMPANY.CITY"); // No
  • 17. Uk叩zka pr叩ce s daty Jak na atributy relan鱈ch objekt哲 ? GXT: ModelData Ujorm: Cujo import static Employee.* import static Company.CITY; ModelData person = new ModelData(); Employee person = new Employee(); // Write: // Write: person.set("ID", 7L); person.set(ID, 7L); person.set("NAME", "Pavel"); person.set(NAME, "Pavel"); person.set("WAGE", 20.00); person.set(WAGE, 20.00); person.set("COMPANY", new Company()); person.set(COMPANY, new Company()); person.set("COMPANY.CITY", "Prague"); // No person.set(COMPANY.add(CITY), "Prague"; // Read: // Read: Long id = person.get("ID"); Long id = person.get(ID); String name = person.get("NAME"); String name = person.get(NAME); double wage = person.get("WAGE"); double wage = person.get(WAGE); Company address = person.get("COMPANY"); Company address = person.get(COMPANY); String cn = person.get("COMPANY.CITY"); // No String cn = person.get(COMPANY.add(CITY);
  • 18. Kopie hodnot Jak pepsat hodnoty z jednoho objektu do druh辿ho ?
  • 19. Kopie hodnot Jak pepsat hodnoty do druh辿ho objektu ? ModelData (GXT): ModelData emplA = findEmployee(); ModelData emplB = new ModelData(); for (String p : emplA.getPropertyNames()) { Object o = emplA.get(p); emplB.set(p, o); } GWT.log("Employee B: " + emplB);
  • 20. Kopie hodnot Jak pepsat hodnoty do druh辿ho objektu ? ModelData (GXT): Cujo (Ujorm): ModelData emplA = findEmployee(); Cujo emplA= findEmployee(); ModelData emplB = new ModelData(); Cujo emplB= employee1.createInstance(); for (String p : emplA.getPropertyNames()) for (CujoProperty p : emplA.readProperties()) { { Object o = emplA.get(p); p.copy(emplA, emplB); emplB.set(p, o); } } GWT.log("Employee B: " + emplB); GWT.log("Employee B: " + emplB);
  • 21. Obnova defaultn鱈ch hodnot Jak obnovit defaultn鱈 hodnoty v objektu ?
  • 22. Obnova defaultn鱈ch hodnot Jak obnovit defaultn鱈 hodnoty objektu ? ModelData (GXT): ModelData employee = findEmployee(); for (String p : employee1.getPropertyNames()) { Object o = employee1.get(p); p.set(p, null); // ?? } GWT.log("Employee: " + employee);
  • 23. Obnova defaultn鱈ch hodnot Jak obnovit defaultn鱈 hodnoty objektu ? ModelData (GXT): ModelData employee = findEmployee(); for (String p : employee1.getPropertyNames()) { Object o = employee1.get(p); p.set(p, null); // ?? p.set(p, getDefaultForProperty(p)); } GWT.log("Employee: " + employee);
  • 24. Obnova defaultn鱈ch hodnot Jak obnovit defaultn鱈 hodnoty objektu ? ModelData (GXT): Cujo (Ujorm): ModelData employee = findEmployee(); Cujo employee = findEmployee(); for (String p : employee1.getPropertyNames()) for (CujoProperty p : employee.readProperties()) { { Object o = employee1.get(p); p.set(p, p.getDefault()); p.set(p, null); // ?? p.set(p, getDefaultForProperty(p)); } } GWT.log("Employee: " + employee); GWT.log("Employee: " + employee);
  • 25. Criterion Test platnosti (validace) objektu v run-time ModelData (GXT): Cujo (Ujorm): import static org.ujorm.gxt.client.cquery.COperator.*; CCriterion<Employee> validWage, validStreet,validator; validWage = CCriterion.where(WAGE, GT, 10.0); validStreet = CCriterion.where(COMPANY.add(CITY), "Prague"); ? validator = validWage.or(validStreet); Employee employee = findEmployee(); boolean isValid = validator.evaluate(employee); GXT.log("Is valid: " + isValid + " for " + employee);
  • 26. Mapov叩n鱈 klientsk箪ch objekt哲 Serverov叩 strana: Ujo Klientsk叩 strana: Cujo
  • 27. Criterion v datab叩zov辿m dotazu Jak sestavit DB dotaz pro GRID na stran klienta ? import static CEmployee.*; CujoProperty[] gridColumns = new CujoProperty[] { NAME , WAGE , COMPANY.add(CCompany.NAME) , COMPANY.add(CCompany.CITY) }; CQuery<CEmployee> query = CQuery.newInstance(CEmployee.class, gridColumns); query.setCriterion(CCriterion.where(COMPANY.add(CCompany.CITY), "Prague")); grid = new Grid<CUJO>(createStore(query) query.getColumnModel();
  • 28. Referenn鱈 aplikace Ujorm: eCall ZEI Inspectime (funkn鱈 demo: http://inspectime.com)
  • 30. GWT Frameworky: Ujorm Dkuji za pozornost Odkazy: Ujorm: http://ujorm.org Ext GWT: http://www.sencha.com/products/extgwt/ Referenn鱈 demo aplikace: http://inspectime.com Tato prezentace: http://ujorm.org/gxt Download: http://sourceforge.net/projects/ujoframework/ Maven repository: groupId=org.ujoframework,artifactId:ujo-* Google User Groups, Praha 9.6.2011, Autor: Pavel Ponec