writeJSSDK(context, component, bean);
}
protected JsonObject createJSONConfig(OAuthEndpoint bean) throws IOException {
JsonObject config = new JsonJavaObject();
try {
String appId = bean.getConsumerKey();
config.putJsonProperty("appId", appId);
} catch (Exception e) {
IOException ioe = new IOException("Error while accessing the consumer key");
ioe.initCause(e);
throw ioe;
}
//http://xxxx/xsp/.ibmxspres/.extlib/sbt/facebook/channel.html
// Note that the URL must be absolute
String htmlResource = FacesContext.getCurrentInstance().getExternalContext().encodeResourceURL(SBTResources.FACEBOOK_CHANNEL_HTML);
String channelURL = FacesUtil.makeUrlAbsolute(FacesContext.getCurrentInstance(), htmlResource);
config.putJsonProperty("channelURL", channelURL);
// Should we make these client parameters?
config.putJsonProperty("status", true);
config.putJsonProperty("cookie", true);
config.putJsonProperty("xfbml", true);
// This currently fails
//config.putJsonProperty("oauth", true);
return config;
}