Package com.gentics.cr.exceptions

Examples of com.gentics.cr.exceptions.CRException


      try {
        is.reset();
        Word6Extractor docextractor = new Word6Extractor(is);
        ret = docextractor.getText();
      } catch (IOException e1) {
        throw new CRException(e1);
      }

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


   */
  public void toStream(final 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 {
      //Elements found/status ok
      this.rootElement.setAttribute("status", "ok");

      for (Iterator<CRResolvableBean> it = this.resolvableColl.iterator(); it.hasNext();) {
View Full Code Here

      Document doc = styledDoc.getDefaultRootElement().getDocument();

      //Printing out the contents of the RTF document as plain text
      ret = doc.getText(0, doc.getLength());
    } catch (IOException e) {
      throw new CRException(e);
    } catch (BadLocationException e) {
      throw new CRException(e);
    }

    return (ret);
  }
View Full Code Here

        sheet.close();
      }

      contents = handler.getResult();
    } catch (IOException io) {
      throw new CRException(io);
    } catch (SAXException e) {
      throw new CRException(e);
    } catch (InvalidFormatException e) {
      throw new CRException(e);
    } catch (OpenXML4JException e) {
      throw new CRException(e);
    }

    return contents;
  }
View Full Code Here

          contents = null;
        }
      }

    } catch (IOException e) {
      throw new CRException(e);
    } catch (Exception e) {
      throw new CRException(e);
    }

    return (contents);
  }
View Full Code Here

    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());
    }
  }
View Full Code Here

    try {
      RequestProcessor rp = (RequestProcessor) Class.forName(requestProcessorClass)
          .getConstructor(new Class[] { CRConfig.class }).newInstance(requestProcessorConfig);
      return rp;
    } catch (Exception e) {
      throw new CRException(e);
    }
  }
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, debug, responsetypesetter);
      }
      stream.flush();
      stream.close();
    } catch (CRException e1) {
      respondWithError((OutputStream) stream, e1, debug, responsetypesetter);
      e1.printStackTrace();
    } catch (Exception e) {
      log.error("Error while processing service " + "(RESTBinaryContainer)", e);
      CRException crex = new CRException(e);
      respondWithError(stream, crex, debug, responsetypesetter);
    }
  }
View Full Code Here

      try {
        tmplManager = VelocityTemplateManagerFactory.getConfiguredVelocityTemplateManagerInstance(
          this.getEncoding(),
          DEFAULT_TEMPLATE_PATH);
      } catch (Exception e) {
        CRException ex = new CRException(e);
        log.error(ex.getMessage(), ex);
      }
      return tmplManager;
    }
    return null;
  }
View Full Code Here

   */
  public void toStream(final 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.cr.put("status", "ok");
      for (Iterator<CRResolvableBean> it = this.resolvableColl.iterator(); it.hasNext();) {
        CRResolvableBean crBean = it.next();
        Map<String, Object> objElement = processElement(crBean);
        this.cr.put(crBean.getContentid(), objElement);
      }
    }

    try {
      OutputStreamWriter wr = new OutputStreamWriter(stream, this.getResponseEncoding());
      wr.write(this.PHPSerializer.serialize(this.cr));
      wr.flush();
      wr.close();

    } catch (IOException e) {
      throw new CRException(e);
    }

  }
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.