Package com.gentics.cr.exceptions

Examples of com.gentics.cr.exceptions.CRException


    this.responseEncoding = config.getEncoding();
    this.crConf = config;
    try {
      this.rp = crConf.getNewRequestProcessorInstance(1);
    } catch (CRException e) {
      CRException ex = new CRException(e);
      log.error("FAILED TO INITIALIZE REQUEST PROCESSOR... " + ex.getStringStackTrace());
    }
    contentRenderer = ContentRendererFactory.getRendererInstance(crConf.getRequestProcessorConfig(1));
    plinkProcessor = new PlinkProcessor(crConf.getRequestProcessorConfig(1));
  }
View Full Code Here


          wr.write(content);
          wr.flush();
          wr.close();
        }
      } else {
        CRException crex = new CRException("NoDataFound", "Data could not be found.", ERRORTYPE.NO_DATA_FOUND);
        this.respondWithError(stream, crex, myReqBuilder.isDebug());
      }
      stream.flush();
      stream.close();
    } catch (CRException e1) {
      this.contenttype = "text/html; charset=" + this.responseEncoding;
      respondWithError((OutputStream) stream, e1, myReqBuilder.isDebug());
      e1.printStackTrace();
    } catch (Exception e) {
      log.error("Error while processing service " + "(RESTBinaryContainer)", e);
      CRException crex = new CRException(e);
      this.respondWithError(stream, crex, myReqBuilder.isDebug());
    }

  }
View Full Code Here

   *
   */
  public void toStream(OutputStream stream) throws CRException {
    if (this.resolvableColl.isEmpty()) {
      // No Data Found
      throw new CRException("NoDataFound", "Data could not be found.", ERRORTYPE.NO_DATA_FOUND);
    } else {
      this.rootObject.element("status", "ok");

      JSONArray jsArray = new JSONArray();

View Full Code Here

        }
       

      } catch (ParserException e) {
        LOG.error("Error getting filter for Datasource.", e);
        throw new CRException(e);
      } catch (ExpressionParserException e) {
        LOG.error("Error getting filter for Datasource.", e);
        throw new CRException(e);
      } catch (DatasourceException e) {
        LOG.error("Error getting result from Datasource.", e);
        throw new CRException(e);
      } finally {
        CRDatabaseFactory.releaseDatasource(ds);
      }
    }
    return collection;
View Full Code Here

   * @throws CRException if there was no data to write into the stream
   */
  @Override
  public final void toStream(final OutputStream stream) throws CRException {
    if (this.resolvableColl.isEmpty()) {
      throw new CRException("NoDataFound", "Data could not be found.", ERRORTYPE.NO_DATA_FOUND);
    } else {
      rootElement = processElement(resolvableColl.get(0));
      doc.appendChild(rootElement);
    }

View Full Code Here

      //CRException is passed down from methods that want to post
      //the occured error to the client
      cr.respondWithError((OutputStream) stream, ex, debug);
      LOG.error(ex.getMessage(), ex);
    } catch (Exception ex) {
      CRException crex = new CRException(ex);
      LOG.error("Exception occured", crex);
      cr.respondWithError((OutputStream) stream, crex, debug);
      LOG.error(ex.getMessage(), crex);
    } finally {
      try {
View Full Code Here

        }
      }

    } catch (ParserException e) {
      logger.error("Error getting filter for Datasource.", e);
      throw new CRException(e);
    } catch (ExpressionParserException e) {
      logger.error("Error getting filter for Datasource.", e);
      throw new CRException(e);
    } catch (DatasourceException e) {
      logger.error("Error getting result from Datasource.", e);
      throw new CRException(e);
    }
    return collection;
  }
View Full Code Here

      String jsonFile = config.getString("file");
      if (jsonFile != null) {
        try {
          objectString = StringUtils.streamToString(new FileInputStream(jsonFile));
        } catch (FileNotFoundException e) {
          throw new CRException("Cannot find the given json file.", e);
        }
      } else {
        objectString = config.getString("objects", "{objects:[]}");
      }
      JSONObject json = JSONObject.fromObject(objectString);
View Full Code Here

      extractor = ExtractorFactory.createExtractor(is);

      ret = extractor.getText();

    } catch (IOException e) {
      throw new CRException(e);
    } catch (InvalidFormatException e) {
      throw new CRException(e);
    } catch (OpenXML4JException e) {
      throw new CRException(e);
    } catch (XmlException e) {
      throw new CRException(e);
    }
    return (ret);
  }
View Full Code Here

   */
  public void toStream(OutputStream stream) throws CRException {

    if (this.resolvableColl.isEmpty()) {
      //No Data Found
      throw new CRException("NoDataFound", "Data could not be found.", CRException.ERRORTYPE.NO_DATA_FOUND);
    } else {
      //Elements found/status ok
      XMLEncoder e = new XMLEncoder(new BufferedOutputStream(stream));
      String[] options = this.getOptionsArray();
      if (options != null) {
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.