UberFire is a tool to help rapidly build workbench or console applications. It's still in early beta stage, but this presentation gives a quick overview of what it provides, and how it woks. It shows a small video of the BRMS project being built with UberFire, as well as finishing with a simple web based IDE, that was built as an example application with UberFire
26. GWT
public class Hello implements EntryPoint {
public void onModuleLoad() {
Button b = new Button("Click me",
new ClickListener() {
public void onClick(Widget sender) {
Window.alert("Hello, Ajax");
RootPanel.get().add(b);
}
});
}
}
Saturday, 29 June 13
27. GWT
• Java
• Type safety
• Refactoring
• Compile errors
• Encourages client side state
• Abstracts browser API hell
• Unified bubble system
• Browser specific compilations
• Small size
• Fast Execution
Saturday, 29 June 13
28. GWT
• Boiler plate code
• API for programmatic UIs
• Slow compilation
• GWT team left Google
• Not open source
• No transparency
Saturday, 29 June 13
29. GWT
• Errai
• UiBinder and ErraiUi
• SuperDev Mode
• Source Maps
• Ray Cromwell + team
• Fully Open Source
• Steering Committee
• Roadmaps
Saturday, 29 June 13
34. Errai
• Removes boiler plate code
• CDI
• Context and Dependency Injection
• Annotation driven development
• Errai UI
• Unified programming model
• Pervasive Events and Event Bus
• Client and server
• RPC
• JAX-RS
• Marshalling @Portable
Saturday, 29 June 13
35. ErraiUI
<form data-field="form">
<legend>Log in to your account</legend>
<label for="username">Username</label>
<input data-field="username" id="username"
type="text" placeholder="Username">
<label for="password">Password</label>
<input data-field="pass" id="password"
type="password" placeholder="Password">
<button data-field="submit">Log in</button>
<button>Cancel</button>
</form>
Saturday, 29 June 13
36. ErraiUI @Templated
public class LoginForm extends Composite {
@Inject @Bound @DataField
private TextBox username;
@Inject @Bound @DataField("pass")
private PasswordTextBox password;
@Inject @Model
private User user;
@EventHandler("submit")
private void onLogin(ClickEvent e) {
login(user);
}
}
Saturday, 29 June 13
37. Errai Injecting,Firing and
@Inject @Updated
private Event<Document> updatedDocEvent;
...
button.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
updatedDocEvent.fire(document);
}
});
...
public void onUpdatedDocument(@Observes @Updated Document doc) {
// received updated document
}
Saturday, 29 June 13
38. Errai @Portable Marshalling@Portable
public class Person {
private String name;
private int age;
public Person() {}
public Person(String name, int age) {
this.name = name;
this.age = age;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
...
}
Saturday, 29 June 13
39. Errai JAX-RS
@Path("customers")
public interface CustomerService {
@POST
@Consumes("application/json")
@Produces("text/plain")
public long createCustomer(Customer customer);
}
@Inject
private Caller<CustomerService> customerService;
...
customerService.call(new RemoteCallback<Long>() {
public void callback(Long response) {
Window.alert(response);
}
}).createCustomer(customer);
Saturday, 29 June 13
40. Errai RPC
@Service
public class HappyServiceImpl implements
HappyService {
public boolean isEveryoneHappy() {
return true; // this could be a lie!
}
}
@Remote
public interface
HappyService {...}
@Inject
private Caller<HappyService> happyService;
...
happyService.call(new RemoteCallback<Boolean>() {
public void callback(Boolean response) {
// process response
}
}).isEveryoneHappy();
shared
server
client
Saturday, 29 June 13
71. • UI Rewrite started in November
• Entire BRMS ported
• New BPMS built, all integrated
• Tasks, Calendars, BPM Designer
• Only one person on core UI framework
• All team memebers distributed
• Despite aggressive schedule
• Code remains modular
• Easy to maintan and extend
• No one is complaining yet :)
Proof Is In The Pudding
Saturday, 29 June 13
73. UberFire
•Compile time composition of plugins
•modular components, each separate maven module.
•Lightweight
•Decoupled components
•Layout Manager and Perspectives
•Embeddable/Reusable (*)
•Unified API
•Security
•I/O
•VFS
•Metadata
•Menus, Toolbars, Panels, etc.
•Standard Life Cycle
Saturday, 29 June 13
75. Component Annotation
@WorkbenchPerspective(
identifier = "HomePerspective",
isDefault = true)
public class HomePerspective {
@Perspective
public PerspectiveDefinition buildPerspective() {
final PerspectiveDefinition p =
new PerspectiveDefinitionImpl();
p.setName( "Home Perspective" );
p.getRoot().addPart(
new PartDefinitionImpl(
new DefaultPlaceRequest( "RepoList" ) ) );
return p;
}
}
Saturday, 29 June 13
76. Component Annotation
@WorkbenchScreen(identifier = "MyFirstPanel")
public class MyFirstPanel extends SimplePanel {
public MyFirstPanel() {
setWidget( new Label("Hello World 1") );
}
@WorkbenchPartTitle
public String myTitle() {
return "My First Panel!";
}
}
Saturday, 29 June 13
77. @WorkbenchEditor(identifier = "TextEditor",
supportedTypes = { TextResourceType.class,
DotResourceType.class })
public class TextEditorPresenter {
@WorkbenchPartTitle
public String getTitle() {
return "Text Editor [" + path.getFileName() + "]";
}
@WorkbenchPartView
public IsWidget getWidget() {
return view; //injected
}
(...)
}
Component Annotation
Saturday, 29 June 13
78. @WorkbenchEditor(identifier = "TextEditor",
supportedTypes = { TextResourceType.class,
DotResourceType.class })
public class TextEditorPresenter {
(...)
@OnStart
public void onStart( final Path path ) {
this.path = path;
}
@OnSave
public void onSave() {
}
@IsDirty
public boolean isDirty() {
return view.isDirty();
}
}
Lifecycle Annotation
Saturday, 29 June 13
79. @OnStart
public void onStart( final Path path ) {
this.path = path;
}
Lifecycle Annotation - Options
@OnStart
public void onStart( final PlaceRequest path ) {
this.path = path;
}
@OnStart
public void onStart( ) {
}
Saturday, 29 June 13