Package com.gentics.cr.configuration

Examples of com.gentics.cr.configuration.GenericConfiguration


  public AutocompleteIndexExtension(CRConfig config, IndexLocation callingLocation) {
    super(config, callingLocation);
    this.config = config;
    this.callingIndexLocation = callingLocation;

    GenericConfiguration src_conf = (GenericConfiguration) config.get(SOURCE_INDEX_KEY);
    CRConfigUtil src_conf_util = new CRConfigUtil(src_conf, "SOURCE_INDEX_KEY");
    if (src_conf_util.getPropertySize() > 0) {
      source = LuceneIndexLocation.getIndexLocation(src_conf_util);
    }
    if (source == null) {
      source = (LuceneIndexLocation) callingLocation;
    }

    GenericConfiguration autoConf = (GenericConfiguration) config.get(AUTOCOMPLETE_INDEX_KEY);
    autocompleteLocation = LuceneIndexLocation
        .getIndexLocation(new CRConfigUtil(autoConf, AUTOCOMPLETE_INDEX_KEY));
    autocompleteLocation.registerDirectoriesSpecial();

    String s_autofield = config.getString(AUTOCOMPLETE_FIELD_KEY);
View Full Code Here


  ContentTransformer t;

  @Before
  public void setUp() throws Exception {
    config = new GenericConfiguration();
    config.set("attribute", BINARY_ATTRIBUTE);

    t = new POIContentTransformer(config);
  }
View Full Code Here

 
  @Override
  protected void setUp() throws Exception {
    super.setUp();

    GenericConfiguration config = new GenericConfiguration();
    Properties p = new Properties();
    p.setProperty("MULTIPLICATORBOOST", "4.0");
    p.setProperty("BOOSTATTRIBUTE", "updatetimestamp");
    p.setProperty("TIMERANGE", "1296000"); // 15 days

    config.setProperties(p);

    crRequest = new CRRequest();
    lucene = new SimpleLucene();
    parser = new CRRecencyBoostingQueryParser(config,
          LuceneVersion.getVersion(), SEARCHED_ATTRIBUTES, STANDARD_ANALYZER, crRequest);
View Full Code Here

        "updatetimestamp:"+daysAgo30,
        "node_id:5")));
  }

  public void testHighlighting() throws ParseException, CorruptIndexException, IOException {
    GenericConfiguration hConfig = new GenericConfiguration();
    hConfig.set("rule", "1==1");
    hConfig.set("attribute", "content");
    hConfig.set("fragments", "5");
    hConfig.set("fragmentsize", "100");
    hConfig.set("highlightprefix", "<b>");
    hConfig.set("highlightpostfix", "</b>");
    hConfig.set("fragmentseperator", "...");


    AdvancedContentHighlighter advancedHighlighter = new WhitespaceVectorBolder(hConfig);
    int documentId = 0;
    Query pQuery = parser.parse("word1");
View Full Code Here

  /**
   * done in the same way as the parameter initialisation in the constructor
   * to avoid repeated code.
   */
  private void getDefaultParameters() {
    GenericConfiguration defaultparameters = null;
    if (this.config != null) {
      defaultparameters = (GenericConfiguration) this.config.get(DEFAULPARAMETERS_KEY);
    }
    if (defaultparameters != null) {
      if (this.node_id == null) {
        String defaultNode = defaultparameters.getString("node");
        if (defaultNode != null) {
          this.node_id = defaultNode.split("^");
        }
      }
      if (contentid == null) {
        contentid = defaultparameters.getString("contentid");
      }
      if (filter == null) {
        filter = defaultparameters.getString("filter");
      }
      if (wordmatch == null) {
        wordmatch = defaultparameters.getString("wm");
      }
      if (count == null) {
        count = defaultparameters.getString("ps");
      }
      if (start == null && count != null) {
        String numberOfPageStr = defaultparameters.getString("np");
        calcStartFromCount(numberOfPageStr);
      }
      addAdvancedSearchParameters();
    }
  }
View Full Code Here

  }


  @Test
  public void testUpdateFiles() throws CRException, FileNotFoundException, URISyntaxException {
    GenericConfiguration genericConf = new GenericConfiguration();
    try {
      URL confPath2 = new File(this.getClass().getResource("testOrder.properties").toURI()).getParentFile().toURI().toURL();
      GenericConfigurationFileLoader.load(genericConf, confPath2.getPath()+"/testOrder.properties");
    } catch (IOException e) {
      e.printStackTrace();
View Full Code Here

    InputStream stream = PDFHighlighterTest.class.getResourceAsStream("test.pdf");
    byte[] arr = IOUtils.toByteArray(stream);
    bean.set("binarycontent", arr);

    config = new GenericConfiguration();
    config.set("attribute", "binarycontent");
    analyzer = new StandardAnalyzer(LuceneVersion.getVersion());
    dir = new RAMDirectory();
    prepareIndex();
View Full Code Here

  }

  public void testVectorBolder() throws Exception {
    System.out.println("VECTOR");
    VectorBolder h = new VectorBolder(new GenericConfiguration());
    String ret = h.highlight(query, searcher.getIndexReader(), 0, "binarycontent");
    System.out.println(ret);

    assertTrue(ret != null && !"".equals(ret));
  }
View Full Code Here

    assertTrue(ret != null && !"".equals(ret));
  }

  public void testWhitespaceVectorBolder() throws Exception {
    System.out.println("WHITESPACEVECTOR");
    WhitespaceVectorBolder h = new WhitespaceVectorBolder(new GenericConfiguration());
    String ret = h.highlight(query, searcher.getIndexReader(), 0, "binarycontent");
    System.out.println(ret);

    assertTrue(ret != null && !"".equals(ret));
  }
View Full Code Here

    assertTrue(ret != null && !"".equals(ret));
  }

  public void testPhraseBolder2() throws Exception {
    System.out.println("PHRASE2");
    ContentHighlighter h = new PhraseBolder(new GenericConfiguration());
    CRResolvableBean crBean = new CRResolvableBean();
    crBean.set("binarycontent", "this is a test (AHSt)");
    String ret = h.highlight((String) crBean.get("binarycontent"), query);
    System.out.println(ret);
View Full Code Here

TOP

Related Classes of com.gentics.cr.configuration.GenericConfiguration

Copyright © 2018 www.massapicom. 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.