Examples of SbiSubObjects


Examples of it.eng.spagobi.analiticalmodel.document.metadata.SbiSubObjects

      // update subobject reference
      if (aObjMetacontent.getSubobjId() == null) {
        hibContents.setSbiSubObjects(null);
      } else {
        SbiSubObjects previousSubobject = hibContents.getSbiSubObjects();
        if (previousSubobject == null || previousSubobject.getSubObjId() != aObjMetacontent.getSubobjId()) {
          aCriterion = Expression.eq("subObjId", aObjMetacontent.getSubobjId());
          criteria = aSession.createCriteria(SbiSubObjects.class);
          criteria.add(aCriterion);
          SbiSubObjects subobj = (SbiSubObjects) criteria.uniqueResult();
          hibContents.setSbiSubObjects(subobj);
        }
      }
      updateSbiCommonInfo4Update(hibContents);
      // update content
View Full Code Here

Examples of it.eng.spagobi.analiticalmodel.document.metadata.SbiSubObjects

        hibContents.setSbiSubObjects(null);
      } else {
        aCriterion = Expression.eq("subObjId", aObjMetacontent.getSubobjId());
        criteria = aSession.createCriteria(SbiSubObjects.class);
        criteria.add(aCriterion);
        SbiSubObjects subobj = (SbiSubObjects) criteria.uniqueResult();
        hibContents.setSbiSubObjects(subobj);
      }

      SbiBinContents binaryContent = new SbiBinContents();
      binaryContent.setContent(aObjMetacontent.getContent());
View Full Code Here

Examples of it.eng.spagobi.analiticalmodel.document.metadata.SbiSubObjects

    SbiDomains docType = obj.getObjectType();
    toReturn.setDocumentType(docType.getValueCd());
    toReturn.setParameters(hibObj.getParameters());
    SbiEngines engine = obj.getSbiEngines();
    toReturn.setEngineName(engine.getName());
    SbiSubObjects subObj = hibObj.getSbiSubObject();
    if (subObj != null) {
      toReturn.setSubObjId(subObj.getSubObjId());
      toReturn.setSubObjName(subObj.getName());
    }
    return toReturn;
  }
View Full Code Here

Examples of it.eng.spagobi.analiticalmodel.document.metadata.SbiSubObjects

      temp.setName(name);
      temp.setDescription(description);
      temp.setUserName(userId);
      SbiObjects obj = (SbiObjects) aSession.load(SbiObjects.class, docId);
      temp.setSbiObject(obj);
      SbiSubObjects subObj = null;
      if (subObjId != null) {
        subObj = (SbiSubObjects) aSession.load(SbiSubObjects.class, subObjId);
      }
      temp.setSbiSubObject(subObj);
      temp.setParameters(parameters);
View Full Code Here

Examples of it.eng.spagobi.analiticalmodel.document.metadata.SbiSubObjects

      .createQuery(" from SbiSubObjects ot where ot.sbiObject.biobjId = " + obj.getBiobjId());
      subObjList = hibQuery.list();
      if (subObjList.isEmpty()) {
        logger.warn(" Existing Sub Object is not present");
     
      SbiSubObjects existingSubObject = (SbiSubObjects) subObjList.get(0);
      if (existingSubObject==null){
        logger.warn("Don't read the Existing SubObject ... ERROR");
        return;
      }
      // read the import sub object
      hibQuery = sessionExpDB
      .createQuery(" from SbiSubObjects ot where ot.sbiObject.biobjId = " + objIdExp);
      subObjList = hibQuery.list();
      if (subObjList.isEmpty()) {
        logger.warn(" Sub Object is not present");
        return;
      }
      SbiSubObjects expSubObject = (SbiSubObjects) subObjList.get(0);
      existingSubObject.setCreationDate(expSubObject.getCreationDate());
      existingSubObject.setDescription(expSubObject.getDescription());
      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

Examples of it.eng.spagobi.analiticalmodel.document.metadata.SbiSubObjects

  private void insertSubObject(SbiObjects obj, SbiObjects exportedObj) throws EMFUserError {
    logger.debug("IN");
    List exportedSubObjList = null;
    List currentSubObjList = null;
    SbiSubObjects expSubObject = null;
    try {
      Query hibQuery = sessionExpDB
      .createQuery(" from SbiSubObjects ot where ot.sbiObject.biobjId = " + exportedObj.getBiobjId());
      exportedSubObjList = hibQuery.list();
      if (exportedSubObjList.isEmpty()) {
        logger.debug("Exported document with label=[" + exportedObj.getLabel() + "] has no subobjects");
        return;
      }
      hibQuery = sessionCurrDB
      .createQuery(" from SbiSubObjects ot where ot.sbiObject.biobjId = " + obj.getBiobjId());
      currentSubObjList = hibQuery.list();
      Iterator exportedSubObjListIt = exportedSubObjList.iterator();
      Map idAssociation = metaAss.getObjSubObjectIDAssociation();
      while (exportedSubObjListIt.hasNext()) {
        expSubObject = (SbiSubObjects) exportedSubObjListIt.next();
        SbiSubObjects current = isAlreadyExisting(expSubObject, currentSubObjList) ;
        if (current != null) {
          logger.info("Exported subobject with name = [" + expSubObject.getName() + "] and owner = [" + expSubObject.getOwner() + "] and visibility = [" + expSubObject.getIsPublic() + "] and creation date = [" + expSubObject.getCreationDate() + "] (of document with name = [" + exportedObj.getName() + "] and label = [" + exportedObj.getLabel() + "]) is already existing, so it will not be inserted.");
          metaLog.log("Exported subobject with name = [" + expSubObject.getName() + "] and owner = [" + expSubObject.getOwner() + "] and visibility = [" + expSubObject.getIsPublic() + "] and creation date = [" + expSubObject.getCreationDate() + "] (of document with name = [" + exportedObj.getName() + "] and label = [" + exportedObj.getLabel() + "]) is already existing, most likely it is the same subobject, so it will not be inserted.");
          // if already present don't modify the subObject so don't map the ID!
          //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());
        }
      }
    } catch (Exception e) {
      if (expSubObject != null) {
        logger.error("Error while importing exported subobject with name [" + expSubObject.getName() + "] " +
View Full Code Here

Examples of it.eng.spagobi.analiticalmodel.document.metadata.SbiSubObjects

   */
  private SbiSubObjects isAlreadyExisting(SbiSubObjects expSubObject,
      List currentSubObjList) {
    Iterator currentSubObjListIt = currentSubObjList.iterator();
    while (currentSubObjListIt.hasNext()) {
      SbiSubObjects currentSubObject = (SbiSubObjects) currentSubObjListIt.next();
      if (((currentSubObject.getName() == null && expSubObject.getName() == null) ||
          (currentSubObject.getName() != null && currentSubObject.getName().equals(expSubObject.getName()))) 
          && ((currentSubObject.getOwner() == null && expSubObject.getOwner() == null) ||
              (currentSubObject.getOwner() != null && currentSubObject.getOwner().equals(expSubObject.getOwner())))
              && currentSubObject.getIsPublic().equals(expSubObject.getIsPublic())
              && currentSubObject.getCreationDate().equals(expSubObject.getCreationDate())
              && currentSubObject.getLastChangeDate().equals(expSubObject.getLastChangeDate())) {
        return currentSubObject;
      }
    }
    return null;
  }
View Full Code Here

Examples of it.eng.spagobi.analiticalmodel.document.metadata.SbiSubObjects

        hibObjMetacontents.setSbiObjects(sbiObjects);
        logger.debug("inserted sbi " + objMetacontent.getBiobjId() + " Object metacontent");
      }
      // get the sub object to insert if present
      if (objMetacontent.getSubobjId() != null) {
        SbiSubObjects sbiSubObjects = (SbiSubObjects) session.load(SbiSubObjects.class, objMetacontent.getSubobjId());
        hibObjMetacontents.setSbiSubObjects(sbiSubObjects);
        logger.debug("inserted sbi " + objMetacontent.getSubobjId() + " SubObject metacontent");
      }
      // get the content
      if (objMetacontent.getBinaryContentId() != null) {
View Full Code Here

Examples of it.eng.spagobi.analiticalmodel.document.metadata.SbiSubObjects

      SbiBinContents hibBinContent = new SbiBinContents();
      hibBinContent.setId(subObject.getBinaryContentId());
      hibBinContent.setContent(subObject.getContent());

      SbiSubObjects sub=new SbiSubObjects();
      sub.setCreationDate(subObject.getCreationDate());
      sub.setDescription(subObject.getDescription());
      sub.setIsPublic(subObject.getIsPublic());
      sub.setName(subObject.getName());
      sub.setOwner(subObject.getOwner());
      sub.setLastChangeDate(subObject.getLastChangeDate());
      sub.setSbiBinContents(hibBinContent);
      sub.setSbiObject(hibBIObj);
      sub.setSubObjId(subObject.getId());

      session.save(sub);
      session.save(hibBinContent);
      tx.commit();
View Full Code Here

Examples of it.eng.spagobi.analiticalmodel.document.metadata.SbiSubObjects

        aSbiAudit.setSbiObject(sbiObject);
      }
      if (aSbiAudit.getSbiSubObject() == null) {
        Integer subObjId = aSbiAudit.getSubObjId();
        if (subObjId != null) {
          SbiSubObjects subObj = (SbiSubObjects) session.load(SbiSubObjects.class, subObjId);
          aSbiAudit.setSbiSubObject(subObj);
        }
      }
      if (aSbiAudit.getSbiEngine() == null) {
        Integer engineId = aSbiAudit.getEngineId();
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.