try {
connectorService = getWookieConnectorService(wookieServerUrl, wookieApiKey, sharedDataKey);
org.apache.wookie.connector.framework.User user = new org.apache.wookie.connector.framework.User(String.valueOf(viewer.getUsername()), viewer.getUsername());
connectorService.setCurrentUser(user);
logger.debug("Getting widget:"+widget.getUrl()+" from:" +connectorService.getConnection().getURL());
WidgetInstance instance = connectorService.getOrCreateInstance(widget.getUrl());
return createWidget(instance);
} catch (WookieConnectorException e) {
logger.error("Unable to connect to Wookie server", e);
// FIXME: provide a real error widget
return createWidget(new WidgetInstance("error", "error", e.getMessage(), "100", "100"));
} catch (IOException e) {
logger.error("Problem communicating with Wookie server", e);
// FIXME: provide a real error widget
return createWidget(new WidgetInstance("error", "error", e.getMessage(), "100", "100"));
}
}