Adding a new GWT Portlet to the DashboardThe steps are not complicated but should be captured to help save others time. The goal of the exercise was to duplicate the UI portlet functionality delivered in the JON 2.4 UI using the new SmartGWT architecture and widgets. The before and after shotsRHQ 3.0.0 UI(Legacy)
View Mode GWT UI
Edit Mode GWT UI
Some differences with the new UIThe dashboard has changed in a number of different ways. The '3.0.0 legacy' dashboard functionality now exists as the 'Default Dashboard' in the GWT based UI. Add/Removal/Moving portletsMoving any of the portlets('Recent Alerts', 'Favorite Resources',etc.) now works by drag-n-drop. To add/replace a portlet to the 'Default Dashboard' you need to click the 'Edit Mode' button. MessagesYou now should be aware of the 'Messages' drop down list for errors/exceptions detected and successfully reported back to the UI. Also with the client side elements being built and run in javascript, error messages can now simply go missing or take a while to pop up. This is a side-effect of XHR and asynchronous responses. Legacy to GWT Dashboard functionality migrationFor the first GWT enabled release of RHQ, the legacy JON 2.4 functionality will be migrated to the 'Default Dashboard' area in the new GWT UI. In future releases of RHQ, the 'Default Dashboard' will be one of many optional and customizable views available to the RHQ user. All functionality outside of the 'Default Dashboard' should be considered experimental until that functionality has been successfully rolled into a release.
Legend:
Source code changes for building and registering the new portletSee below for instructions for how to retrieve the described here:
A Pattern for DisambiguationFrom a source code perspective, disambiguation requires some changes in the GWT world. With JSF/Struts the data type and resource name disambiguation generation always happened on the server side. With Smart GWT, the final translation of these data types for UI display happens on the client side. This means that translations, like disambiguation, which require server side apis must necessarily still happen on the server side, but the results of that translation needs to be shared as 'translated' data types via serialization. To get all the translated data on the client side means one of two approaches:
I want to see some code:With git clone of http://git.fedorahosted.org/git?p=rhq/rhq.git;a=summary of master branch:
Serialization remindersGWT serialization is not as full featured as Java Serialization even though GWT reuses the java.io.Serializable interface to mark object for serialization. See here for more details. Basically to avoid some nasty serialization problems with confusing or no error messages, you should make sure the java types being sent over the wire from browser client to RHQ server do the following:
Debug errors to watch out for:Serialized type doesn't meet GWT serialization requirements Caused by: com.google.gwt.user.client.rpc.SerializationException: Type 'java.util.Collections$UnmodifiableRandomAccessList' was not included in the set of types which can be serialized by this SerializationPolicy or its Class object could not be loaded. For security purposes, this type will not be serialized.: instance = [Resource[id=10003, name='Tomcat (8088)', type=ResourceType[name='Tomcat Server', plugin='null']], Resource[id=10001, name='Vital-AGENT', type=ResourceType[name='Linux', plugin='null']]] at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serialize(ServerSerializationStreamWriter.java:610) at com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamWriter.writeObject(AbstractSerializationStreamWriter.java:129) at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter$ValueWriter$8.write Unfinished tasks
|




