Package it.eng.spagobi.kpi.ou.metadata

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


        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);
      }
      //sets grant available if everithing ok
View Full Code Here


      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);
View Full Code Here

   */
  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);

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

      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

Related Classes of it.eng.spagobi.kpi.ou.metadata.SbiOrgUnitGrantNodesId

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.