Package it.eng.spago.error

Examples of it.eng.spago.error.EMFErrorHandler


   */
  public void service(SourceBean request, SourceBean response) throws Exception {
    String message = (String) request.getAttribute("MESSAGEDET");
    SpagoBITracer.debug(AdmintoolsConstants.NAME_MODULE, "DetailChecksModule","service","begin of detail Engine modify/visualization service with message =" +message);

    EMFErrorHandler errorHandler = getErrorHandler();
    try {
      if (message == null) {
        EMFUserError userError = new EMFUserError(EMFErrorSeverity.ERROR, 101);
        SpagoBITracer.debug(AdmintoolsConstants.NAME_MODULE, "DetailChecksModule", "service", "The message parameter is null");
        throw userError;
      }
      if (message.trim().equalsIgnoreCase(AdmintoolsConstants.DETAIL_SELECT)) {
        String id = (String) request.getAttribute("ID");
        getDetailCheck(id,response);
      } else if (message.trim().equalsIgnoreCase(AdmintoolsConstants.DETAIL_MOD)) {
        //nameControl(request,"MODIFY");
        modDetailCheck(request, AdmintoolsConstants.DETAIL_MOD, response);
      } else if (message.trim().equalsIgnoreCase(AdmintoolsConstants.DETAIL_NEW)) {
        newDetailCheck(response);
      } else if (message.trim().equalsIgnoreCase(AdmintoolsConstants.DETAIL_INS)) {
        //nameControl (request,"INSERT");
        modDetailCheck(request, AdmintoolsConstants.DETAIL_INS, response);
      } else if (message.trim().equalsIgnoreCase(AdmintoolsConstants.DETAIL_DEL)) {
        delDetailCheck(request, AdmintoolsConstants.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


  private void modDetailCheck(SourceBean request, String mod, SourceBean response)
    throws EMFUserError, SourceBeanException {
    try {
     
      Check aCheck = recoverCheckDetails(request);
      EMFErrorHandler errorHandler = getErrorHandler();
     
      // if there are some errors into the errorHandler does not write into DB
      if(!errorHandler.isOKBySeverity(EMFErrorSeverity.ERROR)) {
        response.setAttribute("checkObj", aCheck);
        response.setAttribute("modality", mod);
        return;
      }
      SessionContainer permSess = getRequestContainer().getSessionContainer().getPermanentContainer();
View Full Code Here

    logger.debug("IN");
   
    try {
      super.service(request, response);   
     
      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

    public static transient Logger logger = Logger.getLogger(DrawMapServiceExceptionTrapAction.class);
 
  
  public void service(SourceBean serviceRequest, SourceBean serviceResponse)  {
   
    EMFErrorHandler errorHandler;
    Collection errors ;
    Iterator it;
   
    logger.debug("IN");
    try {
   
      errorHandler = getErrorHandler();
      Assert.assertNotNull(errorHandler, "error handler cannot be null");
     
      errors = errorHandler.getErrors();
      logger.debug("error handler contains [" + errors.size() + "] error/s");
     
      it = errors.iterator();
      while(it.hasNext()) {
        Object o = it.next();
View Full Code Here

    public static transient Logger logger = Logger.getLogger(ServiceExceptionTrapAction.class);
 
  
  public void service(SourceBean serviceRequest, SourceBean serviceResponse)  {
   
    EMFErrorHandler errorHandler;
    Collection errors ;
    Iterator it;
   
    logger.debug("IN");
    try {
   
      errorHandler = getErrorHandler();
      Assert.assertNotNull(errorHandler, "error handler cannot be null");
     
      errors = errorHandler.getErrors();
      logger.debug("error handler contains [" + errors.size() + "] error/s");
     
      it = errors.iterator();
      while(it.hasNext()) {
        Object o = it.next();
View Full Code Here

     
      Monitor monitor = null;
      PortletTracer.info(Constants.NOME_MODULO, "AdapterPortlet", "processService", "Invocato");
        try {
            SourceBean serviceRequest = null;
            EMFErrorHandler emfErrorHandler = null;
           
            RequestContainer requestContainer = new RequestContainer();
            RequestContainer.setRequestContainer(requestContainer);
            ResponseContainer responseContainer = new ResponseContainer();
            ResponseContainer.setResponseContainer(responseContainer);
            RequestContextIFace requestContext = new DefaultRequestContext(requestContainer,
                    responseContainer);
           
            // try to get from the request the loopback attribute. If present the method has to serve
            // a loopback request (the method has been called from the doRenderService)
            // if not present is a normal request
            boolean isLoop = request.getAttribute(Constants.PUBLISHING_MODE_LOOPBACK) != null;
            if(isLoop) {
              // remove from the request the loopback attribute
              request.removeAttribute(Constants.PUBLISHING_MODE_LOOPBACK);
              //String responseContainerName = (String)request.getAttribute(Constants.RESPONSE_CONTAINER);
             
              //**************** START MODFIFICATION ZERBETTO 09-10-2006 ****************
              // get from the session the previous response container name
              //String responseContainerName = (String)request.getPortletSession().getAttribute(RESPONSE_CONTAINER_NAME);
              // get from the session the previous response container
              //ResponseContainer loopbackResponseContainer = (ResponseContainer)request.getPortletSession().getAttribute(responseContainerName);
              ResponseContainer loopbackResponseContainer = (ResponseContainer)request.getPortletSession().getAttribute(Constants.RESPONSE_CONTAINER);
              //**************** END MODFIFICATION ZERBETTO 09-10-2006 ****************
             
                TracerSingleton.log(
                    Constants.NOME_MODULO,
                    TracerSingleton.DEBUG,
                    "AdapterPortlet::service: loop-back rilevato");
                serviceRequest =
                    loopbackResponseContainer.getLoopbackServiceRequest();
                if (serviceRequest == null)
                    serviceRequest = new SourceBean(Constants.SERVICE_REQUEST);
                else {
                    Object newServiceRequest =
                        serviceRequest.getAttribute(Constants.SERVICE_REQUEST);
                    if ((newServiceRequest != null)
                        && (newServiceRequest instanceof SourceBean))
                        serviceRequest = (SourceBean) newServiceRequest;
                } // if (serviceRequest == null)
                emfErrorHandler = loopbackResponseContainer.getErrorHandler();
                if (emfErrorHandler == null)
                    emfErrorHandler = new EMFErrorHandler();
            } // if (isLoop)
            else {
              monitor = MonitorFactory.start("controller.adapter.portlet");
              serviceRequest = new SourceBean(Constants.SERVICE_REQUEST);
              requestContainer.setServiceRequest(serviceRequest);
             
                boolean isMultipart = false;
               
                // only an ActionRequest can have a multipart content
                if (request instanceof ActionRequest && PortletFileUpload.isMultipartContent((ActionRequest) request)) {
                  isMultipart = true;
                }
               
                if (isMultipart) {
                  handleMultipartForm((ActionRequest) request, requestContext);
                } else {
                  handleSimpleForm(request, requestContext);
                }
             
              // ***************** START SERVICE ***********************************************
              String actionName = (String) request.getAttribute("ACTION_NAME");
              if(actionName!=null) {
                request.removeAttribute("ACTION_NAME");
                serviceRequest.setAttribute("ACTION_NAME", actionName);
                serviceRequest.setAttribute(NEW_SESSION, "TRUE");
              }
              String page = (String)request.getAttribute("PAGE");
              if(page!=null) {
                request.removeAttribute("PAGE");
                serviceRequest.setAttribute("PAGE", page);
                serviceRequest.setAttribute(NEW_SESSION, "TRUE");
             
            // *******************************************************************************************
              emfErrorHandler = new EMFErrorHandler();
            }
           
            //***************** NAVIGATION CONTROL *******************************************************
            String navigation = getInitParameter("light_navigation");
            if ("enabled".equalsIgnoreCase(navigation)) {
              serviceRequest = LightNavigationManager.controlLightNavigation(request, serviceRequest);
            }
            //updates service request after LightNavigationManager control
            requestContainer.setServiceRequest(serviceRequest);
            //********************************************************************************************
           
            boolean isRequestedSessionIdValid = true;
            PortletSession session = request.getPortletSession(true);
            /*
            if (session.isNew()) {
                String newSessionString =
                    (String) (serviceRequest.getAttribute(NEW_SESSION));
                isRequestedSessionIdValid =
                    ((newSessionString != null)
                        && (newSessionString.equalsIgnoreCase("TRUE")));
            } // if (session.isNew())
            */
            synchronized (session) {
               
              // try to get the previous request container. Download from the session the previous
              // request container name and if it isn't null (it's null only formthe first invocation)
              //use it for download the request container object
              RequestContainer parentRequestContainer = null;
             
              //**************** START MODFIFICATION ZERBETTO 09-10-2006 ****************
              //String parentRequestContainerName =
              //  (String) session.getAttribute(REQUEST_CONTAINER_NAME);
              //if(parentRequestContainerName != null) {
              //  parentRequestContainer = (RequestContainer) session.getAttribute(parentRequestContainerName);
              //}
              parentRequestContainer = (RequestContainer) session.getAttribute(Constants.REQUEST_CONTAINER);
              //**************** END MODFIFICATION ZERBETTO 09-10-2006 ****************

                if (!Navigator.isNavigatorEnabled()) {
                    if (parentRequestContainer == null)
                        requestContainer.setSessionContainer(
                            new PortletSessionContainer(true));
                    else
                        requestContainer.setSessionContainer(
                            parentRequestContainer.getSessionContainer());
                }
                else {
                    if (parentRequestContainer == null)
                        requestContainer.setSessionContainer(
                            new PortletSessionContainer(true));
                    else {
                        requestContainer.setSessionContainer(
                            new PortletSessionContainer(false));
                        requestContainer.setParent(parentRequestContainer);
                    } // if (parentRequestContainer == null) else
                } // if (!Navigator.isNavigatorEnabled())
               
                //**************** START MODFIFICATION ZERBETTO 09-10-2006 ****************
                //session.setAttribute(Constants.REQUEST_CONTAINER, requestContainer);
                //**************** END MODFIFICATION ZERBETTO 09-10-2006 ****************
               
            } // synchronized (session)
            if (!isRequestedSessionIdValid) {
                TracerSingleton.log(
                    Constants.NOME_MODULO,
                    TracerSingleton.WARNING,
                    "AdapterPortlet::processAction: sessione scaduta !");
                SessionExpiredUtility.setSessionExpiredAction(serviceRequest);
            } // if (!isRequestedSessionIdValid)
           
            requestContainer.setAttribute(
                    HTTP_SESSION_ID,
                    request.getPortletSession().getId());
            String channelType = "PORTLET";
            String channelTypeParameter =
                (String) (serviceRequest.getAttribute(Constants.CHANNEL_TYPE));
            String channelTypeHeader =
                (String) (requestContainer.getAttribute(HTTP_ACCEPT_HEADER));
            if (((channelTypeParameter != null)
                && channelTypeParameter.equalsIgnoreCase(Constants.WAP_CHANNEL))
                || ((channelTypeHeader != null)
                    && (channelTypeHeader.indexOf(WAP_MIME_TYPE) != -1)))
                channelType = Constants.WAP_CHANNEL;
            requestContainer.setChannelType(channelType);


            TracerSingleton.log(
                Constants.NOME_MODULO,
                TracerSingleton.DEBUG,
                "AdapterPortlet::processAction: requestContainer",
                requestContainer);
            TracerSingleton.log(
                Constants.NOME_MODULO,
                TracerSingleton.DEBUG,
                "AdapterPortlet::processAction: sessionContainer",
                requestContainer.getSessionContainer());

            responseContainer.setErrorHandler(emfErrorHandler);
            SourceBean serviceResponse =
                new SourceBean(Constants.SERVICE_RESPONSE);
            responseContainer.setServiceResponse(serviceResponse);
            try {
                Navigator.checkNavigation(requestContainer);
            } // try
            catch (NavigationException ne) {
                TracerSingleton.log(
                    Constants.NOME_MODULO,
                    TracerSingleton.CRITICAL,
                    "AdapterPortlet::processAction: ",
                    ne);
                requestContainer.setServiceRequest(
                    NavigationErrorUtility.getNavigationErrorServiceRequest());
            } // catch (NavigationException ne)
            serviceRequest = requestContainer.getServiceRequest();

            CoordinatorIFace coordinator =
                DispatcherManager.getCoordinator(requestContext);
            Exception serviceException = null;
            if (coordinator == null) {
                TracerSingleton.log(
                    Constants.NOME_MODULO,
                    TracerSingleton.WARNING,
                    "AdapterPortlet::processAction: coordinator nullo !");
                serviceException = new Exception("Coordinatore non trovato");
                emfErrorHandler.addError(
                    new EMFInternalError(
                        EMFErrorSeverity.ERROR,
                        "Coordinatore non trovato !"));
            } // if (coordinator == null)
            else {
                ((RequestContextIFace) coordinator).setRequestContext(
                    requestContext);
                responseContainer.setBusinessType(
                        coordinator.getBusinessType());
                    responseContainer.setBusinessName(
                        coordinator.getBusinessName());
                try {
                    coordinator.service(serviceRequest, serviceResponse);
                } // try
                catch (Exception ex) {
                    TracerSingleton.log(
                        Constants.NOME_MODULO,
                        TracerSingleton.CRITICAL,
                        "AdapterPortlet::processAction:",
                        ex);
                    serviceException = ex;
                    emfErrorHandler.addError(
                        new EMFInternalError(EMFErrorSeverity.ERROR, ex));
                    responseContainer.setAttribute(PORTLET_EXCEPTION, serviceException);
                } // catch (Exception ex)
                 ((RequestContextIFace) coordinator).setRequestContext(null);
            } // if (coordinator == null) else
View Full Code Here

      IEventNotifier eventNotifier = null;
      RequestContextIFace requestContext = null;

        try {
          SourceBean serviceRequest = null;
            EMFErrorHandler emfErrorHandler = null;
            EMFExceptionHandler exceptionHandler = new EMFExceptionHandler();
           
            // Retrieve LOOP responseContainer, if any
            ResponseContainer loopbackResponseContainer = ResponseContainer.getResponseContainer();
           
            RequestContainer requestContainer = new RequestContainer();
            RequestContainer.setRequestContainer(requestContainer);
           
            ResponseContainer responseContainer = new ResponseContainer();
            ResponseContainer.setResponseContainer(responseContainer);
           
            requestContext = new DefaultRequestContext(requestContainer,
                    responseContainer);
           
            // Retrieve HTTP session
            HttpSession session = request.getSession(true);

          eventNotifier = EventNotifierFactory.getEventNotifier();
          eventNotifier.notifyEvent(
                new ServiceStartEvent(session),
                requestContext);           
          // Trace only after calling listener, so the session id can be written on log files
            TracerSingleton.log(Constants.NOME_MODULO, TracerSingleton.DEBUG,
                      "AdapterHTTP::service: invocato");

            boolean loopback = (request.getAttribute(Constants.PUBLISHING_MODE_LOOPBACK) != null);
            if (loopback) {
                TracerSingleton.log(Constants.NOME_MODULO, TracerSingleton.DEBUG,
                "AdapterHTTP::service: loop-back rilevato");

                // remove from the request the loopback attribute
              request.removeAttribute(Constants.PUBLISHING_MODE_LOOPBACK);
           
                loopbackResponseContainer = ResponseContainerAccess.getResponseContainer(request);
                serviceRequest = loopbackResponseContainer.getLoopbackServiceRequest();
                if (serviceRequest == null) {
                    serviceRequest = new SourceBean(Constants.SERVICE_REQUEST);
                } else {
                    Object newServiceRequest = serviceRequest
                            .getAttribute(Constants.SERVICE_REQUEST);
                    if ((newServiceRequest != null) && (newServiceRequest instanceof SourceBean))
                        serviceRequest = (SourceBean) newServiceRequest;
                } // if (serviceRequest == null)
                requestContainer.setServiceRequest(serviceRequest);
               
                // The errors are kept in loop mode, so retrieve old error handler
                emfErrorHandler = loopbackResponseContainer.getErrorHandler();
               
                if (emfErrorHandler == null) {
                    emfErrorHandler = new EMFErrorHandler();
                }
            } // if (loopbackResponseContainer != null)
            else {
                monitor = MonitorFactory.start("controller.adapter.http");
                serviceRequest = new SourceBean(Constants.SERVICE_REQUEST);
                requestContainer.setServiceRequest(serviceRequest);

                // Get header parameter before parsing the request
                setHttpRequestData(request, requestContainer);
               
                // Check if the service was invoked with the .action or .page URL
                handleServiceName(serviceRequest, requestContainer);
               
                boolean isMultipart = ServletFileUpload.isMultipartContent(new ServletRequestContext(request));
                if (isMultipart) {
                  handleMultipartForm(request, requestContext);
                } else {
                  handleSimpleForm(request, requestContext);
                }

                emfErrorHandler = new EMFErrorHandler();
            } // if (loopbackResponseContainer != null) else

           
            //***************** NAVIGATION CONTROL *******************************************************
            serviceRequest = LightNavigationManager.controlLightNavigation(request, serviceRequest);
            requestContainer.setServiceRequest(serviceRequest);
            //********************************************************************************************
           
            Exception serviceException = null;
            CoordinatorIFace coordinator = null;
            try {
              responseContainer.setErrorHandler(emfErrorHandler);
             
              String channelType = Constants.HTTP_CHANNEL;
              String channelTypeParameter = (String) (serviceRequest
                      .getAttribute(Constants.CHANNEL_TYPE));
              String channelTypeHeader = (String) (requestContainer.getAttribute(HTTP_ACCEPT_HEADER));
              if (((channelTypeParameter != null) && channelTypeParameter
                      .equalsIgnoreCase(Constants.WAP_CHANNEL))
                      || ((channelTypeHeader != null) && (channelTypeHeader.indexOf(WAP_MIME_TYPE) != -1)))
                  channelType = Constants.WAP_CHANNEL;
              requestContainer.setChannelType(channelType);
              requestContainer.setInternalRequest(request);
              requestContainer.setInternalResponse(response);
              requestContainer.setAdapterConfig(getServletConfig());
              TracerSingleton.log(Constants.NOME_MODULO, TracerSingleton.DEBUG,
                      "AdapterHTTP::service: requestContainer", requestContainer);
              TracerSingleton.log(Constants.NOME_MODULO, TracerSingleton.DEBUG,
                      "AdapterHTTP::service: sessionContainer", requestContainer
                              .getSessionContainer());
 
              SourceBean serviceResponse = new SourceBean(Constants.SERVICE_RESPONSE);
              responseContainer.setServiceResponse(serviceResponse);

              checkSession(session, requestContext);
                Navigator.checkNavigation(requestContainer);
             
              // Refresh service request because Navigator services can changed it
              serviceRequest = requestContainer.getServiceRequest();
             
              // Suspend/Resume service
              handleSuspendResume(serviceRequest, requestContainer);
             
              coordinator = DispatcherManager.getCoordinator(requestContext);
              if (coordinator == null) {
                  TracerSingleton.log(Constants.NOME_MODULO, TracerSingleton.WARNING,
                          "AdapterHTTP::service: coordinator nullo !");
                  serviceException = new Exception("Coordinatore non trovato");
                  emfErrorHandler.addError(new EMFInternalError(EMFErrorSeverity.ERROR,
                          "Coordinatore non trovato !"));
              } // if (coordinator == null)
              else {
                  ((RequestContextIFace) coordinator).setRequestContext(requestContext);
                  responseContainer.setBusinessType(coordinator.getBusinessType());
View Full Code Here

    SessionContainer sessionContainer = requestContainer
        .getSessionContainer()
    SourceBean serviceRequest = requestContainer.getServiceRequest();
    ValidatorLocator locator = ValidatorLocator.getInstance();
    EMFErrorHandler errorHandler = responseContainer.getErrorHandler();
    TracerSingleton.log(Constants.NOME_MODULO, TracerSingleton.INFORMATION,
        "Validation::validateService:automaticValidation");
    // Controlli formali automatici reperiti dal file validation.xml.xml
    automaticValidation(serviceRequest, errorHandler);
    if (!errorHandler.getErrors().isEmpty()) {
      // Se i controlli formali hanno prodotto errori, non proseguo con
      // gli altri controlli
      return false;
    }
    return true;
View Full Code Here

  public String getPublisherName(RequestContainer requestContainer, ResponseContainer responseContainer){

    String pubName = "";
    SourceBean serviceRequest = requestContainer.getServiceRequest();
    EMFErrorHandler errorHandler = responseContainer.getErrorHandler();
    // if there are some errors into the errorHandler  return the name for the errors publisher
    if(!GeneralUtilities.isErrorHandlerContainingOnlyValidationError(errorHandler)) {
      if(!errorHandler.isOKBySeverity(EMFErrorSeverity.ERROR)) {
        return "error";
      }
    }
    SourceBean moduleResponse = (SourceBean) responseContainer.getServiceResponse().getAttribute("BIObjectsModule");
    // if the module response is null throws an error and return the name of the errors publisher
    if (moduleResponse == null) {
      SpagoBITracer.major(SpagoBIConstants.NAME_MODULE,
                      "BIObjectsPublisher",
                      "getPublisherName",
                      "Module response null");
      EMFUserError error = new EMFUserError(EMFErrorSeverity.ERROR, 10 );
      errorHandler.addError(error);
      return "error";
    }
   
      String publisherName = (String) moduleResponse.getAttribute(SpagoBIConstants.PUBLISHER_NAME );
      if (publisherName != null &&  !publisherName.trim().equals("")) {
           return publisherName;
    }
   
    String objectView = (String) moduleResponse.getAttribute(SpagoBIConstants.OBJECTS_VIEW);
   
    if (SpagoBIConstants.VIEW_OBJECTS_AS_TREE.equalsIgnoreCase(objectView)) {
          // if passed the error check get the response of the module
      SourceBean treeModuleResponse = (SourceBean)responseContainer.getServiceResponse().getAttribute("TreeObjectsModule");
      // if the module response is null throws an error and return the name of the errors publisher
      if(treeModuleResponse==null) {
        SpagoBITracer.major(SpagoBIConstants.NAME_MODULE,
                        "BIObjectsPublisher",
                        "getPublisherName",
                        "Tree module response null");
        EMFUserError error = new EMFUserError(EMFErrorSeverity.ERROR, 10 );
        errorHandler.addError(error);
        return "error";
      }
     
      publisherName = (String) treeModuleResponse.getAttribute(SpagoBIConstants.PUBLISHER_NAME );
      if (publisherName != null &&  !publisherName.trim().equals("")) {
           return publisherName;
      }
     
      //gets the profile
      SessionContainer sessionContainer = requestContainer.getSessionContainer();
      SessionContainer permanentSession = sessionContainer.getPermanentContainer();
      IEngUserProfile profile = (IEngUserProfile)permanentSession.getAttribute(IEngUserProfile.ENG_USER_PROFILE);
     
      try{
        if (profile.isAbleToExecuteAction(SpagoBIConstants.DOCUMENT_MANAGEMENT_ADMIN)){
          String operation = (String)serviceRequest.getAttribute(SpagoBIConstants.OPERATION);
          if( (operation!=null) && (operation.equals(SpagoBIConstants.FUNCTIONALITIES_OPERATION)) ) {
            pubName = "treeFunctionalities";
          } else {
            pubName = "treeAdminObjects";
          }
        }
        else if (profile.isAbleToExecuteAction(SpagoBIConstants.DOCUMENT_MANAGEMENT_DEV))
          pubName = "treeDevObjects";
        else if (profile.isAbleToExecuteAction(SpagoBIConstants.DOCUMENT_MANAGEMENT_USER))
          pubName = "treeExecObjects";
        else if (profile.isAbleToExecuteAction(SpagoBIConstants.DOCUMENT_MANAGEMENT_TEST))
          pubName = "treeExecObjects";
        else pubName = "treeExecObjects";
      }
      catch (Exception e){
        SpagoBITracer.major(SpagoBIConstants.NAME_MODULE,
                  "BIObjectsPublisher",
                  "getPublisherName",
                  "Error would be defining pubName");
        EMFUserError error = new EMFUserError(EMFErrorSeverity.ERROR, 10 );
        errorHandler.addError(error);
        return "error";
      }
    } else {
      pubName = "listBIObjects";
    }
View Full Code Here

   */

  public String getPublisherName(RequestContainer requestContainer,
      ResponseContainer responseContainer) {

    EMFErrorHandler errorHandler = responseContainer.getErrorHandler();

    // get the module response
    SourceBean moduleResponse = (SourceBean) responseContainer
        .getServiceResponse().getAttribute("DocumentTemplateBuildModule");
   
    // if the module response is null throws an error and return the name of
    // the errors publisher
    if (moduleResponse == null) {
      SpagoBITracer.major(SpagoBIConstants.NAME_MODULE,
          this.getClass().getName(), "getPublisherName",
          "Module response null");
      EMFUserError error = new EMFUserError(EMFErrorSeverity.ERROR, 10);
      errorHandler.addError(error);
      return new String("error");
    }
   
    // if there are some errors into the errorHandler return the name for
    // the errors publisher
    if (!errorHandler.isOKBySeverity(EMFErrorSeverity.ERROR)) {
      return "error";
    }
   
    // if there are some error with INFORMATION severity,
    // returns the name of the publishers that will display them
    if (!errorHandler.isOKBySeverity(EMFErrorSeverity.INFORMATION)) {
      return "DocumentTemplateErrorInformationPublisher";
    }

    String publisherName = (String) moduleResponse.getAttribute(SpagoBIConstants.PUBLISHER_NAME);
    if (publisherName == null || publisherName.trim().equals("")) {
      SpagoBITracer.major(SpagoBIConstants.NAME_MODULE,
          this.getClass().getName(), "getPublisherName",
          "Publisher name not set");
      EMFUserError error = new EMFUserError(EMFErrorSeverity.ERROR, 10);
      errorHandler.addError(error);
      return "error";
    } else return publisherName;

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