Examples of OrganizationalUnitNode


Examples of it.eng.spagobi.kpi.ou.bo.OrganizationalUnitNode

      Query hibQuery = aSession.createQuery(" from SbiOrgUnitNodes ");
      List hibList = hibQuery.list();
      Iterator it = hibList.iterator();

      while (it.hasNext()) {
        OrganizationalUnitNode node = toOrganizationalUnitNode((SbiOrgUnitNodes) it.next());
        toReturn.add(node);
      }
    } finally {
      rollbackIfActiveAndClose(tx, aSession);
    }
View Full Code Here

Examples of it.eng.spagobi.kpi.ou.bo.OrganizationalUnitNode

    try {

      List<OrganizationalUnitNode> nodesList = DAOFactory.getOrganizationalUnitDAO().getNodes();
      if(nodesList != null && !nodesList.isEmpty()){
        for (Iterator iterator = nodesList.iterator(); iterator.hasNext();) {
          OrganizationalUnitNode node = (OrganizationalUnitNode) iterator.next();
          exporter.insertOuNode(node, session);         
        }
      }

    } catch (Exception e) {
View Full Code Here

Examples of it.eng.spagobi.kpi.ou.bo.OrganizationalUnitNode

    }
   
    try {
      OrganizationalUnitNodeWithGrant nodeWithGrants = (OrganizationalUnitNodeWithGrant) o;
     
      OrganizationalUnitNode node = nodeWithGrants.getNode();
      List<OrganizationalUnitGrantNode> nodeGrants = nodeWithGrants.getGrants();
     
      result = new JSONObject();
      result.put(ID, node.getNodeId() );
      result.put(PARENT_NODE_ID, node.getParentNodeId() );
      result.put(PATH, node.getPath() );
      result.put(LEAF, node.isLeaf() );
      OrganizationalUnitJSONSerializer orgUnitJSONSerializer = new OrganizationalUnitJSONSerializer();
      result.put(OU, orgUnitJSONSerializer.serialize(node.getOu(), locale));
      // TODO serialize hierarchy?
     
      JSONArray modelInstanceNodesIds = new JSONArray();
      Iterator<OrganizationalUnitGrantNode> it = nodeGrants.iterator();
      while (it.hasNext()) {
View Full Code Here

Examples of it.eng.spagobi.kpi.ou.bo.OrganizationalUnitNode

    toReturn.setKpiValueId(value.getIdKpiInstanceValue());
    logger.debug("Kpi value ID setted");
    toReturn.setValueXml(value.getXmlData());
    logger.debug("Kpi value XML setted");
    OrganizationalUnitGrantNode grantNode = new OrganizationalUnitGrantNode();
    OrganizationalUnitNode node = new OrganizationalUnitNode();
    if(value.getSbiOrgUnit() != null){
      OrganizationalUnit ou = DAOFactory.getOrganizationalUnitDAO().getOrganizationalUnit(value.getSbiOrgUnit().getId());
      node.setOu(ou);
    }
    if(value.getSbiOrgUnitHierarchies() != null){
      OrganizationalUnitHierarchy hierarchy = DAOFactory.getOrganizationalUnitDAO().getHierarchy(value.getSbiOrgUnitHierarchies().getId());
      node.setHierarchy(hierarchy);
    }
    if(value.getSbiOrgUnit() != null && value.getSbiOrgUnitHierarchies() != null){
      grantNode.setOuNode(node);
      toReturn.setGrantNodeOU(grantNode);
    }
View Full Code Here

Examples of it.eng.spagobi.kpi.ou.bo.OrganizationalUnitNode

    logger.debug("Kpi value ID setted");
    toReturn.setValueXml(value.getXmlData());
    logger.debug("Kpi value XML setted");

    OrganizationalUnitGrantNode grantNode = new OrganizationalUnitGrantNode();
    OrganizationalUnitNode node = new OrganizationalUnitNode();
    if(value.getSbiOrgUnit() != null){
      OrganizationalUnit ou = DAOFactory.getOrganizationalUnitDAO().getOrganizationalUnit(value.getSbiOrgUnit().getId());
      node.setOu(ou);
    }
    if(value.getSbiOrgUnitHierarchies() != null){
      OrganizationalUnitHierarchy hierarchy = DAOFactory.getOrganizationalUnitDAO().getHierarchy(value.getSbiOrgUnitHierarchies().getId());
      node.setHierarchy(hierarchy);
    }
    if(value.getSbiOrgUnit() != null && value.getSbiOrgUnitHierarchies() != null){
      grantNode.setOuNode(node);
      toReturn.setGrantNodeOU(grantNode);
    }
View Full Code Here

Examples of it.eng.spagobi.kpi.ou.bo.OrganizationalUnitNode

        Integer grantId =  getAttributeAsInteger("grantId");
        OrganizationalUnitGrant grant = orUnitDao.getGrant(grantId);
        logger.debug("Grant loaded.");

        Integer hierarchyId = grant.getHierarchy().getId();
        OrganizationalUnitNode ou = orUnitDao.getRootNode(hierarchyId);
       
        try {
          JSONObject hierarchyWithRoot = new JSONObject();
          hierarchyWithRoot.put("ouRootName",ou.getOu().getName());
          hierarchyWithRoot.put("ouRootId",ou.getNodeId());
          writeBackToClient( new JSONSuccess( hierarchyWithRoot ) );
        } catch (Exception e) {
          throw new SpagoBIServiceException(SERVICE_NAME, "Impossible to serialize the responce to the client", e);
        }
View Full Code Here

Examples of it.eng.spagobi.kpi.ou.bo.OrganizationalUnitNode

   */
  private void getHierarchyRootNode(Integer hierarchyId, Integer grantId, List<Integer> modelInstances){
    OrganizationalUnitNodeWithGrant ouWithGrant;
   
      if(grantId==null){
        OrganizationalUnitNode ou = orUnitDao.getRootNode(hierarchyId);
        ouWithGrant = new OrganizationalUnitNodeWithGrant(ou, new ArrayList<OrganizationalUnitGrantNode>());

      }else{
        ouWithGrant = orUnitDao.getRootNodeWithGrants(hierarchyId, grantId);

View Full Code Here

Examples of it.eng.spagobi.kpi.ou.bo.OrganizationalUnitNode

    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

Examples of it.eng.spagobi.kpi.ou.bo.OrganizationalUnitNode

    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())){
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.