use of org.pentaho.mantle.client.csrf.CsrfRequestBuilder in project pentaho-platform by pentaho.
the class PurgeMondrianSchemaCacheCommand method performOperation.
protected void performOperation() {
String url = GWT.getHostPageBaseURL() + "api/system/refresh/mondrianSchemaCache";
RequestBuilder requestBuilder = new CsrfRequestBuilder(RequestBuilder.GET, url);
requestBuilder.setHeader("If-Modified-Since", "01 Jan 1970 00:00:00 GMT");
requestBuilder.setHeader("accept", "text/plain");
try {
requestBuilder.sendRequest(null, new RequestCallback() {
public void onError(Request request, Throwable exception) {
// showError(exception);
}
public void onResponseReceived(Request request, Response response) {
MessageDialogBox dialogBox = new MessageDialogBox(Messages.getString("info"), Messages.getString("mondrianSchemaCacheFlushedSuccessfully"), false, false, true);
dialogBox.center();
}
});
} catch (RequestException e) {
Window.alert(e.getMessage());
// showError(e);
}
}
use of org.pentaho.mantle.client.csrf.CsrfRequestBuilder in project pentaho-platform by pentaho.
the class RefreshMetaDataCommand method performOperation.
protected void performOperation() {
// $NON-NLS-1$
final String url = GWT.getHostPageBaseURL() + "api/system/refresh/metadata";
RequestBuilder requestBuilder = new CsrfRequestBuilder(RequestBuilder.GET, url);
requestBuilder.setHeader("accept", "text/plain");
requestBuilder.setHeader("If-Modified-Since", "01 Jan 1970 00:00:00 GMT");
try {
requestBuilder.sendRequest(null, new RequestCallback() {
public void onError(Request request, Throwable exception) {
// showError(exception);
}
public void onResponseReceived(Request request, Response response) {
MessageDialogBox dialogBox = // $NON-NLS-1$
new MessageDialogBox(Messages.getString("info"), response.getText(), true, false, true);
dialogBox.center();
}
});
} catch (RequestException e) {
Window.alert(e.getMessage());
// showError(e);
}
}
use of org.pentaho.mantle.client.csrf.CsrfRequestBuilder in project pentaho-platform by pentaho.
the class SchedulesPanel method openOutputLocation.
private void openOutputLocation(final String outputLocation) {
PerspectiveManager.getInstance().setPerspective(PerspectiveManager.BROWSER_PERSPECTIVE);
String url = GWT.getHostPageBaseURL() + "api/mantle/session-variable?key=scheduler_folder&value=" + outputLocation;
RequestBuilder executableTypesRequestBuilder = new CsrfRequestBuilder(RequestBuilder.POST, url);
try {
executableTypesRequestBuilder.sendRequest(null, EmptyRequestCallback.getInstance());
} catch (RequestException e) {
// IGNORE
}
GenericEvent event = new GenericEvent();
event.setEventSubType("RefreshFolderEvent");
event.setStringParam(outputLocation);
EventBusUtil.EVENT_BUS.fireEvent(event);
}
use of org.pentaho.mantle.client.csrf.CsrfRequestBuilder in project pentaho-platform by pentaho.
the class CollapseBrowserCommand method performOperation.
protected void performOperation(boolean feedback) {
final SolutionBrowserPanel solutionBrowserPerspective = SolutionBrowserPanel.getInstance();
if (!solutionBrowserPerspective.isNavigatorShowing()) {
PerspectiveManager.getInstance().setPerspective(PerspectiveManager.OPENED_PERSPECTIVE);
}
solutionBrowserPerspective.setNavigatorShowing(false);
String url = GWT.getHostPageBaseURL() + "api/user-settings/MANTLE_SHOW_NAVIGATOR";
RequestBuilder builder = new CsrfRequestBuilder(RequestBuilder.POST, url);
try {
builder.setHeader("If-Modified-Since", "01 Jan 1970 00:00:00 GMT");
builder.sendRequest("false", EmptyRequestCallback.getInstance());
} catch (RequestException e) {
// showError(e);
}
}
use of org.pentaho.mantle.client.csrf.CsrfRequestBuilder in project pentaho-platform by pentaho.
the class PurgeReportingDataCacheCommand method performOperation.
protected void performOperation() {
// $NON-NLS-1$
final String url = GWT.getHostPageBaseURL() + "api/system/refresh/reportingDataCache";
RequestBuilder requestBuilder = new CsrfRequestBuilder(RequestBuilder.GET, url);
requestBuilder.setHeader("accept", "text/plain");
requestBuilder.setHeader("If-Modified-Since", "01 Jan 1970 00:00:00 GMT");
try {
requestBuilder.sendRequest(null, new RequestCallback() {
public void onError(Request request, Throwable exception) {
// showError(exception);
}
public void onResponseReceived(Request request, Response response) {
MessageDialogBox dialogBox = new MessageDialogBox(Messages.getString("info"), Messages.getString("reportingDataCacheFlushedSuccessfully"), false, false, // $NON-NLS-1$ //$NON-NLS-2$
true);
dialogBox.center();
}
});
} catch (RequestException e) {
Window.alert(e.getMessage());
// showError(e);
}
}
Aggregations