Package com.gentics.cr.configuration

Examples of com.gentics.cr.configuration.GenericConfiguration


   * @return searchQuery as String, with added synonyms
   * @throws IOException when theres a problem with accessing the Index
   */
  public final String includeSynonyms(String query) throws IOException {
   
    GenericConfiguration autoConf = (GenericConfiguration) config.get("synonymlocation");
    LuceneIndexLocation synonymLocation = LuceneIndexLocation
        .getIndexLocation(new CRConfigUtil(autoConf, "synonymlocation"));
   
   
    IndexAccessor ia = synonymLocation.getAccessor();
View Full Code Here


   * @param configurationKey - configuration key to use.
   * @return HashMap with attribute name and their expressions.
   */
  private HashMap<String, EvaluableExpression> initAttributeDefintion(final String configurationKey) {
    HashMap<String, EvaluableExpression> attributeDefinition = new HashMap<String, EvaluableExpression>();
    GenericConfiguration attributesConfig = crConfig.getSubConfigs().get(configurationKey);
    if (attributesConfig != null) {
      for (Object attributeNameObject : attributesConfig.getProperties().keySet()) {
        String attributeName = (String) attributeNameObject;
        String attributeValue = (String) attributesConfig.get(attributeName);
        try {
          EvaluableExpression attributeExpression = (EvaluableExpression) ExpressionParserHelper
              .parse(attributeValue);
          attributeDefinition.put(attributeName, attributeExpression);
        } catch (ParserException e) {
View Full Code Here

    String indexLocationClassName = config.getString(INDEX_LOCATION_CLASS_KEY);
    Class<? extends IndexLocation> indexLocationClass = null;
    if (indexLocationClassName == null) {
      Object indexesObject = config.get(CRConfig.CR_KEY);
      if (indexesObject != null && indexesObject instanceof GenericConfiguration) {
        GenericConfiguration indexes = (GenericConfiguration) config.get(CRConfig.CR_KEY);
        for (Entry<String, GenericConfiguration> subConfigEntry : indexes.getSubConfigs().entrySet()) {
          String subConfigKey = subConfigEntry.getKey();
          GenericConfiguration subConfig = subConfigEntry.getValue();
          Class<? extends AbstractUpdateCheckerJob> subConfigClass = getUpdateJobImplementationClass(new CRConfigUtil(
              subConfig, config.getName() + "." + subConfigKey));
          try {
            String nextIndexLocationClassName = subConfigClass.getField("INDEXLOCATIONCLASS")
                .get(subConfigClass).toString();
View Full Code Here

  /**
   * @return a map of the configured CRs
   */
  public final ConcurrentHashMap<String, CRConfigUtil> getCRMap() {
    ConcurrentHashMap<String, CRConfigUtil> map = new ConcurrentHashMap<String, CRConfigUtil>();
    GenericConfiguration crConfigs = (GenericConfiguration) config.get(CR_KEY);
    if (crConfigs != null) {
      ConcurrentHashMap<String, GenericConfiguration> configs = crConfigs.getSubConfigs();

      for (Entry<String, GenericConfiguration> e : configs.entrySet()) {
        try {
          map.put(config.getName() + "." + e.getKey(), new CRConfigUtil(e.getValue(), config.getName() + "."
              + e.getKey()));
View Full Code Here

   * @param config
   *            the config for the IndexLocation
   */
  private void registerExtensions(CRConfig config) {
    HashMap<String, IndexExtension> extensionMap = new HashMap<String, IndexExtension>();
    GenericConfiguration extensionConfiguration = (GenericConfiguration) config.get(INDEX_EXTENSIONS_KEY);
    if (extensionConfiguration != null) {
      ConcurrentHashMap<String, GenericConfiguration> configs = extensionConfiguration.getSubConfigs();

      for (Entry<String, GenericConfiguration> e : configs.entrySet()) {
        String indexExtensionName = e.getKey();
        IndexExtension instance = null;
        CRConfig extensionConfig = new CRConfigUtil(e.getValue(), INDEX_EXTENSIONS_KEY + "."
View Full Code Here

   * Reads the config with the index_key, reads all subconfigs and creates IndexLocations for each Index.
   * @return IndexLocation hash identified by the indexkey.indexname
   */
  private ConcurrentHashMap<String, IndexLocation> buildIndexTable() {
    ConcurrentHashMap<String, IndexLocation> indexes = new ConcurrentHashMap<String, IndexLocation>(1);
    GenericConfiguration indexConfiguration = (GenericConfiguration) crconfig.get(INDEX_KEY);
    if (indexConfiguration != null) {
      ConcurrentHashMap<String, GenericConfiguration> configs = indexConfiguration.getSubConfigs();

      for (Entry<String, GenericConfiguration> e : configs.entrySet()) {
        String indexLocationName = e.getKey();
        IndexLocation indexLocation = IndexLocation.getIndexLocation(new CRConfigUtil(e.getValue(), INDEX_KEY
            + "." + indexLocationName));
View Full Code Here

                * Constants.MILLISECONDS_IN_A_SECOND);
            if (hasConfigChanged()) {
              if (listener != null) {
                listener.onBeforeReload();
              }
              GenericConfiguration c = reloadConfiguration();
              if (listener != null) {
                listener.onReloadFinished(c);
              }
            }
          } catch (InterruptedException e) {
View Full Code Here

  ContentTransformer t;

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

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

    super.setUp();

    lucene = new SimpleLucene();
    lucene.add(SimpleLucene.CONTENT_ATTRIBUTE + ":this word9 the word1 tat", "node_id:1");

    config = new GenericConfiguration();
    config.set("class", "com.gentics.cr.lucene.search.highlight.WhitespaceVectorBolder");
    config.set("attribute", SimpleLucene.CONTENT_ATTRIBUTE);
    config.set("rule", "1==1");
    config.set("fragments", "2");
    config.set("fragmentsize", "24");
View Full Code Here

  CRConfig singleConfig3;

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

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

    singleConfig1 = new CRConfigUtil(sc, "sc1");

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

    singleConfig2 = new CRConfigUtil(sc2, "sc2");

    GenericConfiguration sc3 = new GenericConfiguration();
    sc3.set("indexLocations.3.path", "RAM_3");
    sc3.set("indexLocationClass", "com.gentics.cr.lucene.indexer.index.LuceneSingleIndexLocation");

    singleConfig3 = new CRConfigUtil(sc3, "sc3");
  }
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.