Examples of CRConfigUtil


Examples of com.gentics.cr.CRConfigUtil

    ServletRequest renderRequest = getServletRequest();
    HttpSession session = pageContext.getSession();

    ContentRenderer renderer = (ContentRenderer) renderRequest.getAttribute(RENDERER_PARAM);
    PLinkReplacer pLinkReplacer = (PLinkReplacer) renderRequest.getAttribute(PLINK_PARAM);
    CRConfigUtil crConf = (CRConfigUtil) renderRequest.getAttribute(CRCONF_PARAM);

    try {
      if (object != null) {
        try {
          String content = renderer.renderContent(object, contentAttribute, true, pLinkReplacer, false, null);

          /* Get the ContentPostProcessor-Config from the PortletSession or instance it from the Config */
          @SuppressWarnings("unchecked")
          ConcurrentHashMap<String, ContentPostProcesser> confs = (ConcurrentHashMap<String, ContentPostProcesser>) session
              .getAttribute(SESSION_KEY_CONTENTPOSTPROCESSOR_CONF);
          if (confs == null) {
            confs = ContentPostProcesser.getProcessorTable(crConf);
            if (confs != null) {
              session.setAttribute(SESSION_KEY_CONTENTPOSTPROCESSOR_CONF, confs);
              logger.debug("Put ContentPostProcessor config into session of " + crConf.getName() + "!");
            }
          }
          if (confs != null) {
            for (ContentPostProcesser p : confs.values()) {
              content = p.processString(content, renderRequest);
View Full Code Here

Examples of com.gentics.cr.CRConfigUtil

  private static RESTBinaryContainer container;
  private static HSQLTestHandler testHandler;
 
  @BeforeClass
  public static void setUp() throws CRException {
    CRConfigUtil config = HSQLTestConfigFactory.getDefaultHSQLConfiguration(RESTBinaryContainerTest.class.getName());
    config.set("rp.1.rpClass", "com.gentics.cr.CRRequestProcessor");
    container = new RESTBinaryContainer(config);
    testHandler = new HSQLTestHandler(config.getRequestProcessorConfig(1));
   
    CRResolvableBean testBean = new CRResolvableBean();
    testBean.setObj_type("10008");
   
    byte[] file = testHandler.getFileAsByteArray("picture.png");
View Full Code Here

Examples of com.gentics.cr.CRConfigUtil

    RenderRequest renderRequest = getRenderRequest();
    PortletSession session = renderRequest.getPortletSession();

    ContentRenderer renderer = (ContentRenderer) renderRequest.getAttribute(RENDERER_PARAM);
    PLinkReplacer pLinkReplacer = (PLinkReplacer) renderRequest.getAttribute(PLINK_PARAM);
    CRConfigUtil crConf = (CRConfigUtil) renderRequest.getAttribute(CRCONF_PARAM);

    try {
      if (object != null) {
        try {
          String content = renderer.renderContent(object, contentAttribute, true, pLinkReplacer, false, null);

          /* Get the ContentPostProcessor-Config from the PortletSession or instance it from the Config */
          @SuppressWarnings("unchecked")
          ConcurrentHashMap<String, ContentPostProcesser> confs = (ConcurrentHashMap<String, ContentPostProcesser>) session
              .getAttribute(SESSION_KEY_CONTENTPOSTPROCESSOR_CONF, PortletSession.APPLICATION_SCOPE);
          if (confs == null) {
            confs = ContentPostProcesser.getProcessorTable(crConf);
            if (confs != null) {
              session.setAttribute(
                SESSION_KEY_CONTENTPOSTPROCESSOR_CONF,
                confs,
                PortletSession.APPLICATION_SCOPE);
              logger.debug("Put ContentPostProcessor config into session of " + crConf.getName() + "!");
            }
          }
          if (confs != null) {
            for (ContentPostProcesser p : confs.values()) {
              content = p.processString(content, renderRequest);
View Full Code Here

Examples of com.gentics.cr.CRConfigUtil

  };
 
  @Before
  public void setUp() throws Exception {
    ConfigDirectory.useThis();
    conf = new CRConfigUtil();
  }
View Full Code Here

Examples of com.gentics.cr.CRConfigUtil

      }
      if (crBean != null) {
        // set mimetype.
        if (crBean.getMimetype() == null) {

          CRConfigUtil rpConf = crConf.getRequestProcessorConfig(1);
          if (crBean.getObj_type().equals(rpConf.getPageType())) {
            this.contenttype = "text/html; charset=" + this.responseEncoding;
            log.info("Responding with mimetype: text/html");
          } else {
            log.info("Mimetype has not been set, using " + "standard instead. (" + crBean.getObj_type()
                + "!=" + rpConf.getPageType() + ")");
          }
        } else {

          this.contenttype = crBean.getMimetype() + "; charset=" + this.responseEncoding;
View Full Code Here

Examples of com.gentics.cr.CRConfigUtil

      }
      if (crBean != null) {
        String mimetype = crBean.getMimetype();
        if (mimetype == null) {

          CRConfigUtil rpConf = crConf.getRequestProcessorConfig(1);
          if (crBean.getObj_type().equals(rpConf.getPageType())) {
            mimetype = "text/html; charset=" + this.responseEncoding;
            log.info("Responding with mimetype: text/html");
          } else {
            log.info("Mimetype has not been set, using " + "standard instead. (" + crBean.getObj_type()
                + "!=" + rpConf.getPageType() + ")");
          }
        } else {
          // Charset should only be set if content is not a binary
          mimetype = crBean.getMimetype(); //+ "; charset=" + this.responseEncoding;
View Full Code Here

Examples of com.gentics.cr.CRConfigUtil

      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);
   
   
    config2 = new CRConfigUtil(config.getSubConfig("index").getSubConfig("DEFAULT").getSubConfig("extensions").getSubConfig("SYN"), "SYN");
   
    indexExtension = new SynonymIndexExtension(config2, singleLoc1);
   
    SynonymIndexJob job = new SynonymIndexJob(config2, singleLoc1, indexExtension);
    job.run();
View Full Code Here

Examples of com.gentics.cr.CRConfigUtil

      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);

    config2 = new CRConfigUtil(config.getSubConfig("index")
        .getSubConfig("DEFAULT").getSubConfig("extensions")
        .getSubConfig("SYN"), "SYN");

    indexExtension = new SynonymIndexExtension(config2, singleLoc1);
View Full Code Here

Examples of com.gentics.cr.CRConfigUtil

      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);
   
   
    config2 = new CRConfigUtil(config.getSubConfig("index").getSubConfig("DEFAULT").getSubConfig("extensions").getSubConfig("SYN"), "SYN");
   
    indexExtension = new SynonymIndexExtension(config2, singleLoc1);
   
    SynonymIndexJob job = new SynonymIndexJob(config2, singleLoc1, indexExtension);
    job.run();
View Full Code Here

Examples of com.gentics.cr.CRConfigUtil

  public VelocityTransformer(final GenericConfiguration config) {
    super(config);
    if (config instanceof CRConfigUtil) {
      crConfigUtil = (CRConfigUtil) config;
    } else {
      crConfigUtil = new CRConfigUtil(config, "VelocityTransformerConfig");
    }
    configName = crConfigUtil.getName();
    String template = (String) config.get(TRANSFORMER_TEMPLATE_KEY);
    String templatePath = (String) config.get(TRANSFORMER_TEMPLATE_PATH_KEY);
    targetAttribute = (String) config.get(TRANSFORMER_TARGETATTRIBUTE_KEY);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.