Package it.eng.spagobi.kpi.model.bo

Examples of it.eng.spagobi.kpi.model.bo.Model


    logger.debug("IN");

    SbiKpi sbiKpi = null;
    Kpi kpi = null;
    SbiKpiModel sbiKpiModel = null;
    Model modelNode = null;
    boolean isKpi = false;
    if(family.equalsIgnoreCase("KPI")){
      isKpi = true;
      sbiKpi = (SbiKpi)sbiObject;
      kpi = (Kpi)object;
      logger.debug("kpi udp attributes");
    }
    else if(family.equalsIgnoreCase("MODEL")){
      isKpi = false;
      sbiKpiModel = (SbiKpiModel)sbiObject;
      modelNode = (Model)object;
      logger.debug("model udp attributes");
    }
    else {
      logger.debug("family not recognied "+ family);
      return;
    }

    // if there are values associated
    List<UdpValue> udpValues = null;
    Integer idObject = null;
    if(isKpi){
      udpValues = kpi.getUdpValues();
      idObject = sbiKpi.getKpiId();
    }
    else{
      udpValues = modelNode.getUdpValues();     
      idObject = sbiKpiModel.getKpiModelId();
    }   
    if(udpValues != null){
      // an udp value is never erased for a kpi once memorized, that is because by user interface integer have no null value and boolean too
      // these are current UdpValues; for each:
View Full Code Here


    } catch (EMFUserError e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }

    Model aModel = ModelDAOImpl.toModelWithoutChildren(sbiKpiModel,
        aSession);
    SbiKpiInstance sbiKpiInstance = value.getSbiKpiInstance();

    if (sbiKpiInstance != null) {
      // toKpiInstance
View Full Code Here

      sbiKpiModelInst.setLabel(toCreate.getLabel());
      sbiKpiModelInst.setStartDate(toCreate.getStartDate());
      sbiKpiModelInst.setEndDate(toCreate.getEndDate());
      sbiKpiModelInst.setModelUUID(toCreate.getModelUUID());

      Model aModel = toCreate.getModel();
      if (aModel != null && aModel.getId() != null) {
        SbiKpiModel sbiKpiModel = (SbiKpiModel) aSession.load(
            SbiKpiModel.class, aModel.getId());
        sbiKpiModelInst.setSbiKpiModel(sbiKpiModel);

        // set the sbiKpiInstance
        KpiInstance kpiInst = toCreate.getKpiInstance();
View Full Code Here

      sbiKpiModelInst.setLabel(toCreate.getLabel());
      sbiKpiModelInst.setStartDate(toCreate.getStartDate());
      sbiKpiModelInst.setEndDate(toCreate.getEndDate());
      sbiKpiModelInst.setModelUUID(toCreate.getModelUUID());

      Model aModel = toCreate.getModel();
      if (aModel != null && aModel.getId() != null) {
        SbiKpiModel sbiKpiModel = (SbiKpiModel) aSession.load(
            SbiKpiModel.class, aModel.getId());
        sbiKpiModelInst.setSbiKpiModel(sbiKpiModel);

        // set the sbiKpiInstance
        SbiKpi sbiKpi = sbiKpiModel.getSbiKpi();
        if (sbiKpi != null) {
View Full Code Here

    Date startDate = value.getStartDate();
    Date endDate = value.getEndDate();
    Integer id = value.getKpiModelInst();
    SbiKpiModel sbiKpiModel = value.getSbiKpiModel();
    String modelUUID = value.getModelUUID();
    Model aModel = ModelDAOImpl
    .toModelWithoutChildren(sbiKpiModel, session);
    SbiKpiInstance sbiKpiInstance = value.getSbiKpiInstance();

    if (sbiKpiInstance != null) {
      // toKpiInstance
View Full Code Here

        }
        for (Iterator iterator = modelChildren.iterator(); iterator
        .hasNext();) {
          SbiKpiModel sbiKpiModelCandidate = (SbiKpiModel) iterator
          .next();
          Model modelCandidate = new Model();
          modelCandidate.setId(sbiKpiModelCandidate.getKpiModelId());
          modelCandidate
          .setName(sbiKpiModelCandidate.getKpiModelNm());
          toReturn.add(modelCandidate);
        }
      }
View Full Code Here

    // insert the model (model instance root points to model root)
    logger.debug("Insert the model root and the tree");   

    // insert model tree starting from root.
    Model modelRoot=miRoot.getModel();
    insertModelTree(modelRoot, session);

    logger.debug("Insert the model Instance root and the tree");   

    //insert the Model Instanceroot
View Full Code Here

      Set modelChildren=new HashSet();
      logger.debug("insert current model children");

      //Load model childred
      Model modWithChildren=modelDao.loadModelWithChildrenById(mod.getId());

      List childrenList=modWithChildren.getChildrenNodes();
      if(childrenList!=null){
        for (Iterator iterator = childrenList.iterator(); iterator.hasNext();) {
          Model childNode = (Model) iterator.next();
          logger.debug("insert child "+childNode.getCode());
          insertModelTree(childNode,session);       
          SbiKpiModel hibKpiModel = (SbiKpiModel) session.load(SbiKpiModel.class, childNode.getId());
          modelChildren.add(hibKpiModel);
        }
      }
      hibMod.setSbiKpiModels(modelChildren);
View Full Code Here

      throw new SerializationException("ModelExtendedJSONSerializer is unable to serialize object of type: " + o.getClass().getName());
    }
   
    try {
      ModelExtended modelExtended = (ModelExtended)o;
      Model model = modelExtended.getModel();
      result = new JSONObject();
     
      result.put(MODEL_ID, model.getId() );
      result.put(MODEL_GUIID, model.getGuiId() );
      result.put(MODEL_PARENT_ID, model.getParentId() );
      result.put(MODEL_CODE, model.getCode() );
      result.put(MODEL_NAME, model.getName() );
      result.put(MODEL_LABEL, model.getLabel() );
      result.put(MODEL_DESCRIPTION, model.getDescription() );   
     
      //find kpi name
      if(model.getKpiId() != null){
        result.put(MODEL_KPI_ID, model.getKpiId());
        Kpi kpi = DAOFactory.getKpiDAO().loadKpiById(model.getKpiId());
        if(kpi != null){
          result.put(MODEL_KPI, kpi.getKpiName());
        }else{
          result.put(MODEL_KPI, "");
        }
        result.put(KPI_NAME, kpi.getKpiName());
        result.put(KPI_LABEL, kpi.getModelReference());
        if(kpi.getThreshold() != null){
          result.put(KPI_THRESHOLD, kpi.getThreshold().getName());
        }
        result.put(KPI_WEIGHT, kpi.getStandardWeight());
        result.put(KPI_TARGET, kpi.getTargetAudience());

     
      }
      result.put(MODEL_TYPE, model.getTypeCd() );
      result.put(MODEL_TYPE_ID, model.getTypeId() );
      result.put(MODEL_TYPE_DESCR, model.getTypeDescription() );
      if(model.getChildrenNodes() != null && !model.getChildrenNodes().isEmpty()){
        result.put(MODEL_IS_LEAF, false );
      }else{
        result.put(MODEL_IS_LEAF, true );
      }
      result.put(MODEL_TEXT, model.getCode()+" - "+ model.getName() );
      result.put(MODEL_ERROR, false);
      // put udpValues assocated to ModelInstance Node
      List udpValues = model.getUdpValues();
      JSONArray udpValuesJSON = new JSONArray();

      if(udpValues != null){
        Iterator itUdpValues = udpValues.iterator();
        while(itUdpValues.hasNext()){
View Full Code Here

    if( !(o instanceof Model) ) {
      throw new SerializationException("ModelNodeJSONSerializer is unable to serialize object of type: " + o.getClass().getName());
    }
   
    try {
      Model model = (Model)o;
      result = new JSONObject();
     
      result.put(MODEL_ID, model.getId() );
      result.put(MODEL_GUIID, model.getGuiId() );
      result.put(MODEL_PARENT_ID, model.getParentId() );
      result.put(MODEL_CODE, model.getCode() );
      result.put(MODEL_NAME, model.getName() );
      result.put(MODEL_LABEL, model.getLabel() );
      result.put(MODEL_DESCRIPTION, model.getDescription() );   
     
      //find kpi name
      if(model.getKpiId() != null){
        result.put(MODEL_KPI_ID, model.getKpiId());
        Kpi kpi = DAOFactory.getKpiDAO().loadKpiById(model.getKpiId());
        if(kpi != null){
          result.put(MODEL_KPI, kpi.getKpiName());
          result.put(MODEL_KPI_CODE, kpi.getCode());
        }else{
          result.put(MODEL_KPI, "");
        }
      }
      result.put(MODEL_TYPE, model.getTypeCd() );
      result.put(MODEL_TYPE_ID, model.getTypeId() );
      result.put(MODEL_TYPE_DESCR, model.getTypeDescription() );
      if(model.getChildrenNodes() != null && !model.getChildrenNodes().isEmpty()){
        result.put(MODEL_IS_LEAF, false );
      }else{
        result.put(MODEL_IS_LEAF, true );
      }
      result.put(MODEL_TEXT, model.getCode()+" - "+ model.getName() );
      result.put(MODEL_ERROR, false);
      // put udpValues assocated to ModelInstance Node
      List udpValues = model.getUdpValues();
      JSONArray udpValuesJSON = new JSONArray();

      if(udpValues != null){
        Iterator itUdpValues = udpValues.iterator();
        while(itUdpValues.hasNext()){
View Full Code Here

TOP

Related Classes of it.eng.spagobi.kpi.model.bo.Model

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.