Examples of GetDocumentRequest


Examples of com.bluetangstudio.searchcloud.client.request.GetDocumentRequest

            URI.create("http://localhost:" + port), "apikey"
        );

        UserModelId modelId = new UserModelId(new UserId("test"), "testGetDocument");
        DocumentId docId = new DocumentId(10);
        Document document = client.getDocument(new GetDocumentRequest(modelId, docId));

        Assert.assertNotNull(document);
        Assert.assertEquals(document.getId(), docId);
    }
View Full Code Here

Examples of com.bluetangstudio.searchcloud.client.request.GetDocumentRequest

*/
public class GetDocumentRequestBuilderTest extends RequestBuilderTestBase {

    @Test
    public void buildHttpUriRequest() {
        GetDocumentRequest get = new GetDocumentRequest("GetDocumentRequestBuilderTest", 1);
        setTrackingVariables(get);
        get.setFields("fields");

        GetDocumentRequestBuilder builder = new GetDocumentRequestBuilder();
        HttpUriRequest httpUriRequest = builder.build(get);

        Assert.assertEquals(httpUriRequest.getClass(), HttpGet.class);
        Assert.assertEquals(httpUriRequest.getURI().getPath(), "/rest/1.0/model/GetDocumentRequestBuilderTest/doc/1");
        Map<String, String> params = parseQueryParams(httpUriRequest);

        assertContainsTrackingVariables(params);
        Assert.assertEquals(params.get("fl"), get.getFields());
    }
View Full Code Here

Examples of com.bluetangstudio.searchcloud.client.request.GetDocumentRequest

    @Test
    public void testGetDocument() throws IOException, ServiceException {

        RestSearchCloudClient client = buildMockRestSearchCloudClient();
        String modelId = "test_GetDocument";
        client.getDocument(new GetDocumentRequest(modelId, 10));

    }
View Full Code Here

Examples of com.bluetangstudio.searchcloud.client.request.GetDocumentRequest

    }

    /** {@inheritDoc} */
    @Override
    public final T getDocument(String modelId, int documentId) throws IOException, ServiceException {
        return getDocument(new GetDocumentRequest(modelId, documentId));
    }
View Full Code Here

Examples of com.bluetangstudio.searchcloud.client.request.GetDocumentRequest

    public void testGetDocument() throws IOException, ServiceException {

        RestSearchCloudClient<Document> client = new RestSearchCloudClient<Document>(new DefaultHttpClientFactory(), getUri(), "apikey");

        String modelId = "test_GetDocument";
        Document document = client.getDocument(new GetDocumentRequest(modelId, 10));

        Assert.assertNotNull(document);
        Assert.assertEquals(document.getId(), new Integer(10));
    }
View Full Code Here

Examples of com.esri.gpt.catalog.arcims.GetDocumentRequest

      // determine the acl
      ImsMetadataAdminDao adminDao = new ImsMetadataAdminDao(getRequestContext());
      String acl = adminDao.queryAclByUUID(uuid);
     
      // determine the xml and update date
      GetDocumentRequest ims = new GetDocumentRequest(getRequestContext(),publisher);
      ims.executeGet(uuid);
      Timestamp updateDate = ims.getUpdateDate();
      String xml = ims.getXml();
     
      // build the schema
      MetadataDocument mdDoc = new MetadataDocument();
      Schema schema = mdDoc.prepareForView(getRequestContext(),xml);
     
View Full Code Here

Examples of com.esri.gpt.catalog.arcims.GetDocumentRequest

                                   Publisher publisher,
                                   String uuid)
    throws ImsServiceException, SchemaException {
   
    try {
      GetDocumentRequest imsRequest = new GetDocumentRequest(context,publisher);
      imsRequest.executeGet(uuid);
      String sXml = imsRequest.getXml();
      Document dom = loadDom(sXml);
      String sEnclosedXml = lookForEnclosure(dom);
      if (sEnclosedXml.length() > 0) {
        return sEnclosedXml;
      } else {
View Full Code Here

Examples of com.esri.gpt.catalog.arcims.GetDocumentRequest

  public Schema prepareForEdit(RequestContext context,
                               Publisher publisher,
                               String uuid)
    throws ImsServiceException, SchemaException {
    try {
      GetDocumentRequest imsRequest = new GetDocumentRequest(context,publisher);
      imsRequest.executeGet(uuid);
      String sXml = imsRequest.getXml();
      return evaluateSchema(context,sXml,true);   
    } catch (TransformerException e) {
      throw new SchemaException("Unable to transform document.",e);
    }
  }
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.