Package it.eng.spagobi.mapcatalogue.bo

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


  logger.debug("IN");
  String toReturn = null;
  try {
      ISbiGeoMapFeaturesDAO mapFeaturesDAO = DAOFactory.getSbiGeoMapFeaturesDAO();
      ISbiGeoMapsDAO mapDAO = DAOFactory.getSbiGeoMapsDAO();
      GeoMap tmpMap = mapDAO.loadMapByName(mapName);
      if (tmpMap == null)
    return null;
      List lstFeatures = mapFeaturesDAO.loadFeatureNamesByMapId(new Integer(tmpMap.getMapId()));
      if (lstFeatures != null) {
    for (int i = 0; i < lstFeatures.size(); i++) {
        toReturn = ((toReturn == null) ? "" : toReturn) + (String) lstFeatures.get(i)
          + ((i == lstFeatures.size() - 1) ? "" : ",");
    }
View Full Code Here


    private String getMapUrl(String mapName) {
   logger.debug("IN");
  String toReturn = null;
  try {
      ISbiGeoMapsDAO mapDAO = DAOFactory.getSbiGeoMapsDAO();
      GeoMap tmpMap = mapDAO.loadMapByName(mapName);
      if (tmpMap == null)
    return null;
      toReturn = ((tmpMap.getUrl()== null)?"":tmpMap.getUrl()).replace('\\', '/');
      logger.debug("MapUrl:"+toReturn);
      return toReturn;
  } catch (Exception e) {
      logger.error("Error",e);
      return null;
View Full Code Here

      Transaction tx = session.beginTransaction();
      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);
        }
View Full Code Here

      ISbiGeoMapsDAO mapsDAO = DAOFactory.getSbiGeoMapsDAO();
      List allMaps = mapsDAO.loadAllMaps();
      ISbiGeoMapFeaturesDAO mapFeaturesDAO = DAOFactory.getSbiGeoMapFeaturesDAO();
      Iterator mapsIt = allMaps.iterator();
      while (mapsIt.hasNext()) {
        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);
View Full Code Here

   *
   * @return the corrispondent output <code>GeoMap</code>
   */
  public GeoMap toGeoMap(){

    GeoMap map = new GeoMap();
    map.setMapId(getMapId());
    map.setName(getName());
    map.setDescr(getDescr());
    map.setFormat(getFormat());
    map.setUrl(getUrl());
    SbiBinContents tmpBin = getBinContents();
    if (tmpBin != null) {
      map.setBinId(tmpBin.getId().intValue());
    }


    return map;
  }
View Full Code Here

   * @throws EMFUserError the EMF user error
   *
   * @see it.eng.spagobi.mapcatalogue.dao.geo.bo.dao.ISbiGeoMapsDAO#loadMapByID(integer)
   */
  public GeoMap loadMapByID(Integer mapID) throws EMFUserError {
    GeoMap toReturn = null;
    Session tmpSession = null;
    Transaction tx = null;

    try {
      tmpSession = getSession();
View Full Code Here

   * @throws EMFUserError the EMF user error
   *
   * @see it.eng.spagobi.mapcatalogue.dao.geo.bo.dao.ISbiGeoMapsDAO#loadMapByName(string)
   */ 
  public GeoMap loadMapByName(String name) throws EMFUserError {
    GeoMap biMap = null;
    Session tmpSession = null;
    Transaction tx = null;
    try {
      tmpSession = getSession();
      tx = tmpSession.beginTransaction();
View Full Code Here

      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

      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();
    } catch (HibernateException he) {
      logException(he);
View Full Code Here

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

TOP

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

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.