blob: 91ade7e2b8416aade1a90adc4816a4a6961f8491 [file] [log] [blame]
/*
* Copyright (c) 2014-2018 BSI Business Systems Integration AG.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* BSI Business Systems Integration AG - initial API and implementation
*/
import {App, defaultValues, objects, scout} from './index';
import * as $ from 'jquery';
export default class RemoteApp extends App {
constructor() {
super();
this.remote = true;
}
/**
* @override
*/
_doBootstrap(options) {
return super._doBootstrap(options).concat([
this._doBootstrapDefaultValues()
]);
}
_doBootstrapDefaultValues() {
defaultValues.bootstrap();
}
_createErrorHandler() {
return scout.create('ErrorHandler', {
sendError: true
});
}
/**
* @override
*/
_loadSession($entryPoint, options) {
options = options || {};
options.$entryPoint = $entryPoint;
var session = this._createSession(options);
App.get().sessions.push(session);
return session.start();
}
_fail(options, error) {
$.log.error('App initialization failed', error);
// Session.js already handled the error -> don't show a message here
// Reject with original rejection arguments
var args = objects.argumentsToArray(arguments).slice(1);
return $.rejectedPromise.apply($, args);
}
}