Examples of SbiOrgUnitGrantNodes


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

        OrganizationalUnitGrantNode aGrantNode = it.next();

        Integer hierarchyNodeId = aGrantNode.getOuNode().getNodeId();
        Integer kpiModelInstNodeId = aGrantNode.getModelInstanceNode().getModelInstanceNodeId();
       
        SbiOrgUnitGrantNodes grantNode = new SbiOrgUnitGrantNodes();
     
        SbiOrgUnitGrantNodesId grantNodeId = new SbiOrgUnitGrantNodesId(hierarchyNodeId, kpiModelInstNodeId, grantId);
        grantNode.setId(grantNodeId);
       
        SbiOrgUnitNodes hibNode = (SbiOrgUnitNodes) aSession.load(SbiOrgUnitNodes.class, hierarchyNodeId);
        grantNode.setSbiOrgUnitNodes(hibNode);
       
        SbiKpiModelInst kpiModelInst = (SbiKpiModelInst) aSession.load(SbiKpiModelInst.class, kpiModelInstNodeId);
        grantNode.setSbiKpiModelInst(kpiModelInst);
       
       
        grantNode.setSbiOrgUnitGrant(hibGrant);
        logger.debug("Saving grant node with node Id:"+grantNodeId.getNodeId()+" modelInst Id "+grantNodeId.getKpiModelInstNodeId()+" ang grant Id "+grantNodeId.getGrantId());
        //System.out.println("Saving grant node with node Id:"+grantNodeId.getNodeId()+" modelInst Id "+grantNodeId.getKpiModelInstNodeId()+" ang grant Id "+grantNodeId.getGrantId());
        updateSbiCommonInfo4Insert(grantNode);
        aSession.save(grantNode);
      }
View Full Code Here

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

      SbiKpiModelInst mi =(SbiKpiModelInst)session.load(SbiKpiModelInst.class, ou.getModelInstanceNode().getModelInstanceNodeId());
      SbiOrgUnitGrant g =(SbiOrgUnitGrant)session.load(SbiOrgUnitGrant.class, ou.getGrant().getId());
      SbiOrgUnitNodes n =(SbiOrgUnitNodes)session.load(SbiOrgUnitNodes.class, ou.getOuNode().getNodeId());
      // main attributes     
      SbiOrgUnitGrantNodes hibGrant = new SbiOrgUnitGrantNodes();
      SbiOrgUnitGrantNodesId id = new SbiOrgUnitGrantNodesId();
      id.setKpiModelInstNodeId(ou.getModelInstanceNode().getModelInstanceNodeId());
      id.setGrantId(ou.getGrant().getId());
      id.setNodeId(ou.getOuNode().getNodeId());
      hibGrant.setId(id);   


      hibGrant.setSbiKpiModelInst(mi);
      hibGrant.setSbiOrgUnitGrant(g);
      hibGrant.setSbiOrgUnitNodes(n);

      Transaction tx = session.beginTransaction();     
      session.save(hibGrant);
      tx.commit();
View Full Code Here

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

      Integer nodeId = (Integer) uniqueMap.get("nodeId");
      Integer grantId = (Integer) uniqueMap.get("grantId");
      Integer modelInstId = (Integer) uniqueMap.get("modelInstId");
      hql = "from SbiOrgUnitGrantNodes n where n.id.nodeId = " + nodeId + " and n.id.kpiModelInstNodeId = "+modelInstId+" and n.id.grantId = "+grantId;
      hqlQuery = sessionCurrDB.createQuery(hql);
      SbiOrgUnitGrantNodes hibOu = (SbiOrgUnitGrantNodes) hqlQuery.uniqueResult();
      return hibOu;   
    }


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

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

   *
   * @return the new hibernate parameter object
   */
  public static SbiOrgUnitGrantNodes makeNewOuGrantNode(SbiOrgUnitGrantNodes grantNode ,Session sessionCurrDB, MetadataAssociations metaAss, ImporterMetadata importer){
    logger.debug("IN");
    SbiOrgUnitGrantNodes newGrantNode = new SbiOrgUnitGrantNodes();
    try{
      SbiOrgUnitGrantNodesId id = new SbiOrgUnitGrantNodesId();
      // associations
      entitiesAssociationsOuGrantNode(id, grantNode, newGrantNode, sessionCurrDB, metaAss, importer);

View Full Code Here

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

   * @throws EMFUserError the EMF user error
   */
  public static SbiOrgUnitGrantNodes modifyExistingOuGrantNode(SbiOrgUnitGrantNodes exportedGrantNode, Session sessionCurrDB,
      SbiOrgUnitGrantNodesId existingId) throws EMFUserError {
    logger.debug("IN");
    SbiOrgUnitGrantNodes existingGrantNode = null;
    try {
      // update Grant node
      existingGrantNode = (SbiOrgUnitGrantNodes) sessionCurrDB.load(SbiOrgUnitGrantNodes.class, existingId);

    }
View Full Code Here

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

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

      List exportedGrantNodes = (List<SbiOrgUnitGrantNodes>)importer.getAllExportedSbiObjects(sessionExpDB, "SbiOrgUnitGrantNodes", null);
     
      Iterator iterGrantNodes = exportedGrantNodes.iterator();

      while (iterGrantNodes.hasNext()) {
        SbiOrgUnitGrantNodes grantNode = (SbiOrgUnitGrantNodes) iterGrantNodes.next();
         
        Map assGrantNodes = metaAss.getOuGrantNodesAssociation();
        SbiOrgUnitGrantNodesId existingGrantNodeId = null;
        Set assGrantNodesSet = assGrantNodes.keySet();
        if (assGrantNodesSet.contains(grantNode.getId()) && !overwrite) {
          metaLog.log("Exported association of grant node with grant id " + grantNode.getId().getGrantId()+ "  not inserted"
              + " because already existing into the current database");
          continue;
        } else {
          existingGrantNodeId = (SbiOrgUnitGrantNodesId) assGrantNodes.get(grantNode.getId());
        }
        if (existingGrantNodeId != null) {
          metaLog.log("Exported association of grant node with grant id " + grantNode.getId().getGrantId() + "] will be updated.");
          SbiOrgUnitGrantNodes existingGrantNode = ImportUtilities.modifyExistingOuGrantNode(grantNode, sessionCurrDB, existingGrantNodeId);
          ImportUtilities.entitiesAssociationsOuGrantNode(existingGrantNode.getId(), grantNode, existingGrantNode, sessionCurrDB, metaAss, importer);
          sessionCurrDB.update(existingGrantNode);
        } else {
          SbiOrgUnitGrantNodes newGrantNode = ImportUtilities.makeNewOuGrantNode(grantNode, sessionCurrDB, metaAss, importer);
          sessionCurrDB.save(newGrantNode);
          metaLog.log("Inserted new grant node with grant id " + grantNode.getId().getGrantId() );
          SbiOrgUnitGrantNodesId newId = newGrantNode.getId();
          sessionExpDB.evict(grantNode);
          metaAss.insertCoupleIdOuGrantNodesAssociation(grantNode.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.