Exemplo n.º 1
0
  public void saveJobDetails() {
    // TODO Auto-generated method stub
    if (job == null) {
      commonUTIL.showAlertMessage("Select Template");
      return;
    }

    int rowCount = searchPanel.table.getRowCount();
    Vector<UserJobsDetails> jobdets = new Vector<UserJobsDetails>();
    for (int i = 0; i < searchPanel.getFilterBeanData().size(); i++) {
      FilterBean filterBean = searchPanel.getFilterBeanData().get(i);
      UserJobsDetails ud = new UserJobsDetails();
      ud.setJobId(job.getId());
      ud.setColumnName(filterBean.getColumnName());
      ud.setCriteria(filterBean.getSearchCriteria());
      ud.setValues(filterBean.getColumnValues());
      ud.setFilterValues(filterBean.getIdSelected());
      ud.setAnd_or(filterBean.getAnd_or());

      ud.setRowid(i);
      jobdets.add(ud);
    }
    try {

      if (!reportPanel.getColumnSQL().equalsIgnoreCase(job.getSql())) {
        job.setSql(reportPanel.getColumnSQL());
        reportPanel.getRemoteTask().updateJob(job);
      }
      reportPanel.getRemoteTask().saveUserJobsDetails(jobdets, job.getId());
    } catch (RemoteException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
  }
Exemplo n.º 2
0
  public void loadTemplates(int userID) {
    Vector templates = null;
    try {
      templates = (Vector) reportPanel.getRemoteTask().getUserJob(userID);
      for (int i = 0; i < templates.size(); i++) {
        UserJob userjobs = (UserJob) templates.get(i);
        tablemodel.insertRow(i, new Object[] {userjobs.getId(), userjobs.getTreeNodeName()});
      }

    } catch (RemoteException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
  }
Exemplo n.º 3
0
  public void setUserJob(UserJob job2) {
    job = job2;
    Vector<UserJobsDetails> jobdetails;
    try {
      jobdetails = (Vector) reportPanel.getRemoteTask().getDetailsJob(job.getId());
      loadJobs(jobdetails);
    } catch (RemoteException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }

    // TODO Auto-generated method stub

  }
Exemplo n.º 4
0
 public void saveTemplate(String templateName, int userID) {
   if (!commonUTIL.isEmpty(templateName)) {
     job = new UserJob();
     job.setId(0);
     job.setTabid(0);
     job.setUserID(user.getId());
     job.setType(getReportType().toUpperCase());
     job.setTreeNodeName(templateName);
     setTemplateFrame(templateName);
     try {
       job = (UserJob) reportPanel.getRemoteTask().saveUserJob(job);
       tablemodel.insertRow(
           tablemodel.getRowCount(), new Object[] {job.getId(), job.getTreeNodeName()});
     } catch (RemoteException e) {
       // TODO Auto-generated catch block
       e.printStackTrace();
     }
   }
 }