Package de.willuhn.util

Examples of de.willuhn.util.ApplicationException


  public static Version getVersion(DBService service, String name) throws RemoteException, ApplicationException
  {
    if (name == null || name.length() == 0)
    {
      I18N i18n = Application.getPluginLoader().getPlugin(HBCI.class).getResources().getI18N();
      throw new ApplicationException(i18n.tr("Keine Versionsbezeichnung angegeben"));
    }
    DBIterator list = service.createList(Version.class);
    list.addFilter("name = ?",name);
    if (list.hasNext())
      return (Version) list.next();
View Full Code Here


  {
    try
    {
      String name = getName();
      if (name == null || name.length() == 0)
        throw new ApplicationException(i18n.tr("Bitte geben Sie eine Bezeichnung ein."));
     
      String pattern = getPattern();
      if (pattern != null && pattern.length() > 0)
      {
        if (pattern.length() > MAXLENGTH_PATTERN)
          throw new ApplicationException(i18n.tr("Bitte geben Sie maximal {0} Zeichen als Suchbegriff ein.",Integer.toString(MAXLENGTH_PATTERN)));
       
        if (isRegex())
        {
          try
          {
            Pattern.compile(pattern);
          }
          catch (PatternSyntaxException pse)
          {
            throw new ApplicationException(i18n.tr("Regul�rer Ausdruck ung�ltig: {0}",pse.getDescription()));
          }
        }
      }

      if (isCustomColor() && (getColor() == null || getColor().length != 3))
        throw new ApplicationException("W�hlen Sie bitte eine benutzerdefinierte Farbe aus");

    }
    catch (RemoteException e)
    {
      Logger.error("error while insert check", e);
      throw new ApplicationException(i18n.tr("Fehler beim Speichern des Umsatz-Typs."));
    }
    super.insertCheck();
  }
View Full Code Here

   
    try {
      Konto k = getKonto();

      if (k == null)
        throw new ApplicationException(i18n.tr("Bitte w�hlen Sie ein Konto aus."));
      if (k.isNewObject())
        throw new ApplicationException(i18n.tr("Bitte speichern Sie zun�chst das Konto"));
     
      String kiban = k.getIban();
      if (kiban == null || kiban.length() == 0)
        throw new ApplicationException(i18n.tr("Das ausgew�hlte Konto besitzt keine IBAN"));
     
      String bic = k.getBic();
      if (bic == null || bic.length() == 0)
        throw new ApplicationException(i18n.tr("Das ausgew�hlte Konto besitzt keine BIC"));

      double betrag = getBetrag();
      if (betrag == 0.0 || Double.isNaN(betrag))
        throw new ApplicationException(i18n.tr("Bitte geben Sie einen g�ltigen Betrag ein."));

      if (getGegenkontoNummer() == null || getGegenkontoNummer().length() == 0)
        throw new ApplicationException(i18n.tr("Bitte geben Sie die IBAN des Gegenkontos ein"));
      HBCIProperties.checkChars(getGegenkontoNummer(), HBCIProperties.HBCI_IBAN_VALIDCHARS);
      HBCIProperties.checkLength(getGegenkontoNummer(), HBCIProperties.HBCI_IBAN_MAXLENGTH);

      if (getGegenkontoBLZ() == null || getGegenkontoBLZ().length() == 0)
        throw new ApplicationException(i18n.tr("Bitte geben Sie die BIC des Gegenkontos ein"));
      HBCIProperties.checkBIC(getGegenkontoBLZ());

      if (getGegenkontoName() == null || getGegenkontoName().length() == 0)
        throw new ApplicationException(i18n.tr("Bitte geben Sie den Namen des Kontoinhabers des Gegenkontos ein"));
      HBCIProperties.checkLength(getGegenkontoName(), HBCIProperties.HBCI_FOREIGNTRANSFER_USAGE_MAXLENGTH);
      HBCIProperties.checkChars(getGegenkontoName(), HBCIProperties.HBCI_SEPA_VALIDCHARS);

      HBCIProperties.getIBAN(getGegenkontoNummer());
       
      HBCIProperties.checkLength(getZweck(), HBCIProperties.HBCI_FOREIGNTRANSFER_USAGE_MAXLENGTH);
      HBCIProperties.checkChars(getZweck(), HBCIProperties.HBCI_SEPA_VALIDCHARS);
     
      HBCIProperties.checkLength(getEndtoEndId(), HBCIProperties.HBCI_SEPA_ENDTOENDID_MAXLENGTH);
      HBCIProperties.checkChars(getEndtoEndId(), HBCIProperties.HBCI_SEPA_VALIDCHARS);
     
      HBCIProperties.checkLength(getPmtInfId(), HBCIProperties.HBCI_SEPA_ENDTOENDID_MAXLENGTH);
      HBCIProperties.checkChars(getPmtInfId(), HBCIProperties.HBCI_SEPA_VALIDCHARS);

      if (isUmbuchung() && isTerminUeberweisung())
        throw new ApplicationException(i18n.tr("Eine Umbuchung kann nicht als Termin-Auftrag gesendet werden"));
     
      if (this.getTermin() == null)
        this.setTermin(new Date());

    }
    catch (RemoteException e)
    {
      Logger.error("error while checking foreign ueberweisung",e);
      throw new ApplicationException(i18n.tr("Fehler beim Pr�fen der SEPA-�berweisung."));
    }
  }
View Full Code Here

    {
      //////////////////////////////////////////////////////////////////////////
      // Kontoinhaber
      String name = this.getName();
      if (name == null || name.length() == 0)
        throw new ApplicationException(i18n.tr("Bitte geben Sie einen Namen ein."));

      HBCIProperties.checkLength(name, HBCIProperties.HBCI_TRANSFER_NAME_MAXLENGTH);
      //
      //////////////////////////////////////////////////////////////////////////

      boolean haveAccount = false;
      //////////////////////////////////////////////////////////////////////////
      // Deutsche Bankverbindung
      String kn = this.getKontonummer();

      if (kn != null && kn.length() > 0)
      {
        HBCIProperties.checkChars(kn, HBCIProperties.HBCI_KTO_VALIDCHARS);
        HBCIProperties.checkLength(kn, HBCIProperties.HBCI_KTO_MAXLENGTH_SOFT);

        String blz = this.getBlz();
        if (blz == null || blz.length() == 0)
          throw new ApplicationException(i18n.tr("Bitte geben Sie eine BLZ ein."));
        // BUGZILLA 280
        HBCIProperties.checkChars(blz, HBCIProperties.HBCI_BLZ_VALIDCHARS);

        // Nur pruefen, wenn ungueltige Bankverbindungen im Adressbuch erlaubt sind
        if (!Settings.getKontoCheckExcludeAddressbook() && !HBCIProperties.checkAccountCRC(blz,kn))
          throw new ApplicationException(i18n.tr("Ung�ltige BLZ/Kontonummer. Bitte pr�fen Sie Ihre Eingaben."));
       
        haveAccount = true;
      }
      //
      //////////////////////////////////////////////////////////////////////////

      //////////////////////////////////////////////////////////////////////////
      // Auslaendische Bankverbindung
      String iban = this.getIban();
      String bic = this.getBic();
      String bank = this.getBank();
      if (iban != null && iban.length() > 0)
      {
        HBCIProperties.checkLength(iban, HBCIProperties.HBCI_IBAN_MAXLENGTH);
        HBCIProperties.checkChars(iban, HBCIProperties.HBCI_IBAN_VALIDCHARS);
        HBCIProperties.getIBAN(iban);
        haveAccount = true;
      }
      if (bic != null && bic.length() > 0)
      {
        HBCIProperties.checkBIC(bic);
      }
      if (bank != null && bank.length() > 0)
      {
        HBCIProperties.checkLength(bank, HBCIProperties.HBCI_FOREIGNTRANSFER_USAGE_MAXLENGTH);
      }
      //
      //////////////////////////////////////////////////////////////////////////

      if (!haveAccount)
        throw new ApplicationException("Geben Sie bitte eine Kontonummer/BLZ oder IBAN ein");
    }
    catch (RemoteException e)
    {
      Logger.error("error while checking empfaenger",e);
      throw new ApplicationException(i18n.tr("Fehler bei der Pr�fung des Empf�ngers"));
    }
  }
View Full Code Here

   */
  protected void deleteCheck() throws ApplicationException
  {
    try {
      if (isInitial())
        throw new ApplicationException(i18n.tr("Turnus ist Bestandteil der System-Daten und kann nicht gel�scht werden."));
    }
    catch (RemoteException e)
    {
      Logger.error("error in turnus deletCheck",e);
      throw new ApplicationException(i18n.tr("Fehler beim L�schen des Turnus"));
    }
  }
View Full Code Here

  protected void insertCheck() throws ApplicationException
  {
    try {

      if (getZeiteinheit() != Turnus.ZEITEINHEIT_MONATLICH && getZeiteinheit() != Turnus.ZEITEINHEIT_WOECHENTLICH)
        throw new ApplicationException(i18n.tr("Bitte w�hlen Sie eine g�ltige Zeiteinheit aus"));

      if (getIntervall() < 1)
        throw new ApplicationException(i18n.tr("Bitte geben Sie ein g�ltiges Intervall ein"));

      // BUGZILLA #49 http://www.willuhn.de/bugzilla/show_bug.cgi?id=49
      if (getZeiteinheit() == Turnus.ZEITEINHEIT_MONATLICH && (getTag() < 1 || getTag() > 31) && getTag() != HBCIProperties.HBCI_LAST_OF_MONTH)
        throw new ApplicationException(i18n.tr("Bei monatlicher Zeiteinheit darf der Zahltag nicht kleiner als 1 und nicht gr��er als 31 sein. Angegebener Tag: {0}",""+getTag()));

      if (getZeiteinheit() == Turnus.ZEITEINHEIT_WOECHENTLICH && (getTag() < 1 || getTag() > 7))
        throw new ApplicationException(i18n.tr("Bitte w�hlen Sie einen g�ltigen Wochentag"));
    }
    catch (RemoteException e)
    {
      Logger.error("error in turnus insertCheck",e);
      throw new ApplicationException(i18n.tr("Fehler beim Speichern des Turnus"));
    }
  }
View Full Code Here

  /**
   * @see de.willuhn.jameica.hbci.passports.rdh.keyformat.KeyFormat#createKey(java.io.File)
   */
  public RDHKey createKey(File file) throws ApplicationException, OperationCanceledException
  {
    throw new ApplicationException(i18n.tr("Das Erstellen von neuen Schl�sseln wird f�r dieses Format nicht unterst�tzt"));
  }
View Full Code Here

      case Platform.OS_WINDOWS:
        file = settings.getString("sizrdh.nativelib","hbci4java-sizrdh-win32.dll");;
        break;
    }
    if (file == null)
      throw new ApplicationException(res.getI18N().tr("SizRDH-Schl�sseldisketten werden f�r Ihr Betriebssystem nicht von Hibiscus unterst�tzt"));

    file = mf.getPluginDir() + File.separator + "lib" + File.separator + file;
    Logger.info("using sizrdh native lib " + file);
    return file;
  }
View Full Code Here

   * @see de.willuhn.jameica.gui.Action#handleAction(java.lang.Object)
   */
  public void handleAction(Object context) throws ApplicationException
  {
    if (context == null || !(context instanceof AuslandsUeberweisung))
      throw new ApplicationException(i18n.tr("Kein Auftrag angegeben"));

    try
    {
      final AuslandsUeberweisung u = (AuslandsUeberweisung) context;
     
      if (u.ausgefuehrt())
        throw new ApplicationException(i18n.tr("�berweisung wurde bereits ausgef�hrt"));

      if (u.isNewObject())
        u.store(); // wir speichern bei Bedarf selbst.

      Date termin = DateUtil.startOfDay(u.getTermin());
View Full Code Here

      return i18n.tr("{0}: SEPA-Dauerauftr�ge abrufen",kt.getLongName());
    }
    catch (RemoteException re)
    {
      Logger.error("unable to determine job name",re);
      throw new ApplicationException(i18n.tr("Auftragsbezeichnung nicht ermittelbar: {0}",re.getMessage()));
    }
  }
View Full Code Here

TOP

Related Classes of de.willuhn.util.ApplicationException

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.