@Override
 public void onEvent(Event event) throws Exception {
   try {
     Date begin_date = view.getBeginDatabox().getValue();
     Date end_date = view.getEndDatabox().getValue();
     if (view.getSelectedNode() == null) {
       Messagebox.show(
           ErrorMessage.UNSELECT_MONITOR, "提示", Messagebox.OK, Messagebox.INFORMATION);
       return;
     }
     if (begin_date.after(end_date)) {
       Messagebox.show(ErrorMessage.TIME_ERROR, "提示", Messagebox.OK, Messagebox.INFORMATION);
       return;
     }
     Events.sendEvent(new Event(Events.ON_CLICK, view.getQueryBtn()));
     Window win = (Window) Executions.createComponents("/main/report/export.zul", null, null);
     win.setAttribute("colorlist", view.getColorlist());
     win.setAttribute("stateBeanData", view.getStateBean());
     win.setAttribute("persistTimeData", view.getStateItems());
     win.setSizable(false);
     win.setClosable(true);
     win.doModal();
   } catch (Exception e) {
     e.printStackTrace();
   }
 }
  public void onClick$btnAceptar(Event ev) {

    if (docGrupoDTO == null) {
      docGrupoDTO = new DocGrupoDTO();
    }

    if (cmbCurso.getSelectedItem() != null
        && cmbDocente.getSelectedItem() != null
        && cmbGrupo.getSelectedItem() != null) {
      Curso curso = cmbCurso.getSelectedItem().getValue();
      Docente docente = cmbDocente.getSelectedItem().getValue();
      Grupo grupo = cmbGrupo.getSelectedItem().getValue();

      docGrupoDTO.setIdCurso(curso.getIdCurso());
      docGrupoDTO.setIdnGrupo(grupo.getIdn());
      docGrupoDTO.setNombreCurso(curso.getNombre());
      docGrupoDTO.setNombreDocente(docente.getNombreCompleto());
      docGrupoDTO.setNumeroGrupo(grupo.getNumeroGrupo());
      docGrupoDTO.setIdnDocente(docente.getIdn());
      docGruposOpInt.almacenarDocGrupo(docGrupoDTO);

      Messagebox.show(
          "Docente por Grupo guardado", "Informacion", Messagebox.OK, Messagebox.INFORMATION);
      self.detach();
    } else {
      Messagebox.show(
          "Debe ingresar todos los datos", "Informacion", Messagebox.OK, Messagebox.INFORMATION);
    }
  }
Example #3
0
 public void viewReport() throws Exception {
   try {
     JadwalDosenDAO dao = new JadwalDosenDAOImpl();
     if (cmbNamaDosen.getValue() != null
         && cmbProgdi.getValue() != null
         && !cmbTahun.getSelectedItem().getValue().toString().isEmpty()
         && cmbSemester.getValue() != null) {
       datas =
           dao.getJadwalDosen(
               (Dosen) cmbNamaDosen.getSelectedItem().getValue(),
               (ProgramStudi) cmbProgdi.getSelectedItem().getValue(),
               cmbTahun.getSelectedItem().getValue().toString(),
               Integer.valueOf(cmbSemester.getSelectedItem().getValue().toString()));
       lstData.getItems().clear();
       for (JadwalDosen jd : datas) {
         Listitem item = new Listitem();
         item.setValue(jd);
         item.appendChild(new Listcell(jd.getJam()));
         item.appendChild(new Listcell(jd.getSenin()));
         item.appendChild(new Listcell(jd.getSelasa()));
         item.appendChild(new Listcell(jd.getRabu()));
         item.appendChild(new Listcell(jd.getKamis()));
         item.appendChild(new Listcell(jd.getJumat()));
         item.appendChild(new Listcell(jd.getSabtu()));
         lstData.appendChild(item);
       }
       btnExport.setDisabled(false);
     } else {
       Messagebox.show("Silahkan Input Parameter dengan benar");
       btnExport.setDisabled(true);
     }
   } catch (Exception ex) {
     Messagebox.show("Telah terjadi kesalahan..");
   }
 }
 @Listen("onClick = button#cfgSave")
 public void cfgSaveClick(MouseEvent event) {
   if (logger.isDebugEnabled()) logger.debug(" cfgSave button event = " + event);
   try {
     Properties config = Util.getConfig(null);
     if (isValidPort(portsToScan.getText())) {
       config.setProperty(Constants.SERIAL_PORTS, portsToScan.getValue());
     } else {
       Messagebox.show(
           "Device ports to scan is invalid. In Linux (pi) '/dev/ttyUSB0,/dev/ttyUSB1,etc', in MS Windows 'COM1,COM2,COM3,etc'");
     }
     if (isValidBaudRate(portBaudRate.getValue())) {
       config.setProperty(Constants.SERIAL_PORT_BAUD, portBaudRate.getValue());
       Util.saveConfig();
     } else {
       Messagebox.show("Device baud rate (speed) must be one of 4800,9600,19200,38400,57600");
     }
     if (NumberUtils.isNumber(cfgWindOffset.getValue())) {
       config.setProperty(Constants.WIND_ZERO_OFFSET, cfgWindOffset.getValue());
       Util.saveConfig();
       // notify others
       producer.sendBody(Constants.WIND_ZERO_ADJUST_CMD + ":" + cfgWindOffset.getValue() + ",");
     } else {
       Messagebox.show("Wind offset must be numeric");
     }
     config.setProperty(Constants.PREFER_RMC, (String) useRmcGroup.getSelectedItem().getValue());
     config.setProperty(
         Constants.DNS_USE_CHOICE, (String) useHomeGroup.getSelectedItem().getValue());
     Util.saveConfig();
   } catch (Exception e) {
     logger.error(e.getMessage(), e);
   }
 }
Example #5
0
  public void onClick$submit() {
    JXKH_HYLW meeting = new JXKH_HYLW();
    for (int i = 0; i < meetingList.size(); i++) {
      meeting = meetingList.get(i);
      meetDeptList = jxkhHylwService.findMeetingDeptByMeetingId(meeting);
      int index = 0;
      // int tt = 0;
      for (int t = 1; t <= meetDeptList.size(); t++) {
        JXKH_HYLWDept dept = (JXKH_HYLWDept) meetDeptList.get(t - 1);
        if (user.getDept().getKdName().equals(dept.getName())) {
          index = dept.getRank();
        }
      }
      String s = meeting.getTempState();
      char[] myStr = s.toCharArray();
      if (pass.isChecked()) {
        myStr[index - 1] = '1';
        String s0 = new String(myStr);
        meeting.setTempState(s0);
        meeting.setLwState(JXKH_MEETING.First_Dept_Pass);
        jxkhHylwService.saveOrUpdate(meeting);

        int k = 1;
        String str = meeting.getTempState();
        for (int j = 0; j < meetDeptList.size(); j++) {
          if (str.charAt(j) != '1') k = 0;
        }
        if (k == 1) meeting.setLwState(JXKH_MEETING.DEPT_PASS);
      } else if (back.isChecked()) {
        myStr[index - 1] = '2';
        String s0 = new String(myStr);
        meeting.setTempState(s0);
        meeting.setLwState(JXKH_MEETING.DEPT_NOT_PASS);
      }
      jxkhHylwService.saveOrUpdate(meeting);
    }

    try {
      Messagebox.show("批量审核成功!", "提示", Messagebox.OK, Messagebox.INFORMATION);
    } catch (Exception e) {
      e.printStackTrace();
      try {
        Messagebox.show("批量审核失败,请重试!", "提示", Messagebox.OK, Messagebox.INFORMATION);
      } catch (InterruptedException e1) {
        e1.printStackTrace();
      }
    }
    this.onClose();
  }
Example #6
0
  public void onSelected(String string, Object o) {
    // TODO select entries in tables
    if (contentConcepts1 != null && contentConcepts2 != null) {
      try {
        logger.debug("select entries in tables, " + o.getClass().getCanonicalName());

        CodeSystemEntityVersionAssociation cseva = (CodeSystemEntityVersionAssociation) o;
        String code1 =
            cseva
                .getCodeSystemEntityVersionByCodeSystemEntityVersionId1()
                .getCodeSystemConcepts()
                .get(0)
                .getCode();
        String code2 =
            cseva
                .getCodeSystemEntityVersionByCodeSystemEntityVersionId2()
                .getCodeSystemConcepts()
                .get(0)
                .getCode();

        Tree tree1 = contentConcepts1.getConcepts().getTreeConcepts();
        Tree tree2 = contentConcepts2.getConcepts().getTreeConcepts();
        selectCodeInTree(tree1, null, code1);
        selectCodeInTree(tree2, null, code2);

      } catch (Exception ex) {
        LoggingOutput.outputException(ex, this);
        Messagebox.show(ex.getLocalizedMessage());
      }
    } else logger.debug("contentConcepts is null");
  }
  /**
   * Deleta uma {@link Turma} do banco de dados
   *
   * @param turma {@link Turma} a ser deletada
   */
  @SuppressWarnings({"unchecked", "rawtypes"})
  @Command
  public void delete(@BindingParam("turma") final Turma turma) {
    Messagebox.show(
        "Você tem certeza que deseja excluir a turma do semestre " + turma.getSemestre() + "?",
        "Confirmação",
        Messagebox.OK | Messagebox.CANCEL,
        Messagebox.QUESTION,
        new org.zkoss.zk.ui.event.EventListener() {
          public void onEvent(Event e) {
            if (Messagebox.ON_OK.equals(e.getName())) {

              if (turmaBusiness.exclui(turma)) {
                removeFromList(turma);
                Messagebox.show(
                    "A turma foi excluida com sucesso.",
                    "Sucesso",
                    Messagebox.OK,
                    Messagebox.INFORMATION);
              } else {
                String errorMessage = "A turma não pode ser excluída.\n";
                for (String error : turmaBusiness.getErrors()) errorMessage += error;
                Messagebox.show(errorMessage, "Erro", Messagebox.OK, Messagebox.ERROR);
              }
            }
          }
        });
  }
 /**
  * Valida a edição da {@link Turma} e realiza a edição chamando as funções que lidam com o banco
  * de dados
  *
  * @param turma {@link Turma} que está sendo validada
  */
 @Command
 public void confirm(@BindingParam("turma") Turma turma) {
   if (turmaBusiness.validar(turma)) {
     if (!turmaBusiness.editar(turma))
       Messagebox.show(
           "Não foi possível editar o departamento.", "Erro", Messagebox.OK, Messagebox.ERROR);
     editTemp.remove(turma.getId());
     turma.setEditingStatus(false);
     refreshRowTemplate(turma);
   } else {
     String errorMessage = "";
     for (String error : turmaBusiness.getErrors()) errorMessage += error;
     Messagebox.show(
         errorMessage, "Dados insuficientes / inválidos", Messagebox.OK, Messagebox.ERROR);
   }
 }
 public void agregarTodosProcedimientos() {
   Messagebox.show(
       "¿Esta seguro que desea agregar todos los procedimientos?",
       "Eliminar Registro",
       Messagebox.YES + Messagebox.NO,
       Messagebox.QUESTION,
       new org.zkoss.zk.ui.event.EventListener<Event>() {
         public void onEvent(Event event) throws Exception {
           if ("onYes".equals(event.getName())) {
             Map<String, Object> parametros = new HashMap<String, Object>();
             getServiceLocator().getServicio(ProcedimientosService.class).setLimit(null);
             List<Procedimientos> listado =
                 getServiceLocator().getServicio(ProcedimientosService.class).listar(parametros);
             for (Procedimientos procedimientos : listado) {
               if (!mapa_datos_procedimientos.containsKey(procedimientos.getId_procedimiento())) {
                 Map<String, Object> pcd =
                     OpenProcedimientosAction.getProcedimientoMap(
                         codigo_empresa, codigo_sucursal, procedimientos);
                 mapa_datos_procedimientos.put(procedimientos.getId_procedimiento(), pcd);
                 procedimientos_seleccionados.add(procedimientos.getId_procedimiento() + "");
               }
             }
             renderizarMapaDatos();
           }
         }
       });
 }
  @NotifyChange({"informesMordenproduccionSeleccionado", "detalleInformeModel"})
  @Command
  public void eliminarInforme() {
    if (this.informesMordenproduccionSeleccionado == null) {
      Clients.showNotification("Seleccione una Actividad");
      return;
    }

    Messagebox.show(
        "Esta operacion eliminara el item seleccionado esta seguro de continuar?",
        "Confirmar",
        Messagebox.YES | Messagebox.NO,
        Messagebox.QUESTION,
        new EventListener<Event>() {

          @Override
          public void onEvent(Event arg0) throws Exception {
            jdbc.update(
                "update imprentas.actividades_mordenproduccion set id_estado='X',ult_usuarioe=? where id=?",
                new Object[] {
                  UsuarioLogueado.getIdUsuario(), informesMordenproduccionSeleccionado.getId()
                });
            detalleInformeModel.remove(informesMordenproduccionSeleccionado);
            Clients.showNotification("Todo bien! el item seleccionado fue removido");
            BindUtils.postGlobalCommand(null, null, "refrescarDetallePago", null);
          }
        });
  }
  @Command
  public void eliminarDetalle() {
    if (itemSel != null) {

      Messagebox.show(
          "Esta operacion eliminara el item seleccionado esta seguro de continuar?",
          "Confirmar",
          Messagebox.YES | Messagebox.NO,
          Messagebox.QUESTION,
          new EventListener<Event>() {

            @Override
            @NotifyChange({"model", "provSel"})
            public void onEvent(Event arg0) throws Exception {
              switch (((Integer) arg0.getData()).intValue()) {
                case Messagebox.YES:
                  // itemSel.setId_estado("X");
                  //										detalleModel
                  //												.remove(detalleSeleccionado);
                  Clients.showNotification("Todo bien! el item seleccionado fue removido");
                  BindUtils.postGlobalCommand(null, null, "refrescarDetalle", null);
                  break;
              }
            }
          });
    }
  }
Example #12
0
  @Command
  public void eliminarItem() {
    if (itemSel != null) {
      Messagebox.show(
          "Esta operacion Eliminara los datos del registro seleccionado esta seguro de continuar?",
          "Confirmar",
          Messagebox.YES | Messagebox.NO,
          Messagebox.QUESTION,
          new EventListener<Event>() {

            @Override
            @NotifyChange({"model", "provSel"})
            public void onEvent(Event arg0) throws Exception {
              switch (((Integer) arg0.getData()).intValue()) {
                case Messagebox.YES:
                  itemSel.setId_estado("X");
                  itemSel.setUlt_usuarioe(UsuarioLogueado.getIdUsuario());
                  itemsDao.updateByPrimaryKey(itemSel);
                  itemSel = null;
                  BindUtils.postGlobalCommand(null, null, "refrescar", null);
                  Clients.showNotification(
                      "Todo bien! el los datos del pago seleccionado fueron removidos correctamente!");

                  break;
              }
            }
          });
    }
  }
  public void viewReport() throws Exception {
    try {
      listb.getItems().clear();
      DosenSedangMenempuhStudiDAO dao = new DosenSedangMenempuhStudiDAOImpl();
      datas =
          dao.getData(
              (UKProgramStudi) cmbProgdi.getSelectedItem().getValue(),
              (JenjangStudi) cmbJenjangStudi.getSelectedItem().getValue());

      for (DosenSedangMenempuhStudi o : datas) {
        Listitem li = new Listitem();
        Listcell cell = new Listcell(o.getNama());
        li.appendChild(cell);
        cell = new Listcell(o.getProdi());
        li.appendChild(cell);
        cell = new Listcell(o.getJenjangStudi());
        li.appendChild(cell);
        cell = new Listcell(o.getTempat());
        li.appendChild(cell);
        listb.appendChild(li);
      }
      btnExport.setDisabled(false);

    } catch (Exception ex) {
      ex.printStackTrace();
      Messagebox.show(ex.getMessage());
    }
  }
 private IDataUnit updateDataUnit(String paramList, IDataUnit dataUnit) {
   System.out.println("inside the update command for the RevertWorkflowStatusCommand ");
   Hashtable information = new Hashtable();
   String fieldName = null;
   String fieldValue = null;
   if (paramList.indexOf("_FIELDSEP_") >= 0) {
     String[] strValue = paramList.trim().split("_FIELDSEP_");
     if (strValue.length == 6) {
       for (int i = 0; i < strValue.length; i++) {
         String fieldExp = strValue[i];
         if (fieldExp.indexOf("_SEP_") >= 0) {
           String[] fexp = fieldExp.trim().split("_SEP_");
           fieldName = fexp[0];
           fieldValue = fexp[1];
           if (fieldName != null && fieldValue != null) {
             information.put(fieldName, fieldValue);
           }
         } else {
           try {
             Messagebox.show("Invalid arguments");
           } catch (InterruptedException e) {
             e.printStackTrace();
           }
         }
       }
     }
   }
   dataUnit.setFormValues(information);
   return dataUnit;
 }
  private void setConfigDefaults() {
    try {
      Properties config = Util.getConfig(null);

      for (Comboitem item : portBaudRate.getItems()) {
        if (config.getProperty(Constants.SERIAL_PORT_BAUD).equals(item.getValue())) {
          portBaudRate.setSelectedItem(item);
        }
      }
      portsToScan.setValue(config.getProperty(Constants.SERIAL_PORTS));
      cfgWindOffset.setValue(config.getProperty(Constants.WIND_ZERO_OFFSET));
      String useChoice = config.getProperty(Constants.DNS_USE_CHOICE);
      if (Constants.DNS_USE_BOAT.equals(useChoice)) {
        useHomeGroup.setSelectedItem(useBoatRadio);
      } else {
        useHomeGroup.setSelectedItem(useHomeRadio);
      }
      if (new Boolean(config.getProperty(Constants.PREFER_RMC))) {
        useRmcGroup.setSelectedItem(useRmcRadio);
      } else {
        useRmcGroup.setSelectedItem(useHdgRadio);
      }
    } catch (Exception e) {
      logger.error(e.getMessage(), e);
      Messagebox.show("There has been a problem with loading the configuration:" + e.getMessage());
    }
  }
 public void exportReport() throws Exception {
   try {
     // JRBeanCollectionDataSource dataSource = new JRBeanCollectionDataSource(datas);
     if (cmbExportType.getSelectedItem().getValue().toString().equals("pdf")) {
       Window pdfPreviewWnd =
           (Window) Executions.createComponents("/zul/pdfpreview/PdfPreview.zul", null, null);
       Jasperreport pdfReport = (Jasperreport) pdfPreviewWnd.getFellow("report");
       pdfReport.setType(cmbExportType.getSelectedItem().getValue().toString());
       pdfReport.setSrc("reports/statistikpendidikandosen/StatistikPendidikanDosen.jasper");
       Map parameters = new HashMap();
       parameters.put("chart", chart.createBufferedImage(500, 300));
       pdfReport.setParameters(parameters);
       pdfReport.setDatasource(null);
       pdfPreviewWnd.doModal();
     } else {
       report.setType(cmbExportType.getSelectedItem().getValue().toString());
       report.setSrc("reports/statistikpendidikandosen/StatistikPendidikanDosen.jasper");
       Map parameters = new HashMap();
       parameters.put(
           "chart", chart.createBufferedImage(500, 300, BufferedImage.TRANSLUCENT, null));
       report.setParameters(parameters);
       report.setDatasource(null);
     }
   } catch (Exception ex) {
     Messagebox.show(ex.getMessage());
   }
 }
 public void onClick$btnModificar() throws InterruptedException {
   // almacen.setInstalacion(instalacion);
   servicioAlmacen.actualizar(almacen);
   Messagebox.show(
       "Datos modificados exitosamente", "Mensaje", Messagebox.OK, Messagebox.EXCLAMATION);
   this.onClick$btnCancelar();
 }
Example #18
0
 public void exportReport() throws Exception {
   try {
     JRBeanCollectionDataSource dataSource = new JRBeanCollectionDataSource(datas);
     Map param = new HashMap();
     param.put("dosen", ((Dosen) cmbNamaDosen.getSelectedItem().getValue()).getNama());
     param.put("prodi", ((ProgramStudi) cmbProgdi.getSelectedItem().getValue()).getNama());
     param.put("tahun", cmbTahun.getSelectedItem().getValue().toString());
     param.put("semester", cmbSemester.getSelectedItem().getValue() + "");
     if (cmbExportType.getSelectedItem().getValue().toString().equals("pdf")) {
       Window pdfPreviewWnd =
           (Window) Executions.createComponents("/zul/pdfpreview/PdfPreview.zul", null, null);
       Jasperreport pdfReport = (Jasperreport) pdfPreviewWnd.getFellow("report");
       pdfReport.setType(cmbExportType.getSelectedItem().getValue().toString());
       pdfReport.setSrc("reports/jadwaldosen/JadwalDosen.jasper");
       pdfReport.setParameters(param);
       pdfReport.setDatasource(dataSource);
       pdfPreviewWnd.doModal();
     } else {
       report.setType(cmbExportType.getSelectedItem().getValue().toString());
       report.setSrc("reports/jadwaldosen/JadwalDosen.jasper");
       report.setParameters(param);
       report.setDatasource(dataSource);
     }
   } catch (Exception ex) {
     Messagebox.show(ex.getMessage());
   }
 }
 @Listen("onOpen = #gpxDatos")
 public void abrirCatalogo() {
   gpxDatos.setOpen(false);
   if (camposEditando()) {
     Messagebox.show(
         Mensaje.estaEditando,
         "Alerta",
         Messagebox.YES | Messagebox.NO,
         Messagebox.QUESTION,
         new org.zkoss.zk.ui.event.EventListener<Event>() {
           public void onEvent(Event evt) throws InterruptedException {
             if (evt.getName().equals("onYes")) {
               gpxDatos.setOpen(false);
               gpxRegistro.setOpen(true);
             } else {
               if (evt.getName().equals("onNo")) {
                 gpxDatos.setOpen(true);
                 gpxRegistro.setOpen(false);
                 limpiarCampos();
                 habilitarTextClave();
                 mostrarBotones(true);
               }
             }
           }
         });
   } else {
     gpxDatos.setOpen(true);
     gpxRegistro.setOpen(false);
     mostrarBotones(true);
   }
 }
Example #20
0
 // 显示信息
 public static void showInfo(String value) {
   try {
     Messagebox.show(value, "提示", Messagebox.OK, Messagebox.INFORMATION);
   } catch (InterruptedException e) {
     e.printStackTrace();
   }
 }
 private void showInformativeMessage(String message) {
     try {
         Messagebox.show(_(message), _("Delete"), Messagebox.OK,
                 Messagebox.ERROR);
     } catch (InterruptedException e) {
         messagesForUser.showMessage(Level.ERROR, _(e.getMessage()));
     }
 }
 public void onClick$btnEliminar() throws InterruptedException {
   if (Messagebox.show(
           "¿Realmente desea eliminar este almacén?",
           "Mensaje",
           Messagebox.YES + Messagebox.NO,
           Messagebox.QUESTION)
       == Messagebox.YES) {
     almacen.setEstatus('E');
     servicioAlmacen.actualizar(almacen);
     almacenes.remove(almacen);
     Messagebox.show(
         "Datos eliminados exitosamente", "Mensaje", Messagebox.OK, Messagebox.EXCLAMATION);
     this.onClick$btnCancelar();
   } else {
     onClick$btnCancelar();
   }
 }
Example #23
0
  @Command
  @NotifyChange({"selectedTipoCompartimento", "desativado"})
  public void submit() {
    try {
      DaoFactory daof = new DaoFactory();
      daof.beginTransaction();

      if (this.selectedElementos != null) {
        daof.getElementosDAO().adiciona(this.selectedElementos);
        this.selectedTipoCompartimento.setElementos(this.selectedElementos);
      }

      daof.getTipoCompartimentoDAO().adiciona(this.selectedTipoCompartimento);

      daof.commit();

      Messagebox.show(
          "O tipo de compartimento "
              + this.selectedTipoCompartimento.getDescricao().toUpperCase()
              + "\nfoi adicionado ou atualizado com sucesso.",
          "Portal Hydro",
          Messagebox.OK,
          Messagebox.INFORMATION);

      // Atualiza o combobox Tipo de Compartimento na janela Compartimento
      this.atualizaBindComponent(
          "atualizaCompartimentoLists",
          "atualizaCompartimentoLists",
          this.selectedTipoCompartimento);
      // Atualiza a lista na aba Compartimento na janela de Cadastros;
      this.atualizaBindComponent(
          "atualizaListas", "atualizaListas", this.selectedTipoCompartimento);
      this.atualizaAllTipoCompartimento();
      this.atualizaElementos();
    } catch (Exception e) {
      Messagebox.show(
          "Problemas de conexão com o banco de dados.\nContate o administrador ou o desenvolvedor do sistema.",
          "Portal Hydro",
          Messagebox.OK,
          Messagebox.INFORMATION);

      e.printStackTrace();
    }
    this.desativado = true;
  }
 protected void next() {
   try {
     updateChosenKeysIndex();
     getSelection();
     this.primaryKeyW.detach();
     this.bpmnMinerController.setSelectedPrimaryKeys(group);
   } catch (ArrayIndexOutOfBoundsException aob) {
     Messagebox.show("Select a primary key for each activity");
   }
 }
Example #25
0
  public void onClick$delete() {

    if (signList.getSelectedItem() == null) {
      MessageBox.showWarning("请选择删除项!");
    } else {
      WKTHtmlSign sign = (WKTHtmlSign) signList.getSelectedItem().getValue();
      WKTHtmlSign wHtmlSign = signService.findBySignValue(sign.getKsValue().trim());
      if (wHtmlSign.equals("")) {
        WKTHtmlSign sign2;
        for (int i = 0; i < sList.size(); i++) {
          sign2 = sList.get(i);
          if (sign.getKsName().equals(sign2.getKsName())) {
            try {
              if (Messagebox.show(
                      "确定删除标记信息?", "提示信息", Messagebox.YES | Messagebox.NO, Messagebox.QUESTION)
                  == Messagebox.YES) {
                sList.remove(i);
                signValue.setValue("");
                signName.setValue("");
                loadSignList();
              }
            } catch (InterruptedException e) {
              e.printStackTrace();
            }
          }
        }
      } else {
        try {
          if (Messagebox.show(
                  "确定删除标记信息?", "提示信息", Messagebox.YES | Messagebox.NO, Messagebox.QUESTION)
              == Messagebox.YES) {
            signService.delete(sign);
            signValue.setValue("");
            signName.setValue("");
            Init();
          }
        } catch (InterruptedException e) {
          e.printStackTrace();
        }
      } // else
    }
  }
Example #26
0
  public void onClick$loginBtn() throws InterruptedException {

    validateFields(loginWin);

    user.setIsDisabled(false);
    UsersDAO usersDAO = new UsersDAO();
    List<Users> users = usersDAO.findByExample(user, new String[] {});
    if (users.isEmpty() || users.size() > 1) {
      Messagebox.show(
          Labels.getLabel("loginPage.error"),
          Labels.getLabel("error.title"),
          Messagebox.OK,
          Messagebox.ERROR);
      return;
    }
    user = users.get(0);
    session.setAttribute(IConstants.KEY_USER, user);

    // login to OpenKM and get token
    OkmProtocolDispatcherImpl service = getOkmDispatcher();

    RequestLogin loginReq = new RequestLogin();
    loginReq.setUsername(user.getUsername());
    loginReq.setPassword(user.getPassword());

    ResponseLogin respLogin = service.login(loginReq);
    if (respLogin.isError()) {
      log.error(respLogin.toString());
      Messagebox.show(
          Labels.getLabel("loginPage.error"),
          Labels.getLabel("error.title"),
          Messagebox.OK,
          Messagebox.ERROR);
      return;
    }

    log.info(respLogin.getOkmToken());
    session.setAttribute(IConstants.KEY_OKM_TOKEN, respLogin.getOkmToken());

    Executions.getCurrent().sendRedirect("index.zul");
  }
 /**
  * /** Valida os dados da nova {@link Turma} e envia para ser salva no banco , se falhar mostra
  * uma mensagem de erro.
  *
  * @param window Janela que contém os campos de informação da {@link Turma}
  */
 @Command
 public void submitTurma(@BindingParam("window") final Window window) {
   if (turmaBusiness.validar(novaTurma)) {
     if (turmaBusiness.salvar(novaTurma)) {
       todasTurmas.add(novaTurma);
       filterTurmas = todasTurmas;
       notifyTurmas();
       Clients.clearBusy(window);
       Messagebox.show("Turma Adicionada!", "Sucesso", Messagebox.OK, Messagebox.INFORMATION);
       limpa();
     } else {
       Clients.clearBusy(window);
       Messagebox.show("A turma não foi adicionada!", "Erro", Messagebox.OK, Messagebox.ERROR);
     }
   } else {
     String errorMessage = "";
     for (String error : turmaBusiness.getErrors()) errorMessage += error;
     Messagebox.show(
         errorMessage, "Dados insuficientes / inválidos", Messagebox.OK, Messagebox.ERROR);
   }
 }
Example #28
0
    @Override
    public void onEvent(Event event) throws Exception {
      try {
        if (node == null) return;

        // 过滤不需要处理的节点
        Treechildren mytreechildren = treeitem.getTreechildren();
        // 无子节点或者是处于收缩状态的节点
        if (mytreechildren == null
            || mytreechildren.getChildren().size() > 0
            || treeitem.isOpen() == false) return;
        // 是监测器节点的情况
        if (INode.MONITOR.equals(node.getType())) {
          return;
        }

        List<EccTreeItem> sons = node.getChildRen();
        // 查找其儿子
        if (sons != null && sons.size() > 0) {

          for (EccTreeItem son : sons) {
            if (son == null) continue;
            // 如果是监视器 -- 页节点
            if (INode.ENTITY.equals(son.getType())) {
              if (this.tree.getMonitorType() != null) {
                //								MonitorInfo monitorinfo =
                // this.tree.getTreemodel().getView().getMonitorInfo(son.getValue());
                EntityInfo entityInfo =
                    this.tree.getTreemodel().getView().getEntityInfo(son.getValue());
                if (!this.tree.getMonitorType().equals(entityInfo.getType())) {
                  continue;
                }
              }
              BaseTreeitem tii = getTreeitem(son);
              tii.setParent(mytreechildren);
            } else {
              if (existChildren(son)) {
                // 如果存在儿子
                BaseTreeitem tii = getTreeitem(son);
                tii.setParent(mytreechildren);
                Treechildren newtreechildren = new Treechildren();
                tii.appendChild(newtreechildren); // 给以可以展开的属性
                tii.addEventListener(
                    Events.ON_OPEN, new TreeitemOpenListener(tii, this.tree)); // 添加展开事件
              }
            }
          }
        }
      } catch (Exception e) {
        e.printStackTrace();
        Messagebox.show(e.getMessage(), "错误", Messagebox.OK, Messagebox.ERROR);
      }
    }
 public void confirmRemove(TaskQualityForm taskQualityForm) {
     try {
         int status = Messagebox.show(_(
                 "Confirm deleting {0}. Are you sure?",
                 getTaskQualityFormName(taskQualityForm)), _("Delete"),
                 Messagebox.OK | Messagebox.CANCEL, Messagebox.QUESTION);
         if (Messagebox.OK == status) {
             deleteTaskQualityForm(taskQualityForm);
         }
     } catch (InterruptedException e) {
         throw new RuntimeException(e);
     }
 }
Example #30
0
 @Override
 public void onEvent(Event event) throws Exception {
   try {
     if (this.treeitem.isChecked()) {
       this.addMonitorsToList(localnode);
     } else {
       this.removeMonitorsFromList(localnode);
     }
     reflash();
   } catch (Exception e) {
     e.printStackTrace();
     Messagebox.show(e.getMessage(), "错误", Messagebox.OK, Messagebox.ERROR);
   }
 }