throws IOException {
// Mark the Facebook client as enabled
UIViewRootEx2 rootEx = (UIViewRootEx2)context.getViewRoot();
UIFacebookClient.enableClient(rootEx, true);
UIFacebookClient dialog = (UIFacebookClient)component;
String endpoint = dialog.getEndpoint();
Endpoint _bean = EndpointFactory.getEndpoint(endpoint, EndpointFactory.SERVER_FACEBOOK);
if(!(_bean instanceof OAuthEndpoint)) {
throw new FacesExceptionEx("The Facebook endpopint must be a OAuthEndPoint");
}
OAuthEndpoint bean = (OAuthEndpoint)_bean;