Examples of SbiObjPar


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

    logger.debug("IN");
    try {
      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
        Map uniqueMap = new HashMap();
        uniqueMap.put("biobjid", newBIObjId);
        uniqueMap.put("paramid", newParamId);
        uniqueMap.put("urlname", objpar.getParurlNm());
        Object existObj = importer.checkExistence(uniqueMap, sessionCurrDB, new SbiObjPar());
        if (existObj != null) {
          metaLog.log("Exported association between object " + objpar.getSbiObject().getName() + " "
              + " and parameter " + objpar.getSbiParameter().getName() + " with url name "
              + objpar.getParurlNm() + " not inserted"
              + " because already existing into the current database");
          continue;
        }

        SbiObjPar newObjpar = ImportUtilities.makeNewSbiObjpar(objpar);
        sessionCurrDB.save(newObjpar);
        metaLog.log("Inserted new biobject parameter with " + newObjpar.getParurlNm() + " for biobject "
            + newObjpar.getSbiObject().getName());
        Integer newId = newObjpar.getObjParId();
        sessionExpDB.evict(objpar);
        metaAss.insertCoupleObjpar(oldId, newId);
      }
    } catch (HibernateException he) {
      logger.error("Error while inserting object ", he);
View Full Code Here

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

          SbiParuse newParuse = ImportUtilities.makeNewSbiParuse(sbiparuse, newParuseId);
          objparuseid.setSbiParuse(newParuse);
          paruseId = newParuseId;
        }
        if (newObjparId != null) {
          SbiObjPar sbiobjpar = objparuseid.getSbiObjPar();
          SbiObjPar newObjPar = ImportUtilities.makeNewSbiObjpar(sbiobjpar, newObjparId);
          objparuseid.setSbiObjPar(newObjPar);
          objparId = newObjparId;
        }
        if (newObjParFathId != null) {
          SbiObjPar sbiobjparfath = objparuseid.getSbiObjParFather();
          SbiObjPar newObjParFath = ImportUtilities.makeNewSbiObjpar(sbiobjparfath, newObjParFathId);
          objparuseid.setSbiObjParFather(newObjParFath);
          objparfathId = newObjParFathId;
        }

        pardep.setId(objparuseid);
View Full Code Here

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

      }
    }
    List exportedObjPar = importer.getAllExportedSbiObjects(sessionExpDB, "SbiObjPar", null);
    Iterator iterSbiObjPar = exportedObjPar.iterator();
    while (iterSbiObjPar.hasNext()) {
      SbiObjPar objparExp = (SbiObjPar) iterSbiObjPar.next();
      String urlName = objparExp.getParurlNm();

      Integer objid = objparExp.getSbiObject().getBiobjId();
      Map objIdAss = metaAss.getBIobjIDAssociation();
      Integer newObjid = (Integer) objIdAss.get(objid);
      // only if biobject has already been associated there could be association between its biparameters
      if (newObjid == null)
        continue;

      Integer parid = objparExp.getSbiParameter().getParId();
      Map parIdAss = metaAss.getParameterIDAssociation();
      Integer newParid = (Integer) parIdAss.get(parid);
      // only if parameter has already been associated there could be association between its biparameters
      if (newParid == null)
        continue;

      Map uniqueMap = new HashMap();
      uniqueMap.put("biobjid", newObjid);
      uniqueMap.put("paramid", newParid);
      uniqueMap.put("urlname", urlName);
      Object existObj = importer.checkExistence(uniqueMap, sessionCurrDB, new SbiObjPar());

      if (existObj != null) {
        SbiObjPar objParCurr = (SbiObjPar) existObj;
        metaAss.insertCoupleObjpar(objparExp.getObjParId(), objParCurr.getObjParId());
        metaAss.insertCoupleObjpar(objparExp, objParCurr);
        metaLog.log("Found an existing association between object " + objparExp.getSbiObject().getName()
            + " and parameter " + objparExp.getSbiParameter().getName() + " with " + " the same url "
            + objparExp.getParurlNm() + " name of the exported objpar ");
      }
View Full Code Here

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

      hibBIObjParId.setSbiParameters(hibParameter);
      hibBIObjParId.setProg(new Integer(0));
       */

      // build BI Object Parameter
      SbiObjPar hibBIObjPar = new SbiObjPar(biobjpar.getId());
      hibBIObjPar.setLabel(biobjpar.getLabel());
      hibBIObjPar.setReqFl(new Short(biobjpar.getRequired().shortValue()));
      hibBIObjPar.setModFl(new Short(biobjpar.getModifiable().shortValue()));
      hibBIObjPar.setViewFl(new Short(biobjpar.getVisible().shortValue()));
      hibBIObjPar.setMultFl(new Short(biobjpar.getMultivalue().shortValue()));
      hibBIObjPar.setParurlNm(biobjpar.getParameterUrlName());
      hibBIObjPar.setPriority(biobjpar.getPriority());
      hibBIObjPar.setProg(biobjpar.getProg());
      Integer biobjid = biobjpar.getBiObjectID();
      SbiObjects sbiob = (SbiObjects)session.load(SbiObjects.class, biobjid);
      Integer parid = biobjpar.getParID();     
      SbiParameters sbipar = (SbiParameters)session.load(SbiParameters.class, parid);
      hibBIObjPar.setSbiObject(sbiob);
      hibBIObjPar.setSbiParameter(sbipar);
      // save the BI Object Parameter
      session.save(hibBIObjPar);
      tx.commit();

    } catch (Exception e) {
View Full Code Here

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

          if(!hibList.isEmpty()) {
            continue;
          }
          // built key
          SbiObjParuseId hibObjParuseId = new SbiObjParuseId();
          SbiObjPar hibObjPar = (SbiObjPar)session.load(SbiObjPar.class, objparuse.getObjParId());
          SbiParuse hibParuse = (SbiParuse)session.load(SbiParuse.class, objparuse.getParuseId());
          SbiObjPar objparfather = (SbiObjPar)session.load(SbiObjPar.class, objparuse.getObjParFatherId());
          hibObjParuseId.setSbiObjPar(hibObjPar);
          hibObjParuseId.setSbiParuse(hibParuse);
          hibObjParuseId.setFilterOperation(objparuse.getFilterOperation());
          hibObjParuseId.setSbiObjParFather(objparfather);
          SbiObjParuse hibObjParuse = new SbiObjParuse(hibObjParuseId);
View Full Code Here

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

      Integer biobjid = (Integer) uniqueMap.get("biobjid");
      String urlname = (String) uniqueMap.get("urlname");
      hql = "from SbiObjPar op where op.sbiParameter.parId = " + paramid + " and op.sbiObject.biobjId = "
      + biobjid + " and op.parurlNm = '" + urlname + "'";
      hqlQuery = sessionCurrDB.createQuery(hql);
      SbiObjPar hibObjPar = (SbiObjPar) hqlQuery.uniqueResult();
      return hibObjPar;
    } else if (hibObj instanceof SbiDomains) {
      Map uniqueMap = (Map) unique;
      String valuecd = (String) uniqueMap.get("valuecd");
      String domaincd = (String) uniqueMap.get("domaincd");
View Full Code Here

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

   * @throws EMFUserError the EMF user error
   *
   * @see it.eng.spagobi.behaviouralmodel.analyticaldriver.dao.IBIObjectParameterDAO#loadById(java.lang.Integer)
   */
  public SbiObjPar loadById(Integer id) throws EMFUserError {
    SbiObjPar hibObjPar = null;
    Session aSession = null;
    Transaction tx = null;
    try {
      aSession = getSession();
      tx = aSession.beginTransaction();
View Full Code Here

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

    Transaction tx = null;
    try {
      aSession = getSession();
      tx = aSession.beginTransaction();
     
      SbiObjPar hibObjPar = (SbiObjPar) aSession.load(SbiObjPar.class,  objParId);
     
      toReturn = toBIObjectParameter(hibObjPar);
      tx.commit();
    } catch(HibernateException he) {
      logException(he);
View Full Code Here

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

    Transaction tx = null;
    try {
      aSession = getSession();
      tx = aSession.beginTransaction();
   
      SbiObjPar hibObjPar = (SbiObjPar) aSession.load(SbiObjPar.class,  aBIObjectParameter.getId());

      if (hibObjPar == null) {
        logger.error("the BIObjectParameter with id="+aBIObjectParameter.getId()+" does not exist.");
        throw new EMFUserError(EMFErrorSeverity.ERROR, 1033);
      }
     
      SbiObjects aSbiObject = (SbiObjects) aSession.load(SbiObjects.class, aBIObjectParameter.getBiObjectID());
      SbiParameters aSbiParameter = (SbiParameters)aSession.load(SbiParameters.class, aBIObjectParameter.getParameter().getId());
     
      hibObjPar.setSbiObject(aSbiObject);
      hibObjPar.setSbiParameter(aSbiParameter);
      hibObjPar.setLabel(aBIObjectParameter.getLabel());
      hibObjPar.setReqFl(new Short(aBIObjectParameter.getRequired().shortValue()));
      hibObjPar.setModFl(new Short(aBIObjectParameter.getModifiable().shortValue()));
      hibObjPar.setViewFl(new Short(aBIObjectParameter.getVisible().shortValue()));
      hibObjPar.setMultFl(new Short(aBIObjectParameter.getMultivalue().shortValue()));
      hibObjPar.setParurlNm(aBIObjectParameter.getParameterUrlName());
      Integer oldPriority = hibObjPar.getPriority();
      Integer newPriority = aBIObjectParameter.getPriority();
      if (!oldPriority.equals(newPriority)) {
        Query query = null;
        if (oldPriority.intValue() > newPriority.intValue()) {
          String hqlUpdateShiftRight = "update SbiObjPar s set s.priority = (s.priority + 1) where s.priority >= "
            + newPriority + " and s.priority < " + oldPriority + "and s.sbiObject.biobjId = " + aSbiObject.getBiobjId();
          query = aSession.createQuery(hqlUpdateShiftRight);
        } else {
          String hqlUpdateShiftLeft = "update SbiObjPar s set s.priority = (s.priority - 1) where s.priority > "
            + oldPriority + " and s.priority <= " + newPriority + "and s.sbiObject.biobjId = " + aSbiObject.getBiobjId();
          query = aSession.createQuery(hqlUpdateShiftLeft);
        }
        query.executeUpdate();
      }
      hibObjPar.setPriority(newPriority);
      hibObjPar.setProg(new Integer(1));
      updateSbiCommonInfo4Update(hibObjPar);
      tx.commit();
    } catch (HibernateException he) {
      logException(he);
      if (tx != null)
View Full Code Here

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

      tx = aSession.beginTransaction();
   
      SbiObjects aSbiObject = (SbiObjects) aSession.load(SbiObjects.class, aBIObjectParameter.getBiObjectID());
      SbiParameters aSbiParameter = (SbiParameters) aSession.load(SbiParameters.class, aBIObjectParameter.getParameter().getId());
     
      SbiObjPar hibObjectParameterNew = new SbiObjPar();
      hibObjectParameterNew.setSbiObject(aSbiObject);
      hibObjectParameterNew.setSbiParameter(aSbiParameter);
      hibObjectParameterNew.setProg(new Integer(1));
      hibObjectParameterNew.setLabel(aBIObjectParameter.getLabel());
      hibObjectParameterNew.setReqFl(new Short(aBIObjectParameter.getRequired().shortValue()));
      hibObjectParameterNew.setModFl(new Short(aBIObjectParameter.getModifiable().shortValue()));
      hibObjectParameterNew.setViewFl(new Short(aBIObjectParameter.getVisible().shortValue()));
      hibObjectParameterNew.setMultFl(new Short(aBIObjectParameter.getMultivalue().shortValue()));
      hibObjectParameterNew.setParurlNm(aBIObjectParameter.getParameterUrlName());
     
      String hqlUpdateShiftRight = "update SbiObjPar s set s.priority = (s.priority + 1) where s.priority >= "
        + aBIObjectParameter.getPriority() + " and s.sbiObject.biobjId = " + aSbiObject.getBiobjId();
      Query query = aSession.createQuery(hqlUpdateShiftRight);
      query.executeUpdate();
     
      hibObjectParameterNew.setPriority(aBIObjectParameter.getPriority());
      updateSbiCommonInfo4Insert(hibObjectParameterNew);
      aSession.save(hibObjectParameterNew);
     
      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.