当前位置: 首页>>代码示例>>Java>>正文


Java PrintGetTemplateRequest类代码示例

本文整理汇总了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);
				}
			});
}
 
开发者ID:geomajas,项目名称:geomajas-project-client-gwt2,代码行数:21,代码来源:PrintServiceImpl.java

示例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();
}
 
开发者ID:geomajas,项目名称:geomajas-project-client-gwt2,代码行数:26,代码来源:PrintServiceImplTest.java

示例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());
}
 
开发者ID:geomajas,项目名称:geomajas-project-server,代码行数:10,代码来源:PrintGetTemplateCommand.java

示例4: getEmptyCommandRequest

import org.geomajas.plugin.printing.command.dto.PrintGetTemplateRequest; //导入依赖的package包/类
@Override
public PrintGetTemplateRequest getEmptyCommandRequest() {
	return new PrintGetTemplateExtRequest();
}
 
开发者ID:geomajas,项目名称:geomajas-project-server,代码行数:5,代码来源:PrintGetTemplateCommand.java


注:本文中的org.geomajas.plugin.printing.command.dto.PrintGetTemplateRequest类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。