XTemplate template = (XTemplate) input;
WPaloServiceProvider.getInstance().loadWorksheet(template,
new Callback<XWorksheet>(){
public void onSuccess(XWorksheet ws) {
XWorkbook wb = ws.getWorkbook();
XAccount acc = wb.getAccount();
XConnection con = acc.getConnection();
String host = con.getHost();
String service = con.getService();
if (service.indexOf(":") != -1) {
service = service.split(":")[1];
}
String url = host + ":" + service + "/cc/auto_login.php?user=";
url += acc.getLogin() + "&pass=" + acc.getPassword();
url += "&app=" + wb.getAppName() + "&wb=" + wb.getName();
url += "&ws=" + ws.getName() + "&lang=en_US&w=1024&h=768";
frame.setUrl(url);
setText(wb.getName());
}