Comments
Richard Davies wrote: The UK has a good crop of technology pioneers in cloud computing - for example ElasticHosts, FlexiScale, Flexiant, OnApp - and also some strong government initiatives such as G-Cloud. We will have to see whether this kind of technical leadership converts into swift mass-market adoption or not.
Cloud Expo on Google News

SYS-CON.TV
Cloud Expo & Virtualization 2009 East
PLATINUM SPONSORS:
IBM
Smarter Business Solutions Through Dynamic Infrastructure
IBM
Smarter Insights: How the CIO Becomes a Hero Again
Microsoft
Windows Azure
GOLD SPONSORS:
Appsense
Why VDI?
CA
Maximizing the Business Value of Virtualization in Enterprise and Cloud Computing Environments
ExactTarget
Messaging in the Cloud - Email, SMS and Voice
Freedom OSS
Stairway to the Cloud
Sun
Sun's Incubation Platform: Helping Startups Serve the Enterprise
POWER PANELS:
Cloud Computing & Enterprise IT: Cost & Operational Benefits
How and Why is a Flexible IT Infrastructure the Key To the Future?
Click For 2008 West
Event Webcasts
Integrating ZK Calendar with a database

Last month I posted a Small Talk discussing the use of ZK Calendar with a database. Since then I have been working closely with ZK Calendar and thought I would share another way of achieving the same effect.

Extending ZK Calendar’s AbstractCalendarModel

The key is to extend the AbstractCalendarModel and override the get function. This function is used to retrieve the events from the selected model, in this case the underlying model architecture is a database.

The ‘get’ function

The get function takes the following parameters:

  1. public List get(Date arg0, Date arg1, RenderContext arg2)

The two Date objects denote the start and end dates respectively whereas the RenderContext contains a function getTimeZone(). This function is used to retrieve the calendar’s TimeZone which is used to align the Date object’s time with the database’s timezone.

The code

  1. public final class DatabaseCalendarModel extends AbstractCalendarModel {
  2.  
  3.  private NewsDAO _newsDAO = new NewsDAO();
  4.  
  5.  @Override
  6.  public List get(Date arg0, Date arg1, RenderContext arg2) {
  7.  
  8.   long startDate = arg0.getTime();
  9.   long endDate = arg1.getTime();
  10.                
  11.                 //retrieve the events from the database between the two times
  12.   List result =
  13.    _newsDAO.selectAllBetween(startDate, endDate);
  14.  
  15.   return result;
  16.  }
  17. }

The above code demonstrates how we have implemented the retrieval. You can download the Small Talk’s code to give you a better understanding of how the database interaction was implemented.

In this case I added a new function which will retrieve all the database entries between the two dates, I will not show how to do this in this blog post. However, by using the Small Talk’s code as an example you can see that the time is stored as an integer value (the time since Unix Epoch), thus we can easily retrieve the events between two dates using integer comparisons.

Integrating ZK Calendar with a database is a post from: Timothy Clare

Read the original blog entry...

About Timothy Mills-Clare
Timothy Clare is a Technology Evangelist for the Potix corporation which produces the ZK Framework. He has been working with various web technologies for over 10 years.

Latest Cloud Developer Stories
As a result, it said, of “customer feedback and evolving usage patterns,” Microsoft cut the price of its cloud-ified SQL Azure database 48%–75% for databases larger than 1GB and introduced a new entry-level 100MB model. It blogged that it’s noticed that many projects start smal...
Wide and cheap availability of cloud-based media services is upon us. With the transformations these services are already bringing to the consumption of music, video and interactive media, change has likewise come to professional workflows. Documents in 2012 are read, written, co...
With Cloud Expo 2012 New York (10th Cloud Expo) just four months away, what better time to start introducing you in greater detail to the distinguished individuals in our incredible Speaker Faculty for the technical and strategy sessions at the conference... We have technical ...
Fresh off a happy quarter, Rackspace said Thursday that it’s bought SharePoint911, one of those you-never-heard-of-them outfits that does SharePoint consulting, training and JumpStart services so it can deliver newfangled SharePoint services along with its existing SharePoint hos...
Cloud is a shift from the focus on underlying technology implementation to leveraging existing implementations and further building upon them. Cloud orchestration or a network of clouds is the wave of the future where these clouds can operate with elasticity, scalability, and eff...
Subscribe to the World's Most Powerful Newsletters
Subscribe to Our Rss Feeds & Get Your SYS-CON News Live!
Click to Add our RSS Feeds to the Service of Your Choice:
Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
Publish Your Article! Please send it to editorial(at)sys-con.com!

Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021

SYS-CON Featured Whitepapers
ADS BY GOOGLE