Examples of GoalNode


Examples of it.eng.spagobi.kpi.goal.metadata.bo.GoalNode

  }
 

  public GoalNode getRootNode(Integer goalId, Integer ouId) {
    logger.debug("IN: goalId = " + goalId);
    GoalNode toReturn = null;
    Session aSession = null;
    Transaction tx = null;
    try {
      aSession = getSession();
      tx = aSession.beginTransaction();
View Full Code Here

Examples of it.eng.spagobi.kpi.goal.metadata.bo.GoalNode

    Goal g = new Goal(hibernateGoal.getGoalId(), hibernateGoal.getStartDate(), hibernateGoal.getEndDate(), hibernateGoal.getName(), hibernateGoal.getLabel(), hibernateGoal.getDescription(), hibernateGoal.getGrantId());
    return g;
  }
 
  public GoalNode toGoalNode(SbiGoalHierarchy hibernateGoalNode) {
    GoalNode g = new GoalNode(hibernateGoalNode.getName(), hibernateGoalNode.getLabel(), hibernateGoalNode.getGoal(), hibernateGoalNode.getGoalId(), hibernateGoalNode.getOrgUnitId());
    g.setId(hibernateGoalNode.getGoalHierarchyId());
    return g;
  }
View Full Code Here

Examples of it.eng.spagobi.kpi.goal.metadata.bo.GoalNode

      logger.debug("Loading the root node of the goal tree with:");
      JSONObject jo;
      Integer goalId =  getAttributeAsInteger("goalId");
      Integer ouId =  getAttributeAsInteger("ouId");
      logger.debug("goalId: "+goalId+" ,ouId "+ouId);
      GoalNode root = daoGoal.getRootNode(goalId, ouId);
      try{
        if(root!=null){
          jo = (JSONObject) SerializerFactory.getSerializer("application/json").serialize(root, getLocale());
        }else{
          jo = new JSONObject();
        }
        writeBackToClient(new JSONSuccess(jo))
      } catch (Exception e){
        logger.debug("Error getting the root of the goal");
        throw new SpagoBIServiceException(SERVICE_NAME, "Error getting the root of the goal",e);
      }
      logger.debug("Goal root loaded");
    }
    if (serviceType != null && serviceType.equalsIgnoreCase(INSERT_GOAL_NODE)) {
      logger.debug("Adding the goal node: ");
      JSONObject JSONGoal =  getAttributeAsJSONObject("goalNode");
      Integer goalId =  getAttributeAsInteger("goalId");
      Integer ouId =  getAttributeAsInteger("ouId");
      logger.debug("JSONGoal: "+JSONGoal);
      try{
        GoalNode gn = insertGoalNode(JSONGoal, null, goalId, ouId);
        JSONObject jo = (JSONObject) SerializerFactory.getSerializer("application/json").serialize(gn, getLocale());
        writeBackToClient(new JSONSuccess(jo))
      } catch (Exception e){
        logger.debug("Error inserting the goal node");
        throw new SpagoBIServiceException(SERVICE_NAME, "Error inserting the goal node",e);
      }
      logger.debug("Node added");
    }
    if (serviceType != null && serviceType.equalsIgnoreCase(INSERT_GOAL_DETAILS)) {
      logger.debug("Adding the details of the goal node: ");
      List<GoalKpi> kpisList = new ArrayList<GoalKpi>();
      JSONObject JSONGoalDetails =  getAttributeAsJSONObject("goalDetails");
      JSONObject goalNode =  JSONGoalDetails.optJSONObject("goalNode");
      Integer goalNodeId =  goalNode.optInt("id");
      String goalDesc =  goalNode.optString("goalDesc");
      String goalName =  goalNode.optString("name");
      logger.debug(goalNode);
      GoalNode gn = new GoalNode(goalName, "", goalDesc, null, null);
      gn.setId(goalNodeId);
     
      JSONArray kpis =  JSONGoalDetails.optJSONArray("kpis");
      try{
        for(int i=0; i<kpis.length(); i++){
          kpisList.add(deserializeKpiNode((JSONObject)kpis.get(i), goalNodeId));
View Full Code Here

Examples of it.eng.spagobi.kpi.goal.metadata.bo.GoalNode

  }
 
 
  private GoalNode insertGoalNode(JSONObject goal, JSONArray kpis, Integer goalId, Integer ou) throws Exception{
   
    GoalNode gn = deserializeGoalNode(goal,goalId,ou);
    daoGoal.insertGoalNode(gn, gn.getFatherCountId());
    if(kpis!=null){
      insertKpiNodesArray(kpis, gn.getId());
    }
    return gn;
  }
View Full Code Here

Examples of it.eng.spagobi.kpi.goal.metadata.bo.GoalNode

    try {
      fatherCount = goalNode.getInt(GOAL_FATHER);
    } catch (JSONException e) { 
      //the count still be null
    }
    GoalNode gn = new GoalNode(name, "", goalDescr, goalId, ou);
    gn.setFatherCountId(fatherCount);
    return gn;
  }
View Full Code Here

Examples of it.eng.spagobi.kpi.goal.metadata.bo.GoalNode

    if( !(o instanceof GoalNode) ) {
      throw new SerializationException("ModelNodeJSONSerializer is unable to serialize object of type: " + o.getClass().getName());
    }
   
    try {
      GoalNode goalNode = (GoalNode) o;
      result = new JSONObject();
     
      result.put(NODE_ID, goalNode.getId());
      result.put(OU, goalNode.getOuId());
      result.put(NAME, goalNode.getName());
      result.put(LABEL, goalNode.getLabel());
      result.put(GOAL_DESC, goalNode.getGoalDescr());
   
     
    } catch (Throwable t) {
      throw new SerializationException("An error occurred while serializing object: " + o, t);
    } finally {
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.