public MetadataRequestData(String url, BaseRequestItem request) throws ProcessingException { super(url, request, DEFAULT_METADATA_FIELDS); String lang = request.getParameter("language"); String country = request.getParameter("country"); this.locale = (lang != null && country != null) ? new Locale(lang, country) : (lang != null) ? new Locale(lang) : GadgetSpec.DEFAULT_LOCALE; this.ignoreCache = getBooleanParam(request, Param.NO_CACHE); this.debug = getBooleanParam(request, Param.DEBUG); this.renderingType = GadgetsHandler.getRenderingType(getParam(request, Param.RENDER_TYPE)); }
protected Callable<GadgetsHandlerApi.MetadataResponse> createMetadataJob(String url, BaseRequestItem request) { final MetadataRequestData metadataRequest = new MetadataRequestData(url, request); return new Callable<GadgetsHandlerApi.MetadataResponse>() { public GadgetsHandlerApi.MetadataResponse call() throws Exception { try { return handlerService.getMetadata(metadataRequest); } catch (Exception e) { sendError(metadataRequest.getUrl(), e, FAILURE_METADATA); return null; } } }; }
public String getView() { return getParam(request, Param.VIEW, "default"); }
protected Callable<GadgetsHandlerApi.MetadataResponse> createMetadataJob(String url, BaseRequestItem request) { final MetadataRequestData metadataRequest = new MetadataRequestData(url, request); return new Callable<GadgetsHandlerApi.MetadataResponse>() { public GadgetsHandlerApi.MetadataResponse call() throws Exception { try { return handlerService.getMetadata(metadataRequest); } catch (Exception e) { sendError(metadataRequest.getUrl(), e, FAILURE_METADATA); return null; } } }; }
protected Callable<CallableData> createMetadataJob(final String url, BaseRequestItem request) throws ProcessingException { final MetadataRequestData metadataRequest = new MetadataRequestData(url, request); return new Callable<CallableData>() { public CallableData call() throws Exception { try { return new CallableData(url, handlerService.getMetadata(metadataRequest)); } catch (Exception e) { return new CallableData(url, handlerService.createErrorResponse(null, e, FAILURE_METADATA)); } } }; }
public GadgetsHandlerApi.MetadataResponse call() throws Exception { try { return handlerService.getMetadata(metadataRequest); } catch (Exception e) { sendError(metadataRequest.getUrl(), e, FAILURE_METADATA); return null; } } };
public GadgetsHandlerApi.MetadataResponse call() throws Exception { try { return handlerService.getMetadata(metadataRequest); } catch (Exception e) { sendError(metadataRequest.getUrl(), e, FAILURE_METADATA); return null; } } };