Package com.gentics.cr.exceptions

Examples of com.gentics.cr.exceptions.CRException


    String httpVersionString = config.getString(HTTP_VERSION_KEY);
    if (httpVersionString != null) {
      try {
        this.httpVersion = HttpVersion.parse(httpVersionString);
      } catch (ProtocolException e) {
        throw new CRException(e);
      }
    }
  }
View Full Code Here


        if (responseObject instanceof Collection<?>) {
          result = this.toCRResolvableBeanCollection(responseObject);
        } else if (responseObject instanceof CRError) {
          CRError ex = (CRError) responseObject;
          throw new CRException(ex);
        } else {
          log.error("COULD NOT CAST RESULT. Perhaps remote agent does not work properly");
        }

      } catch (ClassNotFoundException e) {
        log.error("Coult not load object from http response", e);
        throw new CRException(e);
      }

      if (result != null) {
        for (CRResolvableBean crBean : result) {
          resultlist.add(crBean);
        }
      }

    } catch (HttpException e) {
      log.error("Fatal protocol violation", e);
      throw new CRException(e);
    } catch (IOException e) {
      log.error("Fatal transport error", e);
      throw new CRException(e);
    } finally {
      // Release the connection.
      method.releaseConnection();
    }
View Full Code Here

      log.debug(e1.getMessage() + " : " + e1.getStringStackTrace());
      this.vtl.put("notfound", true);
      this.vtl.put("size", 0);
    } catch (Exception ex) {
      CRException crex = new CRException(ex);
      log.debug(ex.getMessage() + " : " + crex.getStringStackTrace());
      this.vtl.put("error", true);
    }

    try {
      String output = this.vtl.render(this.tpl.getKey(), this.tpl.getSource());
View Full Code Here

 
  public byte[] getFileAsByteArray(String path) throws CRException {
    try {
      return IOUtils.toByteArray(getFileAsStream(path));
    } catch (IOException e) {
      throw new CRException(e);
    }
  }
View Full Code Here

  public HSQLTestHandler(CRConfigUtil rpConfig) throws CRException {
    wDs = (WriteableDatasource) rpConfig.getDatasource();
    try {
      GenticsCRHelper.importObjectTypes(wDs);
    } catch (Exception e) {
      throw new CRException(e);
    }
  }
View Full Code Here

    map.put("obj_type", bean.getObj_type());
    try {
      Changeable changeable = wDs.create(map);
      wDs.store(Collections.singleton(changeable));
    } catch (DatasourceException e) {
      throw new CRException(e);
    }
    contentids.add(bean.getContentid());
  }
View Full Code Here

      base.set("contentids", contentids);
      dsFilter = wDs.createDatasourceFilter(PortalConnectorFactory.createExpression("object.contentid CONTAINSONEOF base.contentids"));
      dsFilter.addBaseResolvable("base", base);
      wDs.delete(dsFilter);
    } catch (Exception e) {
      throw new CRException(e);
    } finally {
      CRDatabaseFactory.releaseDatasource(wDs);
    }
  }
View Full Code Here

    responseEncoding = crConf.getEncoding();
    conf = crConf;
    try {
      rp = crConf.getNewRequestProcessorInstance(1);
    } catch (CRException e) {
      CRException ex = new CRException(e);
      log.error("FAILED TO INITIALIZE REQUEST PROCESSOR... ", ex);
    }
  }
View Full Code Here

      //CRException is passed down from methods that want to post
      //the occured error to the client
      cr.respondWithError((OutputStream) stream, e1, myReqBuilder.isDebug());
      log.debug(e1.getMessage(), e1);
    } catch (Exception ex) {
      CRException crex = new CRException(ex);
      if (cr != null) {
        cr.respondWithError((OutputStream) stream, crex, myReqBuilder.isDebug());
        log.debug(ex.getMessage(), ex);
      } else {
        log.error("Cannot initialize ContentRepository", ex);
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
      serialize(this.resolvableColl, stream);
    }

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.