Examples of SbiOrgUnitGrant


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

      Integer newGrantId=(Integer)grantAss.get(oldGrantId);
      if(newGrantId==null) {
        logger.error("could not find association with grant id with id " + oldGrantId);       
      }
      else{
        SbiOrgUnitGrant newSbiGrant = (SbiOrgUnitGrant) sessionCurrDB.load(SbiOrgUnitGrant.class, newGrantId);
        exportedGrantNode.setSbiOrgUnitGrant(newSbiGrant);
        id.setGrantId(newSbiGrant.getId());
      }
    }
    // node id
    Map nodeAss = metaAss.getOuNodeAssociation();
    //original value of exported object != null
View Full Code Here

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

      }
    }// 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

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

      List exportedGrants = (List<SbiOrgUnitGrant>)importer.getAllExportedSbiObjects(sessionExpDB, "SbiOrgUnitGrant", null);
     
      Iterator iterGrants = exportedGrants.iterator();

      while (iterGrants.hasNext()) {
        SbiOrgUnitGrant grant = (SbiOrgUnitGrant) iterGrants.next();
         
        Map assGrants = metaAss.getOuGrantAssociation();
        Integer existingGrantId = null;
        Set assGrantsSet = assGrants.keySet();
        if (assGrantsSet.contains(grant.getId()) && !overwrite) {
          metaLog.log("Exported association of grant with name " + grant.getName() + "  not inserted"
              + " because already existing into the current database");
          continue;
        } else {
          existingGrantId = (Integer) assGrants.get(grant.getId());
        }
        if (existingGrantId != null) {
          metaLog.log("Exported association of grant with name " + grant.getName() + "] will be updated.");
          SbiOrgUnitGrant existingGrant = ImportUtilities.modifyExistingOuGrant(grant, sessionCurrDB, existingGrantId);
          ImportUtilities.entitiesAssociationsOuGrant(grant, existingGrant, sessionCurrDB, metaAss, importer);
          sessionCurrDB.update(existingGrant);
        } else {
          SbiOrgUnitGrant newGrant = ImportUtilities.makeNewOuGrant(grant, sessionCurrDB, metaAss, importer);
          sessionCurrDB.save(newGrant);
          metaLog.log("Inserted new grant with name " + grant.getName() );
          Integer newId = newGrant.getId();
          sessionExpDB.evict(grant);
          metaAss.insertCoupleIdOuGrantAssociation(grant.getId(), newId);
        }

      }
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.