Package it.eng.spagobi.commons.metadata

Examples of it.eng.spagobi.commons.metadata.SbiBinContents


  Session aSession = null;
  Transaction tx = null;
  try {
      aSession = getSession();
      tx = aSession.beginTransaction();
      SbiBinContents hibBinCont = (SbiBinContents) aSession.load(SbiBinContents.class, binId);
      content = hibBinCont.getContent();
      tx.commit();
  } catch (HibernateException he) {
      logger.error("HibernateException",he);
      if (tx != null)
    tx.rollback();
View Full Code Here


          metaLog.log("Exported snaphost with name = [" + expSbiSnapshots.getName() + "] and creation date = [" + expSbiSnapshots.getCreationDate() + "] (of document with name = [" + exportedObj.getName() + "] and label = [" + exportedObj.getLabel() + "]) is already existing, most likely it is the same snapshot, so it will not be inserted.");
          continue;
        } else {
          SbiSnapshots newSnapshots = ImportUtilities.makeNewSbiSnapshots(expSbiSnapshots);
          newSnapshots.setSbiObject(obj);
          SbiBinContents binary = insertBinaryContent(expSbiSnapshots.getSbiBinContents());
          newSnapshots.setSbiBinContents(binary);
          sessionCurrDB.save(newSnapshots);
        }
      }
    } catch (Exception e) {
View Full Code Here

      existingSbiSnapshots.setCreationDate(expSbiSnapshots.getCreationDate());
      existingSbiSnapshots.setDescription(expSbiSnapshots.getDescription());
      existingSbiSnapshots.setName(expSbiSnapshots.getName());
      //existingSbiSnapshots.setSbiObject(obj);
      SbiBinContents existingBinaryContent=existingSbiSnapshots.getSbiBinContents();
      sessionCurrDB.delete(existingBinaryContent);
      SbiBinContents binary = insertBinaryContent(expSbiSnapshots.getSbiBinContents());
      existingSbiSnapshots.setSbiBinContents(binary);
      sessionCurrDB.update(existingSbiSnapshots);

    } catch (Exception e) {
      if (expSbiSnapshots != null) {
View Full Code Here

      existingSubObject.setLastChangeDate(expSubObject.getLastChangeDate());
      existingSubObject.setIsPublic(expSubObject.getIsPublic());
      existingSubObject.setName(expSubObject.getName());
      existingSubObject.setOwner(expSubObject.getOwner());
      //existingSubObject.setSbiObject(obj);
      SbiBinContents existingBinaryContent=existingSubObject.getSbiBinContents();
      sessionCurrDB.delete(existingBinaryContent);
      SbiBinContents binary = insertBinaryContent(expSubObject.getSbiBinContents());
      existingSubObject.setSbiBinContents(binary);
      sessionCurrDB.update(existingSubObject);

    } catch (HibernateException he) {
      logger.error("Error while getting exported template objects ", he);
View Full Code Here

          //idAssociation.put(expSubObject.getSubObjId(), current.getSubObjId());
          continue;
        } else {
          SbiSubObjects newSubObj = ImportUtilities.makeNewSbiSubObjects(expSubObject);
          newSubObj.setSbiObject(obj);
          SbiBinContents binary = insertBinaryContent(expSubObject.getSbiBinContents());
          newSubObj.setSbiBinContents(binary);
          sessionCurrDB.save(newSubObj);
          idAssociation.put(expSubObject.getSubObjId(), newSubObj.getSubObjId());
        }
      }
View Full Code Here

        SbiObjTemplates existingObjTemplate = getCurrentActiveTemplate(obj.getBiobjId());
        existingObjTemplate.setActive(new Boolean(false));
        sessionCurrDB.save(existingObjTemplate);
      }
      newObj.setSbiObject(obj);
      SbiBinContents binary = insertBinaryContent(expTemplate.getSbiBinContents());
      newObj.setSbiBinContents(binary);
      sessionCurrDB.save(newObj);
    } catch (Exception he) {
      logger.error("Error while getting exported template objects ", he);
      throw new EMFUserError(EMFErrorSeverity.ERROR, "8004", "component_impexp_messages");
View Full Code Here

  }

  private SbiBinContents insertBinaryContent(SbiBinContents binaryContent) throws EMFUserError {
    logger.debug("IN");
    List templateList = null;
    SbiBinContents newObj = null;
    try {
      Query hibQuery = sessionExpDB.createQuery(" from SbiBinContents where id = " + binaryContent.getId());
      templateList = hibQuery.list();
      if (templateList.isEmpty()) {
        logger.warn(" Binary Content is not present");
        return null;
      }
      SbiBinContents expBinaryContent = (SbiBinContents) templateList.get(0);
      newObj = ImportUtilities.makeNewSbiBinContents(expBinaryContent);
      // save new binary content
      sessionCurrDB.save(newObj);
      return newObj;
View Full Code Here

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

      IBinContentDAO binContentDAO=DAOFactory.getBinContentDAO();
      byte[] binContentsContent=binContentDAO.getBinContent(map.getBinId());
      if(binContentsContent!=null){
        Integer contentId=map.getBinId();
        SbiBinContents sbiBinContents=new SbiBinContents();
        sbiBinContents.setId(contentId);
        sbiBinContents.setContent(binContentsContent);
        sbiMap.setBinContents(sbiBinContents);
      }

    } catch (Exception e) {
      logger.error("Error while converting SDKMap into SbiGeoFeature.", e);
View Full Code Here

    Transaction tx = null;
    try {
      aSession = getSession();
      tx = aSession.beginTransaction();
      SbiSubObjects hibSubobject = (SbiSubObjects)aSession.load(SbiSubObjects.class, idSub);
      SbiBinContents hibBinCont = hibSubobject.getSbiBinContents();
     
      //delete metadata eventually associated
      List metadata = DAOFactory.getObjMetadataDAO().loadAllObjMetadata();
      IObjMetacontentDAO objMetaContentDAO = DAOFactory.getObjMetacontentDAO();
      if (metadata != null && !metadata.isEmpty()) {
View Full Code Here

TOP

Related Classes of it.eng.spagobi.commons.metadata.SbiBinContents

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.