本文整理汇总了Java中org.geomajas.plugin.printing.command.dto.PrintGetTemplateRequest类的典型用法代码示例。如果您正苦于以下问题:Java PrintGetTemplateRequest类的具体用法?Java PrintGetTemplateRequest怎么用?Java PrintGetTemplateRequest使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PrintGetTemplateRequest类属于org.geomajas.plugin.printing.command.dto包,在下文中一共展示了PrintGetTemplateRequest类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: runAsync
import org.geomajas.plugin.printing.command.dto.PrintGetTemplateRequest; //导入依赖的package包/类
private void runAsync(final Callback<PrintFinishedInfo, Void> callback, PrintRequestInfo printRequestInfo) {
// prepare common url and parameters
final PrintFinishedInfo printFinishedInfo = prepareInfo(printRequestInfo);
// method = GET
printFinishedInfo.setMethod(HttpMethod.GET);
// run the command
PrintGetTemplateRequest request = new PrintGetTemplateRequest();
request.setTemplate(printRequestInfo.getPrintTemplateInfo());
final GwtCommand command = new GwtCommand(PrintGetTemplateRequest.COMMAND);
command.setCommandRequest(request);
GeomajasServerExtension.getInstance().getCommandService()
.execute(command, new AbstractCommandCallback<PrintGetTemplateResponse>() {
public void execute(PrintGetTemplateResponse response) {
// add the document id
printFinishedInfo.addParam(PrintUrlParameterKey.URL_DOCUMENT_ID, response.getDocumentId());
callback.onSuccess(printFinishedInfo);
}
});
}
示例2: printWithTemplateArgumentTest
import org.geomajas.plugin.printing.command.dto.PrintGetTemplateRequest; //导入依赖的package包/类
@Test
public void printWithTemplateArgumentTest() {
PrintTemplateInfo printTemplateInfo = new PrintTemplateInfo();
PrintRequestInfo createInfo = new PrintRequestInfo();
createInfo.setPrintTemplateInfo(printTemplateInfo);
createInfo.setFileName("test.pdf");
createInfo.setPostPrintAction(PostPrintAction.OPEN);
Callback<PrintFinishedInfo, Void> callbackMock = mock(Callback.class);
printService.print(createInfo, callbackMock);
ArgumentCaptor<GwtCommand> commandCaptor = ArgumentCaptor.forClass(GwtCommand.class);
ArgumentCaptor<CommandCallback> callbackCaptor = ArgumentCaptor.forClass(CommandCallback.class);
verify(commandServiceMock).execute(commandCaptor.capture(), callbackCaptor.capture());
// assert command
GwtCommand command = commandCaptor.getValue();
Assert.assertEquals(PrintGetTemplateRequest.COMMAND, command.getCommandName());
Assert.assertTrue(command.getCommandRequest() instanceof PrintGetTemplateRequest);
PrintGetTemplateRequest request = (PrintGetTemplateRequest) command.getCommandRequest();
Assert.assertEquals(printTemplateInfo, request.getTemplate());
// assert callback
//callbackCaptor.getValue().execute();
}
示例3: execute
import org.geomajas.plugin.printing.command.dto.PrintGetTemplateRequest; //导入依赖的package包/类
@Override
public void execute(PrintGetTemplateRequest request, PrintGetTemplateResponse response) throws Exception {
PrintGetTemplateExtRequest extRequest = new PrintGetTemplateExtRequest(request);
PrintGetTemplateExtResponse extResponse = new PrintGetTemplateExtResponse();
LayoutAsSinglePageDoc.execute(extRequest, extResponse, converterService, printService);
response.setDocumentId(extResponse.getDocumentId());
}
示例4: getEmptyCommandRequest
import org.geomajas.plugin.printing.command.dto.PrintGetTemplateRequest; //导入依赖的package包/类
@Override
public PrintGetTemplateRequest getEmptyCommandRequest() {
return new PrintGetTemplateExtRequest();
}