Examples of SbiGeoMapFeatures


Examples of it.eng.spagobi.mapcatalogue.metadata.SbiGeoMapFeatures

        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

Examples of it.eng.spagobi.mapcatalogue.metadata.SbiGeoMapFeatures

      Map uniqueMap = (Map) unique;
      Integer mapId = (Integer) uniqueMap.get("mapId");
      Integer featureId = (Integer) uniqueMap.get("featureId");
      hql = "from SbiGeoMapFeatures where id.mapId = " + mapId + " and id.featureId = " + featureId;
      hqlQuery = sessionCurrDB.createQuery(hql);
      SbiGeoMapFeatures hibMapFeature = (SbiGeoMapFeatures) hqlQuery.uniqueResult();
      return hibMapFeature;
    } else if (hibObj instanceof it.eng.spagobi.kpi.threshold.metadata.SbiThreshold) {
      String label = (String) unique;
      hql = "from SbiThreshold ds where ds.code = '" + label + "'";
      hqlQuery = sessionCurrDB.createQuery(hql);
View Full Code Here

Examples of it.eng.spagobi.mapcatalogue.metadata.SbiGeoMapFeatures

      // import association between maps and features
      List exportedMapFeatures = importer.getAllExportedSbiObjects(sessionExpDB, "SbiGeoMapFeatures", null);
      Iterator iterMapFeatures = exportedMapFeatures.iterator();
      while (iterMapFeatures.hasNext()) {
        SbiGeoMapFeatures expMapFeature = (SbiGeoMapFeatures) iterMapFeatures.next();
        Integer expMapId = new Integer(expMapFeature.getId().getMapId());
        Integer expFeatureId = new Integer(expMapFeature.getId().getFeatureId());
        Integer existingMapId = null;
        Integer existingFeatureId = null;
        // find associated map id
        Map mapsIDAssociations = metaAss.getMapIDAssociation();
        Set mapsIDAssociationsKeySet = mapsIDAssociations.keySet();
        if (!mapsIDAssociationsKeySet.contains(expMapId)) {
          metaLog.log("Association between exported map with id = " + expMapId + " and exported feature with id = " + expFeatureId +
          " will not be imported: the map was not imported.");
          continue;
        } else {
          existingMapId = (Integer) mapsIDAssociations.get(expMapId);
        }
        // find associated feature id
        Map featuresIDAssociations = metaAss.getFeaturesIDAssociation();
        Set featuresIDAssociationsKeySet = featuresIDAssociations.keySet();
        if (!featuresIDAssociationsKeySet.contains(expFeatureId)) {
          metaLog.log("Association between exported map with id = " + expMapId + " and exported feature with id = " + expFeatureId +
          " will not be imported: the feature was not imported.");
          continue;
        } else {
          existingFeatureId = (Integer) featuresIDAssociations.get(expFeatureId);
        }

        Map unique = new HashMap();
        unique.put("mapId", existingMapId);
        unique.put("featureId", existingFeatureId);
        Object existObj = importer.checkExistence(unique, sessionCurrDB, new SbiGeoMapFeatures());
        SbiGeoMapFeatures newMapFeature = null;
        if (existObj != null) {
          if (!overwrite) {
            metaLog.log("Found an existing association between map " + existingMapId + " and feature " + existingFeatureId + ". " +
            "It will be not overwritten.");
            continue;
          } else {
            metaLog.log("Found an existing association between map " + existingMapId + " and feature " + existingFeatureId + ". " +
            "It will be overwritten.");
            newMapFeature = (SbiGeoMapFeatures) existObj;
          }
        } else {
          newMapFeature = new SbiGeoMapFeatures();
          SbiGeoMapFeaturesId hibMapFeatureId = new SbiGeoMapFeaturesId();     
          hibMapFeatureId.setMapId(existingMapId.intValue());
          hibMapFeatureId.setFeatureId(existingFeatureId.intValue());
          newMapFeature.setId(hibMapFeatureId);
        }
        newMapFeature.setSvgGroup(expMapFeature.getSvgGroup());
        newMapFeature.setVisibleFlag(expMapFeature.getVisibleFlag());
        sessionCurrDB.save(newMapFeature);
      }

      /*
      // copy all exported map files
View Full Code Here

Examples of it.eng.spagobi.mapcatalogue.metadata.SbiGeoMapFeatures

      hqlQuery.setInteger(0, mapId.intValue());
      List hibList = hqlQuery.list();
     
      Iterator it = hibList.iterator();
      ISbiGeoFeaturesDAO featuresDAO = DAOFactory.getSbiGeoFeaturesDAO();
      SbiGeoMapFeatures tmpMapFeature = null;
      GeoFeature tmpFeature = null;
      while (it.hasNext()) {     
        tmpMapFeature = (SbiGeoMapFeatures) it.next();
        SbiGeoMapFeaturesId tmpMapFeatureId = tmpMapFeature.getId();       
        tmpFeature = featuresDAO.loadFeatureByID(new Integer(tmpMapFeatureId.getFeatureId()));
   
        if (tmpFeature != null)
          realResult.add((String)tmpFeature.getName());
      }
View Full Code Here

Examples of it.eng.spagobi.mapcatalogue.metadata.SbiGeoMapFeatures

      hqlQuery.setInteger(0, mapId.intValue());
      List hibList = hqlQuery.list();
     
      Iterator it = hibList.iterator();
      ISbiGeoFeaturesDAO featuresDAO = DAOFactory.getSbiGeoFeaturesDAO();
      SbiGeoMapFeatures tmpMapFeature = null;
      GeoFeature tmpFeature = null;
      while (it.hasNext()) {     
        tmpMapFeature = (SbiGeoMapFeatures) it.next();
        SbiGeoMapFeaturesId tmpMapFeatureId = tmpMapFeature.getId();       
        tmpFeature = featuresDAO.loadFeatureByID(new Integer(tmpMapFeatureId.getFeatureId()));
   
        if (tmpFeature != null)
          realResult.add((GeoFeature)tmpFeature);
      }
View Full Code Here

Examples of it.eng.spagobi.mapcatalogue.metadata.SbiGeoMapFeatures

      hqlQuery.setInteger(0, featureId.intValue());
      List hibList = hqlQuery.list();
     
      Iterator it = hibList.iterator();
      ISbiGeoMapsDAO mapDAO = DAOFactory.getSbiGeoMapsDAO();
      SbiGeoMapFeatures tmpMapFeature = null;
      GeoMap tmpMap = null;
      while (it.hasNext()) {       
        tmpMapFeature = (SbiGeoMapFeatures) it.next();
        SbiGeoMapFeaturesId tmpMapFeatureId = tmpMapFeature.getId();       
        tmpMap = mapDAO.loadMapByID(new Integer(tmpMapFeatureId.getMapId()));
        if (tmpMap != null)
          realResult.add((String)tmpMap.getName());
      }
      tx.commit();
View Full Code Here

Examples of it.eng.spagobi.mapcatalogue.metadata.SbiGeoMapFeatures

      hqlQuery.setInteger(0, featureId.intValue());
      List hibList = hqlQuery.list();
     
      Iterator it = hibList.iterator();
      ISbiGeoMapsDAO mapDAO = DAOFactory.getSbiGeoMapsDAO();
      SbiGeoMapFeatures tmpMapFeature = null;
      GeoMap tmpMap = null;
      while (it.hasNext()) {       
        tmpMapFeature = (SbiGeoMapFeatures) it.next();
        SbiGeoMapFeaturesId tmpMapFeatureId = tmpMapFeature.getId();       
        tmpMap = mapDAO.loadMapByID(new Integer(tmpMapFeatureId.getMapId()));
        if (tmpMap != null)
          realResult.add((GeoMap)tmpMap);
      }
      tx.commit();
View Full Code Here

Examples of it.eng.spagobi.mapcatalogue.metadata.SbiGeoMapFeatures

            " and s.id.featureId=?" ;
      Query query = aSession.createQuery(hql);
      query.setInteger(0, mapId.intValue());
      query.setInteger(1, featureId.intValue());
      //toReturn =(GeoMapFeature) query.uniqueResult();     
      SbiGeoMapFeatures hibMapFeature = (SbiGeoMapFeatures)query.uniqueResult();
      if (hibMapFeature == null) return null;
      toReturn = toGeoMapFeature(hibMapFeature);
     
      tx.commit();
    } catch (HibernateException he) {
View Full Code Here

Examples of it.eng.spagobi.mapcatalogue.metadata.SbiGeoMapFeatures

      tx = aSession.beginTransaction();
      SbiGeoMapFeaturesId hibMapFeatureId = new SbiGeoMapFeaturesId();
      hibMapFeatureId.setMapId(aMapFeature.getMapId());
      hibMapFeatureId.setFeatureId(aMapFeature.getFeatureId());

      SbiGeoMapFeatures hibFeature = (SbiGeoMapFeatures) aSession.load(SbiGeoMapFeatures.class, hibMapFeatureId);
      hibFeature.setSvgGroup(aMapFeature.getSvgGroup());
      hibFeature.setVisibleFlag(aMapFeature.getVisibleFlag());
      updateSbiCommonInfo4Update(hibFeature);
      tx.commit();
    } catch (HibernateException he) {
      logException(he);
View Full Code Here

Examples of it.eng.spagobi.mapcatalogue.metadata.SbiGeoMapFeatures

    Session aSession = null;
    Transaction tx = null;
    try {
      aSession = getSession();
      tx = aSession.beginTransaction();
      SbiGeoMapFeatures hibMapFeature = new SbiGeoMapFeatures()
     
      SbiGeoMapFeaturesId hibMapFeatureId = new SbiGeoMapFeaturesId();     
      hibMapFeatureId.setMapId(aMapFeature.getMapId());
      hibMapFeatureId.setFeatureId(aMapFeature.getFeatureId());
      hibMapFeature.setId(hibMapFeatureId);
     
      hibMapFeature.setSvgGroup(aMapFeature.getSvgGroup());
      hibMapFeature.setVisibleFlag(aMapFeature.getVisibleFlag());
      updateSbiCommonInfo4Insert(hibMapFeature);
      aSession.save(hibMapFeature);
      tx.commit();
    } catch (HibernateException he) {
      logException(he);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.