Examples of ViewRequest


Examples of com.couchbase.client.core.message.view.ViewRequest

        return request;
    }

    @Override
    protected CouchbaseResponse decodeResponse(final ChannelHandlerContext ctx, final HttpObject msg) throws Exception {
        ViewRequest request = currentRequest();
        CouchbaseResponse response = null;

        if (msg instanceof HttpResponse) {
            responseHeader = (HttpResponse) msg;
View Full Code Here

Examples of com.opengamma.web.analytics.ViewRequest

    ArgumentChecker.notEmpty(clientId, "clientId");
    boolean blotterColumns = blotter == null ? false : blotter;
    List<MarketDataSpecification> marketDataSpecs = MarketDataSpecificationJsonReader.buildSpecifications(marketDataProviders);
    VersionCorrection versionCorrection = VersionCorrection.of(parseInstant(portfolioVersionTime),
                                                               parseInstant(portfolioCorrectionTime));
    ViewRequest viewRequest = new ViewRequest(UniqueId.parse(viewDefinitionId), aggregators, marketDataSpecs,
                                              parseInstant(valuationTime), versionCorrection, blotterColumns);
    String viewId = Long.toString(s_nextViewId.getAndIncrement());
    URI portfolioGridUri = uriInfo.getAbsolutePathBuilder()
        .path(viewId)
        .path(ViewResource.class, "getPortfolioGrid")
View Full Code Here

Examples of com.opengamma.web.analytics.ViewRequest

    boolean blotterColumns = blotter == null ? false : blotter;
    List<MarketDataSpecification> marketDataSpecs =
        MarketDataSpecificationJsonReader.buildSpecifications(marketDataProviders);
    VersionCorrection versionCorrection = VersionCorrection.of(parseInstant(portfolioVersionTime),
                                                               parseInstant(portfolioCorrectionTime));
    ViewRequest viewRequest = new ViewRequest(UniqueId.parse(viewDefinitionId), aggregators, marketDataSpecs,
                                              parseInstant(valuationTime), versionCorrection, blotterColumns);
    String viewId = Long.toString(s_nextViewId.getAndIncrement());
    URI portfolioGridUri = uriInfo.getAbsolutePathBuilder()
        .path(viewId)
        .path("portfolio")
View Full Code Here

Examples of org.elasticsearch.action.view.ViewRequest

        );
    }

    @Test
    public void testDefaultView() throws Exception {
        ViewResponse response = esSetup.client().execute(ViewAction.INSTANCE, new ViewRequest("catalog", "product", "1")).get();
        assertEquals("Rendering the document #1 in version 1 of type product from index catalog", new String(response.content(), "UTF-8"));
    }
View Full Code Here

Examples of org.elasticsearch.action.view.ViewRequest

        assertEquals("Rendering the document #1 in version 1 of type product from index catalog", new String(response.content(), "UTF-8"));
    }

    @Test
    public void testFullView() throws Exception {
        ViewResponse response = esSetup.client().execute(ViewAction.INSTANCE, new ViewRequest("catalog", "product", "2").format("full")).get();
        assertEquals("<div id=\"product-2\"><h2>Detail of 1952 ALPINE RENAULT 1300</h2><p>Year: 1952, price: 98.58€</p><p>Turnable front wheels; steering function; detailed interior; detailed engine; opening hood; opening trunk; opening doors; and detailed chassis.</p><p>© Copyright Renault</p></div>", new String(response.content(), "UTF-8"));
    }
View Full Code Here

Examples of org.elasticsearch.action.view.ViewRequest

        assertEquals("<div id=\"product-2\"><h2>Detail of 1952 ALPINE RENAULT 1300</h2><p>Year: 1952, price: 98.58€</p><p>Turnable front wheels; steering function; detailed interior; detailed engine; opening hood; opening trunk; opening doors; and detailed chassis.</p><p>© Copyright Renault</p></div>", new String(response.content(), "UTF-8"));
    }

    @Test
    public void testBinaryView() throws Exception {
        ViewResponse response = esSetup.client().execute(ViewAction.INSTANCE, new ViewRequest("catalog", "product", "1").format("logo")).get();
        assertNotNull(response.content());
        assertEquals(0, response.content().length);

        response = esSetup.client().execute(ViewAction.INSTANCE, new ViewRequest("catalog", "product", "2").format("logo")).get();
        assertNotNull(response.content());
        assertEquals(61752, response.content().length);
    }
View Full Code Here

Examples of org.elasticsearch.action.view.ViewRequest

    }

    @Test
    public void testUndefinedView() throws Exception {
        try {
            ViewResponse response = esSetup.client().execute(ViewAction.INSTANCE, new ViewRequest("catalog", "product", "1").format("undefined")).get();
            fail("Exception expected!");
        } catch (Exception e) {
            assertEquals("org.elasticsearch.view.exception.ElasticSearchViewNotFoundException: No view [undefined] found for document type [product]", e.getMessage());
        }
    }
View Full Code Here

Examples of org.elasticsearch.action.view.ViewRequest

                        "        }\n" +
                        "    }\n" +
                        "}")
        );

        ViewResponse response = esSetup.client().execute(ViewAction.INSTANCE, new ViewRequest("catalog", "list-of-products-by-size", "1:10")).get();
        assertEquals(fromClassPath("org/elasticsearch/test/integration/views/config/views/list-of-products.html").toString(), new String(response.content(), "UTF-8"));
    }
View Full Code Here

Examples of org.elasticsearch.action.view.ViewRequest

                                "        }\n" +
                                "    }\n" +
                                "}")
        );

        ViewResponse response = esSetup.client().execute(ViewAction.INSTANCE, new ViewRequest("web", "pages", "home")).get();
        assertEquals(fromClassPath("org/elasticsearch/test/integration/views/config/views/list-of-products-with-brands.html").toString(), new String(response.content(), "UTF-8"));
    }
View Full Code Here

Examples of org.elasticsearch.action.view.ViewRequest

        controller.registerHandler(GET, "/_view/{index}/{type}/{id}", this);
        controller.registerHandler(GET, "/_view/{index}/{type}/{id}/{format}", this);
    }

    public void handleRequest(final RestRequest request, final RestChannel channel) {
        ViewRequest viewRequest = new ViewRequest(request.param("index"), request.param("type"), request.param("id"));
        if (request.hasParam("format")) {
            viewRequest.format(request.param("format"));
        }

        // we just send a response, no need to fork
        viewRequest.listenerThreaded(false);
        // we don't spawn, then fork if local
        viewRequest.operationThreaded(true);

        client.execute(ViewAction.INSTANCE, viewRequest, new ActionListener<ViewResponse>() {

            public void onResponse(ViewResponse response) {
                try {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.