GwtCommandDispatcher.getInstance().execute(command, new CommandCallback() {
public void execute(CommandResponse r) {
stopProgress();
if (r instanceof PrintGetTemplateResponse) {
PrintGetTemplateResponse response = (PrintGetTemplateResponse) r;
GWT.log("Downloading " + response.getDocumentId(), null);
UrlBuilder url = new UrlBuilder(GWT.getHostPageBaseURL());
url.addPath("d/printing").addParameter("documentId", response.getDocumentId());
url.addParameter("name", (String) fileNameItem.getValue());
url.addParameter("userToken", command.getUserToken());
if ("save".equals(downloadTypeGroup.getValue())) {
url.addParameter("download", "1");
String encodedUrl = url.toString();