Examples of OrganizationalUnit


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

      Node<OrganizationalUnit> parent,
      OrganizationalUnitHierarchy hierarchy) {
    logger.debug("IN: node = " + node + ", parent = " + parent + ", hierarchy = " + hierarchy);
    OrganizationalUnitNode aNode = new OrganizationalUnitNode();
    aNode.setHierarchy(hierarchy);
    OrganizationalUnit content = node.getNodeContent();
    content = DAOFactory.getOrganizationalUnitDAO().getOrganizationalUnitByLabelAndName(content.getLabel(), content.getName());
    if(content == null){
      //then insert it!!there could be a misalignment
      DAOFactory.getOrganizationalUnitDAO().insertOrganizationalUnit(node.getNodeContent());
      content = DAOFactory.getOrganizationalUnitDAO().getOrganizationalUnitByLabelAndName(node.getNodeContent().getLabel(), node.getNodeContent().getName());
    }
View Full Code Here

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

 
  private void removeNoMoreExistingOUs(List<OrganizationalUnit> newOUs, List<OrganizationalUnit> oldOUs) {
    logger.debug("IN");
    Iterator<OrganizationalUnit> it = oldOUs.iterator();
    while (it.hasNext()) {
      OrganizationalUnit ou = it.next();
      if (!newOUs.contains(ou)) {
        logger.debug("OU " + ou + " does no more exists. Removing it ...");
        DAOFactory.getOrganizationalUnitDAO().eraseOrganizationalUnit(ou.getId());
        logger.debug("OU " + ou + " removed.");
      }
    }
    logger.debug("OUT");
  }
View Full Code Here

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

 
  private void modifyExistingOUs(List<OrganizationalUnit> newOUs, List<OrganizationalUnit> oldOUs) {
    logger.debug("IN");
    Iterator<OrganizationalUnit> it = oldOUs.iterator();
    while (it.hasNext()) {
      OrganizationalUnit ou = it.next();
      int index = newOUs.indexOf(ou);
      if (index >= 0) {
        OrganizationalUnit newOU = newOUs.get(index);
        if (!newOU.deepEquals(ou)) {
          logger.debug("OU " + ou + " has been changed. Updating it ...");
          ou.setName(newOU.getName());
          ou.setDescription(newOU.getDescription());
          DAOFactory.getOrganizationalUnitDAO().modifyOrganizationalUnit(ou);
          logger.debug("OU updated: " + ou);
        }
        newOU.setId(ou.getId()); // setting the current OU id
        logger.debug("OU id updated: " + newOU);
      }
    }
    logger.debug("OUT");
  }
View Full Code Here

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

 
  private void insertNewOUs(List<OrganizationalUnit> newOUs, List<OrganizationalUnit> oldOUs) {
    logger.debug("IN");
    Iterator<OrganizationalUnit> it = newOUs.iterator();
    while (it.hasNext()) {
      OrganizationalUnit ou = it.next();
      if (!oldOUs.contains(ou)) {
        logger.debug("OU " + ou + " does not exists. Inserting it ...");
        DAOFactory.getOrganizationalUnitDAO().insertOrganizationalUnit(ou);
        logger.debug("OU inserted: " + ou);
      }
View Full Code Here

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

    return toReturn;
  }

  public OrganizationalUnit getOrganizationalUnit(Integer id) {
    logger.debug("IN: id = " + id);
    OrganizationalUnit toReturn = null;
    Session aSession = null;
    Transaction tx = null;
    try {
      aSession = getSession();
      tx = aSession.beginTransaction();
View Full Code Here

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

        hibGrant.getName(), hibGrant.getDescription());
    return grant;
  }

  public OrganizationalUnit toOrganizationalUnit(SbiOrgUnit hibOrgUnit){
    OrganizationalUnit ou = new OrganizationalUnit(hibOrgUnit.getId(), hibOrgUnit.getLabel(),
        hibOrgUnit.getName(), hibOrgUnit.getDescription());
    return ou;
  }
View Full Code Here

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

        hibOrgUnitHierarchies.getTarget(), hibOrgUnitHierarchies.getCompany());
    return hierarchy;
  }
 
  public OrganizationalUnitNode toOrganizationalUnitNode(SbiOrgUnitNodes hibOrgUnitNode) {
    OrganizationalUnit ou = toOrganizationalUnit(hibOrgUnitNode.getSbiOrgUnit());
    OrganizationalUnitHierarchy hierarchy = toOrganizationalUnitHierarchy(hibOrgUnitNode.getSbiOrgUnitHierarchies());
    OrganizationalUnitNode node = new OrganizationalUnitNode(hibOrgUnitNode.getNodeId(), ou, hierarchy,
        hibOrgUnitNode.getPath(),
        hibOrgUnitNode.getSbiOrgUnitNodes() == null ? null : hibOrgUnitNode.getSbiOrgUnitNodes().getNodeId() );
View Full Code Here

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

    return grantNode;
  }

  public OrganizationalUnit getOrganizationalUnitByLabelAndName(String label, String name) {
    logger.debug("IN: label = " + label+" name = "+name);
    OrganizationalUnit toReturn = null;
    Session aSession = null;
    Transaction tx = null;
    try {
      aSession = getSession();
      tx = aSession.beginTransaction();
View Full Code Here

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

  }
 
  @Override
  public Tree<OrganizationalUnit> getHierarchyStructure(
      OrganizationalUnitHierarchy hierarchy) {
    OrganizationalUnit root = new OrganizationalUnit();
    HashMap<String, String> params = new HashMap<String, String>();
    params.put(HIERARCHY, hierarchy.getName());
    params.put(COMPANY, hierarchy.getCompany());
    Tree<OrganizationalUnit> toReturn = null;
    try {
View Full Code Here

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

        }else if(type.equals(OU)){           

          String ouName =  rs.getString("NAME");
          String ouCode =  rs.getString("CODE");
          if(ouCode != null){
            OrganizationalUnit item = new OrganizationalUnit(null, ouCode, ouName, null);
            toReturn.add(item);
          }else{
            isToBreak = true;
            break;
          }
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.