Package no.ugland.utransprod

Examples of no.ugland.utransprod.ProTransException


    public Cutting importCuttingFile(String fileName) throws ProTransException {
        File cuttingFile = getCuttingFile(fileName);
        if (cuttingFile.exists()) {
            return readAndImportCuttingFile(cuttingFile);
        }
        throw new ProTransException("Filen " + fileName + " finnes ikke");
    }
View Full Code Here


                lineCount++;
                importLine(line, lineCount, cutting);
            }
        } catch (IOException e) {
            e.printStackTrace();
            throw new ProTransException(e);
        }
        return cutting;
    }
View Full Code Here

        cuttingType.setCuttingData(cutting, lineElements,lineCount);
    }

    private CuttingType validateLine(int lineCount, String[] lineElements) throws ProTransException {
        if (lineElements == null || lineElements.length < 2) {
            throw new ProTransException("Linje " + lineCount + " inneholder for f� elementer");
        }
        CuttingType cuttingType = CuttingType.valueOf(lineElements[0].trim());

        if (!cuttingType.checkNumberOfElements(lineElements)) {
            throw new ProTransException("Linje " + lineCount + " inneholder feil antall elementer "
                    + lineElements.length);
        }
        return cuttingType;
    }
View Full Code Here

    } else if (description.equalsIgnoreCase("Takstol")) {
      return new AdditionTruss(addition, "Takstoler", "Takstol");
    } else if (description.equalsIgnoreCase("St�ende tak")) {
      return new AdditionStandingRoof(addition, null, "St�ende tak");
    } else {
      throw new ProTransException("Ikke definert klasse for tillegg "
          + addition.getDescription());
    }
  }
View Full Code Here

            throws ProTransException {
        SpecialConcern specialConcern = new SpecialConcern();
        specialConcern.setDescription(description);
        List<SpecialConcern> list = find(specialConcern);
        if (list == null || list.size() != 1) {
            throw new ProTransException("Kunne ikke finne spesielt hensyn for "
                    + description);
        }
        return list.get(0);
    }
View Full Code Here

            String[] fileNames = attachmentDir.list();
            fileNameList.addAll(new ArrayList<String>(Arrays.asList(fileNames)));

        } catch (IOException e) {
            e.printStackTrace();
            throw new ProTransException(e.getMessage());
        }
    }
View Full Code Here

        String week = excelUtil.readCell(row, COLUMN_WEEK, "%1$04.0f");
        String productAreaName = excelUtil.readCell(row, budgetType.getProductAreaColumn(), null);
        ProductArea productArea = productAreaManager.findByName(productAreaName);

        if (productArea == null) {
            throw new ProTransException("Produktomr�de " + productAreaName + " ble ikke funnet");
        }

        while (week != null) {
            if (infoLabel != null) {
                infoLabel.setText(infoText + row);
View Full Code Here

  private void setCostsFromUdsalesmall(final Order incomingOrder)
      throws ProTransException {
    ImportOrderV importOrderV = importOrderVDAO.findByNumber1(incomingOrder
        .getOrderNr());
    if (importOrderV == null) {
      throw new ProTransException("Kan ikke finne importordre");
    }
    if (importOrderV.getUserdefId() != null) {
      Udsalesmall udsalesmall = udsalesmallDao.getObject(importOrderV
          .getUserdefId());
      setCustomerCost(incomingOrder, udsalesmall);
View Full Code Here

    try {
      InputStream stream = getClass().getClassLoader()
          .getResourceAsStream(reportFile);

      if (stream == null) {
        throw new ProTransException("Fant ikke rapport");
      }
      jasperPrintReport = JasperFillManager.fillReport(stream,
          parameters, datasource);

      JRViewerProTrans viewer = new JRViewerProTrans(jasperPrintReport);
      viewer.setPrintable(printable);
      viewer.setSavable(printable);
      this.pnlMain.add(viewer, BorderLayout.CENTER);
    } catch (JRException e) {
      e.printStackTrace();
      String msg;
      if (e.getCause() instanceof FileNotFoundException) {
        msg = "Kunne ikke finne rapport " + reportFile;
      } else {
        msg = e.getMessage();
      }
      throw new ProTransException("Feil ved generering av rapport " + msg);
    }
  }
View Full Code Here

  final String getTempDir() throws ProTransException {
    String tmpPath = ApplicationParamUtil.findParamByName("temp_dir");
    File tempDir = new File(tmpPath);
    if (!tempDir.exists()) {
      if (!tempDir.mkdir()) {
        throw new ProTransException("Kunne ikke lage temp katalog "
            + tmpPath);
      }
    }
    return tmpPath;
  }
View Full Code Here

TOP

Related Classes of no.ugland.utransprod.ProTransException

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.