Examples of SbiOrgUnitHierarchies


Examples of it.eng.spagobi.kpi.ou.metadata.SbiOrgUnitHierarchies

      String label = (String) uniqueMap.get("label");
      String company = (String) uniqueMap.get("company");
     
      hql = "from SbiOrgUnitHierarchies h where h.label = '" + label + "' and h.company = '"+company+"'";
      hqlQuery = sessionCurrDB.createQuery(hql);
      SbiOrgUnitHierarchies hibHier = (SbiOrgUnitHierarchies) hqlQuery.uniqueResult();
      return hibHier;   
    }else if (hibObj instanceof SbiOrgUnitNodes) {
      Map uniqueMap = (Map) unique;
      Integer ouId = (Integer) uniqueMap.get("ouId");
      Integer hierarchyId = (Integer) uniqueMap.get("hierarchyId");
View Full Code Here

Examples of it.eng.spagobi.kpi.ou.metadata.SbiOrgUnitHierarchies

      Integer newHierId=(Integer)ouHierAss.get(oldHierId);
      if(newHierId==null) {
        logger.error("could not find association with ou hierarchy id with id " + oldHierId);       
      }
      else{
        SbiOrgUnitHierarchies newSbiHier = (SbiOrgUnitHierarchies) sessionCurrDB.load(SbiOrgUnitHierarchies.class, newHierId);
        existingGrant.setSbiOrgUnitHierarchies(newSbiHier);
      }
    }

    logger.debug("OUT");
View Full Code Here

Examples of it.eng.spagobi.kpi.ou.metadata.SbiOrgUnitHierarchies

            + (ou.getName() != null ? ou.getName()
                : "OU name null"));
        hibKpiValue.setSbiOrgUnit(hibOU);
        //same for hierarchy
        OrganizationalUnitHierarchy hier = grantNode.getOuNode().getHierarchy();
        SbiOrgUnitHierarchies hibHier = new SbiOrgUnitHierarchies();
        hibHier.setDescription(hier.getDescription());
        hibHier.setId(hier.getId());
        hibHier.setLabel(hier.getLabel());
        hibHier.setName(hier.getName());
        hibHier.setTarget(hier.getTarget());
        hibHier.setCompany(hier.getCompany());
       
        hibKpiValue.setSbiOrgUnitHierarchies(hibHier);
        //inserts company too as standalone column field
        hibKpiValue.setCompany(hier.getCompany());
       
View Full Code Here

Examples of it.eng.spagobi.kpi.ou.metadata.SbiOrgUnitHierarchies

      }
    }// OU hierarchy SbiOrgUnitHierarchies
    List exportedSbiOuHierList = importer.getAllExportedSbiObjects(sessionExpDB, "SbiOrgUnitHierarchies", null);
    Iterator iterOUHierVal = exportedSbiOuHierList.iterator();
    while (iterOUHierVal.hasNext()) {
      SbiOrgUnitHierarchies ouHierVal = (SbiOrgUnitHierarchies) iterOUHierVal.next();
      // check if the association already exist
      Map uniqueMap = new HashMap();
      String label = ouHierVal.getLabel();
      String company = ouHierVal.getCompany();
      uniqueMap.put("label", label);
      uniqueMap.put("company", company);
      Object existObj = importer.checkExistence(uniqueMap, sessionCurrDB, new SbiOrgUnitHierarchies());
      if (existObj != null) {
        SbiOrgUnitHierarchies dsCurr = (SbiOrgUnitHierarchies) existObj;
        metaAss.insertCoupleIdOuHierarchyAssociation(ouHierVal.getId(), dsCurr.getId());
        metaLog.log("Found an existing ou hierarchy " + dsCurr.getName() + " with "
            + "the same label of one exported ou hierarchy");
      }
      /*
      String label = ouHierVal.getLabel();
      Object existObj = importer.checkExistence(label, sessionCurrDB, new SbiOrgUnitHierarchies());
      if (existObj != null) {
        SbiOrgUnitHierarchies dsCurr = (SbiOrgUnitHierarchies) existObj;
        metaAss.insertCoupleIdOuHierarchyAssociation(ouHierVal.getId(), dsCurr.getId());
        metaLog.log("Found an existing ou hierarchy " + dsCurr.getName() + " with "
            + "the same label of one exported ou hierarchy");
      }
      */
    }// OU node  SbiOrgUnitNodes
    List exportedSbiOrgUnitNodeList = importer.getAllExportedSbiObjects(sessionExpDB, "SbiOrgUnitNodes", null);
    Iterator iterOUNodeVal = exportedSbiOrgUnitNodeList.iterator();
    while (iterOUNodeVal.hasNext()) {
      SbiOrgUnitNodes ouVal = (SbiOrgUnitNodes) iterOUNodeVal.next();
      // check if the association already exist
      Map uniqueMap = new HashMap();
      Map ouAss = metaAss.getOuAssociation();
      Map hierAss = metaAss.getOuHierarchiesAssociation();
      if(ouVal.getSbiOrgUnit() != null){
        Integer newOuId = (Integer)ouAss.get(ouVal.getSbiOrgUnit().getId());
        uniqueMap.put("ouId", newOuId);
        Integer newHierId = (Integer)hierAss.get(ouVal.getSbiOrgUnitHierarchies().getId());
        uniqueMap.put("hierarchyId", newHierId);
      }
      Object existObj = importer.checkExistence(uniqueMap, sessionCurrDB, new SbiOrgUnitNodes());
      if (existObj != null) {
        SbiOrgUnitNodes dsCurr = (SbiOrgUnitNodes) existObj;
        metaAss.insertCoupleIdOuNodeAssociation(ouVal.getNodeId(), dsCurr.getNodeId());
        metaLog.log("Found an existing ou node " + dsCurr.getNodeId() + " with "
            + "the same organizational unit and hierarchy of one exported ou node");
      }
    }// OU grants  SbiOrgUnitGrant
    List exportedSbiOUGrantList = importer.getAllExportedSbiObjects(sessionExpDB, "SbiOrgUnitGrant", null);
    Iterator iterOUGrantVal = exportedSbiOUGrantList.iterator();
    while (iterOUGrantVal.hasNext()) {
      SbiOrgUnitGrant ouGrantVal = (SbiOrgUnitGrant) iterOUGrantVal.next();
      String label = ouGrantVal.getLabel();
      Object existObj = importer.checkExistence(label, sessionCurrDB, new SbiOrgUnitGrant());
      if (existObj != null) {
        SbiOrgUnitGrant dsCurr = (SbiOrgUnitGrant) existObj;
        metaAss.insertCoupleIdOuGrantAssociation(ouGrantVal.getId(), dsCurr.getId());
        metaLog.log("Found an existing ou grant " + dsCurr.getId() + " with "
            + "the same label of one exported ou grant");
      }
    }// OU grant nodes  SbiOrgUnitGrantNodes
    List exportedSbiOUGrantNodeList = importer.getAllExportedSbiObjects(sessionExpDB, "SbiOrgUnitGrantNodes", null);
    Iterator iterOUGrantNodesVal = exportedSbiOUGrantNodeList.iterator();
    while (iterOUGrantNodesVal.hasNext()) {
      SbiOrgUnitGrantNodes ouGrantNode = (SbiOrgUnitGrantNodes) iterOUGrantNodesVal.next();
      Map uniqueMap = new HashMap();   
      Map nodeAss = metaAss.getOuNodeAssociation();
      Map miAss = metaAss.getModelInstanceIDAssociation();
      Map grantAss = metaAss.getOuGrantAssociation();
      if(ouGrantNode.getId() != null){
        Integer newGrantId = (Integer)grantAss.get(ouGrantNode.getId().getGrantId());
        uniqueMap.put("grantId", newGrantId );
        Integer newNodeId = (Integer)nodeAss.get(ouGrantNode.getId().getNodeId());
        uniqueMap.put("nodeId", newNodeId);
        Integer newMiId = (Integer)miAss.get(ouGrantNode.getId().getKpiModelInstNodeId());
        uniqueMap.put("modelInstId", newMiId);
      }
      Object existObj = importer.checkExistence(uniqueMap, sessionCurrDB, new SbiOrgUnitGrantNodes());
      if (existObj != null) {
        SbiOrgUnitGrantNodes dsCurr = (SbiOrgUnitGrantNodes) existObj;
        metaAss.insertCoupleIdOuGrantNodesAssociation(ouGrantNode.getId(), dsCurr.getId());
        metaLog.log("Found an existing ou grant node with grant id " + dsCurr.getId().getGrantId() + " with "
            + "the same id of one exported ou grant node");
      }
    }
    logger.debug("OUT");
  }
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.