Examples of SbiThresholdValue


Examples of it.eng.spagobi.kpi.threshold.metadata.SbiThresholdValue

          id);

      Set thresholdValues = t.getSbiThresholdValues();
      Iterator it = thresholdValues.iterator();
      while (it.hasNext()) {
        SbiThresholdValue val = (SbiThresholdValue) it.next();
//        TODO mettere a posto
        ThresholdValue tr = toThresholdValue(val);
        logger.debug("Added threshold value with label " + tr.getLabel());
        toReturn.add(tr);
      }
View Full Code Here

Examples of it.eng.spagobi.kpi.threshold.metadata.SbiThresholdValue

      if(t!=null){
        Set thresholdValues = t.getSbiThresholdValues();
        Iterator it = thresholdValues.iterator();
        while (it.hasNext()) {
          SbiThresholdValue val = (SbiThresholdValue) it.next();
          ThresholdValue tr = toThresholdValue(val);
          logger.debug("Added threshold value with label " + tr.getLabel());
          thresholdValueList.add(tr);
        }
      }     
View Full Code Here

Examples of it.eng.spagobi.kpi.threshold.metadata.SbiThresholdValue

          crit.addOrder(Order.desc(getThresholdValueProperty(fieldOrder)));
      }
      toTransform = crit.list();

      for (Iterator iterator = toTransform.iterator(); iterator.hasNext();) {
        SbiThresholdValue hibThresholdValue = (SbiThresholdValue) iterator
        .next();
        ThresholdValue thresholdValue = new ThresholdValue();

        thresholdValue.setId(hibThresholdValue.getIdThresholdValue());
        thresholdValue.setLabel(hibThresholdValue.getLabel());
        thresholdValue.setPosition(hibThresholdValue.getPosition());
        thresholdValue.setMaxValue(hibThresholdValue.getMaxValue());
        thresholdValue.setMinValue(hibThresholdValue.getMinValue());
        thresholdValue.setMinClosed(hibThresholdValue.getMinClosed());
        thresholdValue.setMaxClosed(hibThresholdValue.getMaxClosed());
        thresholdValue.setValue(hibThresholdValue.getThValue());

        thresholdValue.setThresholdId(hibThresholdValue
            .getSbiThreshold().getThresholdId());
        toReturn.add(thresholdValue);
      }

    } catch (HibernateException he) {
View Full Code Here

Examples of it.eng.spagobi.kpi.threshold.metadata.SbiThresholdValue

    Session aSession = null;
    Transaction tx = null;
    try {
      aSession = getSession();
      tx = aSession.beginTransaction();
      SbiThresholdValue hibThresholdValue = (SbiThresholdValue) aSession
      .load(SbiThresholdValue.class, id);
      toReturn = new ThresholdValue();
      toReturn.setId(hibThresholdValue.getIdThresholdValue());
      toReturn.setPosition(hibThresholdValue.getPosition());
      toReturn.setLabel(hibThresholdValue.getLabel());
      toReturn.setMinValue(hibThresholdValue.getMinValue());
      toReturn.setMaxValue(hibThresholdValue.getMaxValue());
      toReturn.setMinClosed(hibThresholdValue.getMinClosed());
      toReturn.setMaxClosed(hibThresholdValue.getMaxClosed());
      toReturn.setValue(hibThresholdValue.getThValue());

      Color color=null;
      String col=hibThresholdValue.getColour();
      if (col != null) {
        try{
          color = Color.decode(col);
        }
        catch (Exception e) {
          color=Color.RED;
        }
        logger.debug("Color decoded");
      }
      toReturn.setColor(color);
      toReturn.setColourString(hibThresholdValue.getColour());
      toReturn.setSeverityId(hibThresholdValue.getSeverity().getValueId());
      toReturn.setSeverityCd(hibThresholdValue.getSeverity().getValueCd());
      toReturn.setThresholdId(hibThresholdValue.getSbiThreshold()
          .getThresholdId());
      toReturn.setThresholdType(hibThresholdValue.getSbiThreshold().getThresholdType().getValueCd());
      tx.commit();
    } catch (HibernateException he) {
      logger.error("Error while loading the ThresholdValue with id "
          + ((id == null) ? "" : id.toString()), he);
View Full Code Here

Examples of it.eng.spagobi.kpi.threshold.metadata.SbiThresholdValue

    return toReturn;
  }
  public SbiThresholdValue loadSbiThresholdValueById(Integer id)
  throws EMFUserError {
    logger.debug("IN");
    SbiThresholdValue toReturn = null;
    Session aSession = null;
    Transaction tx = null;
    try {
      aSession = getSession();
      tx = aSession.beginTransaction();
      SbiThresholdValue hibThresholdValue = (SbiThresholdValue) aSession
      .load(SbiThresholdValue.class, id);
      toReturn = hibThresholdValue;

      tx.commit();
    } catch (HibernateException he) {
View Full Code Here

Examples of it.eng.spagobi.kpi.threshold.metadata.SbiThresholdValue

      colour=thresholdValue.getColourString();

      Integer thresholdId = thresholdValue.getThresholdId();
      Integer severityId = thresholdValue.getSeverityId();

      SbiThresholdValue sbiThresholdValue = (SbiThresholdValue) aSession
      .load(SbiThresholdValue.class, thresholdValue.getId());

      SbiDomains severity = null;
      if (severityId != null) {
        severity = (SbiDomains) aSession.load(SbiDomains.class,
            severityId);
      }

      SbiThreshold threshold = null;
      if (thresholdId != null) {
        threshold = (SbiThreshold) aSession.load(SbiThreshold.class,
            thresholdId);
      }

      sbiThresholdValue.setPosition(position);
      sbiThresholdValue.setLabel(label);
      sbiThresholdValue.setMinValue(minValue);
      sbiThresholdValue.setMaxValue(maxValue);
      sbiThresholdValue.setColour(colour);
      sbiThresholdValue.setMinClosed(minClosed);
      sbiThresholdValue.setMaxClosed(maxClosed);
      sbiThresholdValue.setThValue(value);

      sbiThresholdValue.setSbiThreshold(threshold);
      sbiThresholdValue.setSeverity(severity);

      aSession.saveOrUpdate(sbiThresholdValue);

      tx.commit();
View Full Code Here

Examples of it.eng.spagobi.kpi.threshold.metadata.SbiThresholdValue

    logger.debug("IN");
    Session aSession = null;
    Transaction tx = null;
    Integer toReturn = null;
    boolean save = true;
    SbiThresholdValue sbiThresholdValue = null;
    try {
      aSession = getSession();
      tx = aSession.beginTransaction();
     
      Integer position = thresholdValue.getPosition();
      String label = thresholdValue.getLabel();
      Double minValue = thresholdValue.getMinValue();
      Double maxValue = thresholdValue.getMaxValue();
      Boolean minClosed = thresholdValue.getMinClosed();
      Boolean maxClosed = thresholdValue.getMaxClosed();
      Double value = thresholdValue.getValue();

      String colour = "";
      colour=thresholdValue.getColourString();

      Integer thresholdId = thresholdValue.getThresholdId();
      Integer severityId = thresholdValue.getSeverityId();
     
      SbiDomains severity = null;
      if (severityId != null) {
        severity = (SbiDomains) aSession.load(SbiDomains.class,
            severityId);
      }

      SbiThreshold threshold = null;
      if (thresholdId != null) {
        threshold = (SbiThreshold) aSession.load(SbiThreshold.class,
            thresholdId);
      }
     
      Integer thrValId = thresholdValue.getId();     
     
      if(thrValId!=null && !thrValId.equals(new Integer(0))){
        save = false;
        try{
          sbiThresholdValue = (SbiThresholdValue) aSession.load(SbiThresholdValue.class, thrValId);
          Hibernate.initialize(sbiThresholdValue);
          toReturn = thrValId;
          if(sbiThresholdValue == null || (sbiThresholdValue != null && sbiThresholdValue.getIdThresholdValue() == null)){
            sbiThresholdValue = new SbiThresholdValue();
            save = true;
          }
        }catch(Throwable ex){
          sbiThresholdValue = new SbiThresholdValue();
          save = true;
        }

      }else{
        sbiThresholdValue = new SbiThresholdValue();
      }
      if(sbiThresholdValue == null || (sbiThresholdValue != null && sbiThresholdValue.getIdThresholdValue() == null)){
        //previously deleted
        //reinsert
        sbiThresholdValue = new SbiThresholdValue();
        save = true;
      }
      sbiThresholdValue.setPosition(position);
      sbiThresholdValue.setLabel(label);
      sbiThresholdValue.setMinValue(minValue);
      sbiThresholdValue.setMaxValue(maxValue);
      sbiThresholdValue.setColour(colour);
      sbiThresholdValue.setMinClosed(minClosed);
      sbiThresholdValue.setMaxClosed(maxClosed);
      sbiThresholdValue.setThValue(value);
      sbiThresholdValue.setSbiThreshold(threshold);
      sbiThresholdValue.setSeverity(severity);
     
      if(save){
        //save
        toReturn = (Integer)aSession.save(sbiThresholdValue)
        sbiThresholdValue.setIdThresholdValue(toReturn);
      }else{
        //update
        aSession.saveOrUpdate(sbiThresholdValue);

      }
View Full Code Here

Examples of it.eng.spagobi.kpi.threshold.metadata.SbiThresholdValue

      colour=toCreate.getColourString();

      Integer thresholdId = toCreate.getThresholdId();
      Integer severityId = toCreate.getSeverityId();

      SbiThresholdValue sbiThresholdValue = new SbiThresholdValue();

      SbiDomains severity = null;
      if (severityId != null) {
        severity = (SbiDomains) aSession.load(SbiDomains.class,
            severityId);
      }

      SbiThreshold threshold = null;
      if (thresholdId != null) {
        threshold = (SbiThreshold) aSession.load(SbiThreshold.class,
            thresholdId);
      }

      sbiThresholdValue.setPosition(position);
      sbiThresholdValue.setLabel(label);
      sbiThresholdValue.setMinValue(minValue);
      sbiThresholdValue.setMaxValue(maxValue);
      sbiThresholdValue.setColour(colour);
      sbiThresholdValue.setSbiThreshold(threshold);
      sbiThresholdValue.setSeverity(severity);
     
      sbiThresholdValue.setMinClosed(minClosed);
      sbiThresholdValue.setMaxClosed(maxClosed);
      sbiThresholdValue.setThValue(value);

      idToReturn = (Integer) aSession.save(sbiThresholdValue);

      tx.commit();
View Full Code Here

Examples of it.eng.spagobi.kpi.threshold.metadata.SbiThresholdValue

  throws EMFUserError {
    Session aSession = getSession();
    Transaction tx = null;
    try {
      tx = aSession.beginTransaction();
      SbiThresholdValue aThresholdValue = (SbiThresholdValue) aSession
      .load(SbiThresholdValue.class, thresholdValueId);
      aSession.delete(aThresholdValue);
      tx.commit();

    } catch (ConstraintViolationException cve) {
View Full Code Here

Examples of it.eng.spagobi.kpi.threshold.metadata.SbiThresholdValue

      if(newThValueId==null) {
        logger.error("could not find ThValue associater to Alarm; with label "+exportedAlarm.getSbiThresholdValue().getLabel());
      }
      else{
        // I must get the new SbiDomains object
        SbiThresholdValue newSbiThValue = (SbiThresholdValue) sessionCurrDB.load(SbiThresholdValue.class, newThValueId);
        existingAlarm.setSbiThresholdValue(newSbiThValue);
      }
    } 

    // fill the set of AlarmContacts
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.