Upload
doannhu
View
216
Download
2
Embed Size (px)
Citation preview
Advanced Features
of
SmartGWT framework
Ladislav Mačkala
IT director, Podsjetnik d.o.o
About me
• 15+ years of experience in Java development and relational database design and implementation
• Holding B.Sc. And M.Sc. in Computing, Ph.D. in progress
• Have lead Java development teams in several software companies in Croatia
• Currently leading small IT team in medical tourism company
What is this presentation about?
• About a really good piece of software
• About even cooler features of that good piece of softwarepiece of software
SmartGWT at glance (1)
• RIA development framework: • end-to-end application architecture
• a zero-install Ajax/HTML5 client engine• a zero-install Ajax/HTML5 client engine
• rich user interface components & services
• client-server data binding systems
• “One language to rule them all”:• written in Java
• cross-compiled to JavaScript on the client side
• integrated with desired Java technologies on the server side
SmartGWT architecture
SmartGWT advanced features
• Real-time messaging module – based on HTTP streaming (aka “Comet”), integration with JMSintegration with JMS
• Analytics module – BI, analytics and reporting client module
What is Comet?
• Comet – “a web application model in which a long-held HTTP request allows a web server to push data to a browser, a web server to push data to a browser, without the browser explicitly requesting it”
• AKA: Ajax Push, Reverse Ajax, Two-way web, HTTP Streaming, HTTP server push
RTM Module - features
• SmartGWT Real-time Messaging Module (RTM) supports Comet
• Features:• asynchronous delivery of real-time messages to the client• asynchronous delivery of real-time messages to the client
• High data delivery rates
• Works through firewalls, HTTP proxies and other intervening network devices
• Supports codeless integration with JMS (Java Message Service)
• Supports custom connector architecture for other message sources
RTM Module –programming model
• Extremely simple programming model:
• Message producers – can be on the client or on the server sideor on the server side
• Message subscribers – on the client side
• A channel – a common denominator for both message producers and consumers
• A message – a java.lang.Object, consumer has to know what producer produced
RTM Module – do some plumbing
• Include required jars in the project
• Register a servlet in WEB-INF/web.xml:
<servlet><servlet>
<servlet-name>MessagingServlet</servlet-name>
<servlet-class>com.isomorphic.messaging.MessagingServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>MessagingServlet</servlet-name>
<url-pattern>/myapp/sc/messaging/*</url-pattern>
</servlet-mapping>
RTM Module – generate a message (1)
• On the client side, inside any GUI component, just call Message.send()
public void sendChatMessage() {
String userName = (String) chatForm.getValue("user");
Object messageText = chatForm.getValue("msg");
String message = "<b>" + userName + ":</b> " + (String) String message = "<b>" + userName + ":</b> " + (String)
messageText + "<br><br>";
Messaging.send("chatChannel", message, new RPCCallback () {
@Override
public void execute(RPCResponse response, Object rawData,
RPCRequest request) {
if (response.getStatus() != RPCResponse.STATUS_SUCCESS) {
SC.say("Failed send message to server.");
}
}
});
}
RTM Module – generate a message (2)
• Or on the server side, inside DMI class, some Spring bean or something similar:
private void sendToClients(…) throws Exception {
final ISCMessageDispatcher dispatcher = ISCMessageDispatcher.instance();
final Map data = new HashMap();
data.put(“key1”, someValue1);
data.put(“key2”, someValue2);
dispatcher.send(new ISCMessage(“myChannell”, (Object) data));
}
RTM Module – consume a message
• On the client side, inside any GUI component, register a handler that will listen to the channel and process messages as they come:
Messaging.subscribe("chatChannel", new MessagingCallback() {
@Override
public void execute(Object data) {
chatLog.setContents(chatLog.getContents() + (String)data);
}
});
RTM Module – operation modes
• 2 operation modes:• Simple mode
• in-memory messaging delivery system
• no message persistence • no message persistence
• operates only in the context of a single JVM
• Enterprise mode • uses Java Message Service (JMS) as the
messaging backend
• can operate in a clustered environment
RTM Module –integration
• Easily integrable with JMS servers
• Examples of third-party integration in the SmartGWT wiki:the SmartGWT wiki:
• Integration with JBoss AS JMS Server
• Integration with Tomcat and ActiveMQ
RTM Module – use cases
• From examples and the wiki:• Simple chat between clients
• Stock quotes in real time
• Propagation of data set updates to all clients
• From the real world:• Notifying clients about various business events in
the system
• Monitoring client activities
• Real-time collaboration between clients
Analytics module - overview
• CubeGrid
• wraps OLAP cube functionality into a single interactive grid componentinteractive grid component
• data analysis engine
• access to multidimensional data and calculations
• view, analyze and extract data
• front-ends for business intelligence, analytics and reporting applications
Analytics module - operations
• Operations on the CubeGrid
• performing analysis of very large data sets
• user is able to re-organize or re-orient the • user is able to re-organize or re-orient the way information is viewed on the fly
• slicing, dicing
• drilling up and drilling down
• rolling-up, pivoting
Analytics module -terminology
• OLAP terminology <=> CubeGrid terminology:
• Data cube <=> Cube • Data cube <=> Cube • Means: multidimensional dataset
• Dimension <=> Facet• Means: dimension, attribute, or feature
• Member <=> Facet value• Means: dimension member, attribute value, or
feature value
The CubeGrid - features
• Features of the CubeGrid:• add and remove facets on the fly
• expand or collapse within facets and across facets• expand or collapse within facets and across facets
• drag-and-drop re-arrangement and pivoting of facets
• interactive operations (select, resize, reorder, minimize, maximize or auto-fit of columns)
• HTML5 Charts with mobile support
• Loading-On-Demand - only visible data is loaded
The CubeGrid – add row
front-ends for business intelligence, analytics and reporting applications
The CubeGrid – row added
Analytics module – data sources
• CubeGrid can be connected to various data sources:
• MDX• MDX
• XMLA
• OLAP4J
• Regular SmartGWT SQLDataSource – i.e. anything that SmartGWT supports as data source
Analytics module -integration
• CubeGrid can be easily integrated with OLAP server through mentioned protocolsprotocols
• Examples of third-party OLAP servers integration in the SmartGWT wiki:
• Pentaho Mondrian Server
• JasperReport Server
• Microsoft SQL Server Analysis Services
Analytics module – use cases
• Integration of Analytics module into the application for transactional database
• Fetching data for Analytics module from • Fetching data for Analytics module from transactional database, no OLAP server
• Analysis of real-life data:
• Marketing department data
• Sales / customer support department data
• Production department data
• Financial data
SmartGWT licensing
• Client-side – LGPL
• Server-side – commercial license• 3 levels (Power, Pro, Enterprise)• 3 levels (Power, Pro, Enterprise)
• Per developer, Enterprise per CPU or flat rate also
• No runtime licenses, just for developers
• 60-days trial
• Advanced modules – commercial license
• Payed support, training etc. available
SmartGWT links
• Homepage: http://www.smartclient.com
• Comparing with the competition: http://www.smartclient.com/product/competition.jsp
• SmartGWT Showcase: http://www.smartclient.com/smartgwt/showcase/#mainhttp://www.smartclient.com/smartgwt/showcase/#main
• SmartGWT Enterprise Showcase:http://www.smartclient.com/smartgwtee/showcase/
• Forum: http://forums.smartclient.com
• Blog: http://blog.isomorphic.com
• Wiki: https://isomorphic.atlassian.net/wiki/display/Main/Isomorphic+P
ublic+Wiki
Q & A
http://groups.google.com/group/smartgwt-hr