Package it.eng.spagobi.kpi.goal.metadata.bo

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


    GoalKpi g = new GoalKpi(hibernateGoalKpi.getKpiInstanceId(), hibernateGoalKpi.getWeight1(), hibernateGoalKpi.getWeight2(), hibernateGoalKpi.getThreshold1(), hibernateGoalKpi.getThreshold2(), hibernateGoalKpi.getThreshold1sign(), hibernateGoalKpi.getThreshold2sign(), hibernateGoalKpi.getGoalKpiId(),  hibernateGoalKpi.getSbiGoalHierarchy().getGoalHierarchyId());
    return g;
  }
 
  public Goal toGoal(SbiGoal hibernateGoal) {
    Goal g = new Goal(hibernateGoal.getGoalId(), hibernateGoal.getStartDate(), hibernateGoal.getEndDate(), hibernateGoal.getName(), hibernateGoal.getLabel(), hibernateGoal.getDescription(), hibernateGoal.getGrantId());
    return g;
  }
View Full Code Here


    if( !(o instanceof Goal) ) {
      throw new SerializationException("GoalJSONSerializer is unable to serialize object of type: " + o.getClass().getName());
    }
   
    try {
      Goal goal = (Goal) o;
      result = new JSONObject();
      result.put(ID, goal.getId() );
      result.put(NAME, goal.getName() );
      result.put(DESCRIPTION, goal.getDescription() );
      result.put(LABEL, goal.getLabel() );
      String df = GeneralUtilities.getServerDateFormat();
      SimpleDateFormat dateFormat = new SimpleDateFormat();
      dateFormat.applyPattern(df);
      dateFormat.setLenient(false);
      result.put(START_DATE, dateFormat.format(goal.getStartDate()) );
      result.put(END_DATE, dateFormat.format(goal.getEndDate()) );
     
      if(goal.getGrant()!=null){
       
        OrganizationalUnitGrant grant = DAOFactory.getOrganizationalUnitDAO().getGrant(goal.getGrant());
        result.put(GRANT_ID, goal.getGrant());
        result.put(GRANT_NAME, grant.getName());
      }
     
    } catch (Throwable t) {
      throw new SerializationException("An error occurred while serializing object: " + o, t);
View Full Code Here

    if (serviceType != null && serviceType.equalsIgnoreCase(GOAL_INSERT)) {
      logger.debug("Adding the goal: ");
      JSONObject goalJSON = getAttributeAsJSONObject(GOAL);
      logger.debug(goalJSON);
      try{
        Goal goal = deserializeGoal(goalJSON);
        daoGoal.insertGoal(goal);
        writeBackToClient( new JSONAcknowledge() );
      } catch (Exception e){
        logger.debug("Error inserting the goal");
        throw new SpagoBIServiceException(SERVICE_NAME, "Error inserting the goal",e);
View Full Code Here

    String description = (String) JSONGoal.opt(DESCRIPTION);
    String start_date = (String) JSONGoal.opt(START_DATE);
    String end_date = (String) JSONGoal.opt(END_DATE);
    Integer grant =JSONGoal.optInt(GRANT);
    String label = (String) JSONGoal.opt(LABEL);
    Goal g = new Goal(id, toDate(start_date), toDate(end_date), name, label, description, grant);
    return g;
  }
View Full Code Here

TOP

Related Classes of it.eng.spagobi.kpi.goal.metadata.bo.Goal

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.