Package it.eng.spagobi.mapcatalogue.dao

Examples of it.eng.spagobi.mapcatalogue.dao.ISbiGeoFeaturesDAO


        if (feature == null || feature.getFeatureId() == 0) {
          feature = new GeoFeature();
          feature.setName((String)hFeature.get("id"));
          feature.setDescr((String)hFeature.get("descr"));
          feature.setType((String)hFeature.get("type"));
          ISbiGeoFeaturesDAO dao=DAOFactory.getSbiGeoFeaturesDAO();
          dao.setUserProfile(profile);
          dao.insertFeature(feature);                  
        }
        lstFeatures.add(feature.getName());
  //      for every map/feature inserts a row in join table (SBI_GEO_MAP_FEATURES)             
        //gets map_id
        mapId = mapNew.getMapId();
        if (mapId == -1 )
          mapId = ((GeoMap)DAOFactory.getSbiGeoMapsDAO().loadMapByName(mapNew.getName())).getMapId();
       
        //gets feature id       
        if (feature.getFeatureId() == 0)
          feature = DAOFactory.getSbiGeoFeaturesDAO().loadFeatureByName((String)hFeature.get("id"));
       
        featureId = feature.getFeatureId();
        //gets relation
        GeoMapFeature mapFeature = DAOFactory.getSbiGeoMapFeaturesDAO().loadMapFeatures(new Integer(mapId), new Integer(featureId));
        if (mapFeature == null){ 
          mapFeature = new GeoMapFeature();
          mapFeature.setMapId(mapId);
          mapFeature.setFeatureId(featureId);
          mapFeature.setSvgGroup(null);
          mapFeature.setVisibleFlag(null);
          ISbiGeoMapFeaturesDAO dao=DAOFactory.getSbiGeoMapFeaturesDAO();
          dao.setUserProfile(profile);
          dao.insertMapFeatures(mapFeature);     
        }
      }//for
      return lstFeatures;
    } catch(EMFUserError eu){
      throw new EMFUserError(eu);
View Full Code Here


    RequestContainer reqCont = getRequestContainer();
    SessionContainer sessCont = reqCont.getSessionContainer();
    SessionContainer permSess = sessCont.getPermanentContainer();
    IEngUserProfile profile = (IEngUserProfile)permSess.getAttribute(IEngUserProfile.ENG_USER_PROFILE);
   
    ISbiGeoFeaturesDAO dao=DAOFactory.getSbiGeoFeaturesDAO();
    dao.setUserProfile(profile);
    GeoFeature feature = recoverFeatureDetails(request);
    if (feature.getName() == null) {
      response.setAttribute("mapObj", feature);
      response.setAttribute("modality", mod);
      return;
    }

    EMFErrorHandler errorHandler = getErrorHandler();
   
    // if there are some validation errors into the errorHandler does not write into DB
    Collection errors = errorHandler.getErrors();
    if (errors != null && errors.size() > 0) {
      Iterator iterator = errors.iterator();
      while (iterator.hasNext()) {
        Object error = iterator.next();
        if (error instanceof EMFValidationError) {
          response.setAttribute("featureObj", feature);
          response.setAttribute("modality", mod);
          return;
        }
      }
    }
   
    if (mod.equalsIgnoreCase(SpagoBIConstants.DETAIL_INS)) {
      //if a feature with the same name yet exists on db: error
      if (dao.loadFeatureByName(feature.getName()) != null){
        HashMap params = new HashMap();
        params.put(AdmintoolsConstants.PAGE, ListFeaturesModule.MODULE_PAGE);
        EMFUserError error = new EMFUserError(EMFErrorSeverity.ERROR, 5018, new Vector(), params );
        getErrorHandler().addError(error);
        return;
      }     
      dao.insertFeature(feature);
    } else {
      dao.modifyFeature(feature);
    }
       
  } catch (EMFUserError e){
    HashMap params = new HashMap();
    params.put(AdmintoolsConstants.PAGE, ListMapsModule.MODULE_PAGE);
View Full Code Here

    private String getMapsByFeature(String featureName) {
  logger.debug("IN");
  String toReturn = null;
  try {
      ISbiGeoMapFeaturesDAO mapFeaturesDAO = DAOFactory.getSbiGeoMapFeaturesDAO();
      ISbiGeoFeaturesDAO featureDAO = DAOFactory.getSbiGeoFeaturesDAO();
      GeoFeature tmpFeature = featureDAO.loadFeatureByName(featureName);
      if (tmpFeature == null)
    return null;
      List lstMaps = mapFeaturesDAO.loadMapNamesByFeatureId(new Integer(tmpFeature.getFeatureId()));
      if (lstMaps != null) {
    for (int i = 0; i < lstMaps.size(); i++) {
View Full Code Here

    private String getAllFeatureNames() {
  logger.debug("IN");
  String toReturn = null;
  try {
      ISbiGeoFeaturesDAO featureDAO = DAOFactory.getSbiGeoFeaturesDAO();
      List lstFeatures = featureDAO.loadAllFeatures();
      if (lstFeatures == null)
    return null;
      if (lstFeatures != null) {
    for (int i = 0; i < lstFeatures.size(); i++) {
        toReturn = ((toReturn == null) ? "" : toReturn) + ((GeoFeature) lstFeatures.get(i)).getName()
View Full Code Here

   */
  private void insertFeatures(Session session) throws EMFUserError {
    logger.debug("IN");
    try {
      Transaction tx = session.beginTransaction();
      ISbiGeoFeaturesDAO featuresDAO = DAOFactory.getSbiGeoFeaturesDAO();
      List allFeatures = featuresDAO.loadAllFeatures();
      Iterator featureIt = allFeatures.iterator();
      while (featureIt.hasNext()) {
        GeoFeature feature = (GeoFeature) featureIt.next();
        SbiGeoFeatures hibFeature = new SbiGeoFeatures(feature.getFeatureId());
        hibFeature.setDescr(feature.getDescr());
View Full Code Here

TOP

Related Classes of it.eng.spagobi.mapcatalogue.dao.ISbiGeoFeaturesDAO

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.