-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi guys,
What are you think - Is it possible to develop with ZK with REST like approuch? I think it's especialy impotant when we are trying get information from datasource.
---
Just look at this codes to understand what I mean:
Get ALL Accounts: Accounts = RestObj('http://data.location.com/accounts');
Set Accounts pagination size: Accounts = RestObj('http://data.location.com/accounts/setPageSize/20');
Get 2nd page of Accounts list: Accounts = RestObj('http://data.location.com/accounts/page/2');
Get pages count of Accounts list: page_count = RestObj('http://data.location.com/accounts/pages');
Get columns_names list for Account: columns_names = RestObj('http://data.location.com/accounts/columns_names');
Get columns_types list for Account: columns_types = RestObj('http://data.location.com/accounts/columns_types');
---
Now we can bind grid with datasourse like this:
<some_grid>
<headers names="@{RestObj('http://data.location.com/accounts/columns_names')}"
types="@{RestObj('http://data.location.com/accounts/columns_types'}"/>
<data sourse="@{RestObj('http://data.location.com/accounts'}">
<paginator value="@{RestObj('http://data.location.com/accounts/pages')}"
</some_grid>
So, what are you think about it?
Max
Yes. It is doable.
Write a "RestManager" that will read such @{...} ZK annotations. Then the RestManager shall parse and interpret the given URL to read the data back (via web service or message queue) and then populate the components.
Why not name it to ZKRest ??? So you have more hits on the zk website by googeling after 'Rest'
Asked: 2008-10-24 15:46:54 +0800
Seen: 767 times
Last updated: Apr 28 '11