Tagged: Flamingo

Invoking Hibernate Validator from JavaFX

I showed how to call a Seam component with Flamingo from JavaFX. In this post I show how to invoke Hibernate Validator from JavaFX with Flamingo:

Entity (and Seam component):

@Entity
@Name ("icecream")
public class IceCream {
 
   @Id @GeneratedValue
   private Long id;
 
   @Max(value=5, message="Sorry, you can't have more than {value} flavors")
   private Integer flavors;
 
   // getters and setters
}

JavaFX script (most interesting stuff is happening lines 17-21):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
FXServiceFactory.URL = "http://localhost:8080/server-javafx/seam/resource/hessian/";
 
var message:String;
var textBox:TextBox = TextBox {
    columns: 15  
}
var label:Label = Label {
    text : "How many flavors:"   
    style:"-fx-font-weight:bold"
}
var errorMessage:Label = Label {
    text: bind message
    style : "-fx-text-fill:red; -fx-font-weight:bold" 
}
var button:Button = Button {
    text: "Click"
    action : function () {
       var ev = FXServiceFactory.getService(EntityValidator.class, 
       		"com.exadel.flamingo.service.validator.entityValidator")
       		as (EntityValidator);      
       message = ev.validate ("icecream.flavors", textBox.text)
    } 
}
 
Stage {
    title: "Application"
    width: 250 height: 100
    scene: Scene {
        content: [ 
        VBox {
            spacing: 5
            content:[
            label, 
            HBox {
                spacing: 5
                content: [
                   textBox, 
                   errorMessage
                ] 
            }            
            button
            ]
        }
        ]
    }
};

Result:

That’s it.

Calling Seam component from JavaFX

We very close to moving Flamingo and Fiji to exadel.org. It will probably (finally) happen next week. I just wanted to show how simple it is to call a Seam component from JavaFX using Flamingo:

Seam component (server):

@Name ("currentTime")
public class CurrentTime {
   public Date currentTime () {
	return (new java.util.Date());
   }
}

Service interface (client):

public interface CurrentTime {
   public Date currentTime ();
}

JavaFX script (client):

FXServiceFactory.URL = "http://localhost:8080/server-javafx/seam/resource/hessian/";
var ct = (FXServiceFactory.getService(CurrentTime.class,"currentTime") as CurrentTime);
var now = ct.currentTime();
FX.println(now);

That’s it!

Videos from JavaOne 2009

I knew these existed but somehow forgot to post them. These are videos of my presentations at JBoss booth at JavaOne 2009 in San Francisco. I think it would be more useful if the videos would switch more often to the slides I’m showing, but in case, enjoy!

RichFaces presentation
Part 1
Part 2
Part 3
Part 4

JavaFX with Seam presentation
Part 1
Part 2
Part 3

Weekend reading list

Flamingo mobile webinar, learn about iPhone and Android features

There was a last minute change and I will be doing tomorrow’s webinar on Flamingo and its new mobile features. There is still time to register. The webinar it tomorrow, June 15th at 11am PT/2pm ET.

Exadel Flamingo, an open source Java EE development framework, enables the “mobilization” of existing e-commerce applications by seamlessly encapsulating existing server-side functionality to be used by mobile devices. Flamingo establishes a lightweight abstract layer between the server and the mobile client to preserve and reuse existing server-side components and services.

In this webinar, we will show an example of integrating the Android platform with ofbiz, a popular open source e-commerce platform, using Flamingo.

Register now!

Enterprise mobile for iPhone and Android webinar

Learn how to build enterprise mobile applications for iPhone an Android by attending our webinar on Tuesday, Jun 15, 2010 at 11:00 AM – 12:00 PM PDT

Exadel Flamingo, an open source Java EE development framework, enables the “mobilization” of existing e-commerce applications by seamlessly encapsulating existing server-side functionality to be used by mobile devices. Flamingo establishes a lightweight abstract layer between the server and the mobile client to preserve and reuse existing server-side components and services.

In this webinar, we will show an example of integrating the Android platform with ofbiz, a popular open source e-commerce platform, using Flamingo.

Register now!