Search in sources :

Example 1 with FormNode

use of org.jivesoftware.smackx.pubsub.FormNode in project ecf by eclipse.

the class NodeUtils method getFormFromPacket.

/**
 * Get a {@link ConfigureForm} from a packet.
 *
 * @param packet
 * @param elem
 * @return The configuration form
 */
public static ConfigureForm getFormFromPacket(Packet packet, PubSubElementType elem) {
    FormNode config = (FormNode) packet.getExtension(elem.getElementName(), elem.getNamespace().getXmlns());
    Form formReply = config.getForm();
    return new ConfigureForm(formReply);
}
Also used : FormNode(org.jivesoftware.smackx.pubsub.FormNode) Form(org.jivesoftware.smackx.Form) ConfigureForm(org.jivesoftware.smackx.pubsub.ConfigureForm) ConfigureForm(org.jivesoftware.smackx.pubsub.ConfigureForm)

Example 2 with FormNode

use of org.jivesoftware.smackx.pubsub.FormNode in project Smack by igniterealtime.

the class NodeUtils method getFormFromPacket.

/**
 * Get a {@link ConfigureForm} from a packet.
 *
 * @param packet TODO javadoc me please
 * @param elem TODO javadoc me please
 * @return The configuration form
 */
public static ConfigureForm getFormFromPacket(Stanza packet, PubSubElementType elem) {
    FormNode config = (FormNode) packet.getExtensionElement(elem.getElementName(), elem.getNamespace().getXmlns());
    DataForm dataForm = config.getForm();
    return new ConfigureForm(dataForm);
}
Also used : FormNode(org.jivesoftware.smackx.pubsub.FormNode) DataForm(org.jivesoftware.smackx.xdata.packet.DataForm) ConfigureForm(org.jivesoftware.smackx.pubsub.form.ConfigureForm)

Aggregations

FormNode (org.jivesoftware.smackx.pubsub.FormNode)2 Form (org.jivesoftware.smackx.Form)1 ConfigureForm (org.jivesoftware.smackx.pubsub.ConfigureForm)1 ConfigureForm (org.jivesoftware.smackx.pubsub.form.ConfigureForm)1 DataForm (org.jivesoftware.smackx.xdata.packet.DataForm)1