Package it.eng.spagobi.mapcatalogue.bo

Examples of it.eng.spagobi.mapcatalogue.bo.GeoMapFeature


//    if the map is associated with any BIFeautures, delete before this associations and then delete the map
    List lstMapFeatures =  DAOFactory.getSbiGeoMapFeaturesDAO().loadFeaturesByMapId(new Integer(id));
    if (lstMapFeatures != null){
      for (int i=0; i<lstMapFeatures.size();i++){
        int featureId = ((GeoFeature)lstMapFeatures.get(i)).getFeatureId();
        GeoMapFeature tmpMapFeature = DAOFactory.getSbiGeoMapFeaturesDAO().loadMapFeatures(new Integer(id), new Integer(featureId));       
        DAOFactory.getSbiGeoMapFeaturesDAO().eraseMapFeatures(tmpMapFeature);
      }
    }
    //delete the map
    GeoMap map = DAOFactory.getSbiGeoMapsDAO().loadMapByID(new Integer(id));
View Full Code Here


        }
      }
    }

    //inserts the relation
    GeoMapFeature mapFeature = dao.loadMapFeatures(new Integer(mapId), new Integer(featureId));
    if (mapFeature == null){
      mapFeature = new  GeoMapFeature();
      mapFeature.setMapId(new Integer(mapId).intValue());
      mapFeature.setFeatureId(new Integer(featureId).intValue());
      mapFeature.setSvgGroup(null);
      mapFeature.setVisibleFlag(null);   
      dao.insertMapFeatures(mapFeature);
    }
    //create a List of features
    List lstAllFeatures = dao.loadFeatureNamesByMapId(new Integer(map.getMapId()));
    List lstMapFeatures = new ArrayList();
View Full Code Here

        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
View Full Code Here

          String[] lstOldFeatures = oldFeatures.split(",");                    
      if (lstOldFeatures != null){
        String mapId = (String)request.getAttribute("id");
        for (int i=0; i<lstOldFeatures.length; i++){
          GeoFeature aFeature = DAOFactory.getSbiGeoFeaturesDAO().loadFeatureByName(((String)lstOldFeatures[i]).trim());
          GeoMapFeature aMapFeature = (GeoMapFeature)DAOFactory.getSbiGeoMapFeaturesDAO().loadMapFeatures(new Integer(mapId), new Integer(aFeature.getFeatureId()));                
          DAOFactory.getSbiGeoMapFeaturesDAO().eraseMapFeatures(aMapFeature);
        }         
      } 
     
      if (((String)request.getAttribute("SUBMESSAGEDET")).equalsIgnoreCase(MOD_SAVEBACK))
View Full Code Here

        GeoFeature feature = DAOFactory.getSbiGeoFeaturesDAO().loadFeatureByID(new Integer(id));
        List lstMapFeature =DAOFactory.getSbiGeoMapFeaturesDAO().loadMapsByFeatureId(new Integer(id));
        //deletes relations between feature and maps
        for (int i=0; i < lstMapFeature.size(); i++){
          GeoMap map = (GeoMap)lstMapFeature.get(i);
          GeoMapFeature mapFeature = DAOFactory.getSbiGeoMapFeaturesDAO().loadMapFeatures(new Integer(map.getMapId()), new Integer(id));
          DAOFactory.getSbiGeoMapFeaturesDAO().eraseMapFeatures(mapFeature);
        }
        //deletes the feature
        DAOFactory.getSbiGeoFeaturesDAO().eraseFeature(feature);
  }   catch (EMFUserError e){
View Full Code Here

        GeoMap map = (GeoMap) mapsIt.next();
        List mapFeatures = mapFeaturesDAO.loadFeaturesByMapId(new Integer(map.getMapId()));
        Iterator mapFeaturesIt = mapFeatures.iterator();
        while (mapFeaturesIt.hasNext()) {
          GeoFeature feature = (GeoFeature) mapFeaturesIt.next();
          GeoMapFeature mapFeature = mapFeaturesDAO.loadMapFeatures(new Integer(map.getMapId()), new Integer(feature.getFeatureId()));
          SbiGeoMapFeatures hibMapFeature = new SbiGeoMapFeatures()
          SbiGeoMapFeaturesId hibMapFeatureId = new SbiGeoMapFeaturesId();     
          hibMapFeatureId.setMapId(mapFeature.getMapId());
          hibMapFeatureId.setFeatureId(mapFeature.getFeatureId());
          hibMapFeature.setId(hibMapFeatureId);
          hibMapFeature.setSvgGroup(mapFeature.getSvgGroup());
          hibMapFeature.setVisibleFlag(mapFeature.getVisibleFlag());
          session.save(hibMapFeature);
        }
      }
      tx.commit();
    } catch (Exception e) {
View Full Code Here

   * @throws EMFUserError the EMF user error
   *
   * @see it.eng.spagobi.mapcatalogue.dao.bo.dao.ISbiGeoMapFeaturesDAO#loadMapFeatures(java.lang.Integer, java.lang.Integer)
   */
  public GeoMapFeature loadMapFeatures(Integer mapId, Integer featureId) throws EMFUserError {
    GeoMapFeature toReturn = null;
    Session aSession = null;
    Transaction tx = null;
    try {
      aSession = getSession();
      tx = aSession.beginTransaction();
View Full Code Here

   *
   * @return the corrispondent output <code>GeoMap</code>
   */
  public GeoMapFeature toGeoMapFeature(SbiGeoMapFeatures hibMapFeature){
   
    GeoMapFeature mapFeature = new GeoMapFeature();         
   
    mapFeature.setMapId(hibMapFeature.getId().getMapId());
    mapFeature.setFeatureId(hibMapFeature.getId().getFeatureId());
    mapFeature.setSvgGroup(hibMapFeature.getSvgGroup());
    mapFeature.setVisibleFlag(hibMapFeature.getVisibleFlag());
   
    /*List maps = new ArrayList();
 
    Set hibFeatures = hibMap.getSbiGeoMapFeatureses();     
    for (Iterator it = hibFeatures.iterator(); it.hasNext(); ) {
View Full Code Here

TOP

Related Classes of it.eng.spagobi.mapcatalogue.bo.GeoMapFeature

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.