Package org.dom4j.dom

Examples of org.dom4j.dom.DOMDocument.createElementNS()


      org.dom4j.Element pubsubElement = result.setChildElement("pubsub", "http://jabber.org/protocol/pubsub");
      org.dom4j.Element itemsElement = pubsubElement.addElement("items");
      itemsElement.addAttribute("node", PEPActivityHandler.NODE);

      for (ActivityEntry entry : activities) {
        Element entryElement = (Element) domDocument.appendChild(domDocument.createElementNS(Atom.NAMESPACE, Atom.ENTRY_ELEMENT));
        writer.write(entry, entryElement);
        domDocument.removeChild(entryElement);
        org.dom4j.Element itemElement = itemsElement.addElement("item");
        itemElement.addAttribute("id", entry.getId());
        itemElement.add((org.dom4j.Element) entryElement);
View Full Code Here


     
      // Prepare the result packet
      VCard4DomWriter writer = new DefaultVCard4DomWriter();
      DOMDocument domDocument = new DOMDocument();
      IQ result = IQ.createResultIQ(packet);
      Element query = (Element) domDocument.appendChild(domDocument.createElementNS(NAMESPACE, NAME));
      if (profile != null) {
        writer.toElement(profile, query);
      } else {
        query.appendChild(domDocument.createElementNS(VCard4.NAMESPACE, VCard4.VCARD_ELEMENT));
      }
View Full Code Here

      IQ result = IQ.createResultIQ(packet);
      Element query = (Element) domDocument.appendChild(domDocument.createElementNS(NAMESPACE, NAME));
      if (profile != null) {
        writer.toElement(profile, query);
      } else {
        query.appendChild(domDocument.createElementNS(VCard4.NAMESPACE, VCard4.VCARD_ELEMENT));
      }
      result.setChildElement((org.dom4j.Element) query);
     
      // Return and send the result packet
      return result;
View Full Code Here

     
      // Prepare the result packet
      RelationDomWriter writer = new DefaultRelationDomWriter();
      DOMDocument domDocument = new DOMDocument();
      IQ result = IQ.createResultIQ(packet);
      Element query = (Element) domDocument.appendChild(domDocument.createElementNS(NAMESPACE, NAME));
      for (Relation relation : relations) {
        writer.toElement(relation,query);
      }
      result.setChildElement((org.dom4j.Element) query);
      // Return and send the result packet
View Full Code Here

      org.dom4j.Element pubsubElement = result.setChildElement("pubsub", "http://jabber.org/protocol/pubsub");
      org.dom4j.Element itemsElement = pubsubElement.addElement("items");
      itemsElement.addAttribute("node", PEPActivityHandler.NODE);

      for (ActivityMessage message : messages) {
        Element entryElement = (Element) domDocument.appendChild(domDocument.createElementNS(Atom.NAMESPACE, Atom.ENTRY_ELEMENT));
        writer.write(message.getActivity(), entryElement);
        domDocument.removeChild(entryElement);
        org.dom4j.Element itemElement = itemsElement.addElement("item");
        itemElement.addAttribute("id", message.getActivity().getId());
        itemElement.add((org.dom4j.Element) entryElement);
View Full Code Here

    em.close();
  }

  private void notify(String localJID, Relation relation) {
    final DOMDocument domDocument = new DOMDocument();
    final Element entryElement = (Element) domDocument.appendChild(domDocument.createElementNS(Onesocialweb.NAMESPACE, Onesocialweb.RELATION_ELEMENT));
    final RelationDomWriter writer = new DefaultRelationDomWriter();
    writer.write(relation, entryElement);
    domDocument.removeChild(entryElement);

    final Message message = new Message();
View Full Code Here

    final List<Subscription> subscriptions = getSubscribers(fromJID);
  //  final Roster roster = XMPPServer.getInstance().getRosterManager().getRoster(new JID(fromJID).getNode());
    final DOMDocument domDocument = new DOMDocument();

    // Prepare the message
    final Element entryElement = (Element) domDocument.appendChild(domDocument.createElementNS(Atom.NAMESPACE, Atom.ENTRY_ELEMENT));
    writer.write(entry, entryElement);
    domDocument.removeChild(entryElement);

    final Message message = new Message();
    message.setFrom(fromJID);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.