Package net.sf.chellow.monad

Examples of net.sf.chellow.monad.XmlTree


    for (Provider provider : (List<Provider>) Hiber
        .session()
        .createQuery(
            "from Provider provider where provider.role.code = :roleCode order by provider.participant.code")
        .setCharacter("roleCode", MarketRole.MOP).list()) {
      source.appendChild(provider.toXml(doc, new XmlTree("participant")));
    }
    source.appendChild(MonadDate.getMonthsXml(doc));
    source.appendChild(MonadDate.getDaysXml(doc));
    source.appendChild(MonadDate.getHoursXml(doc));
    source.appendChild(HhStartDate.getHhMinutesXml(doc));
View Full Code Here


  @SuppressWarnings("unchecked")
  public Node toXml(Document doc, XmlTree tree) throws HttpException {
    Node node = toXml(doc);

    for (String methodBase : tree.keySet()) {
      XmlTree nestedTree = tree.get(methodBase);
      String methodName = "get"
          + methodBase.substring(0, 1).toUpperCase()
          + methodBase.substring(1);

      try {
View Full Code Here

  @Override
  public void httpGet(Invocation inv) throws HttpException {
    Document doc = MonadUtils.newSourceDocument();
    Element source = doc.getDocumentElement();

    source.appendChild(toXml(doc, new XmlTree("participant").put("role")));
    inv.sendOk(doc);
  }
View Full Code Here

  @SuppressWarnings("unchecked")
  protected Document document() throws HttpException {
    Document doc = MonadUtils.newSourceDocument();
    Element source = doc.getDocumentElement();
    source.appendChild(toXml(doc, new XmlTree("party", new XmlTree(
        "participant"))));
    for (Party party : (List<Party>) Hiber
        .session()
        .createQuery(
            "from Party party where party.role.code = :roleCode order by party.participant.code")
        .setCharacter("roleCode", MarketRole.HHDC).list()) {
      source.appendChild(party.toXml(doc, new XmlTree("participant")));
    }
    source.appendChild(new MonadDate().toXml(doc));
    source.appendChild(MonadDate.getMonthsXml(doc));
    source.appendChild(MonadDate.getDaysXml(doc));
    return doc;
View Full Code Here

  private Document document() throws HttpException {
    Document doc = MonadUtils.newSourceDocument();
    Element source = doc.getDocumentElement();
    Element billsElement = toXml(doc);
    source.appendChild(billsElement);
    billsElement.appendChild(batch.toXml(doc, new XmlTree("contract",
        new XmlTree("party"))));
    for (Bill bill : (List<Bill>) Hiber
        .session()
        .createQuery(
            "from Bill bill where bill.batch = :batch order by bill.reference, bill.startDate.date")
        .setEntity("batch", batch).list()) {
      billsElement.appendChild(bill.toXml(doc,
          new XmlTree("supply").put("type")));
    }
    for (BillType type : (List<BillType>) Hiber.session()
        .createQuery("from BillType type order by type.code").list()) {
      source.appendChild(type.toXml(doc));
    }
View Full Code Here

  public void httpGet(Invocation inv) throws HttpException {
    Document doc = MonadUtils.newSourceDocument();
    Element source = doc.getDocumentElement();

    source.appendChild(toXml(doc, new XmlTree("dno").put("voltageLevel")));
    inv.sendOk(doc);
  }
View Full Code Here

  @SuppressWarnings("unchecked")
  private Document document() throws HttpException {
    Document doc = MonadUtils.newSourceDocument();
    Element source = doc.getDocumentElement();
    Element billElement = (Element) toXml(doc,
        new XmlTree("batch", new XmlTree("contract", new XmlTree(
            "party"))).put("type").put("reads").put("supply"));
    source.appendChild(billElement);
    source.appendChild(MonadDate.getMonthsXml(doc));
    source.appendChild(MonadDate.getDaysXml(doc));
    source.appendChild(MonadDate.getHoursXml(doc));
View Full Code Here

    for (Provider provider : (List<Provider>) Hiber
        .session()
        .createQuery(
            "from Provider provider where provider.role.code = :roleCode order by provider.participant.code")
        .setCharacter("roleCode", MarketRole.SUPPLIER).list()) {
      source.appendChild(provider.toXml(doc, new XmlTree("participant")));
    }
    source.appendChild(MonadDate.getMonthsXml(doc));
    source.appendChild(MonadDate.getDaysXml(doc));
    source.appendChild(MonadDate.getHoursXml(doc));
    source.appendChild(HhStartDate.getHhMinutesXml(doc));
View Full Code Here

    for (Provider provider : (List<Provider>) Hiber
        .session()
        .createQuery(
            "from Provider provider where provider.role.code = :roleCode order by provider.participant.code")
        .setCharacter("roleCode", MarketRole.HHDC).list()) {
      source.appendChild(provider.toXml(doc, new XmlTree("participant")));
    }
    source.appendChild(MonadDate.getMonthsXml(doc));
    source.appendChild(MonadDate.getDaysXml(doc));
    source.appendChild(MonadDate.getHoursXml(doc));
    source.appendChild(HhStartDate.getHhMinutesXml(doc));
View Full Code Here

  private Document document() throws HttpException {
    Document doc = MonadUtils.newSourceDocument();
    Element source = doc.getDocumentElement();
    Element supplyElement = (Element) toXml(
        doc,
        new XmlTree("generations", new XmlTree("mpans", new XmlTree(
            "core").put("llfc", new XmlTree("voltageLevel"))))
            .put("source").put("generatorType").put("gspGroup"));
    source.appendChild(supplyElement);
    for (Source supplySource : (List<Source>) Hiber.session()
        .createQuery("from Source source order by source.code").list()) {
      source.appendChild(supplySource.toXml(doc));
View Full Code Here

TOP

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

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.