Package it.eng.spagobi.kpi.ou.bo

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


 

  public OrganizationalUnitNodeWithGrant getRootNodeWithGrants(
      Integer hierarchyId, Integer grantId) {
    logger.debug("IN: hierarchyId = " + hierarchyId + ", grantId = " + grantId);
    OrganizationalUnitNodeWithGrant toReturn = null;
    Session aSession = null;
    Transaction tx = null;
    try {
      aSession = getSession();
      tx = aSession.beginTransaction();
View Full Code Here


  }

  private OrganizationalUnitNodeWithGrant getNodeWithGrants(
      OrganizationalUnitNode node, Integer grantId, Session aSession) {
    logger.debug("IN");
    OrganizationalUnitNodeWithGrant toReturn = null;
    List<OrganizationalUnitGrantNode> grants = new ArrayList<OrganizationalUnitGrantNode>();
    Query hibQuery = aSession.createQuery(" from SbiOrgUnitGrantNodes n where n.id.nodeId = ? " +
      " and n.id.grantId = ?");
    hibQuery.setInteger(0, node.getNodeId());
    hibQuery.setInteger(1, grantId);
    List hibList = hibQuery.list();
    Iterator it = hibList.iterator();
    while (it.hasNext()) {
      grants.add(toOrganizationalUnitGrantNode((SbiOrgUnitGrantNodes) it.next(), aSession));
    }
    toReturn = new OrganizationalUnitNodeWithGrant(node, grants);
    logger.debug("OUT");
    return toReturn;
  }
View Full Code Here

      List hibList = hibQuery.list();
      Iterator it = hibList.iterator();

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

      List hibList = hibQuery.list();
      Iterator it = hibList.iterator();

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

    if( !(o instanceof OrganizationalUnitNodeWithGrant) ) {
      throw new SerializationException("OrganizationalUnitNodeWithGrantJSONSerializer is unable to serialize object of type: " + o.getClass().getName());
    }
   
    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() );
View Full Code Here

    List<OrganizationalUnitNodeWithGrant> ousWithGrants = null;
    if(grantId==null){
      List<OrganizationalUnitNode> ous = orUnitDao.getChildrenNodes(nodeId);
      ousWithGrants = new ArrayList<OrganizationalUnitNodeWithGrant>();
      for(int i=0; i<ous.size(); i++){
        ousWithGrants.add(new OrganizationalUnitNodeWithGrant(ous.get(i), new ArrayList<OrganizationalUnitGrantNode>()));
      }
    }else{
      ousWithGrants = orUnitDao.getChildrenNodesWithGrants(nodeId, grantId);
    } try {
      JSONArray grantsJSON = (JSONArray) SerializerFactory.getSerializer("application/json").serialize( ousWithGrants, null);
View Full Code Here

   * @param hierarchyId the id of the hierarchy
   * @param grantId the id of the grant because we return OrganizationalUnitNodeWithGrant. If null
   *       the grant object in the OrganizationalUnitNodeWithGrant will be null
   */
  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

TOP

Related Classes of it.eng.spagobi.kpi.ou.bo.OrganizationalUnitNodeWithGrant

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.