Package net.sf.chellow.monad

Examples of net.sf.chellow.monad.MonadMessage


        HhDatum.insert(hhData.iterator(), halt);
        Hiber.close();
      }

      if (shouldHalt()) {
        errors.add(new MonadMessage("The import has been cancelled."));
      } else {
        source.appendChild(new MonadMessage(
            "The file has been imported successfully.").toXml(doc));
      }
    } catch (HttpException e) {
      String message = e.getMessage();
      if (message == null) {
        message = HttpException.getStackTraceString(e);
      }
      errors.add(new MonadMessage(message));
      // errors.add(new MonadMessage(
      // "There are errors that need to be corrected before "
      // + "the file can be imported."));
      if (csvElement != null) {
        source.appendChild(csvElement);
      }
      if (e instanceof InternalException) {
        ChellowLogger.getLogger().log(Level.SEVERE,
            "From header import process", e);
      }
    } catch (Throwable e) {
      if (csvElement != null) {
        source.appendChild(csvElement);
      }
      errors.add(new MonadMessage("Programmer Exception: "
          + HttpException.getStackTraceString(e)));
      ChellowLogger.getLogger().log(Level.SEVERE,
          "From header import process", e);
    } finally {
      source.setAttribute("line-number", String.valueOf(lineNumber));
View Full Code Here


      for (Map<RawBill, String> billMap : failedBills) {
        for (Entry<RawBill, String> entry : billMap.entrySet()) {
          Element billRawElement = (Element) entry.getKey().toXml(
              doc, new XmlTree("registerReads").put("type"));
          failedElement.appendChild(billRawElement);
          billRawElement.appendChild(new MonadMessage(entry
              .getValue()).toXml(doc));
        }
      }
      for (RawBill billRaw : successfulBills) {
        successfulElement.appendChild(billRaw.toXml(doc, new XmlTree(
            "registerReads").put("type")));
      }
    }
    for (String message : messages) {
      importElement.appendChild(new MonadMessage(message).toXml(doc));
    }
    return importElement;
  }
View Full Code Here

        Element source = doc.getDocumentElement();

        source.appendChild(toXml(doc));
        delete();
        Hiber.commit();
        source.appendChild(new MonadMessage(
            "Supply deleted successfully.").toXml(doc));
        inv.sendSeeOther(Chellow.SUPPLIES_INSTANCE.getEditUri());
      } else {
        String name = inv.getString("name");
        Long sourceId = inv.getLong("source-id");
View Full Code Here

        .list()) {
      source.appendChild(party.toXml(doc,
          new XmlTree("participant").put("role")));
    }
    if (message != null) {
      source.appendChild(new MonadMessage(message).toXml(doc));
    }
    return doc;
  }
View Full Code Here

        e.setDocument(doc(inv));
        throw e;
      }
      Document doc = doc(inv);
      Element docElement = doc.getDocumentElement();
      docElement.appendChild(new MonadMessage(
          "HH data deleted successfully.").toXml(doc));
      inv.sendOk(doc);
    } else if (inv.hasParameter("insert")) {
      Date startDate = inv.getDateTime("start");
      BigDecimal value = inv.getBigDecimal("value");
View Full Code Here

    if (inv.hasParameter("delete")) {
      delete();
      Hiber.commit();
      Document doc = document();
      Element source = doc.getDocumentElement();
      source.appendChild(new MonadMessage(
          "This register read has been successfully deleted.")
          .toXml(doc));
      inv.sendOk(doc);
    } else {
      String tprCode = inv.getString("tpr-code");
View Full Code Here

        Site.deleteSite(this);
      } catch (HttpException e) {
        e.setDocument(doc);
        throw e;
      }
      source.appendChild(new MonadMessage("Site deleted successfully.")
          .toXml(doc));
      Hiber.commit();
      inv.sendOk(doc);
    } else if (inv.hasParameter("update")) {
      String code = inv.getString("code");
View Full Code Here

  private Document document(String message) throws HttpException {
    Document doc = MonadUtils.newSourceDocument();
    Element source = doc.getDocumentElement();
    source.appendChild(toXml(doc));
    if (message != null) {
      source.appendChild(new MonadMessage(message).toXml(doc));
    }
    return doc;
  }
View Full Code Here

    Document doc = MonadUtils.newSourceDocument();
    Element source = doc.getDocumentElement();
    source.appendChild(toXml(doc, new XmlTree("channel", new XmlTree(
        "supplyGeneration", new XmlTree("supply")))));
    if (message != null) {
      source.appendChild(new MonadMessage(message).toXml(doc));
    }
    return doc;
  }
View Full Code Here

TOP

Related Classes of net.sf.chellow.monad.MonadMessage

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.