requestBuilder.setHeader( "If-Modified-Since", "01 Jan 1970 00:00:00 GMT" );
requestBuilder.sendRequest( null, new RequestCallback() {
@Override
public void onError( Request arg0, Throwable arg1 ) {
MessageDialogBox dialogBox =
new MessageDialogBox( Messages.getString( "error" ), arg1.getLocalizedMessage(), false, false, true ); //$NON-NLS-1$
dialogBox.center();
}
@Override
public void onResponseReceived( Request arg0, Response response ) {
Boolean isAdministrator = Boolean.parseBoolean( response.getText() );
SolutionBrowserPanel.getInstance().setAdministrator( isAdministrator );
try {
String restUrl2 = GWT.getHostPageBaseURL() + "api/scheduler/canSchedule"; //$NON-NLS-1$
RequestBuilder requestBuilder2 = new RequestBuilder( RequestBuilder.GET, restUrl2 );
requestBuilder2.setHeader( "If-Modified-Since", "01 Jan 1970 00:00:00 GMT" );
requestBuilder2.sendRequest( null, new RequestCallback() {
@Override
public void onError( Request arg0, Throwable arg1 ) {
MessageDialogBox dialogBox =
new MessageDialogBox( Messages.getString( "error" ), arg1.getLocalizedMessage(), false, false, true ); //$NON-NLS-1$
dialogBox.center();
}
public void onResponseReceived( Request arg0, Response response ) {
Boolean isScheduler = Boolean.parseBoolean( response.getText() );
SolutionBrowserPanel.getInstance().setScheduler( isScheduler );
String numStartupURLsSetting = settings.get( "num-startup-urls" );
if ( numStartupURLsSetting != null ) {
int numStartupURLs = Integer.parseInt( numStartupURLsSetting ); //$NON-NLS-1$
for ( int i = 0; i < numStartupURLs; i++ ) {
String url = settings.get( "startup-url-" + ( i + 1 ) ); //$NON-NLS-1$
String name = settings.get( "startup-name-" + ( i + 1 ) ); //$NON-NLS-1$
if ( StringUtils.isEmpty( url ) == false ) { //$NON-NLS-1$
url = URL.decodeQueryString( url );
name = URL.decodeQueryString( name );
SolutionBrowserPanel.getInstance().getContentTabPanel().showNewURLTab( name != null ? name : url,
url, url, false );
}
}
}
if ( SolutionBrowserPanel.getInstance().getContentTabPanel().getWidgetCount() > 0 ) {
SolutionBrowserPanel.getInstance().getContentTabPanel().selectTab( 0 );
}
// startup-url on the URL for the app, wins over settings
String startupURL = Window.Location.getParameter( "startup-url" ); //$NON-NLS-1$
if ( startupURL != null && !"".equals( startupURL ) ) { //$NON-NLS-1$
// Spaces were double encoded so that they wouldn't be replaced with '+' when creating a deep
// link so when following a deep link we need to replace '%20' with a space even after decoding
String title = Window.Location.getParameter( "name" ).replaceAll( "%20", " " ); //$NON-NLS-1$
SolutionBrowserPanel.getInstance().getContentTabPanel().showNewURLTab( title, title, startupURL,
false );
}
}
} );
} catch ( RequestException e ) {
MessageDialogBox dialogBox =
new MessageDialogBox( Messages.getString( "error" ), e.getLocalizedMessage(), false, false, true ); //$NON-NLS-1$
dialogBox.center();
}
}
} );
} catch ( RequestException e ) {
MessageDialogBox dialogBox =
new MessageDialogBox( Messages.getString( "error" ), e.getLocalizedMessage(), false, false, true ); //$NON-NLS-1$
dialogBox.center();
}
if ( !StringUtils.isEmpty( startupPerspective ) ) {
if ( PerspectiveManager.getInstance().isLoaded() ) {
PerspectiveManager.getInstance().setPerspective( startupPerspective );