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


Java ResultSequence类代码示例

本文整理汇总了Java中com.marklogic.xcc.ResultSequence的典型用法代码示例。如果您正苦于以下问题:Java ResultSequence类的具体用法?Java ResultSequence怎么用?Java ResultSequence使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ResultSequence类属于com.marklogic.xcc包,在下文中一共展示了ResultSequence类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: runQueryAgainstDb

import com.marklogic.xcc.ResultSequence; //导入依赖的package包/类
public static ResultSequence runQueryAgainstDb(String xccUri, String query, String db)
    throws XccConfigException, URISyntaxException, RequestException {
    StringBuilder buf = new StringBuilder();
    buf.append("xdmp:eval('");
    buf.append(query);
    buf.append("',(),<options xmlns=\"xdmp:eval\">\n" + 
            "            <database>{xdmp:database(\"");
    buf.append(db);
    buf.append("\")}</database>\n" + 
            "          </options>)");
    ContentSource cs = csMap.get(xccUri);
    if (cs == null) {
        cs = ContentSourceFactory.newContentSource(new URI(
        xccUri));
        csMap.put(xccUri, cs);
    }
    session = cs.newSession();
    AdhocQuery aquery = session.newAdhocQuery(buf.toString());

    RequestOptions options = new RequestOptions();
    options.setCacheResult(false);
    options.setDefaultXQueryVersion("1.0-ml");
    aquery.setOptions(options);
    return session.submitRequest(aquery);
}
 
开发者ID:marklogic,项目名称:marklogic-contentpump,代码行数:26,代码来源:Utils.java

示例2: testImportEscapeQuoteInAttr

import com.marklogic.xcc.ResultSequence; //导入依赖的package包/类
@Test
public void testImportEscapeQuoteInAttr() throws Exception {
    String cmd = "IMPORT -host localhost -username admin -password"
        + " admin -input_file_path " + Constants.TEST_PATH.toUri()
        + "/agg/escapequote.xml"
        + " -thread_count 1 -aggregate_record_element parent"
        + " -input_file_type aggregates"
        + " -output_uri_prefix /data/ -output_uri_suffix .xml"
        + " -port " + Constants.port + " -database " + Constants.testDb;
    String[] args = cmd.split(" ");
    assertFalse(args.length == 0);

    Utils.clearDB(Utils.getTestDbXccUri(), Constants.testDb);

    String[] expandedArgs = null;
    expandedArgs = OptionsFileUtil.expandArguments(args);
    ContentPump.runCommand(expandedArgs);

    ResultSequence result = Utils.runQuery(
        Utils.getTestDbXccUri(), "fn:count(fn:collection())");
    assertTrue(result.hasNext());
    assertEquals("3", result.next().asString());
    Utils.closeSession();
}
 
开发者ID:marklogic,项目名称:marklogic-contentpump,代码行数:25,代码来源:TestImportAggregate.java

示例3: testEDFastRestrict

import com.marklogic.xcc.ResultSequence; //导入依赖的package包/类
@Test
public void testEDFastRestrict() throws Exception {
    String cmd = "IMPORT -password admin -username admin -host localhost"
            + " -input_file_path " + Constants.TEST_PATH.toUri() + "/wiki/AndorrA.xml"
            + " -port " + Constants.port + " -database " + Constants.testDb 
            + " -fastload -restrict_hosts";
    String[] args = cmd.split(" +");
    assertFalse(args.length == 0);

    Utils.clearDB(Utils.getTestDbXccUri(), Constants.testDb);
    String[] expandedArgs = null;
    expandedArgs = OptionsFileUtil.expandArguments(args);
    ContentPump.runCommand(expandedArgs);
    
    ResultSequence result = Utils.runQuery(
            Utils.getTestDbXccUri(),
            "fn:count(fn:collection())");
    assertTrue(result.hasNext());
    assertEquals("1", result.next().asString());
    Utils.closeSession();
    AssignmentManager.getInstance().setInitialized(false);
}
 
开发者ID:marklogic,项目名称:marklogic-contentpump,代码行数:23,代码来源:TestEDSeparation.java

示例4: testImportMedlineZip

import com.marklogic.xcc.ResultSequence; //导入依赖的package包/类
@Test
public void testImportMedlineZip() throws Exception {
    String cmd = "IMPORT -host localhost -username admin -password"
        + " admin -input_file_path " + Constants.TEST_PATH.toUri()
        + "/medlinezip/medline04.zip"
        + " -thread_count 2 -aggregate_uri_id PMID"
        + " -input_file_type aggregates -input_compressed -input_compressed true"
        + " -port " + Constants.port + " -database " + Constants.testDb;
    String[] args = cmd.split(" ");
    assertFalse(args.length == 0);

    Utils.clearDB(Utils.getTestDbXccUri(), Constants.testDb);

    String[] expandedArgs = null;
    expandedArgs = OptionsFileUtil.expandArguments(args);
    ContentPump.runCommand(expandedArgs);

    ResultSequence result = Utils.runQuery(
        Utils.getTestDbXccUri(), "fn:count(fn:collection())");
    assertTrue(result.hasNext());
    assertEquals("2", result.next().asString());
    Utils.closeSession();
}
 
开发者ID:marklogic,项目名称:marklogic-contentpump,代码行数:24,代码来源:TestImportAggregate.java

示例5: testBug44422JP

import com.marklogic.xcc.ResultSequence; //导入依赖的package包/类
@Test
public void testBug44422JP() throws Exception {
    String cmd =
            "IMPORT -host localhost -username admin -password admin"
            + " -input_file_path " + Constants.TEST_PATH.toUri() + "/delimitedText/44422JP.csv"
            + " -input_file_type delimited_text -split_input true -max_split_size 1000"
            + " -uri_id id -output_uri_prefix .xml"
            + " -port " + Constants.port + " -database " + Constants.testDb;
    String[] args = cmd.split(" ");
    assertFalse(args.length == 0);

    Utils.clearDB(Utils.getTestDbXccUri(), Constants.testDb);
    String[] expandedArgs = null;
    expandedArgs = OptionsFileUtil.expandArguments(args);
    ContentPump.runCommand(expandedArgs);
    ResultSequence result = Utils.runQuery(
            Utils.getTestDbXccUri(), "fn:count(fn:collection())");
    assertTrue(result.hasNext());
    assertEquals("900", result.next().asString());
    Utils.closeSession();
}
 
开发者ID:marklogic,项目名称:marklogic-contentpump,代码行数:22,代码来源:TestImportDelimitedText.java

示例6: testEscapedQuoteInAtrr

import com.marklogic.xcc.ResultSequence; //导入依赖的package包/类
@Test
public void testEscapedQuoteInAtrr() throws Exception {
    String cmd = "IMPORT -host localhost -username admin -password"
        + " admin -input_file_path " + Constants.TEST_PATH.toUri()
        + "/agg/21045.xml"
        + " -aggregate_record_element parent"
        + " -input_file_type aggregates"
        + " -output_uri_replace \"\\[,'',\\],'',:,''\""
        + " -port " + Constants.port + " -database " + Constants.testDb;
    String[] args = cmd.split(" ");
    assertFalse(args.length == 0);

    Utils.clearDB(Utils.getTestDbXccUri(), Constants.testDb);

    String[] expandedArgs = null;
    expandedArgs = OptionsFileUtil.expandArguments(args);
    ContentPump.runCommand(expandedArgs);

    ResultSequence result = Utils.runQuery(
        Utils.getTestDbXccUri(), "fn:count(fn:collection())");
    assertTrue(result.hasNext());
    assertEquals("3", result.next().asString());
    Utils.closeSession();
}
 
开发者ID:marklogic,项目名称:marklogic-contentpump,代码行数:25,代码来源:TestImportAggregate.java

示例7: runQuery

import com.marklogic.xcc.ResultSequence; //导入依赖的package包/类
public static ResultSequence runQuery(String xccUri, String query, String queryLanguage) 
        throws XccConfigException, URISyntaxException, RequestException {
    ContentSource cs = csMap.get(xccUri);
    if (cs == null) {
        cs = ContentSourceFactory.newContentSource(new URI(
        xccUri));
        csMap.put(xccUri, cs);
    }
    session = cs.newSession();
    AdhocQuery aquery = session.newAdhocQuery(query);

    RequestOptions options = new RequestOptions();
    options.setQueryLanguage(queryLanguage);
    options.setCacheResult(false);
    options.setDefaultXQueryVersion("1.0-ml");
    aquery.setOptions(options);
    return session.submitRequest(aquery);
}
 
开发者ID:marklogic,项目名称:marklogic-contentpump,代码行数:19,代码来源:Utils.java

示例8: testBug42027

import com.marklogic.xcc.ResultSequence; //导入依赖的package包/类
@Test
public void testBug42027() throws Exception {
    String cmd =
            "IMPORT -host localhost -username admin -password admin"
            + " -input_file_path " + Constants.TEST_PATH.toUri() + "/delimitedText/42027.csv"
            + " -fastload false -input_file_type delimited_text -document_type json"
            + " -split_input true -max_split_size 50 -generate_uri true"
            + " -port " + Constants.port + " -database " + Constants.testDb;
    String[] args = cmd.split(" ");
    assertFalse(args.length == 0);

    Utils.clearDB(Utils.getTestDbXccUri(), Constants.testDb);
    String[] expandedArgs = null;
    expandedArgs = OptionsFileUtil.expandArguments(args);
    ContentPump.runCommand(expandedArgs);

    ResultSequence result = Utils.runQuery(
            Utils.getTestDbXccUri(), "fn:count(fn:collection())");
    assertTrue(result.hasNext());
    assertEquals("1000", result.next().asString());
    Utils.closeSession();
}
 
开发者ID:marklogic,项目名称:marklogic-contentpump,代码行数:23,代码来源:TestImportDelimitedText.java

示例9: testBug19403_1

import com.marklogic.xcc.ResultSequence; //导入依赖的package包/类
@Test
public void testBug19403_1() throws Exception {
    String cmd = "IMPORT -host localhost -username admin -password"
        + " admin -input_file_path " + Constants.TEST_PATH.toUri()
        + "/archive/wiki-000001.zip"
        + " -input_file_type archive"
        + " -port " + Constants.port + " -database " + Constants.testDb;
    String[] args = cmd.split(" ");
    assertFalse(args.length == 0);

    Utils.clearDB(Utils.getTestDbXccUri(), Constants.testDb);

    String[] expandedArgs = null;
    expandedArgs = OptionsFileUtil.expandArguments(args);
    ContentPump.runCommand(expandedArgs);

    ResultSequence result = Utils.runQuery(
        Utils.getTestDbXccUri(), "fn:count(fn:collection())");
    assertTrue(result.hasNext());
    assertEquals("0", result.next().asString());
    Utils.closeSession();
}
 
开发者ID:marklogic,项目名称:marklogic-contentpump,代码行数:23,代码来源:TestImportArchive.java

示例10: testImportText

import com.marklogic.xcc.ResultSequence; //导入依赖的package包/类
@Test
public void testImportText() throws Exception {
    String cmd = 
        "IMPORT -password admin -username admin -host localhost"
        + " -input_file_path " + Constants.TEST_PATH.toUri() + "/wiki/AbacuS.xml"
        + " -thread_count 1 -output_uri_prefix ABC"
        + " -fastload"
        + " -output_collections test,ML -document_type text"
        + " -port " + Constants.port + " -database " + Constants.testDb;
    String[] args = cmd.split(" +");
    assertFalse(args.length == 0);

    Utils.clearDB(Utils.getTestDbXccUri(), Constants.testDb);

    String[] expandedArgs = null;
    expandedArgs = OptionsFileUtil.expandArguments(args);
    ContentPump.runCommand(expandedArgs);

    ResultSequence result = Utils.runQuery(
        Utils.getTestDbXccUri(), "fn:count(fn:collection())");
    assertTrue(result.hasNext());
    assertEquals("1", result.next().asString());
    Utils.closeSession();
    AssignmentManager.getInstance().setInitialized(false);
}
 
开发者ID:marklogic,项目名称:marklogic-contentpump,代码行数:26,代码来源:TestImportDocs.java

示例11: testBadXML

import com.marklogic.xcc.ResultSequence; //导入依赖的package包/类
public void testBadXML() throws Exception {
    String cmd = "IMPORT -host localhost -username admin -password"
        + " admin -input_file_path " + Constants.TEST_PATH.toUri()
        + "/agg/bad.xml"
        + " -aggregate_record_element r"
        + " -input_file_type aggregates"
        + " -port " + Constants.port + " -database " + Constants.testDb;
    String[] args = cmd.split(" ");
    assertFalse(args.length == 0);

    Utils.clearDB(Utils.getTestDbXccUri(), Constants.testDb);

    String[] expandedArgs = null;
    expandedArgs = OptionsFileUtil.expandArguments(args);
    ContentPump.runCommand(expandedArgs);

    ResultSequence result = Utils.runQuery(
        Utils.getTestDbXccUri(), "fn:count(fn:collection())");
    assertTrue(result.hasNext());
    assertEquals("2", result.next().asString());
    Utils.closeSession();
}
 
开发者ID:marklogic,项目名称:marklogic-contentpump,代码行数:23,代码来源:TestImportAggregate.java

示例12: testImportTransform25444

import com.marklogic.xcc.ResultSequence; //导入依赖的package包/类
@Test
public void testImportTransform25444() throws Exception {
    Utils.prepareModule(Utils.getTestDbXccUri(), "/trans.xqy");
    String cmd = 
        "IMPORT -password admin -username admin -host localhost"
        + " -input_file_path " + Constants.TEST_PATH.toUri() + "/foo.0"
        + " -transform_namespace dmc"
        + " -transform_module /trans.xqy"
        + " -port " + Constants.port + " -database " + Constants.testDb;
    String[] args = cmd.split(" +");
    assertFalse(args.length == 0);

    Utils.clearDB(Utils.getTestDbXccUri(), Constants.testDb);

    String[] expandedArgs = null;
    expandedArgs = OptionsFileUtil.expandArguments(args);
    ContentPump.runCommand(expandedArgs);

    ResultSequence result = Utils.runQuery(
        Utils.getTestDbXccUri(), "fn:count(fn:collection())");
    assertTrue(result.hasNext());
    assertEquals("1", result.next().asString());
    Utils.closeSession();
}
 
开发者ID:marklogic,项目名称:marklogic-contentpump,代码行数:25,代码来源:TestImportDocs.java

示例13: testImportXML

import com.marklogic.xcc.ResultSequence; //导入依赖的package包/类
@Test
public void testImportXML() throws Exception {
    String cmd = 
        "IMPORT -password admin -username admin -host localhost"
        + " -input_file_path " + Constants.TEST_PATH.toUri() + "/wiki"
        + " -thread_count 1 -output_uri_prefix ABC"
        + " -output_collections test,ML -document_type XML"
        + " -input_file_pattern ^A.*"
        + " -port " + Constants.port + " -database " + Constants.testDb;
    String[] args = cmd.split(" +");
    assertFalse(args.length == 0);

    Utils.clearDB(Utils.getTestDbXccUri(), Constants.testDb);

    String[] expandedArgs = null;
    expandedArgs = OptionsFileUtil.expandArguments(args);
    ContentPump.runCommand(expandedArgs);

    ResultSequence result = Utils.runQuery(
        Utils.getTestDbXccUri(), "fn:count(fn:collection())");
    assertTrue(result.hasNext());
    assertEquals("89", result.next().asString());
    Utils.closeSession();
}
 
开发者ID:marklogic,项目名称:marklogic-contentpump,代码行数:25,代码来源:TestImportDocs.java

示例14: testIDWithNS

import com.marklogic.xcc.ResultSequence; //导入依赖的package包/类
@Test
public void testIDWithNS() throws Exception {
    String cmd = "IMPORT -host localhost -username admin -password"
        + " admin -input_file_path " + Constants.TEST_PATH.toUri()
        + "/agg/31691.xml"
        + " -aggregate_record_element item"
        + " -uri_id post_id -thread_count 1"
        + " -input_file_type aggregates"
        + " -port " + Constants.port + " -database " + Constants.testDb;
    String[] args = cmd.split(" ");
    assertFalse(args.length == 0);

    Utils.clearDB(Utils.getTestDbXccUri(), Constants.testDb);

    String[] expandedArgs = null;
    expandedArgs = OptionsFileUtil.expandArguments(args);
    ContentPump.runCommand(expandedArgs);

    ResultSequence result = Utils.runQuery(
        Utils.getTestDbXccUri(), "fn:count(fn:collection())");
    assertTrue(result.hasNext());
    assertEquals("2", result.next().asString());
    Utils.closeSession();
}
 
开发者ID:marklogic,项目名称:marklogic-contentpump,代码行数:25,代码来源:TestImportAggregate.java

示例15: testImportMixedDocsZipHTTP

import com.marklogic.xcc.ResultSequence; //导入依赖的package包/类
@Test
public void testImportMixedDocsZipHTTP() throws Exception {
    System.setProperty("xcc.httpcompliant", "true");
    String cmd = 
        "IMPORT -password admin -username admin -host localhost"
        + " -input_file_path " + Constants.TEST_PATH.toUri() + "/wiki.zip" //"/space/tmp/cpox/tmp/WikiToZip-00000080.zip"
        + " -thread_count 4 "
        + " -input_compressed -input_compression_codec zip"
        + " -output_collections test,ML"
        + " -port " + Constants.port + " -database " + Constants.testDb;
    String[] args = cmd.split(" +");
    assertFalse(args.length == 0);

    Utils.clearDB(Utils.getTestDbXccUri(), Constants.testDb);

    String[] expandedArgs = null;
    expandedArgs = OptionsFileUtil.expandArguments(args);
    ContentPump.runCommand(expandedArgs);

    ResultSequence result = Utils.runQuery(
        Utils.getTestDbXccUri(),
        "fn:count(fn:collection(\"test\"))");
    assertTrue(result.hasNext());
    assertEquals("93", result.next().asString());
    Utils.closeSession();
}
 
开发者ID:marklogic,项目名称:marklogic-contentpump,代码行数:27,代码来源:TestImportDocs.java


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