Package it.eng.spagobi.kpi.config.bo

Examples of it.eng.spagobi.kpi.config.bo.KpiDocuments


        List docs = k.getSbiKpiDocuments();

        Iterator it = docs.iterator();
        List documents = new ArrayList();
        while(it.hasNext()){
          KpiDocuments doc = (KpiDocuments)it.next();
          String docLabel = doc.getBiObjLabel();
          if (docLabel != null && !docLabel.equals("")) {           
            logger.debug("Retrieved documents associated to the KPI");
            documents.add(docLabel);           
          }
        }
View Full Code Here


          List docsList = null;
          if(docLabelsJSON != null){
            docsList = deserializeDocLabelsJSONArray(docLabelsJSON);
            k.setSbiKpiDocuments(docsList);
          }else if(docs!=null && !docs.equalsIgnoreCase("")){
            KpiDocuments d = new KpiDocuments();
            d.setBiObjLabel(docs);
            docsList = new ArrayList();
            docsList.add(d);
            k.setSbiKpiDocuments(docsList);
          }
View Full Code Here

  private List deserializeDocLabelsJSONArray(JSONArray rows) throws JSONException{
    List toReturn = new ArrayList();
    for(int i=0; i< rows.length(); i++){     
      if(!rows.isNull(i)){
        String label = (String)rows.get(i);
        KpiDocuments d = new KpiDocuments();
        d.setBiObjLabel(label);
        toReturn.add(d);
      }
    } 
    return toReturn;
  }
View Full Code Here

      tx.commit();

      List kpiDocsList = kpi.getSbiKpiDocuments();
      Iterator i = kpiDocsList.iterator();
      while (i.hasNext()) {
        KpiDocuments doc = (KpiDocuments) i.next();
        String label = doc.getBiObjLabel();

        IBIObjectDAO biobjDAO = DAOFactory.getBIObjectDAO();
        BIObject biobj = biobjDAO.loadBIObjectByLabel(label);
        if(biobj!=null){
          insertBIObject(biobj, session, true);
          doc.setBiObjId(biobj.getId());       
        }

        Integer origDocId = doc.getBiObjId();
        Criterion labelCriterrion = Expression.eq("label",label);
        Criteria criteria = session.createCriteria(SbiObjects.class);
        criteria.add(labelCriterrion);
        SbiObjects hibObject = (SbiObjects) criteria.uniqueResult();

        if(hibObject!=null){
          SbiKpiDocument temp = new SbiKpiDocument();
          temp.setSbiKpi(hibKpi);
          temp.setSbiObjects(hibObject);
          KpiDocuments docK = kpiDao.loadKpiDocByKpiIdAndDocId(kpiId, origDocId);
          if(docK!=null && docK.getKpiDocId()!=null){
            temp.setIdKpiDoc(docK.getKpiDocId());
            Transaction tx2 = session.beginTransaction();
            session.save(temp);
            tx2.commit();
          }
        }
View Full Code Here

      tx.commit();

      List kpiDocsList = kpi.getSbiKpiDocuments();
      Iterator i = kpiDocsList.iterator();
      while (i.hasNext()) {
        KpiDocuments doc = (KpiDocuments) i.next();
        String label = doc.getBiObjLabel();

        IBIObjectDAO biobjDAO = DAOFactory.getBIObjectDAO();
        BIObject biobj = biobjDAO.loadBIObjectByLabel(label);
        if(biobj!=null){
          insertBIObject(biobj, session, true);
          doc.setBiObjId(biobj.getId());       
        }

        Integer origDocId = doc.getBiObjId();
        Criterion labelCriterrion = Expression.eq("label",label);
        Criteria criteria = session.createCriteria(SbiObjects.class);
        criteria.add(labelCriterrion);
        SbiObjects hibObject = (SbiObjects) criteria.uniqueResult();

        if(hibObject!=null){
          SbiKpiDocument temp = new SbiKpiDocument();
          temp.setSbiKpi(hibKpi);
          temp.setSbiObjects(hibObject);
          KpiDocuments docK = kpiDao.loadKpiDocByKpiIdAndDocId(kpiId, origDocId);
          if(docK!=null && docK.getKpiDocId()!=null){
            temp.setIdKpiDoc(docK.getKpiDocId());
            Transaction tx2 = session.beginTransaction();
            session.save(temp);
            tx2.commit();
          }
        }
View Full Code Here

      JSONArray documentsJSON = new JSONArray();
      //documentsJSON.put("documents");

      while(itDocs.hasNext()){
        //JSONObject jsonDoc = new JSONObject();
        KpiDocuments kpiDoc = (KpiDocuments)itDocs.next();
        //jsonDoc.put("label", kpiDoc.getBiObjLabel());
        documentsJSON.put(kpiDoc.getBiObjLabel());
     
      result.put(KPI_DOCS, documentsJSON);

      // put udpValues assocated to KPI
      List udpValues = kpi.getUdpValues();
View Full Code Here

    return xmlToReturn;
  }

  private KpiDocuments toKpiDoc(SbiKpiDocument kpiDoc) throws EMFUserError {
    logger.debug("IN");
    KpiDocuments toReturn = new KpiDocuments();

    toReturn.setBiObjId(kpiDoc.getSbiObjects().getBiobjId());
    toReturn.setBiObjLabel(kpiDoc.getSbiObjects().getLabel());
    toReturn.setKpiDocId(kpiDoc.getIdKpiDoc());
    toReturn.setKpiId(kpiDoc.getSbiKpi().getKpiId());
    return toReturn;
  }
View Full Code Here

    return toReturn;
  }

  public KpiDocuments loadKpiDocByKpiIdAndDocId(Integer kpiId,Integer docId) throws EMFUserError {
    logger.debug("IN");
    KpiDocuments toReturn = null;
    Session aSession = null;
    Transaction tx = null;

    try {
      aSession = getSession();
View Full Code Here

    if(kpiDocs!=null && !kpiDocs.isEmpty()){
      Iterator i = kpiDocs.iterator();
      while (i.hasNext()) {
        SbiKpiDocument doc = (SbiKpiDocument) i.next();
        if(doc!=null){       
          KpiDocuments temp = new KpiDocuments();
          temp.setBiObjId(doc.getSbiObjects().getBiobjId());
          temp.setBiObjLabel(doc.getSbiObjects().getLabel());
          temp.setKpiDocId(doc.getIdKpiDoc());
          temp.setKpiId(doc.getSbiKpi().getKpiId());
          kpiDocsList.add(temp);
        }
      }
    }
View Full Code Here

    if(kpiDocs!=null && !kpiDocs.isEmpty()){
      Iterator i = kpiDocs.iterator();
      while (i.hasNext()) {
        SbiKpiDocument doc = (SbiKpiDocument) i.next();
        if(doc!=null){
          KpiDocuments temp = new KpiDocuments();
          temp.setBiObjId(doc.getSbiObjects().getBiobjId());
          temp.setBiObjLabel(doc.getSbiObjects().getLabel());
          temp.setKpiDocId(doc.getIdKpiDoc());
          temp.setKpiId(doc.getSbiKpi().getKpiId());
          kpiDocsList.add(temp);
        }
      }
    }
View Full Code Here

TOP

Related Classes of it.eng.spagobi.kpi.config.bo.KpiDocuments

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.