Examples of SbiGeoMaps


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

  }


  public SbiGeoMaps toSpagoBiGeoMaps() throws EMFUserError, EMFInternalError {
    logger.info("IN");
    SbiGeoMaps sbm = new SbiGeoMaps();
    sbm.setMapId(getMapId());
    sbm.setName(getName());
    sbm.setDescr(getDescr());
    sbm.setFormat(getFormat())
    sbm.setUrl(getUrl());

    IBinContentDAO binContentDAO=DAOFactory.getBinContentDAO();
    try{
      byte[] binContentsContent=binContentDAO.getBinContent(getBinId());
      if(binContentsContent!=null){
        Integer contentId=getBinId();
        SbiBinContents sbiBinContents=new SbiBinContents();
        sbiBinContents.setId(contentId);
        sbiBinContents.setContent(binContentsContent);
        sbm.setBinContents(sbiBinContents);
      }
    }
    catch (Exception e) {
      logger.error("Bin COntent not found");
    }
View Full Code Here

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

      ISbiGeoMapsDAO mapsDAO = DAOFactory.getSbiGeoMapsDAO();
      List allMaps = mapsDAO.loadAllMaps();
      Iterator mapsIt = allMaps.iterator();
      while (mapsIt.hasNext()) {
        GeoMap map = (GeoMap) mapsIt.next();
        SbiGeoMaps hibMap = new SbiGeoMaps(map.getMapId());
        hibMap.setDescr(map.getDescr());
        hibMap.setFormat(map.getFormat());
        hibMap.setName(map.getName());
        hibMap.setUrl(map.getUrl());

        if (map.getBinId() == 0) {
          logger.warn("Map with id = " + map.getMapId() + " and name = " + map.getName() +
          " has not binary content!!");
          hibMap.setBinContents(null);
        } else {
          SbiBinContents hibBinContent = new SbiBinContents();
          hibBinContent.setId(map.getBinId());
          byte[] content = DAOFactory.getBinContentDAO().getBinContent(map.getBinId());
          hibBinContent.setContent(content);
          hibMap.setBinContents(hibBinContent);

          session.save(hibBinContent);
        }

        session.save(hibMap);
View Full Code Here

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

      return hibDs;
    } else if (hibObj instanceof SbiGeoMaps) {
      String name = (String) unique;
      hql = "from SbiGeoMaps where name = '" + name + "'";
      hqlQuery = sessionCurrDB.createQuery(hql);
      SbiGeoMaps hibMap = (SbiGeoMaps) hqlQuery.uniqueResult();
      return hibMap;
    } else if (hibObj instanceof SbiGeoFeatures) {
      String name = (String) unique;
      hql = "from SbiGeoFeatures where name = '" + name + "'";
      hqlQuery = sessionCurrDB.createQuery(hql);
View Full Code Here

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

    try {
      // import maps
      List exportedMaps = importer.getAllExportedSbiObjects(sessionExpDB, "SbiGeoMaps", null);
      Iterator iterMaps = exportedMaps.iterator();
      while (iterMaps.hasNext()) {
        SbiGeoMaps expMap = (SbiGeoMaps) iterMaps.next();
        String name = expMap.getName();
        Object existObj = importer.checkExistence(name, sessionCurrDB, new SbiGeoMaps());
        SbiGeoMaps newMap = null;
        if (existObj != null) {
          if (!overwrite) {
            metaLog.log("Found an existing map '" + name + "' with "
                + "the same name of the exported map. It will be not overwritten.");
            continue;
          } else {
            metaLog.log("Found an existing map '" + name + "' with "
                + "the same name of the exported map. It will be overwritten.");
            newMap = (SbiGeoMaps) existObj;
          }
        } else {
          newMap = new SbiGeoMaps();
        }
        newMap.setName(expMap.getName());
        newMap.setDescr(expMap.getDescr());
        newMap.setFormat(expMap.getFormat());
        newMap.setUrl(expMap.getUrl());

        if (expMap.getBinContents() != null) {
          SbiBinContents binary = insertBinaryContent(expMap.getBinContents());
          newMap.setBinContents(binary);
        } else {
          metaLog.log("WARN: exported map with name '" + expMap.getName() + "' has no content!!");
          newMap.setBinContents(null);
        }

        sessionCurrDB.save(newMap);
        metaAss.insertCoupleMaps(new Integer(expMap.getMapId()), new Integer(newMap.getMapId()));
      }

      // import features
      List exportedFeatures = importer.getAllExportedSbiObjects(sessionExpDB, "SbiGeoFeatures", null);
      Iterator iterFeatures = exportedFeatures.iterator();
View Full Code Here

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

    Transaction tx = null;

    try {
      tmpSession = getSession();
      tx = tmpSession.beginTransaction();
      SbiGeoMaps hibMap = (SbiGeoMaps)tmpSession.load(SbiGeoMaps.class,  mapID);
      toReturn = hibMap.toGeoMap();
      tx.commit();

    } catch (HibernateException he) {
      logException(he);
View Full Code Here

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

      criteria.add(labelCriterrion)
      //List tmpLst = criteria.list();
      //return first map (unique)
      //if (tmpLst != null && tmpLst.size()>0) biMap = (SbiGeoMaps)tmpLst.get(0);   
      //if (tmpLst != null && tmpLst.size()>0) biMap = (SbiGeoMaps)tmpLst.get(0);
      SbiGeoMaps hibMap = (SbiGeoMaps) criteria.uniqueResult();
      if (hibMap == null) return null;
      biMap = hibMap.toGeoMap();       

      tx.commit();
    } catch (HibernateException he) {
      logException(he);
      if (tx != null)
View Full Code Here

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

        hibBinContents.setContent(content);
        Integer idBin = (Integer)tmpSession.save(hibBinContents);
        // recover the saved binary hibernate object
        hibBinContents = (SbiBinContents) tmpSession.load(SbiBinContents.class, idBin);
      }
      SbiGeoMaps hibMap = (SbiGeoMaps) tmpSession.load(SbiGeoMaps.class, new Integer(aMap.getMapId()));
      hibMap.setName(aMap.getName());
      hibMap.setDescr(aMap.getDescr());
      hibMap.setUrl(aMap.getUrl());     
      hibMap.setFormat(aMap.getFormat());
      hibMap.setBinContents(hibBinContents);
      updateSbiCommonInfo4Update(hibMap);
      tx.commit();

    } catch (HibernateException he) {
      logException(he);
View Full Code Here

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

      hibBinContents.setContent(content);
      Integer idBin = (Integer)tmpSession.save(hibBinContents);
      // recover the saved binary hibernate object
      hibBinContents = (SbiBinContents) tmpSession.load(SbiBinContents.class, idBin);

      SbiGeoMaps hibMap = new SbiGeoMaps();
      hibMap.setName(aMap.getName());
      hibMap.setDescr(aMap.getDescr());
      hibMap.setUrl(aMap.getUrl());
      hibMap.setFormat(aMap.getFormat());

      hibMap.setBinContents(hibBinContents);
      updateSbiCommonInfo4Insert(hibMap);
      tmpSession.save(hibMap);
      tx.commit();
    } catch (HibernateException he) {
      logException(he);
View Full Code Here

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

    Transaction tx = null;
    try {
      tmpSession = getSession();
      tx = tmpSession.beginTransaction();

      SbiGeoMaps hibMap = (SbiGeoMaps) tmpSession.load(SbiGeoMaps.class,
          new Integer(aMap.getMapId()));

      tmpSession.delete(hibMap);

      // delete template from sbi_binary_contents
      SbiBinContents hibBinCont = hibMap.getBinContents();
      if (hibBinCont != null) tmpSession.delete(hibBinCont);

      tx.commit();
    } catch (HibernateException he) {
      logException(he);
View Full Code Here

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

      Query hibQuery = tmpSession.createQuery(" from SbiGeoMaps");

      List hibList = hibQuery.list();
      Iterator it = hibList.iterator();     
      while (it.hasNext()) {     
        SbiGeoMaps hibMap = (SbiGeoMaps) it.next()
        if (hibMap != null) {
          GeoMap biMap = hibMap.toGeoMap()
          realResult.add(biMap);
        }
      }
      tx.commit();
    } catch (HibernateException 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.