Está en la página 1de 26

Data Providers. GeneXus ms declarativo.

Luis Murilo lmurillo@artech.com.uy

Agenda

El por qu de los Data Providers Contundencia Generacin X

El por qu de los Data Providers

El por qu de los Data Providers Contundencia Generacin X

El por qu de los Data Providers


GeneXus cada vez ms declarativo
ClienteLista using ClientesActivos(&today) { ClienteId ClienteName } for each where FuncionarioActivo = S and (FechaBaja.IsNull() or FechaBaja > &today) &ClienteListaItem.ClienteId = ClienteId & ClienteListaItem.ClienteName = ClienteName &ClienteLista.Add(&ClienteListaItem) &ClienteListaItem = new() endfor

ClienteLista { ClienteId = 123 ClienteName = Luis }

El por qu de los Data Providers

El por qu de los Data Providers


GeneXus cada vez ms declarativo

Aplicaciones SOA

Contundencia

El por qu de los Data Providers Contundencia Generacin X

Contundencia: User Controls

Ejecutando

Desarrollando

Contundencia: Paging

Arquitectura SOA Intercambio de importantes volumenes de datos Paginado

Contundencia: Paging Data Provider


SdtPaging { SdtPagingItem [Count = &PageSize] [Skip = (&PageNumber - 1) * &PageSize] { CampoId = ClientId CampoDsc = ClientName } }

Contundencia: Paging
if not &PageNumber.IsEmpty() &CountRec = 0 &CountPage = 1 for each &CountRec += 1 if &CountPage < &PageNumber if &CountRec = &PageSize &CountRec = 0 &CountPage += 1 endif else &SdtOutItem.CampoId = ClientId &SdtOutItem.CampoDsc = ClientName &SdtOut.Add(&SdtOutItem) &SdtOutItem = new() if &CountRec = &PageSize exit endif endif endfor endif

Procedure

Contundencia: RSS

Ejecutando

Desarrollando

Generacin X

El por qu de los Data Providers Contundencia Generacin X

Generacion X
Componentes bsicos:
Grupos Elementos Variables
Passengers { Passenger { Id = PassengerId Name = PassengerName Phone = PassengerPhone &quantity += 1 } Amount = &quantity }

Generacion X
Opciones avanzadas
Clusula Default Clusulas de Paginado Clusula NoOutput Clusula Input

Generacion X
Opciones avanzadas
Clusula Default
(~ When none)
CurrentTaxes Where TaxInitialDate >= today() Where TaxFinalDate <= today() { VAT = TaxVAT Income = TaxIncome } CurrentTaxes [Default] { VAT = 0.7 Income = 0.3 }

Generacion X
Opciones avanzadas
Clusulas de Paginado: Count y Skip
Customers { Customer [Count = 20] [Skip = 100] { Code = CustomerId Name = CustomerName } }

Generacion X
Opciones avanzadas
Clusula NoOutput
Employees { Employee { Id = EmployeeId Name = EmployeeName EarningInfo [NoOutput] Where IsAutorized(&UserId) { Salary = EmployeeSalary Bonus = EmployeeBonus } } }
<Employees> <Employee> <Id>123</Id> <Name>John Doe</Name> <EarningInfo> <Salary>30000</Salary> <Bonus>5000</Bonus> </EarningInfo> </Employee> ... </Employees>

<Employees> <Employee> <Id>123</Id> <Name>John Doe</Name> <Salary>30000</Salary> <Bonus>5000</Bonus> </Employee> ... </Employees>

Generacion X
Opciones avanzadas
Clusula Input
VerySimple { Month Input &i = 1 to 12 { MonthNumber = &i } }

CustomersFromAnotherDataProvider { &CustomersSDT = GetCustomers() // a DataProvider that Outputs Customers collection Customer Input &Customer in &CustomersSDT { Id = &Customer.Code Name = &Customer.Name } }

Generacion X
Outpu

&rss = RSS() // RSS es un DP que carga los datos &response.addstring(&rss.toxml(true)) For &Var in DataProvider(par1, , parN) &Var.SomeElement Endfor

I have a dream

Data Providers. GeneXus ms declarativo.

lmurillo@artech.com.uy

También podría gustarte