Package co.nubetech.crux.model

Examples of co.nubetech.crux.model.Dashboard


   
    ReportType reportType1 = new ReportType(121, "ReportType1");
    ReportType reportType2= new ReportType(122, "ReportType2");
    ReportType reportType3 = new ReportType(123, "ReportType3");
   
    Dashboard dashboard = new Dashboard(1, 2);
   
    Report report1 = new Report(user,"Report1", reportType1, dashboard);
    Report report2 = new Report(user,"Report2", reportType2, dashboard);
    Report report3 = new Report(user,"Report3", reportType3, dashboard);
   
View Full Code Here


   
    ReportType reportType1 = new ReportType(121, "ReportType1");
    ReportType reportType2= new ReportType(122, "ReportType2");
    ReportType reportType3 = new ReportType(123, "ReportType3");
   
    Dashboard dashboard = new Dashboard(1, 2);
   
    Report report1 = new Report(user,"Report1", reportType1, dashboard);
    Report report2 = new Report(user,"Report2", reportType2, dashboard);
    Report report3 = new Report(user,"Report3", reportType3, dashboard);
   
View Full Code Here

      Session session = com.googlecode.s2hibernate.struts2.plugin.util.HibernateSessionFactory
      .getNewSession();
     
    DashboardDAO dashboardDAO = new DashboardDAO();
    dashboardDAO.session = session;
    Dashboard dashboard = dashboardDAO.findById(99999l);
    assertEquals(1,dashboard.getIndex());
    assertEquals(1,dashboard.getColumn());
   
    } finally{
    stmt.execute("delete from dashboard where id=99999");
    stmt.close();
    }
View Full Code Here

      .getNewSession();
     
    DashboardDAO dashboardDAO = new DashboardDAO();
    dashboardDAO.session = session;
    dashboardDAO.transaction = session.getTransaction();
    Dashboard dashboard = new Dashboard(1,1);
    dashboardId = dashboardDAO.save(dashboard);
    ResultSet rs = stmt.executeQuery("select * from dashboard where id="
        + dashboardId);
   
    while (rs.next()) {
View Full Code Here

      .getNewSession();
     
    DashboardDAO dashboardDAO = new DashboardDAO();
    dashboardDAO.session = session;
    dashboardDAO.transaction = session.getTransaction();
    Dashboard dashboard =dashboardDAO.findById(99999l);
    dashboard.setColumn(2);
    dashboardDAO.save(dashboard);
    ResultSet rs = stmt.executeQuery("select * from dashboard where id=99999");
   
    while (rs.next()) {
      assertEquals(rs.getInt("indexNo"), 1);
View Full Code Here

  public Session session;
  @TransactionTarget
  public Transaction transaction;
 
  public Dashboard findById(Long id) {
    Dashboard dashboard = (Dashboard) session.get(
        Dashboard.class, id);
    return dashboard;
  }
View Full Code Here

    }
    return SUCCESS;
  }

  public Dashboard getDashboardObject(long id) {
    Dashboard result = null;
    ArrayList<Report> reportList = new ArrayList<Report>(
        reportDAO.findDashboardReports());
    for (Report report : reportList) {
      if (report.getDashboard() != null) {
        if (id == report.getId()) {
          result = report.getDashboard();
        }
      }
    }
    if (result == null) {
      result = new Dashboard();
    }
    return result;
  }
View Full Code Here

  // here format of each string is dash+dashboardId:index:column
  public String saveDashBoard() {
    logger.debug("dashBoardInfo:" + dashboardInfo);
    for (String info : dashboardInfo) {
      String[] details = info.split(":");
      Dashboard dashboard = dashboardDAO.findById(new Long(details[0]));
      dashboard.setIndex(Integer.parseInt(details[1]));
      dashboard.setColumn(Integer.parseInt(details[2]));
      try {
        dashboardDAO.save(dashboard);
      } catch (CruxException e) {
        error.setMessage("Error: " + e.getMessage());
      }
View Full Code Here

public class TestDashboardAction extends DBConnection {
 
  @Test
  public void testGetDashboardWhenReportsAreOnDashboard(){
    Report report1 = new Report(null,"first",null,new Dashboard(1,1));
    Report report3 = new Report(null,"third",null,new Dashboard(0,0));
   
    ArrayList<Report> reportList = new ArrayList<Report>();
    reportList.add(report1);
    reportList.add(report3);
   
View Full Code Here

   
    ReportType reportType1 = new ReportType(121, "ReportType1");
    ReportType reportType2= new ReportType(122, "ReportType2");
    ReportType reportType3 = new ReportType(123, "ReportType3");
   
    Dashboard dashboard = new Dashboard(1, 2);
   
    Report report1 = new Report(user,"Report1", reportType1, dashboard);
    Report report2 = new Report(user,"Report2", reportType2, dashboard);
    Report report3 = new Report(user,"Report3", reportType3, dashboard);
   
View Full Code Here

TOP

Related Classes of co.nubetech.crux.model.Dashboard

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.