Package com.gentics.cr.configuration

Examples of com.gentics.cr.configuration.GenericConfiguration


    InputStream stream = RTFContentTransformerTest.class.getResourceAsStream("testdoc.rtf");
    byte[] arr = IOUtils.toByteArray(stream);
    bean.set("binarycontent", arr);

    config = new GenericConfiguration();
    config.set("attribute", "binarycontent");
  }
View Full Code Here


  /**
   * Create table of ContentTransformers configured in config.
   * @param config
   */
  public static ConcurrentHashMap<String, ContentPostProcesser> getProcessorTable(GenericConfiguration config) {
    GenericConfiguration tconf = null;

    /** Needn't be configured, if not set, dont use it */
    try {
      tconf = (GenericConfiguration) config.get(FILTERCHAIN_KEY);
    } catch (NullPointerException ex) {
      return null;
    }

    if (tconf != null) {
      ConcurrentHashMap<String, GenericConfiguration> confs = tconf.getSubConfigs();
      if (confs != null && confs.size() > 0) {
        ConcurrentHashMap<String, ContentPostProcesser> ret
          = new ConcurrentHashMap<String, ContentPostProcesser>(confs.size());
        int i = 0;
        for (Map.Entry<String, GenericConfiguration> e : confs.entrySet()) {
          GenericConfiguration c = e.getValue();
          String filterchainClass = (String) c.get(FILTERCHAIN_CLASS_KEY);
          try {

            ContentPostProcesser t = null;
            t = (ContentPostProcesser) Class.forName(filterchainClass)
                .getConstructor(new Class[] { GenericConfiguration.class }).newInstance(c);
View Full Code Here

   */
  private final Properties getConfiguredContentRepositories() {
    if (config != null) {
      Object crs = this.config.get(REPOSITORIES_KEY);
      if (crs != null && crs instanceof GenericConfiguration) {
        GenericConfiguration crConf = (GenericConfiguration) crs;
        Properties crProperties = crConf.getProperties();
        return crProperties;
      }
    } else {
      logger.debug("Cannot find my config.");
    }
View Full Code Here

  /**
   * done in the same way as the parameter initialisation in the constructor
   * to avoid repeated code.
   */
  public void getDefaultParameters() {
    GenericConfiguration defaultparameters = null;
    if (this.config != null) {
      defaultparameters = (GenericConfiguration) this.config.get(CRRequestBuilder.DEFAULPARAMETERS_KEY);
    }
    if (defaultparameters != null) {
      if (repotype == null) {
        repotype = defaultparameters.getString("type");
      }
      if (getAttributeArray() == null || getAttributeArray().length == 0) {
        String defaultAttributes = (String) defaultparameters.get("attributes");
        if (defaultAttributes != null) {
          setAttributeArray(defaultAttributes.split(",[ ]*"));
        }
      }
    }
 
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.