Package cli_fmw.main

Examples of cli_fmw.main.ClipsException


    FileLocal file = loadFile(fileName);
    if (file != null) {
      setMainFile(file);
    }
    else {
      throw new ClipsException("Ошибка добавления основного файла");
    }
  }
View Full Code Here


      getDetails().mainFile = null;
      return;
    }
     
    if (file.getFileTypeID() != FileDetails.TYPE_JASPER_REPORT) {
      throw new ClipsException("Основной файл отчета должен быть отчетом");
    }

    FileLocal      presFile = filesList.get(file.getFileName());
    if (presFile != file) {
      addFile(file);
View Full Code Here

    return presFile;
  }

  public JasperPrint getClientReport(Map<String, Object> params) throws ClipsException, JRException{
    if (isDirty()) {
      throw new ClipsException("Отчет должен быть сохранен, проед выполением");
    }
    InputStream          stream = getInputStream(null);
    if (stream != null){
      try{
        JasperReport        jasperReport = (JasperReport)JRLoader.loadObject(stream);
        HashMap<String, Object>    map = new HashMap<String, Object>(params);
        map.putAll(getDefaultParameters());
        return JasperFillManager.fillReport(jasperReport, map);
      }
      finally{
        try {
          stream.close();
        } catch (IOException ex) {
          throw new ClipsException("Неизвестная ошибка при закрытии потока", ex);
        }
      }
    }
    return null;
  }
View Full Code Here

   * @throws net.sf.jasperreports.engine.JRException - ошбка при постраении отчета
   */
  @SuppressWarnings("unchecked")
  public JasperPrint getReport(Map<String, Object> params) throws ClipsException, JRException{
    if (isDirty()) {
      throw new ClipsException("Отчет должен быть сохранен, проед выполением");
    }
    try{
      return getBean().getReport(params);
    }
    catch (JRException ex){
      throw ex;
    }
    catch (Exception ex){
            clearBean();
      throw new ClipsException("Ошибка при получения отчета", ex);
    }
  }
View Full Code Here

    try{
      return getBean().getFileData(fileID);
    }
    catch (Exception ex){
            clearBean();
      throw new ClipsException("Не прав доступа для получения файлов", ex);
    }
  }
View Full Code Here

      for (Element el: (List<Element>)root.getChildren("Param")){
        String      name = el.getChildText("Name");
        String      rname = el.getChildText("RealName");
        String      pclass = el.getChildText("Class");
        if (name == null || rname == null || pclass == null) {
          throw new ClipsException("Ошибка в хмл");
        }
        params.add(new ReportParam(this, name, rname, pclass));
      }
    } catch (JDOMException ex) {
      ex.printStackTrace();
View Full Code Here

  public Map<String, Object> getDefaultParameters() throws ClipsException{
        try {
            return getBean().getDefaultParameters();
        } catch (Exception ex) {
            clearBean();
            throw new ClipsException("Не удалось загрузить дефолтовые параметры", ex);
        }
  }
View Full Code Here

            for (int i = 0; i < Col.values().length; i++) {
                Col col = Col.values()[i];
                fields.put(col, dbf.getField(col.toString()));
            }
        } catch (xBaseJException ex) {
            throw new ClipsException("Ошибка при чтении данных из файла " + dbf.getName(), ex);
        }
        int recordCount = dbf.getRecordCount();

        DirectorySurname dirSurname = DirectoryLocator.getDirectory(DirectorySurname.class);
        DirectoryName dirName = DirectoryLocator.getDirectory(DirectoryName.class);
        DirectoryPathron dirPathron = DirectoryLocator.getDirectory(DirectoryPathron.class);
        DirectorySpeciality dirSpec = DirectoryLocator.getDirectory(DirectorySpeciality.class);
        DirectoryReceptionType dirRecType = DirectoryLocator.getDirectory(DirectoryReceptionType.class);
        DirectoryDvr dirDvr = DirectoryLocator.getDirectory(DirectoryDvr.class);
        DirectoryMedicalAidType dirVmu = DirectoryLocator.getDirectory(DirectoryMedicalAidType.class);
        colDataList = new ArrayList<CollabData>();
        colClientMap = new HashMap<ColDataKey, ArrayList<ClientLocal>>();
        for (int i = 0; i < recordCount; i++) {
            try {
                dbf.read();
                if (dbf.deleted()) {
                    continue;
                }
                if (fields.get(Col.FAMILY).get().trim().isEmpty()) {
                    continue;
                }
                String extKey = fields.get(Col.ID).get().trim();
                DirectorySurnameItem surename = dirSurname.getItemFromTitle(fields.get(Col.FAMILY).get().trim());
                if (surename == null) {
                    DirectoryItemDetails d = new DirectoryItemDetails(fields.get(Col.FAMILY).get().trim());
                    surename = new DirectorySurnameItem(d);
                    dirSurname.getItems().append(surename);
                }
                int surnameID = surename.getID();
                DirectoryNameItem name = dirName.getItemFromTitle(fields.get(Col.NAME).get().trim());
                if (name == null) {
                    DirectoryItemDetails d = new DirectoryItemDetails(fields.get(Col.NAME).get().trim());
                    name = new DirectoryNameItem(d);
                    dirName.getItems().append(name);
                }
                int nameID = name.getID();
                //Финт ушами - исправление отчества
                String father = fields.get(Col.FATHER).get().trim();
                if (father.equals("Тимирьянович")) {
                    father = "Тимерзянович";
                }
                DirectoryPathronItem pathron = dirPathron.getItemFromTitle(father);
                if (pathron == null) {
                    DirectoryItemDetails d = new DirectoryItemDetails(father);
                    pathron = new DirectoryPathronItem(d);
                    dirPathron.getItems().append(pathron);
                }
                int pathronID = pathron.getID();
                int specID = dirSpec.getItemFromExtKey(fields.get(Col.KOD_SPEC).get().trim()).getID();
                DirectoryReceptionTypeItem recType = dirRecType.getItemFromExtKey(fields.get(Col.KOD_PRIEM).get().trim());
                if (recType == null) {
                    recType = dirRecType.getItemFromExtKey("600");
                }
                int receptionTypeID = recType.getID();
                DirectoryDvrItem dvr = dirDvr.getItemFromExtKey(fields.get(Col.DOLV).get().trim());
                if (dvr == null) {
                    dvr = dirDvr.getItemFromID(0);
                }
                int dvrID = dvr.getID();
                DirectoryMedicalAidTypeItem vmu = dirVmu.getItemFromExtKey(fields.get(Col.VMU).get().trim());
                if (vmu == null) {
                    vmu = dirVmu.getItemFromID(0);
                }
                int vmuID = vmu.getID();
                String snils = fields.get(Col.SNILS).get().trim();

                CollabData cd = new CollabData(extKey, surnameID, nameID, pathronID, specID, receptionTypeID, dvrID, vmuID);
                ColDataKey key = new ColDataKey(surnameID, nameID, pathronID);
                colClientMap.put(key, findClient(surename.getTitle(), name.getTitle(), pathron.getTitle(), snils));
                colDataList.add(cd);

            } catch (IOException ex) {
                closeDBF(dbf);
                throw new ClipsException("Ошибка при чтении данных из файла " + dbf.getName() + " (строка " + i + ")", ex);
            } catch (xBaseJException ex) {
                closeDBF(dbf);
                throw new ClipsException("Ошибка при чтении данных из файла " + dbf.getName() + " (строка " + i + ")", ex);
            } catch (NumberFormatException ex) {
                closeDBF(dbf);
                throw new ClipsException("Ошибка при чтении данных из файла " + dbf.getName() + " (строка " + i + ")", ex);
            }
        }
        changeData();
    }
View Full Code Here

        initUI();

        try {
            chooseDone(0, collaborator.getID());
        } catch (ChoosePanelComboException ex) {
            throw new ClipsException("Error occured", ex);
        }

        StateSaver.attachTo(this);
    }
View Full Code Here

        createTimeTable();

        try {
            chooseDone(0, collaborator.getID());
        } catch (ChoosePanelComboException ex) {
            throw new ClipsException("Access denied",ex);
        }
    StateSaver.attachTo(this);
    }
View Full Code Here

TOP

Related Classes of cli_fmw.main.ClipsException

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.