Package it.eng.spagobi.kpi.config.dao

Examples of it.eng.spagobi.kpi.config.dao.IKpiInstanceDAO


    String name = hibSbiKpiModelInst.getName();
    logger.debug("SbiKpiModelInstanceNode name: "
        + (name != null ? name : "name null"));
    SbiKpiInstance kpiInst = hibSbiKpiModelInst.getSbiKpiInstance();

    IKpiInstanceDAO kpiInstDAO = DAOFactory.getKpiInstanceDAO();
    KpiInstance kpiInstanceAssociated = null;
    if (kpiInst != null) {
      kpiInstanceAssociated = kpiInstDAO.toKpiInstance(kpiInst);
    }

    Set resources = hibSbiKpiModelInst.getSbiKpiModelResourceses();
    List res = new ArrayList();
    if (!resources.isEmpty()) {
View Full Code Here


    if(kpiValID!=null && !kpiValID.equals("")){
      xml = DAOFactory.getKpiDAO().loadKPIValueXml(new Integer(kpiValID));
    }
     
    if (kpiInstanceID!=null){
      IKpiInstanceDAO kpiInstDAO=DAOFactory.getKpiInstanceDAO();
      KpiInstance kI = kpiInstDAO.loadKpiInstanceById(new Integer(kpiInstanceID));
      Integer kpiID = kI.getKpi();
      if (kpiID!=null){
        Kpi k = DAOFactory.getKpiDAO().loadKpiById(kpiID);
        String kpiCode = k.getCode();
        String kpiDescription = k.getDescription();
View Full Code Here

      if(!hibList.isEmpty()) {
        return;
      }

      // recover kpi instance from Id
      IKpiInstanceDAO kpiInstDAO=DAOFactory.getKpiInstanceDAO();
      KpiInstance kpiInst=kpiInstDAO.loadKpiInstanceById(kpiInstId);

      // main attributes     
      SbiKpiInstance hibKpiInst = new SbiKpiInstance();
      hibKpiInst.setIdKpiInstance(kpiInst.getKpiInstanceId());
      hibKpiInst.setBeginDt(kpiInst.getD());
View Full Code Here

        //nothing
        logger.error("no model!");
        modelInst.setModel(null);
      }
      try{
        IKpiInstanceDAO kpiInstDao = DAOFactory.getKpiInstanceDAO();
        String kpiIdStr ;
        try{
          kpiIdStr = obj.getString("kpiId");
        }catch(Throwable t){
          kpiIdStr = null;
        }
        String kpiInIDStr;
        try{
          kpiInIDStr = obj.getString("kpiInstId");
        }catch(Throwable t){
          kpiInIDStr = null;

        }
        KpiInstance kpiInstance = null;
        if(kpiInIDStr != null){
          //existing kpi instance means model instance exists
          kpiInstance = kpiInstDao.loadKpiInstanceById(obj.getInt("kpiInstId"));

        }else{
          //new kpi instance
          if(kpiIdStr != null){
            if(obj.get("kpiId")!= null && !obj.getString("kpiId").equalsIgnoreCase("")){
              kpiInstance = new KpiInstance();
              int idd = obj.getInt("kpiId");
              kpiInstDao.setKpiInstanceFromKPI(kpiInstance, idd);
            }
          } 
        }
        String kpiInstPeriodicity;
        try{
View Full Code Here

    } else if (serviceType != null  && serviceType.equalsIgnoreCase(TRESHOLDS_LIST)) {
      Integer id =  getAttributeAsInteger(ID);
      try {
        if(id != null){
          IThresholdValueDAO tresholdDao = DAOFactory.getThresholdValueDAO();
          IKpiInstanceDAO kpiDao = DAOFactory.getKpiInstanceDAO();
          KpiInstance k = kpiDao.loadKpiInstanceById(id);
          if(k!=null){
            List<ThresholdValue> tresholds = tresholdDao.loadThresholdValuesByThresholdId(k.getThresholdId());
            logger.debug("Threshold values loaded");
            JSONArray trshJSON = (JSONArray) SerializerFactory.getSerializer("application/json").serialize(tresholds,locale);
            JSONObject trashResponseJSON = createJSONResponseThresholds(trshJSON);
   
            writeBackToClient(new JSONSuccess(trashResponseJSON));
          }else{
            writeBackToClient("Error");
          }
        }

      } catch (Throwable e) {
        logger.error("Exception occurred while retrieving tresholds", e);
        throw new SpagoBIServiceException(SERVICE_NAME,
            "Exception occurred while retrieving tresholds",e);
      }
    }else if(serviceType == null){
      try {
        IKpiInstanceDAO kpiDao = DAOFactory.getKpiInstanceDAO();
        List<String> kpis = (List<String>)getSessionContainer().getAttribute(KPI_LIST);
        if(kpis != null){
          getSessionContainer().delAttribute(KPI_LIST);       
        }
        List<KpiAlarmInstance> kpisAlarm = kpiDao.loadKpiAlarmInstances();
        if(kpisAlarm != null){
          getSessionContainer().setAttribute(KPI_LIST, kpisAlarm);
        }
       
        List<SbiAlarmContact> contactsList = DAOFactory.getAlarmContactDAO().findAll();
View Full Code Here

TOP

Related Classes of it.eng.spagobi.kpi.config.dao.IKpiInstanceDAO

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.