Package it.eng.spago.error

Examples of it.eng.spago.error.EMFUserError


    if (mod.equalsIgnoreCase(SpagoBIConstants.DETAIL_INS)) {     
      //if a map with the same name not exists on db ok else error
      if (daoGeoMaps.loadMapByName(mapNew.getName()) != null){
        HashMap params = new HashMap();
        params.put(AdmintoolsConstants.PAGE, ListMapsModule.MODULE_PAGE);
        EMFUserError error = new EMFUserError(EMFErrorSeverity.ERROR, 5005, new Vector(), params );
        getErrorHandler().addError(error);
        return;
      }      
      /* The activity INSERT consists in:
       * - insert a map (SBI_GEO_MAPS),
       * - insert of the features (SBI_GEO_FEATURES) through the   method 'loadUpdateMapFeatures'
       * - insert of the relations (SBI_GEO_MAP_FEATURES) through the method 'loadUpdateMapFeatures'
       * (all objects are had taken from the template file)
       */
      //DAOFactory.getSbiGeoMapsDAO().insertMap(mapNew);
      daoGeoMaps.insertMap(mapNew, content);
      loadUpdateMapFeatures(mapNew,profile);
      GeoMap tmpMap = daoGeoMaps.loadMapByName(mapNew.getName());
      mapNew.setMapId(tmpMap.getMapId());
      mapNew.setBinId(tmpMap.getBinId());
      serviceResponse.setAttribute("mapObj", mapNew);
      serviceResponse.setAttribute("modality", SpagoBIConstants.DETAIL_MOD);
     
      getTabDetails(serviceRequest, serviceResponse);
     
      if (((String)serviceRequest.getAttribute("SUBMESSAGEDET")).equalsIgnoreCase(MOD_SAVEBACK))
      {
        serviceResponse.setAttribute("loopback", "true");
        return;
      }
     
      return;

    } else {
      /* The activity UPDATE consists in:
       * - update of a map (SBI_GEO_MAPS),
       * - update of the relations (SBI_GEO_MAP_FEATURES) through the method 'loadUpdateMapFeatures', eventually if
       *   there are new features those will be inserted.
       * (all objects had taken from the template file)
       */
      //if content is null is because the user has modified the detail of map but not the content file (not upload)
      if (content == null){
        content = DAOFactory.getBinContentDAO().getBinContent(new Integer(mapNew.getBinId()));
      }
      List lstOldFeatures = DAOFactory.getSbiGeoMapFeaturesDAO().loadFeaturesByMapId(new Integer(mapNew.getMapId()));
      //update map
      daoGeoMaps.modifyMap(mapNew, content);     
      //update features
      List lstNewFeatures = loadUpdateMapFeatures(mapNew,profile);
      logger.debug("Loaded " +lstNewFeatures.size()+ " features form svg file." );
       // If in the new file svg there aren't more some feature, the user can choose if erase theme relations or not.
      List lstFeaturesDel = new ArrayList();
     
      for (int i=0; i<lstOldFeatures.size(); i++){         
        if (!(lstNewFeatures.contains(((GeoFeature)lstOldFeatures.get(i)).getName())))
          lstFeaturesDel.add(((GeoFeature)lstOldFeatures.get(i)).getName());
      }
      if (lstFeaturesDel.size() > 0){
        serviceResponse.setAttribute("lstFeaturesOld",lstFeaturesDel);
        serviceResponse.setAttribute("SUBMESSAGEDET", ((String)serviceRequest.getAttribute("SUBMESSAGEDET")));
        getTabDetails(serviceRequest, serviceResponse);     
        serviceResponse.setAttribute("modality", mod);
        serviceResponse.setAttribute("mapObj", mapNew);         
        return;                   
      }       
    } 
    if (serviceRequest.getAttribute("SUBMESSAGEDET") != null &&
      ((String)serviceRequest.getAttribute("SUBMESSAGEDET")).equalsIgnoreCase(MOD_SAVE)) {     
      getTabDetails(serviceRequest, serviceResponse);     
      serviceResponse.setAttribute("modality", mod);
      serviceResponse.setAttribute("mapObj", mapNew);       
      return;
    }
    else if (serviceRequest.getAttribute("SUBMESSAGEDET") != null &&
        ((String)serviceRequest.getAttribute("SUBMESSAGEDET")).equalsIgnoreCase(MOD_SAVEBACK)){
        serviceResponse.setAttribute("loopback", "true");
          return;
    }              
  } catch (EMFUserError e){
    logger.error("Error while saving catalogue map: " +  e.getMessage());
    HashMap params = new HashMap();
    params.put(AdmintoolsConstants.PAGE, ListMapsModule.MODULE_PAGE);
    throw new EMFUserError(EMFErrorSeverity.ERROR, e.getDescription(), new Vector(), params);
   
  }
 
  catch (Exception ex) {   
    TracerSingleton.log(SpagoBIConstants.NAME_MODULE, TracerSingleton.MAJOR, "Cannot fill response container" + ex.getLocalizedMessage());   
    throw new EMFUserError(EMFErrorSeverity.ERROR, 100);
 
}
View Full Code Here


    GeoMap map = DAOFactory.getSbiGeoMapsDAO().loadMapByID(new Integer(id));
    DAOFactory.getSbiGeoMapsDAO().eraseMap(map);
  }   catch (EMFUserError e){
      HashMap params = new HashMap();     
      params.put(AdmintoolsConstants.PAGE, ListMapsModule.MODULE_PAGE);
      throw new EMFUserError(EMFErrorSeverity.ERROR, 5010, new Vector(), params);
     
    }
      catch (Exception ex) {   
      ex.printStackTrace();
    TracerSingleton.log(SpagoBIConstants.NAME_MODULE, TracerSingleton.MAJOR, "Cannot fill response container" + ex.getLocalizedMessage());
    throw new EMFUserError(EMFErrorSeverity.ERROR, 100);
  }
  response.setAttribute("loopback", "true")
}
View Full Code Here

      response.setAttribute("modality", SpagoBIConstants.DETAIL_MOD);
     
  }   catch (EMFUserError e){
      HashMap params = new HashMap();     
      params.put(AdmintoolsConstants.PAGE, ListMapsModule.MODULE_PAGE);
      throw new EMFUserError(EMFErrorSeverity.ERROR, 5027, new Vector(), params);
     
    }
      catch (Exception ex) {   
      ex.printStackTrace();
    TracerSingleton.log(SpagoBIConstants.NAME_MODULE, TracerSingleton.MAJOR, "Cannot fill response container" + ex.getLocalizedMessage());
    throw new EMFUserError(EMFErrorSeverity.ERROR, 100);
 
}
View Full Code Here

    map.setFormat("");
    map.setBinId(-1);
    response.setAttribute("mapObj", map);
  } catch (Exception ex) {
    TracerSingleton.log(SpagoBIConstants.NAME_MODULE, TracerSingleton.MAJOR, "Cannot prepare page for the insertion" + ex.getLocalizedMessage());   
    throw new EMFUserError(EMFErrorSeverity.ERROR, 100);
  }
 
}
View Full Code Here

          dao.insertMapFeatures(mapFeature);     
        }
      }//for
      return lstFeatures;
    } catch(EMFUserError eu){
      throw new EMFUserError(eu);
    } catch (Exception e) {
      e.printStackTrace();
      throw new EMFUserError(EMFErrorSeverity.ERROR, 5009)
    }
  }
View Full Code Here

      response.setAttribute("selectedFeatureId",selectedFeatureId);               
    } catch (Exception ex) {
      TracerSingleton.log(SpagoBIConstants.NAME_MODULE, TracerSingleton.MAJOR, "Cannot fill response container" + ex.getLocalizedMessage())
      HashMap params = new HashMap();
      params.put(AdmintoolsConstants.PAGE, ListMapsModule.MODULE_PAGE);
      throw new EMFUserError(EMFErrorSeverity.ERROR, 5011, new Vector(), params);
    }
  }
View Full Code Here

      }
    } catch (Exception ex) {
      TracerSingleton.log(SpagoBIConstants.NAME_MODULE, TracerSingleton.MAJOR, "Cannot fill response container" + ex.getLocalizedMessage())
      HashMap params = new HashMap();
      params.put(AdmintoolsConstants.PAGE, ListMapsModule.MODULE_PAGE);
      throw new EMFUserError(EMFErrorSeverity.ERROR, 5011, new Vector(), params);
    }
  } 
View Full Code Here

       try
      if (binId == null || binId.equals("0") ){
        logger.error("Cannot get content file. The identifier is null.");
        HashMap params = new HashMap();
        params.put(AdmintoolsConstants.PAGE, DetailMapModule.MODULE_PAGE);
        throw new EMFUserError(EMFErrorSeverity.ERROR, "5030", new Vector(), params, "component_mapcatalogue_messages");
      }
      else{
        freezeHttpResponse();
          //HttpServletRequest request = getHttpRequest();
          HttpServletResponse response = getHttpResponse();
View Full Code Here

    ContextManager contextManager = new ContextManager(new SpagoBISessionContainer(session),
        new LightNavigatorContextRetrieverStrategy(requestContainer.getServiceRequest()));
   
    if (obj == null) {
      logger.error("The input object is null");
      throw new EMFUserError(EMFErrorSeverity.ERROR, "100", messageBundle);
    }

    if (!obj.getBiObjectTypeCode().equalsIgnoreCase("OFFICE_DOC")) {
      logger.error("The input object is not a office document");
      throw new EMFUserError(EMFErrorSeverity.ERROR, "1001", messageBundle);
    }
   
    try {
      response.setAttribute(ObjectsTreeConstants.SESSION_OBJ_ATTR, obj);
      // set information for the publisher
      response.setAttribute(SpagoBIConstants.PUBLISHER_NAME, "OFFICE_DOC");
    } catch (Exception e) {
      logger.error("Cannot exec the Office document");
      throw new EMFUserError(EMFErrorSeverity.ERROR, "100", messageBundle);
    }
  }
View Full Code Here

  public void executeSubObject(RequestContainer requestContainer,
      BIObject obj, SourceBean response, Object subObjectInfo)
      throws EMFUserError {
    // it cannot be invoked
    logger.error("SpagoBIOfficeDocumentInternalEngine cannot exec subobjects");
    throw new EMFUserError(EMFErrorSeverity.ERROR, "101", messageBundle);
  }
View Full Code Here

TOP

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

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.