Package com.gentics.cr.exceptions

Examples of com.gentics.cr.exceptions.CRException


            //TODO use a stream to consume lower memory for large files
            os.write(bean.getBinaryContent());
            os.close();
          }
        } catch (Exception e) {
          throw new CRException("Cannot update the index.", e);
        }

      } else if (!ignorePubDir) {
        //it would just make no sense to check for check for folders existence if the pub_dir attribute is ignored
        String publicationDirectory = bean.getString("pub_dir");
View Full Code Here


      }
      StringWriter ret = new StringWriter();
      template.merge(context, ret);
      renderedTemplate = ret.toString();
    } catch (ResourceNotFoundException e) {
      throw new CRException(e);
    } catch (ParseErrorException e) {
      throw new CRException(e);
    } catch (Exception e) {
      throw new CRException(e);
    } finally {
      this.objectstoput = new HashMap<String, Object>();
    }
    log.debug("Velocity has been rendered in " + (System.currentTimeMillis() - s1) + "ms");
    return renderedTemplate;
View Full Code Here

      MessageDigest digest = MessageDigest.getInstance("MD5");
      digest.update(this.source.getBytes());
      this.key = new String(digest.digest());
    } catch (NoSuchAlgorithmException e) {
      e.printStackTrace();
      throw new CRException(e);
    }
  }
View Full Code Here

        String key = it.next();
        processor.put(key, this.contextObjects.get(key));
      }
      renderedTemplate = processor.getOutputForSource(templatesource, this.portlet);
    } catch (TemplateNotFoundException e) {
      throw new CRException(e);
    } catch (PrivateKeyException e) {
      throw new CRException(e);
    } finally {
      this.portlet.getGenticsPortletContext().returnTemplateProcessor(processor);
    }

    return renderedTemplate;
View Full Code Here

        }

        link = myTemplateEngine.render("link", this.config.getPlinkTemplate());

      } catch (DatasourceNotAvailableException e) {
        CRException ex = new CRException(e);
        log.error(ex.getMessage() + ex.getStringStackTrace());
      } catch (CRException ex) {
        log.error(ex.getMessage() + ex.getStringStackTrace());
      } finally {
        CRDatabaseFactory.releaseDatasource(ds);
      }
      // endtime
      long end = new Date().getTime();
View Full Code Here

          map.put(config.getName() + "." + e.getKey(), new CRConfigUtil(e.getValue(), config.getName() + "."
              + e.getKey()));
        } catch (Exception ex) {
          String name = "<no config name>";
          String key = "<no key>";
          CRException cex = new CRException(ex);
          if (e != null && e.getKey() != null) {
            key = e.getKey();
          }
          if (config.getName() != null) {
            name = config.getName();
          }
          log.error("Error while creating cr map for " + name + "." + key + " - " + cex.getMessage(), cex);
        }
      }
    } else {
      log.debug("There are no crs configured for indexing. Config: " + config.getName());
    }
View Full Code Here

            result = fragmentText;
          }
        }
      }
    } catch (Exception ex) {
      throw new CRException(ex);
    }
    return result;
  }
View Full Code Here

  @Override
  protected void indexCR(IndexLocation indexLocation, CRConfigUtil config) throws CRException {
    try {
      reIndex();
    } catch (IOException e) {
      throw new CRException("Could not access the Autocomplete index! " + e.getMessage());
    }

  }
View Full Code Here

      initConfigs.add(configName);
      config = StaticConfigurationContainer.getConfig(configName, "");
      configs.put(configName, config);
      initConfigs.remove(configName);
    } else {
      CRException e = new CRException();
      e.setMessage("Recursion in content connector properties detected. " + "Configs currently initialising: "
          + StringUtils.getCollectionSummary(initConfigs));
      throw e;
    }
    return config;
  }
View Full Code Here

              header = StringUtils.readUntil((InputStream) content, framePlaceholder);
              footer = StringUtils.streamToString((InputStream) content);
            } else {
              logger.error(
                "Error reading frame source" + framePath,
                new CRException("Unknown response type (" + content.getClass() + ")"));
            }
            cache.put(framePath + HEADER_CACHE_KEY_SUFFIX, header);
            cache.put(framePath + FOOTER_CACHE_KEY_SUFFIX, footer);

          }
View Full Code Here

TOP

Related Classes of com.gentics.cr.exceptions.CRException

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.