Information Technology Reference
In-Depth Information
provides the possibility of having different visual components arranged in mul-
tiple different ways with little or no code at all.
Flexible layout : This, combined with the perspective generation utilities,
provides the final user with a way of defining a particular view for him or her that
can be utilized later on in future when he or she logs in. Thanks to the filesystem
and security management features combined, the UberFire framework can intern-
ally store the preferences for each user's perspectives.
Event intercommunication between components : Thanks to Errai and CDI, all
components (both client and server side) can easily interact using events.
Event intercommunication is a very important and simple-to-use component that gener-
ates events that can be shared by the client and server. The first thing we need to do is to
define our event objects. Let's examine how we defined NewMessageEvent in our
uberfire-demo-api project:
@org.jboss.errai.common.client.api.annotations.Portable
public class NewMessageEvent implements Serializable {
public NewMessageEvent() { … }
}
In the previous code fragment, which we reduced to the most important sections, you can
see that our event doesn't have to extend any specific class. All it needs is a @Portable
annotation from Errai to be shared between client and server. Inside the event, any kind of
serializable information can be placed to be shared between a client and server.
Later on, these events are captured or fired by specific instances, but the configuration to
use them is almost trivial. In the following code fragment, we see how the Mes-
sageListViewImpl class in the uberfire-demo-client project listens for
NewMessageEvent firings and how it fires another type of event called Notifica-
tionEvent :
public class MessageListViewImpl … {
@javax.inject.Inject
public javax.enterprise.event.Event<NotificationEvent>
notification;
public void
Search WWH ::




Custom Search