/** * {@inheritDoc} */ @Override public boolean execute(IActionHandler actionHandler, Map<String, Object> context) { RemoteFileDownloadCommand fileDownloadCommand = new RemoteFileDownloadCommand(); fileDownloadCommand.setFileFilter(translateFilter(getFileFilter(context), context)); String fileName = getFileName(context); fileDownloadCommand.setDefaultFileName(fileName); IFileSaveCallback callback = getFileSaveCallback(context); String resourceId = ResourceManager.getInstance().register( new ResourceAdapter(fileName, getContentType(), callback, actionHandler, context)); fileDownloadCommand.setResourceId(resourceId); fileDownloadCommand.setFileUrl(ResourceProviderServlet .computeDownloadUrl(resourceId)); IView<RComponent> view = getView(context); RAction cancelCallbackAction = getActionFactory(context).createAction( getFileCancelCallbackAction(context), actionHandler, view, getLocale(context)); fileDownloadCommand.setCancelCallbackAction(cancelCallbackAction); registerCommand(fileDownloadCommand, context); return super.execute(actionHandler, context); }