Package it.eng.spagobi.kpi.model.bo

Examples of it.eng.spagobi.kpi.model.bo.ModelInstanceNode


  private OrganizationalUnitGrantNode deserializeOrganizationalUnitGrantNode(JSONObject JSONGrantNode, OrganizationalUnitGrant grant) throws Exception{
    OrganizationalUnitGrantNode node = new OrganizationalUnitGrantNode();
    int hierarchyId = JSONGrantNode.getInt("hierarchyId");
    int modelInstanceId = JSONGrantNode.getInt("modelinstance");
    String ouPath = JSONGrantNode.getString("ouPath");
    ModelInstanceNode modelInstanceNode = DAOFactory.getModelInstanceDAO().loadModelInstanceById(modelInstanceId, null);
    OrganizationalUnitNode ouNode = orUnitDao.getOrganizationalUnitNode(ouPath, hierarchyId);
    node.setGrant(grant);
    node.setModelInstanceNode(modelInstanceNode);
    node.setOuNode(ouNode);
    return node;
View Full Code Here


  private List<OrganizationalUnitGrantNode> deserializeOrganizationalUnitGrantNodeAndUpdateChilds(JSONObject JSONGrantNode, OrganizationalUnitGrant grant) throws Exception{
    OrganizationalUnitGrantNode node = new OrganizationalUnitGrantNode();
    int hierarchyId = JSONGrantNode.getInt("hierarchyId");
    int modelInstanceId = JSONGrantNode.getInt("modelinstance");
    String ouPath = JSONGrantNode.getString("ouPath");
    ModelInstanceNode modelInstanceNode = DAOFactory.getModelInstanceDAO().loadModelInstanceById(modelInstanceId, null);
    OrganizationalUnitNode ouNode = orUnitDao.getOrganizationalUnitNode(ouPath, hierarchyId);
    node.setGrant(grant);
    node.setModelInstanceNode(modelInstanceNode);
    node.setOuNode(ouNode);
    List<OrganizationalUnitGrantNode> nodes = new ArrayList<OrganizationalUnitGrantNode>();

    HashMap<Integer, Integer> tempGrantNodeIds = new HashMap<Integer, Integer>();
    tempGrantNodeIds.put(modelInstanceNode.getModelInstanceNodeId(),ouNode.getNodeId());
    if(!utilityGrantNodesCollection.contains(tempGrantNodeIds)  ){     
      Integer modelInstancesToUncheck = JSONGrantNode.optInt("childrenToUncheck");
      if(modelInstancesToUncheck!=null){

        if(modelInstancesToUncheck.equals(modelInstanceNode.getModelInstanceNodeId())){
          return nodes;
        }

      }
      nodes.add(node);
      utilityGrantNodesCollection.add(tempGrantNodeIds);
    }else{
      return nodes;
    }
    boolean expanded = JSONGrantNode.getBoolean("expanded");
    if(!expanded){
      //if(JSONGrantNode.opt("childrenToUncheck")== null || JSONGrantNode.getInt("childrenToUncheck")!=modelInstanceNode.getModelInstanceNodeId()){
        nodes.addAll(buildGrantForChilds(ouNode, modelInstanceNode, grant));
      //}
    }
    Integer checkChildren = null;
   
    try{
      checkChildren = JSONGrantNode.getInt("childrenToCheck");
      ModelInstanceNode modelInstNode = DAOFactory.getModelInstanceDAO().loadModelInstanceById(checkChildren, null);
      List<OrganizationalUnitGrantNode> childrenChecked = buildGrantForModelInstChildren(ouNode, modelInstNode, grant);
      for(int i=0; i< childrenChecked.size(); i++){
        OrganizationalUnitGrantNode nodeToAdd = childrenChecked.get(i);
        HashMap<Integer, Integer> temp2GrantNodeIds = new HashMap<Integer, Integer>();
        temp2GrantNodeIds.put(nodeToAdd.getModelInstanceNode().getModelInstanceNodeId(), nodeToAdd.getOuNode().getNodeId());
View Full Code Here

  private List<OrganizationalUnitGrantNode> buildGrantForModelInstChildren(OrganizationalUnitNode ouNode, ModelInstanceNode modelInstanceNode,  OrganizationalUnitGrant grant) throws EMFUserError{
    List<OrganizationalUnitGrantNode> nodes = new ArrayList<OrganizationalUnitGrantNode>();
    OrganizationalUnitGrantNode childNode;
    List<Integer> childOus = modelInstanceNode.getChildrenIds();
    for(int i=0; i<childOus.size(); i++){
      ModelInstanceNode miChildNode = DAOFactory.getModelInstanceDAO().loadModelInstanceById((Integer)childOus.get(i), null);
      childNode = new OrganizationalUnitGrantNode();
      childNode.setGrant(grant);
      childNode.setModelInstanceNode(miChildNode);
      childNode.setOuNode(ouNode);
      nodes.add(childNode);
View Full Code Here

   * @return
   * @throws EMFUserError
   */
  private List<ModelInstanceNode> getModelInstList(Integer id) throws EMFUserError{
    List<ModelInstanceNode> nodes = new ArrayList<ModelInstanceNode>();
    ModelInstanceNode modelInstanceNode = DAOFactory.getModelInstanceDAO().loadModelInstanceById(id, null);
   
    List<Integer> childOus = modelInstanceNode.getChildrenIds();
    for(int i=0; i<childOus.size(); i++){
      ModelInstanceNode miChildNode = DAOFactory.getModelInstanceDAO().loadModelInstanceById((Integer)childOus.get(i), null);
      nodes.add(miChildNode);
      nodes.addAll(getModelInstList(miChildNode.getModelInstanceNodeId()));
    }
    return nodes;
  }
View Full Code Here

        KpiInstance k = null;
        if (line.getModelInstanceNodeId()!=null){
          Integer id = new Integer(line.getModelInstanceNodeId());
          Date d = new Date();
          IModelInstanceDAO modInstDAO=DAOFactory.getModelInstanceDAO();
          ModelInstanceNode n = modInstDAO.loadModelInstanceById(id, d);
          String descr = n.getDescr();
          modelNodeL.setAttribute("description",descr!=null?descr:"");   
          k= n.getKpiInstanceAssociated();
        }
       
        if(k!=null){
          SourceBean kpiToAdd = newKpi(k);
          modelNodeL.setAttribute(kpiToAdd);
View Full Code Here

TOP

Related Classes of it.eng.spagobi.kpi.model.bo.ModelInstanceNode

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.