[Showcase] using Dashboard Widgets with Servoy
By Edward Callaghan, Servoy
In Servoy 2.2, we’ve introduced a new way to access database data and Servoy solution business logic: the ‘Servoy Headless client’.
The Servoy Headless Client (SHC) enables you to develop web browser applications that access any data hosted by a Servoy Server and also execute any method in a solution hosted on that particular server. With introduction of dashboard Widgets, in Mac OS X.4 (Tiger) we thought we would demonstrate how you could use a widget to display data and use business logic of any Servoy solution.
As Dashboard Widgets are essentially mini webbrowsers nearly any SHC app you build can be deployed as a Dashboard Widget.
Before you begin with the Widget design
Read the whitepaper about Servoy headless client that you can get from the following URL:
http://developer.servoy.com/docs/servoy_headless_client.pdf
For this widget we took one of the example JSP’s you find with headless and did some minor tweaking to it’s appearance to make it look like this:
[image unavailable: Widget_1_2]
How Does The Widget Work?
In the document you can find the whole code that we had to write to get the widget to talk to Servoy and do all the funtionality..
We use a standard web HTTP request to the Servoy Server where there is a JSP page with the code for the Servoy Headless Client. This also includes the css for the inner detail of the widget.
We modified the name of headless_client_formresult.jsp to widget.jsp and also changed any methods that refernced this file to reference widget.jsp
[image unavailable: Widget_2_1]
The headless client in this instance connects to example data, but with this functionality you could have it connect to ANY servoy solution and get it to execute ANY method you want and return it wrapped up in an HTML table.
Further discussion
The widget functionality is based on the guidelines
http://developer.apple.com/documentation/AppleApplications/Conceptual/Dashboard_Tutorial/
The headless client is based on the example documentation installed with Servoy
/server/webapps/ROOT/ and used the solution example_headless_client_01 and uses example data.
Conclusion
Servoy Headless Client gives you many options to access Servoy data and methods from other devices and applications. Using the Dashboard functionality in OS X.4, we have built a widget that demonstrates the speed and scope of how one could make a dashboard widget interrogate ANY Servoy solution anywhere in the world and display the data.
The widgets can be downloaded here
Download servoy_forum_rss.wdgt.zip
Download servoy_data.wdgt.zip
and the whitepaper here
Download servoy_dashboard_widget.pdf
Comments (1)