Examples of Threshold


Examples of it.eng.spagobi.kpi.threshold.bo.Threshold

    toReturn.setDsLabel(dsLabel);
    toReturn.setKpiDsId(dsId);
    logger.debug("Kpi dataset setted");

    if (kpi.getSbiThreshold() != null) {
      Threshold threshold = DAOFactory.getThresholdDAO().loadThresholdById(
          kpi.getSbiThreshold().getThresholdId());
      toReturn.setThreshold(threshold);
      logger.debug("Kpi threshold setted");

    }
View Full Code Here

Examples of it.eng.spagobi.kpi.threshold.bo.Threshold

    }

    IThresholdDAO thresholdDAO=DAOFactory.getThresholdDAO();
    SbiThreshold thresh = kpi.getSbiThreshold();
    if(thresh!=null){
      Threshold threshold=thresholdDAO.toThreshold(thresh);
      toReturn.setThreshold(threshold);
      logger.debug("Kpi threshold setted");
    }

    Double standardWeight = kpi.getWeight();
View Full Code Here

Examples of it.eng.spagobi.kpi.threshold.bo.Threshold

        kpi.setCode(hibKpi.getCode());
        kpi.setDescription(hibKpi.getDescription());
        kpi.setKpiName(hibKpi.getName());
        kpi.setKpiId(hibKpi.getKpiId());
        if(hibKpi.getSbiThreshold() != null){
          Threshold threshold = new Threshold();
          threshold.setId(hibKpi.getSbiThreshold().getThresholdId());
          threshold.setName(hibKpi.getSbiThreshold().getName());
          kpi.setThreshold(threshold);
        }
        toReturn.add(kpi);
      }
View Full Code Here

Examples of it.eng.spagobi.kpi.threshold.bo.Threshold

    Integer kpiId = model.getKpiId();
    if(kpiId != null){
      Kpi kpi = DAOFactory.getKpiDAO().loadKpiById(kpiId);
      KpiInstance kpiInst = new KpiInstance();
      kpiInst.setKpi(kpiId);
      Threshold thrSrc = kpi.getThreshold();
      if(thrSrc != null){
        kpiInst.setThresholdId(thrSrc.getId());
      }
      kpiInst.setWeight(kpi.getStandardWeight());
      modelInstNode.setKpiInstance(kpiInst);
    }
View Full Code Here

Examples of it.eng.spagobi.kpi.threshold.bo.Threshold


        String kpiInstThrCode;
        try{
          kpiInstThrCode = obj.getString("kpiInstThrName");
          Threshold thr = DAOFactory.getThresholdDAO().loadThresholdByCode(kpiInstThrCode);
          if(thr != null){
            kpiInstance.setThresholdId(thr.getId());
          }
        }catch(Throwable t){
          kpiInstThrCode = null;
          if(kpiInstance != null) kpiInstance.setThresholdId(null);
        }
View Full Code Here

Examples of it.eng.spagobi.kpi.threshold.bo.Threshold

    if( !(o instanceof Threshold) ) {
      throw new SerializationException("ThresholdJSONSerializer is unable to serialize object of type: " + o.getClass().getName());
    }
   
    try {
      Threshold thr = (Threshold)o;
      result = new JSONObject();
     
      result.put(THRESHOLD_ID, thr.getId() );
      result.put(THRESHOLD_NAME, thr.getName() );
      result.put(THRESHOLD_DESCRIPTION, thr.getDescription() );
      result.put(THRESHOLD_CODE, thr.getCode() );
      result.put(THRESHOLD_TYPE_ID, thr.getThresholdTypeId() );
      result.put(THRESHOLD_TYPE_CD, thr.getThresholdTypeCode());   
      result.put(OLD_TO_DELETE, new Boolean(false))
     
      List thrValues = thr.getThresholdValues();
      JSONArray thValues = new JSONArray();
      if(thrValues!=null){   
        if(!thrValues.isEmpty()){
          if(thrValues.size()==1 && !thr.getThresholdTypeCode().equalsIgnoreCase("RANGE")){
            ThresholdValue thrVal = (ThresholdValue) thrValues.get(0);
            if(thrVal != null){
             result.put(THR_VAL_ID,  thrVal.getId());
             result.put(THR_VAL_LABEL,  thrVal.getLabel());
             result.put(THR_VAL_POSITION,  thrVal.getPosition());
View Full Code Here

Examples of it.eng.spagobi.kpi.threshold.bo.Threshold

    try {
      SourceBean thresholdslist = new SourceBean(thresholdsS);
      if(thresholdsList!=null && !thresholdsList.isEmpty()){
        Iterator th = thresholdsList.iterator();
        while(th.hasNext()){
          Threshold t2 = (Threshold)th.next();
          SourceBean singlethreshold = new SourceBean(thresholdS);
          singlethreshold.setAttribute("id",t2.getId()!=null?t2.getId().toString():"");
         
          String type = "";
          String code = "";
          List thValues = t2.getThresholdValues();
          if(thValues!=null && !thValues.isEmpty()){
            Iterator th2 = thValues.iterator();
            while(th2.hasNext()){
              ThresholdValue t = (ThresholdValue)th2.next();
              SourceBean range = new SourceBean(rangeS);
View Full Code Here

Examples of it.eng.spagobi.kpi.threshold.bo.Threshold

  }
 
 
  public Threshold loadThresholdById(Integer id) throws EMFUserError {
    logger.debug("IN");
    Threshold toReturn = null;
    Session aSession = null;
    Transaction tx = null;
    try {
      aSession = getSession();
      tx = aSession.beginTransaction();
      SbiThreshold hibThreshold = (SbiThreshold) aSession.load(
          SbiThreshold.class, id);
      toReturn = new Threshold();
      toReturn = toThreshold(hibThreshold);

    } catch (HibernateException he) {
      logger.error("Error while loading the Threshold with id "
          + ((id == null) ? "" : id.toString()), he);
View Full Code Here

Examples of it.eng.spagobi.kpi.threshold.bo.Threshold

        if ( line.getValue()!=null && line.getValue().getValue() != null) {
          t = line.getValue().getThresholdOfValue();
       
        if(t!=null){
          try {
            Threshold tr = DAOFactory.getThresholdDAO().loadThresholdById(t.getThresholdId());
            if (!thresholdsList.contains(tr)){
              thresholdsList.add(tr);
            }
            kpiValueToAdd.setAttribute("thresholdid",t.getThresholdId()!=null ? t.getThresholdId().toString() :"");
           
View Full Code Here

Examples of it.eng.spagobi.kpi.threshold.bo.Threshold

    return toReturn;
  }

  public Threshold loadThresholdByCode(String thrCode) throws EMFUserError {
    logger.debug("IN");
    Threshold toReturn = null;
    Session aSession = null;
    Transaction tx = null;
    try {
      aSession = getSession();
      tx = aSession.beginTransaction();
      Criterion labelCriterrion = Expression.eq("code", thrCode);
      Criteria criteria = aSession.createCriteria(SbiThreshold.class);
      criteria.add(labelCriterrion);     
      SbiThreshold hibThreshold = (SbiThreshold)criteria.uniqueResult();
      if (hibThreshold == null) return null;
      toReturn = new Threshold();
      toReturn = toThreshold(hibThreshold);

    } catch (HibernateException he) {
      logger.error("Error while loading the Threshold with code "
          + ((thrCode == null) ? "" : thrCode), 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.