Package it.eng.spago.error

Examples of it.eng.spago.error.EMFErrorHandler


   * @return A string representing the name of the correct publisher, which will
   * call the correct jsp reference.
   */
  public String getPublisherName(RequestContainer requestContainer, ResponseContainer responseContainer) {
    logger.debug("IN");
    EMFErrorHandler errorHandler = responseContainer.getErrorHandler();
   
    // if there are errors and they are only validation errors return the name for the detail publisher
    if(!errorHandler.isOK()) {
      if(GeneralUtilities.isErrorHandlerContainingOnlyValidationError(errorHandler)) {       
        logger.info("Publish: listDistributionListUser"  );
        logger.debug("OUT");
        return "listDistributionListUser";
      }
    }
   
    if (errorHandler.isOKBySeverity(EMFErrorSeverity.ERROR)){
      logger.info("Publish: listDistributionListUser"  );
      logger.debug("OUT");     
      return new String("listDistributionListUser");
    }
    else {
View Full Code Here


   * @return A string representing the name of the correct publisher, which will
   * call the correct jsp reference.
   */
  public String getPublisherName(RequestContainer requestContainer, ResponseContainer responseContainer) {
    logger.debug("IN");
    EMFErrorHandler errorHandler = responseContainer.getErrorHandler();
   
    // if there are errors and they are only validation errors return the name for the detail publisher
    if(!errorHandler.isOK()) {
      if(GeneralUtilities.isErrorHandlerContainingOnlyValidationError(errorHandler)) {       
        logger.info("Publish: listDistributionList"  );
        logger.debug("OUT");
        return "listDistributionList";
      }
    }
   
    if (errorHandler.isOKBySeverity(EMFErrorSeverity.ERROR)){
      logger.info("Publish: listDistributionList"  );
      logger.debug("OUT");     
      return new String("listDistributionList");
    }
    else {
View Full Code Here

   * call the correct jsp reference.
   */
  public String getPublisherName(RequestContainer requestContainer, ResponseContainer responseContainer) {
    logger.debug("IN");

    EMFErrorHandler errorHandler = responseContainer.getErrorHandler();
   
    // get the module response
    SourceBean moduleResponse = (SourceBean)responseContainer.getServiceResponse().getAttribute("DetailDistributionListUserModule");
   
    // if the module response is null throws an error and return the name of the errors publisher
    if(moduleResponse==null) {
      logger.error("Module response null");
      EMFUserError error = new EMFUserError(EMFErrorSeverity.ERROR, 10 );
      errorHandler.addError(error);     
      return "error";
    }
   
    // if there are errors and they are only validation errors return the name for the detail publisher
    if(!errorHandler.isOK()) {
      if(GeneralUtilities.isErrorHandlerContainingOnlyValidationError(errorHandler)) {
        logger.info("Publish: insertEmail"  );
        return "insertEmail";
      }
    }
   
    // if there are some errors into the errorHandler (not validation errors), return the name for the errors publisher
    if(!errorHandler.isOKBySeverity(EMFErrorSeverity.ERROR)) {
      return new String("error");
    }

        Object loop = moduleResponse.getAttribute("loopback");
        if (loop != null) {
View Full Code Here

   * call the correct jsp reference.
   */
  public String getPublisherName(RequestContainer requestContainer, ResponseContainer responseContainer) {
    logger.debug("IN");

    EMFErrorHandler errorHandler = responseContainer.getErrorHandler();
   
    // gets the module response
    SourceBean moduleResponse = (SourceBean)responseContainer.getServiceResponse().getAttribute("DetailDistributionListModule");
   
    // if the module response is null throws an error and returns the name of the error publisher
    if(moduleResponse==null) {
      logger.error("Module response null");
      EMFUserError error = new EMFUserError(EMFErrorSeverity.ERROR, 100 );
      errorHandler.addError(error);     
      return "error";
    }
   
    // if there are errors and they are only validation errors return the name for the detail publisher
    if(!errorHandler.isOK()) {
      if(GeneralUtilities.isErrorHandlerContainingOnlyValidationError(errorHandler)) {
        logger.info("Publish: detailDistributionList"  );
        return "detailDistributionList";
      }
    }
   
    // if there are some errors into the errorHandler (not validation errors), return the name for the errors publisher
    if(!errorHandler.isOKBySeverity(EMFErrorSeverity.ERROR)) {
      return new String("error");
    }

        Object loop = moduleResponse.getAttribute("loopback");
        if (loop != null) {
View Full Code Here

   * @see it.eng.spago.presentation.PublisherDispatcherIFace#getPublisherName(it.eng.spago.base.RequestContainer, it.eng.spago.base.ResponseContainer)
   */
  public String getPublisherName(RequestContainer requestContainer,
      ResponseContainer responseContainer) {
    // get error handler
    EMFErrorHandler errorHandler = responseContainer.getErrorHandler();
    // if there are some errors (not validation error) into the errorHandler
    // return the name for the errors publisher
    if (!errorHandler.isOKBySeverity(EMFErrorSeverity.ERROR)) {
      return "error";
    }
   
    // get the module response
    SourceBean moduleResponse = (SourceBean) responseContainer.getServiceResponse().getAttribute("HotLinkModule");
    // if the module response is null throws an error and return the name of
    // the errors publisher
    if (moduleResponse == null) {
        logger.error("Module response null");
        EMFUserError error = new EMFUserError(EMFErrorSeverity.ERROR, 10);
        errorHandler.addError(error);
        return "error";
    }
    // get the value of the publisher name attribute
    String publisherName = (String) moduleResponse.getAttribute(SpagoBIConstants.PUBLISHER_NAME);
    if (publisherName != null && !publisherName.trim().equals("")) {
        return publisherName;
    } else {
      logger.error("Publisher name attribute not found");
        EMFUserError error = new EMFUserError(EMFErrorSeverity.ERROR, 10);
        errorHandler.addError(error);
        return "error";
      }
   
  }
View Full Code Here

      logger.debug("OUT");
    }   
  }
 
  public void validateInput() {
    EMFErrorHandler errorHandler = getErrorHandler();
    if (!errorHandler.isOKBySeverity(EMFErrorSeverity.ERROR)) {
      Collection errors = errorHandler.getErrors();
      Iterator it = errors.iterator();
      while (it.hasNext()) {
        EMFAbstractError error = (EMFAbstractError) it.next();
        if (error.getSeverity().equals(EMFErrorSeverity.ERROR)) {
          throw new SpagoBIEngineServiceException(getActionName(), error.getMessage(), null);
View Full Code Here

   * call the correct jsp reference.
   */
  public String getPublisherName(RequestContainer requestContainer, ResponseContainer responseContainer) {
    logger.debug("IN");

    EMFErrorHandler errorHandler = responseContainer.getErrorHandler();
   
    // get the module response
    SourceBean moduleResponse = (SourceBean)responseContainer.getServiceResponse();
    String publisher_Name = (String)moduleResponse.getAttribute("publisher_Name");
   
    // if there are errors and they are only validation errors return the name for the detail publisher
    if(errorHandler.isOK() && errorHandler.isOKBySeverity(EMFErrorSeverity.ERROR)) {
        if(publisher_Name!=null && publisher_Name !="") {       
          logger.info("Publish:" + publisher_Name);   
          logger.debug("OUT");
          return publisher_Name;
        }else{
View Full Code Here

          Date endDate=context.getNextFireTime();
         
         
          SourceBean request = null;
          SourceBean resp = null;
          EMFErrorHandler errorHandler = null;
         
          try {
            request = new SourceBean("");
            resp = new SourceBean("");
          } catch (SourceBeanException e1) {
            e1.printStackTrace();
          }
          RequestContainer reqContainer = new RequestContainer();
          ResponseContainer resContainer = new ResponseContainer();
          reqContainer.setServiceRequest(request);
          resContainer.setServiceResponse(resp);
          DefaultRequestContext defaultRequestContext = new DefaultRequestContext(
              reqContainer, resContainer);
          resContainer.setErrorHandler(new EMFErrorHandler());
          RequestContainer.setRequestContainer(reqContainer);
          ResponseContainer.setResponseContainer(resContainer);
          Locale locale = new Locale("it","IT","");
          SessionContainer session = new SessionContainer(true);
          reqContainer.setSessionContainer(session);
          SessionContainer permSession = session.getPermanentContainer();
          IEngUserProfile profile =UserProfile.createSchedulerUserProfile();         
          permSession.setAttribute(IEngUserProfile.ENG_USER_PROFILE, profile);
          errorHandler = defaultRequestContext.getErrorHandler();
          reqContainer.setAttribute("model_node_instance", modelInstanceId);
          reqContainer.setAttribute("start_date", beginDate);
          reqContainer.setAttribute("end_date", endDate);
          reqContainer.setAttribute("cascade", cascade);
          reqContainer.setAttribute("recalculate_anyway", "true");

          SpagoBIKpiInternalEngine engine = new SpagoBIKpiInternalEngine();         

        try {
          engine.execute(reqContainer, resp);
        } catch (EMFUserError e) {
          logger.error("Error during engine execution", e);
          errorHandler.addError(e);
        } catch (Exception e) {
          logger.error("Error while engine execution", e);
          errorHandler.addError(new EMFUserError(EMFErrorSeverity.ERROR,
              100));
        }
   
       } catch (Throwable e) {
              logger.error("Error while executiong KpiEngineJob", e);
View Full Code Here

   * call the correct jsp reference.
   */
  public String getPublisherName(RequestContainer requestContainer, ResponseContainer responseContainer) {
    logger.debug("IN");

    EMFErrorHandler errorHandler = responseContainer.getErrorHandler();
   
    // get the module response
    SourceBean moduleResponse = (SourceBean)responseContainer.getServiceResponse();
    String publisher_Name = (String)moduleResponse.getAttribute("publisher_Name");
   
    // if there are errors and they are only validation errors return the name for the detail publisher
    if(errorHandler.isOK() && errorHandler.isOKBySeverity(EMFErrorSeverity.ERROR)) {
        if(publisher_Name!=null && publisher_Name !="") {       
          logger.info("Publish:" + publisher_Name);   
          logger.debug("OUT");
          return publisher_Name;
        }else{
View Full Code Here

    ResponseContainer responseContainer = this.getResponseContainer()
    SessionContainer session = requestContainer.getSessionContainer();
    SessionContainer permanentSession = session.getPermanentContainer();
    profile = (IEngUserProfile) permanentSession.getAttribute(IEngUserProfile.ENG_USER_PROFILE);
   
    EMFErrorHandler errorHandler = getErrorHandler();
    try {
      if (message == null) {
        EMFUserError userError = new EMFUserError(EMFErrorSeverity.ERROR, 101);
        logger.debug("The message parameter is null");
        throw userError;
      }
      logger.debug("The message parameter is: " + message.trim());
      if (message.trim().equalsIgnoreCase(SpagoBIConstants.DETAIL_SELECT)) {
        getDataSource(request, response);
      } else if (message.trim().equalsIgnoreCase(SpagoBIConstants.DETAIL_MOD)) {
        modifyDataSource(request, SpagoBIConstants.DETAIL_MOD, response);
      } else if (message.trim().equalsIgnoreCase(SpagoBIConstants.DETAIL_NEW)) {
        newDataSource(response);
      } else if (message.trim().equalsIgnoreCase(SpagoBIConstants.DETAIL_INS)) {
        modifyDataSource(request, SpagoBIConstants.DETAIL_INS, response);
      } else if (message.trim().equalsIgnoreCase(SpagoBIConstants.DETAIL_DEL)) {
        deleteDataSource(request, SpagoBIConstants.DETAIL_DEL, response);
      }
    } catch (EMFUserError eex) {
      errorHandler.addError(eex);
      return;
    } catch (Exception ex) {
      EMFInternalError internalError = new EMFInternalError(EMFErrorSeverity.ERROR, ex);
      errorHandler.addError(internalError);
      return;
    }
  }
View Full Code Here

TOP

Related Classes of it.eng.spago.error.EMFErrorHandler

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.