Package it.eng.spagobi.kpi.ou.bo

Examples of it.eng.spagobi.kpi.ou.bo.OrganizationalUnit


      while (rs.next()) {
       
        String code =  rs.getString(CODE);
        String name =  rs.getString(NAME);
       
        OrganizationalUnit ou =new OrganizationalUnit();
        ou.setDescription("");
        ou.setLabel(code);
        ou.setName(name);
        String path = "";
        if(ouParentNode != null){
          path = ouParentNode.getPath();
        }
        if(code != null){
          root = new Node<OrganizationalUnit>(ou, path + S + ou.getLabel(), ouParentNode);       
        }

      }
      rs.close();
      pstmt.close();
View Full Code Here


      while (rs.next()) {
       
        String code =  rs.getString(CODE);
        String name =  rs.getString(NAME);
       
        OrganizationalUnit ou =new OrganizationalUnit();
        ou.setDescription("");
        ou.setLabel(code);
        ou.setName(name);
        String path = "";
        if(level != 1){
          path = parent.getPath();
        }
        if(code != null){
          Node<OrganizationalUnit> node = new Node<OrganizationalUnit>(ou, path + S+ ou.getLabel(), parent);   
          children.add(node);
        }
      }
      rs.close();
      pstmt.close();
View Full Code Here

    try {

      List<OrganizationalUnit> ouList = DAOFactory.getOrganizationalUnitDAO().getOrganizationalUnitList();
      if(ouList != null && !ouList.isEmpty()){
        for (Iterator iterator = ouList.iterator(); iterator.hasNext();) {
          OrganizationalUnit ou = (OrganizationalUnit) iterator.next();
          exporter.insertOu(ou, session);         
        }
      }

    } catch (Exception e) {
View Full Code Here

    if( !(o instanceof OrganizationalUnit) ) {
      throw new SerializationException("OrganizationalUnitJSONSerializer is unable to serialize object of type: " + o.getClass().getName());
    }
   
    try {
      OrganizationalUnit ou = (OrganizationalUnit) o;
      result = new JSONObject();
      result.put(ID, ou.getId() );
      result.put(LABEL, ou.getLabel() );
      result.put(NAME, ou.getName() );
      result.put(DESCRIPTION, ou.getDescription() );
    } catch (Throwable t) {
      throw new SerializationException("An error occurred while serializing object: " + o, t);
    }
   
    return result;
View Full Code Here

                : "Resource name null"));
        hibKpiValue.setSbiResources(sbiResources);
      }
      OrganizationalUnitGrantNode grantNode = value.getGrantNodeOU();
      if (grantNode != null) {
        OrganizationalUnit ou = grantNode.getOuNode().getOu();
        SbiOrgUnit hibOU = new SbiOrgUnit();
        hibOU.setLabel(ou.getLabel());
        hibOU.setName(ou.getName());
        hibOU.setDescription(ou.getDescription());
        hibOU.setId(ou.getId());
       
        logger.debug("Organizational unit: "
            + (ou.getName() != null ? ou.getName()
                : "OU name null"));
        hibKpiValue.setSbiOrgUnit(hibOU);
        //same for hierarchy
        OrganizationalUnitHierarchy hier = grantNode.getOuNode().getHierarchy();
        SbiOrgUnitHierarchies hibHier = new SbiOrgUnitHierarchies();
View Full Code Here

    toReturn.setValueXml(value.getXmlData());
    logger.debug("Kpi value XML setted");
    OrganizationalUnitGrantNode grantNode = new OrganizationalUnitGrantNode();
    OrganizationalUnitNode node = new OrganizationalUnitNode();
    if(value.getSbiOrgUnit() != null){
      OrganizationalUnit ou = DAOFactory.getOrganizationalUnitDAO().getOrganizationalUnit(value.getSbiOrgUnit().getId());
      node.setOu(ou);
    }
    if(value.getSbiOrgUnitHierarchies() != null){
      OrganizationalUnitHierarchy hierarchy = DAOFactory.getOrganizationalUnitDAO().getHierarchy(value.getSbiOrgUnitHierarchies().getId());
      node.setHierarchy(hierarchy);
View Full Code Here

      r = resDao.toResource(res);
      logger.debug("SbiKpiValue resource: "
          + (r.getColumn_name() != null ? r.getColumn_name() : "resource name null"));
    }
    SbiOrgUnit sbiOrgUnit = value.getSbiOrgUnit();
    OrganizationalUnit orgUnit = null;
    if(sbiOrgUnit != null){
      orgUnit = DAOFactory.getOrganizationalUnitDAO().getOrganizationalUnit(sbiOrgUnit.getId())
      logger.debug("SbiKpiValue ou: "
          + (orgUnit.getName() != null ? orgUnit.getName()
              : "ou name null"));
    }
    kpiInstanceID = value.getSbiKpiInstance().getIdKpiInstance();
    logger.debug("SbiKpiValue kpiInstanceID: "
        + (kpiInstanceID != null ? kpiInstanceID.toString() : "kpiInstanceID null"));
    SbiKpiInstance kpiInst = value.getSbiKpiInstance();

    List thresholdValues = new ArrayList();
    Date kpiInstBegDt = kpiInst.getBeginDt();
    logger.debug("kpiInstBegDt begin date: "
        + (kpiInstBegDt != null ? kpiInstBegDt.toString() : "Begin date null"));
   
    // TODO for the moment get actual values of weight/target etc check if it is correct
    weight = kpiInst.getWeight();
    logger.debug("SbiKpiValue weight: "
        + (weight != null ? weight.toString() : "weight null"));
    target = kpiInst.getTarget();
    logger.debug("SbiKpiValue target: "
        + (target != null ? target.toString() : "target null"));

    if (kpiInst.getSbiMeasureUnit() != null) {
      scaleCode = kpiInst.getSbiMeasureUnit().getScaleCd();
      logger.debug("SbiKpiValue scaleCode: "
          + (scaleCode != null ? scaleCode : "scaleCode null"));
      scaleName = kpiInst.getSbiMeasureUnit().getScaleNm();
      logger.debug("SbiKpiValue scaleName: "
          + (scaleName != null ? scaleName : "scaleName null"));
    }
    SbiThreshold t = kpiInst.getSbiThreshold();
    if(t!=null){

      Set ts = t.getSbiThresholdValues();
      Iterator i = ts.iterator();
      while (i.hasNext()) {
        SbiThresholdValue tls = (SbiThresholdValue) i.next();

        IThresholdValueDAO thDao=(IThresholdValueDAO)DAOFactory.getThresholdValueDAO();
        ThresholdValue tr = thDao.toThresholdValue(tls);
        thresholdValues.add(tr);
      }
    }     
    // TODO for the moment get actual values of weight/target etc check if it is correct
   
    toReturn.setValueDescr(valueDescr);
    logger.debug("Kpi value descritpion setted");
    toReturn.setTarget(target);
    logger.debug("Kpi value target setted");
    toReturn.setBeginDate(beginDate);
    logger.debug("Kpi value begin date setted");
    toReturn.setEndDate(endDate);
    logger.debug("Kpi value end date setted");
    toReturn.setValue(val);
    logger.debug("Kpi value setted");
    toReturn.setKpiInstanceId(kpiInstanceID);
    logger.debug("Kpi value Instance ID setted");
    toReturn.setWeight(weight);
    logger.debug("Kpi value weight setted");
    toReturn.setR(r);
    logger.debug("Kpi value resource setted");
    toReturn.setScaleCode(scaleCode);
    logger.debug("Kpi value scale Code setted");
    toReturn.setScaleName(scaleName);
    logger.debug("Kpi value scale Name setted");
    toReturn.setThresholdValues(thresholdValues);
    logger.debug("Kpi value Thresholds setted");
    toReturn.setKpiValueId(value.getIdKpiInstanceValue());
    logger.debug("Kpi value ID setted");
    toReturn.setValueXml(value.getXmlData());
    logger.debug("Kpi value XML setted");

    OrganizationalUnitGrantNode grantNode = new OrganizationalUnitGrantNode();
    OrganizationalUnitNode node = new OrganizationalUnitNode();
    if(value.getSbiOrgUnit() != null){
      OrganizationalUnit ou = DAOFactory.getOrganizationalUnitDAO().getOrganizationalUnit(value.getSbiOrgUnit().getId());
      node.setOu(ou);
    }
    if(value.getSbiOrgUnitHierarchies() != null){
      OrganizationalUnitHierarchy hierarchy = DAOFactory.getOrganizationalUnitDAO().getHierarchy(value.getSbiOrgUnitHierarchies().getId());
      node.setHierarchy(hierarchy);
View Full Code Here

  }
 
  @Override
  public Tree<OrganizationalUnit> getHierarchyStructure(
      OrganizationalUnitHierarchy hierarchy) {
    OrganizationalUnit root = new OrganizationalUnit();
    HashMap<String, String> params = new HashMap<String, String>();
    params.put(HIERARCHY, hierarchy.getName());
    params.put(COMPANY, hierarchy.getCompany());
    Tree<OrganizationalUnit> toReturn = null;
    try {
View Full Code Here

        }else if(type.equals(OU)){           

          String ouName =  rs.getString("NAME");
          String ouCode =  rs.getString("CODE");
          if(ouCode != null){
            OrganizationalUnit item = new OrganizationalUnit(null, ouCode, ouName, null);
            toReturn.add(item);
          }else{
            isToBreak = true;
            break;
          }
View Full Code Here

      while (rs.next()) {
       
        String code =  rs.getString(CODE);
        String name =  rs.getString(NAME);
       
        OrganizationalUnit ou =new OrganizationalUnit();
        ou.setDescription("");
        ou.setLabel(code);
        ou.setName(name);
        String path = "";
        if(ouParentNode != null){
          path = ouParentNode.getPath();
        }
        if(code != null){
          root = new Node<OrganizationalUnit>(ou, path + S + ou.getLabel(), ouParentNode);       
        }

      }
      rs.close();
      pstmt.close();
View Full Code Here

TOP

Related Classes of it.eng.spagobi.kpi.ou.bo.OrganizationalUnit

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.