use of org.pentaho.mantle.client.dialogs.scheduling.ScheduleOutputLocationDialog in project pentaho-platform by pentaho.
the class AdhocRunInBackgroundCommand method showDialog.
@Override
protected void showDialog(final boolean feedback) {
final ScheduleOutputLocationDialog outputLocationDialog = new ScheduleOutputLocationDialog(getSolutionPath()) {
@Override
protected void onSelect(final String name, final String outputPath, String useWorkerNodes, final boolean overwriteFile, final String dateFormat) {
setOutputName(name);
setOutputLocationPath(outputPath);
setUseWorkerNodes(useWorkerNodes);
setOverwriteFile(String.valueOf(overwriteFile));
setDateFormat(dateFormat);
performOperation(feedback);
}
@Override
protected void onCancel() {
super.onCancel();
AdhocRunInBackgroundCommand.onCancel();
}
@Override
protected void onOk() {
super.onOk();
AdhocRunInBackgroundCommand.onOk(getOutputLocationPath());
}
@Override
protected void onAttach() {
super.onAttach();
AdhocRunInBackgroundCommand.onAttach();
}
};
outputLocationDialog.setOkButtonText(Messages.getString("ok"));
outputLocationDialog.setScheduleNameText(Messages.getString("scheduleNameColonReportviewer"));
outputLocationDialog.center();
}
use of org.pentaho.mantle.client.dialogs.scheduling.ScheduleOutputLocationDialog in project pentaho-platform by pentaho.
the class RunInBackgroundCommand method showDialog.
protected void showDialog(final boolean feedback) {
final ScheduleOutputLocationDialog outputLocationDialog = new ScheduleOutputLocationDialog(solutionPath) {
@Override
protected void onSelect(final String name, final String outputLocationPath, final String useWorkerNodes, final boolean overwriteFile, final String dateFormat) {
setOutputName(name);
setOutputLocationPath(outputLocationPath);
setUseWorkerNodes(useWorkerNodes);
setOverwriteFile(String.valueOf(overwriteFile));
setDateFormat(dateFormat);
performOperation(feedback);
}
};
final String filePath = solutionPath;
String urlPath = NameUtils.URLEncode(NameUtils.encodeRepositoryPath(filePath));
RequestBuilder scheduleFileRequestBuilder = createParametersChecker(urlPath);
final boolean isXAction = isXAction(urlPath);
try {
scheduleFileRequestBuilder.sendRequest(null, new RequestCallback() {
public void onError(Request request, Throwable exception) {
MessageDialogBox dialogBox = // $NON-NLS-1$
new MessageDialogBox(Messages.getString("error"), exception.toString(), false, false, true);
dialogBox.center();
}
public void onResponseReceived(Request request, Response response) {
if (response.getStatusCode() == Response.SC_OK) {
String responseMessage = response.getText();
boolean hasParams = hasParameters(responseMessage, isXAction);
if (!hasParams) {
outputLocationDialog.setOkButtonText(Messages.getString("ok"));
}
outputLocationDialog.center();
} else {
MessageDialogBox dialogBox = new MessageDialogBox(Messages.getString("error"), Messages.getString("serverErrorColon") + " " + response.getStatusCode(), false, false, // $NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
true);
dialogBox.center();
}
}
});
} catch (RequestException e) {
MessageDialogBox dialogBox = // $NON-NLS-1$
new MessageDialogBox(Messages.getString("error"), e.toString(), false, false, true);
dialogBox.center();
}
}
Aggregations