Package org.projectforge.core

Examples of org.projectforge.core.InternalErrorException


        transport.connect();
      }
      transport.sendMessage(message, message.getAllRecipients());
    } catch (final MessagingException ex) {
      log.error("While creating and sending message: " + composedMessage.toString(), ex);
      throw new InternalErrorException("mail.error.exception");
    } finally {
      if (transport != null) {
        try {
          transport.close();
        } catch (final MessagingException ex) {
          log.error("While creating and sending message: " + composedMessage.toString(), ex);
          throw new InternalErrorException("mail.error.exception");
        }
      }
    }
    log.info("E-Mail successfully sent: " + composedMessage.toString());
  }
View Full Code Here


        transport.connect();
      }
      transport.sendMessage(message, message.getAllRecipients());
    } catch (final MessagingException ex) {
      log.error("While creating and sending message: " + composedMessage.toString(), ex);
      throw new InternalErrorException("mail.error.exception");
    } finally {
      if (transport != null) {
        try {
          transport.close();
        } catch (final MessagingException ex) {
          log.error("While creating and sending message: " + composedMessage.toString(), ex);
          throw new InternalErrorException("mail.error.exception");
        }
      }
    }
    log.info("E-Mail successfully sent: " + composedMessage.toString());
  }
View Full Code Here

  public void internalSetProject(final Integer taskId, final ProjektDO projekt)
  {
    final TaskNode node = getTaskNodeById(taskId);
    if (node == null) {
      throw new InternalErrorException("Could not found task with id " + taskId + " in internalSetProject");
    }
    node.projekt = projekt;
  }
View Full Code Here

   
    try {
      task = (TaskDO)node.getTask().clone();
    } catch (CloneNotSupportedException ex) {
      log.fatal("Exception encountered " + ex, ex);
      throw new InternalErrorException();
    }
  }
View Full Code Here

      if (doLog == true) {
        log.info(ex.toString() + ExceptionHelper.getFilteredStackTrace(ex, ONLY4NAMESPACE));
      }
      return securedPage.translateParams(ex.getI18nKey(), ex.getMsgParams(), ex.getParams());
    } else if (exception instanceof InternalErrorException) {
      final InternalErrorException ex = (InternalErrorException) exception;
      if (doLog == true) {
        log.info(ex.toString() + ExceptionHelper.getFilteredStackTrace(ex, ONLY4NAMESPACE));
      }
      return securedPage.translateParams(ex.getI18nKey(), ex.getMsgParams(), ex.getParams());
    } else if (exception instanceof AccessException) {
      final AccessException ex = (AccessException) exception;
      if (doLog == true) {
        log.info(ex.toString() + ExceptionHelper.getFilteredStackTrace(ex, ONLY4NAMESPACE));
      }
      if (ex.getParams() != null) {
        return securedPage.getLocalizedMessage(ex.getI18nKey(), ex.getParams());
      } else {
        return securedPage.translateParams(ex.getI18nKey(), ex.getMessageArgs(), ex.getParams());
      }
    }
    throw new UnsupportedOperationException("For developer: Please add unknown ProjectForgeException here!", exception);
  }
View Full Code Here

    if (StringUtils.equals(sessionCsrfToken, csrfToken) == false) {
      log.error("Cross site request forgery alert. csrf token doesn't match! session csrf token="
          + sessionCsrfToken
          + ", posted csrf token="
          + csrfToken);
      throw new InternalErrorException("errorpage.csrfError");
    }
  }
View Full Code Here

    final Transformer transformer;
    try {
      transformer = tranFactory.newTransformer();
    } catch (final TransformerConfigurationException ex) {
      log.error("Exception encountered while transcoding org.w3c.dom.Document to a string: " + ex.getMessage(), ex);
      throw new InternalErrorException("Exception encountered while transcoding org.w3c.dom.Document to a string: " + ex.getMessage());
    }
    if (prettyFormat == true) {
      transformer.setOutputProperty(OutputKeys.INDENT, "yes");
      transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
    }
    final Source src = new DOMSource(document);
    final ByteArrayOutputStream bout = new ByteArrayOutputStream();
    final Result dest = new StreamResult(bout);
    try {
      transformer.transform(src, dest);
    } catch (final TransformerException ex) {
      log.error("Exception encountered while transcoding org.w3c.dom.Document to a string: " + ex.getMessage(), ex);
      throw new InternalErrorException("Exception encountered while transcoding org.w3c.dom.Document to a string: " + ex.getMessage());
    }
    final String result;
    try {
      result = new String(bout.toByteArray(), "UTF-8");
    } catch (final UnsupportedEncodingException ex) {
      log.error("Exception encountered while transcoding org.w3c.dom.Document to a string: " + ex.getMessage(), ex);
      throw new InternalErrorException("Exception encountered while transcoding org.w3c.dom.Document to a string: " + ex.getMessage());
    }
    return result;
  }
View Full Code Here

      xsltInputStream = (InputStream) result[0];
      final StreamSource xltStreamSource = new StreamSource(xsltInputStream);
      final String url = (String) result[1];
      if (url == null) {
        log.error("Url of xsl resource is null.");
        throw new InternalErrorException();
      }
      xltStreamSource.setSystemId(url);

      final Transformer transformer = factory.newTransformer(xltStreamSource);
View Full Code Here

TOP

Related Classes of org.projectforge.core.InternalErrorException

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.