Package it.eng.spagobi.analiticalmodel.document.metadata

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


      // update biobject reference
      if (hibContents.getSbiObjects().getBiobjId() != aObjMetacontent.getBiobjId()) {
        aCriterion = Expression.eq("biobjId", aObjMetacontent.getBiobjId());
        criteria = aSession.createCriteria(SbiObjects.class);
        criteria.add(aCriterion);
        SbiObjects biobj = (SbiObjects) criteria.uniqueResult();
        hibContents.setSbiObjects(biobj);
      }

      // update subobject reference
      if (aObjMetacontent.getSubobjId() == null) {
View Full Code Here


      // get biobject reference   
      aCriterion = Expression.eq("biobjId", aObjMetacontent.getBiobjId());
      criteria = aSession.createCriteria(SbiObjects.class);
      criteria.add(aCriterion);
      SbiObjects biobj = (SbiObjects) criteria.uniqueResult();
      hibContents.setSbiObjects(biobj);

      // get subobject reference
      if (aObjMetacontent.getSubobjId() == null) {
        hibContents.setSbiSubObjects(null);
View Full Code Here

    List documents = new ArrayList();
    Set d = hibDistributionList.getSbiDistributionListsObjectses();
    Iterator it = d.iterator();
    while(it.hasNext()){
      SbiDistributionListsObjects dlo =(SbiDistributionListsObjects) it.next();
      SbiObjects so = dlo.getSbiObjects();
      BIObjectDAOHibImpl objDAO=null;
      try {
        objDAO = (BIObjectDAOHibImpl)DAOFactory.getBIObjectDAO();
        BIObject obj = objDAO.toBIObject(so);
        documents.add(obj);
View Full Code Here

          }     
      }
     
      SbiDistributionList hibDistributionList = (SbiDistributionList) aSession.load(SbiDistributionList.class,
          new Integer(dl.getId()));
      SbiObjects hibObj = (SbiObjects) aSession.load(SbiObjects.class,new Integer(objId));
     
      hibDistributionListsObjects.setSbiDistributionList(hibDistributionList);
      hibDistributionListsObjects.setSbiObjects(hibObj);
      hibDistributionListsObjects.setXml(xml);
      updateSbiCommonInfo4Insert(hibDistributionListsObjects);
View Full Code Here

    RememberMe toReturn = new RememberMe();
    toReturn.setId(hibObj.getId());
    toReturn.setName(hibObj.getName());
    toReturn.setDescription(hibObj.getDescription());
    toReturn.setUserName(hibObj.getUserName());
    SbiObjects obj = hibObj.getSbiObject();
    toReturn.setObjId(obj.getBiobjId());
    toReturn.setDocumentLabel(obj.getLabel());
    toReturn.setDocumentName(obj.getName());
    toReturn.setDocumentDescription(obj.getDescr());
    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());
View Full Code Here

       */
      SbiRememberMe temp = new SbiRememberMe();
      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);
      }
View Full Code Here

   *
   * @throws EMFUserError
   */
  private void importBIObjects(boolean overwrite) throws EMFUserError {
    logger.debug("IN");
    SbiObjects exportedObj = null;
    try {
      List exportedBIObjs = importer.getAllExportedSbiObjects(sessionExpDB, "SbiObjects", "label");
      Iterator iterSbiObjs = exportedBIObjs.iterator();
     
        LuceneIndexer indexer = new LuceneIndexer();
       
      while (iterSbiObjs.hasNext()) {
        exportedObj = (SbiObjects) iterSbiObjs.next();
        Integer expId = exportedObj.getBiobjId();
        Integer existingObjId = null;
        Map objIdAss = metaAss.getBIobjIDAssociation();
        Set objIdAssSet = objIdAss.keySet();
        if (objIdAssSet.contains(expId) && !overwrite) {
          metaLog.log("Exported biobject "+exportedObj.getName()+" not inserted" +
          " because it has the same label of an existing biobject");
          continue;
        } else {
          existingObjId = (Integer) objIdAss.get(expId);
        }

        SbiObjects obj = null;
        if (existingObjId != null) {
          logger.info("The document with label:[" + exportedObj.getLabel() + "] is just present. It will be updated.");
          metaLog.log("The document with label = [" + exportedObj.getLabel() + "] will be updated.");
          obj = ImportUtilities.modifyExistingSbiObject(exportedObj, sessionCurrDB, existingObjId);
          ImportUtilities.associateWithExistingEntities(obj, exportedObj, sessionCurrDB, importer, metaAss);
          sessionCurrDB.update(obj);
        } else {
          obj = ImportUtilities.makeNewSbiObject(exportedObj);
          ImportUtilities.associateWithExistingEntities(obj, exportedObj, sessionCurrDB, importer, metaAss);
          // insert document
          Integer newId = (Integer) sessionCurrDB.save(obj);
          metaLog.log("Inserted new biobject " + obj.getName());
          metaAss.insertCoupleBIObj(expId, newId);
        }
        // manage object template
        insertObjectTemplate(obj, exportedObj.getBiobjId());
        // manage sub_object here
View Full Code Here

      Iterator iterSbiObjLinks = exportedBIObjectsLinks.iterator();
      while (iterSbiObjLinks.hasNext()) {
        objlink = (SbiSubreports) iterSbiObjLinks.next();

        // get biobjects
        SbiObjects masterBIObj = objlink.getId().getMasterReport();
        SbiObjects subBIObj = objlink.getId().getSubReport();
        Integer masterid = masterBIObj.getBiobjId();
        Integer subid = subBIObj.getBiobjId();
        // get association of object
        Map biobjIdAss = metaAss.getBIobjIDAssociation();
        // try to get from association the id associate to the exported
        // metadata
        Integer newMasterId = (Integer) biobjIdAss.get(masterid);
        Integer newSubId = (Integer) biobjIdAss.get(subid);

        // build a new SbiSubreport
        // build a new id for the SbiSubreport
        SbiSubreportsId sbiSubReportsId = objlink.getId();
        SbiSubreportsId newSubReportsId = new SbiSubreportsId();
        if (sbiSubReportsId != null) {
          SbiObjects master = sbiSubReportsId.getMasterReport();
          SbiObjects sub = sbiSubReportsId.getMasterReport();
          SbiObjects newMaster = ImportUtilities.makeNewSbiObject(master, newMasterId);
          SbiObjects newSub = ImportUtilities.makeNewSbiObject(sub, newSubId);
          newSubReportsId.setMasterReport(newMaster);
          newSubReportsId.setSubReport(newSub);
        }
        SbiSubreports newSubReport = new SbiSubreports();
        newSubReport.setId(newSubReportsId);
View Full Code Here

          SbiFunctions newFunct = ImportUtilities.makeNewSbiFunction(sbifunct, newFunctid);
          objfunctid.setSbiFunctions(newFunct);
          functid = newFunctid;
        }
        if (newObjectid != null) {
          SbiObjects sbiobj = objfunctid.getSbiObjects();
          SbiObjects newObj = ImportUtilities.makeNewSbiObject(sbiobj, newObjectid);
          objfunctid.setSbiObjects(newObj);
          objid = newObjectid;
        }
        objfunct.setId(objfunctid);
        // check if the association between metadata already exist
View Full Code Here

      List exportedObjPars = importer.getFilteredExportedSbiObjects(sessionExpDB, "SbiObjPar", "sbiObject.biobjId", exportedBIObjectId);
      Iterator iterSbiObjPar = exportedObjPars.iterator();
      while (iterSbiObjPar.hasNext()) {
        SbiObjPar objpar = (SbiObjPar) iterSbiObjPar.next();
        SbiParameters param = objpar.getSbiParameter();
        SbiObjects biobj = objpar.getSbiObject();
        Integer oldParamId = param.getParId();
        Integer oldBIObjId = biobj.getBiobjId();
        Map assBIObj = metaAss.getBIobjIDAssociation();
        Map assParams = metaAss.getParameterIDAssociation();
        Integer newParamId = (Integer) assParams.get(oldParamId);
        Integer newBIObjId = (Integer) assBIObj.get(oldBIObjId);
        if (newParamId != null) {
          SbiParameters newParam = ImportUtilities.makeNewSbiParameter(param, newParamId);
          objpar.setSbiParameter(newParam);
        }
        if (newBIObjId != null) {
          SbiObjects newObj = ImportUtilities.makeNewSbiObject(biobj, newBIObjId);
          objpar.setSbiObject(newObj);
        }
        Integer oldId = objpar.getObjParId();

        // check if the association already exist
View Full Code Here

TOP

Related Classes of it.eng.spagobi.analiticalmodel.document.metadata.SbiObjects

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.