Package com.gentics.cr.configuration

Examples of com.gentics.cr.configuration.GenericConfiguration


  @Before
  public void setUp() throws Exception {
    bean = new CRResolvableBean();

    config = new GenericConfiguration();
    config.set("attribute", "content");
    config.set("langattribute", "lang");
    t = new LanguageIdentifyer(config);
  }
View Full Code Here


   * Get the names of all {@link RequestProcessor}s in this config.
   * @return Collection with the names of the {@link RequestProcessor}s
   */
  public final Collection<String> getRequestProcessorNames() {
    if (getSubConfigSize() > 0) {
      GenericConfiguration requestProcessorsConfigs = (GenericConfiguration) get(REQUEST_PROCESSOR_KEY);
      if (requestProcessorsConfigs != null) {
        ConcurrentHashMap<String, GenericConfiguration> requestProcessorTable = requestProcessorsConfigs
            .getSubConfigs();
        if (requestProcessorTable != null && !requestProcessorTable.isEmpty()) {
          return requestProcessorTable.keySet();
        }
      }
View Full Code Here

    EnvironmentConfiguration.loadCacheProperties();
  }
 
  @Before
  public void fill() throws CRException, FileNotFoundException, URISyntaxException {
    GenericConfiguration genericConf = new GenericConfiguration();
    try {
      URL confPath2 = new File(this.getClass().getResource("indexer.properties").toURI()).getParentFile().toURI().toURL();
      GenericConfigurationFileLoader.load(genericConf, confPath2.getPath() + "/indexer.properties");

    } catch (IOException e) {
      e.printStackTrace();
    }
    CRConfigUtil config = new CRConfigUtil(genericConf, "DEFAULT");

    GenericConfiguration sc = new GenericConfiguration();
    sc.set("indexLocations.1.path", "RAM_1");
    sc.set("indexLocationClass", "com.gentics.cr.lucene.indexer.index.LuceneSingleIndexLocation");

    CRConfig singleConfig1 = new CRConfigUtil(sc, "sc1");
    singleLoc1 = LuceneIndexLocation.getIndexLocation(singleConfig1);
   
   
View Full Code Here

  }

  @Before
  public void create() throws CRException,
      FileNotFoundException, URISyntaxException {
    GenericConfiguration genericConf = new GenericConfiguration();
    try {
      URL confPath2 = new File(this.getClass()
          .getResource("indexer.properties").toURI()).getParentFile()
          .toURI().toURL();
      GenericConfigurationFileLoader.load(genericConf,
          confPath2.getPath() + "/indexer.properties");
    } catch (IOException e) {
      e.printStackTrace();
    }
    CRConfigUtil config = new CRConfigUtil(genericConf, "DEFAULT");

    GenericConfiguration sc = new GenericConfiguration();
    sc.set("indexLocations.1.path", "RAM_1");
    sc.set("indexLocationClass",
        "com.gentics.cr.lucene.indexer.index.LuceneSingleIndexLocation");

    CRConfig singleConfig1 = new CRConfigUtil(sc, "sc1");
    singleLoc1 = LuceneIndexLocation.getIndexLocation(singleConfig1);
View Full Code Here

    EnvironmentConfiguration.loadCacheProperties();
  }
 
  @Before
  public void create() throws CRException, FileNotFoundException, URISyntaxException {
    GenericConfiguration genericConf = new GenericConfiguration();
    try {
      URL confPath2 = new File(this.getClass().getResource("indexer.properties").toURI()).getParentFile().toURI().toURL();
      GenericConfigurationFileLoader.load(genericConf, confPath2.getPath() + "/indexer.properties");
    } catch (IOException e) {
      e.printStackTrace();
    }
    CRConfigUtil config = new CRConfigUtil(genericConf, "DEFAULT");

    GenericConfiguration sc = new GenericConfiguration();
    sc.set("indexLocations.1.path", "RAM_1");
    sc.set("indexLocationClass", "com.gentics.cr.lucene.indexer.index.LuceneSingleIndexLocation");

    CRConfig singleConfig1 = new CRConfigUtil(sc, "sc1");
    singleLoc1 = LuceneIndexLocation.getIndexLocation(singleConfig1);
   
   
View Full Code Here

  /**
   * @param config - configuration containing the definition of the transformers
   * @return List of ContentTransformer defined in the confguration.
   */
  public static List<ContentTransformer> getTransformerList(final GenericConfiguration config) {
    GenericConfiguration tconf = (GenericConfiguration) config.get(TRANSFORMER_KEY);
    if (tconf != null) {
      Map<String, GenericConfiguration> confs = tconf.getSortedSubconfigs();
      if (confs != null && confs.size() > 0) {
        ArrayList<ContentTransformer> ret = new ArrayList<ContentTransformer>(confs.size());
        for (Map.Entry<String, GenericConfiguration> e : confs.entrySet()) {
          GenericConfiguration c = e.getValue();
          String transformerClass = (String) c.get(TRANSFORMER_CLASS_KEY);
          try {
            ContentTransformer t = null;
            t = (ContentTransformer) Class.forName(transformerClass).getConstructor(new Class[] { GenericConfiguration.class })
                .newInstance(c);
            if (t != null) {
View Full Code Here

        TRANSFORMER_SOURCE_ATTRIBUTE_KEY, "");
    targetAttribute = (String) config.getString(
        TRANSFORMER_TARGET_ATTRIBUTE_KEY, "");

    valueMap = new HashMap<String, String>();
    GenericConfiguration mappingsConf = (GenericConfiguration) config
        .get(TRANSFORMER_VALUE_MAPPINGS_KEY);

    if (mappingsConf != null) {
      Map<String, GenericConfiguration> mappingsMap = mappingsConf
          .getSortedSubconfigs();
      if (mappingsMap != null) {
        for (GenericConfiguration mapConf : mappingsMap.values()) {
          String source = mapConf.getString(
              TRANSFORMER_VALUE_MAPPING_SOURCE_KEY, "");
View Full Code Here

   * @param config
   */
  public FacetsSearch(CRConfig config) throws IllegalStateException {
    usefacets = config.getBoolean(FACETS_ENABLED_KEY, usefacets);
    if (usefacets) {
      GenericConfiguration subconf = (GenericConfiguration) config
          .get(FACETS_CONFIG_KEY);
      if (subconf != null) {
        facetdisplayordinal = subconf.getBoolean(
            FACETS_DISPLAY_ORDINAL_KEY, facetdisplayordinal);
        facetdisplaypath = subconf.getBoolean(FACETS_DISPLAY_PATH_KEY,
            facetdisplaypath);
        String delimiter = subconf.getString(FACETS_PATH_DELIMITER_KEY,
            "");
        facetpathdelimiter = (delimiter != null && !"".equals(delimiter)) ? delimiter.charAt(0)
            : DEFAULT_FACET_PATH_DELIMITER;
        facetnumbercategories = subconf.getInteger(
            FACET_NUMBER_OF_CATEGORIES_KEY,
            DEFAULT_FACET_NUMBER_OF_CATEGORIES);
      }
      log.debug("Facets enabled");
    } else {
View Full Code Here

  public DidYouMeanProvider(CRConfig config) {

    useDidyomeanIndexExtension = config.getBoolean(DIDYOUMEAN_USE_INDEX_EXTENSION, useDidyomeanIndexExtension);

    if (!useDidyomeanIndexExtension) {
      GenericConfiguration srcConf = (GenericConfiguration) config.get(SOURCE_INDEX_KEY);
      source = LuceneIndexLocation.createDirectory(new CRConfigUtil(srcConf, "SOURCE_INDEX_KEY"));
    }

    GenericConfiguration autoConf = (GenericConfiguration) config.get(DIDYOUMEAN_INDEX_KEY);
    CRConfigUtil dymConfUtil = new CRConfigUtil(autoConf, config.getName() + "." + DIDYOUMEAN_INDEX_KEY);
    didyoumeanLocation = LuceneIndexLocation.getIndexLocation(dymConfUtil);
    if (!useDidyomeanIndexExtension) {
      didyoumeanLocation.registerDirectoriesSpecial();
    }
View Full Code Here

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

    GenericConfiguration srcConf = (GenericConfiguration) config.get(SOURCE_INDEX_KEY);
    CRConfigUtil srcConfUtil = new CRConfigUtil(srcConf, "SOURCE_INDEX_KEY");
    if (srcConfUtil.getPropertySize() > 0) {
      sourceLocation = LuceneIndexLocation.getIndexLocation(srcConfUtil);
    }
    if (sourceLocation == null) {
      sourceLocation = (LuceneIndexLocation) callingLocation;
    }

    GenericConfiguration didyouConf = (GenericConfiguration) config.get(DIDYOUMEAN_INDEX_KEY);
    didyoumeanLocation = LuceneIndexLocation.getIndexLocation(new CRConfigUtil(didyouConf, DIDYOUMEAN_INDEX_KEY));
    didyoumeanLocation.registerDirectoriesSpecial();

    didyoumeanfield = config.getString(DIDYOUMEAN_FIELD_KEY, didyoumeanfield);
    minDScore = config.getFloat(DIDYOUMEAN_MIN_DISTANCESCORE, (float) 0.0);
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.