Search in sources :

Example 6 with FormField

use of org.xmpp.forms.FormField in project Openfire by igniterealtime.

the class PacketsNotification method addStageInformation.

@Override
protected void addStageInformation(SessionData data, Element command) {
    DataForm form = new DataForm(DataForm.Type.form);
    form.setTitle("Receiving notification of packets activity");
    form.addInstruction("Fill out this form to configure packets to receive.");
    FormField field = form.addField();
    field.setType(FormField.Type.hidden);
    field.setVariable("FORM_TYPE");
    field.addValue("http://jabber.org/protocol/admin");
    field = form.addField();
    field.setType(FormField.Type.list_multi);
    field.setLabel("Type of packet");
    field.setVariable("packet_type");
    field.addOption("Presence", "presence");
    field.addOption("IQ", "iq");
    field.addOption("Message", "message");
    field.setRequired(true);
    field = form.addField();
    field.setType(FormField.Type.list_single);
    field.setLabel("Direction");
    field.setVariable("direction");
    field.addOption("Incoming", "incoming");
    field.addOption("Outgoing", "outgoing");
    field.setRequired(true);
    field = form.addField();
    field.setType(FormField.Type.list_single);
    field.setLabel("Processing time");
    field.setVariable("processed");
    field.addOption("Before processing", "false");
    field.addOption("After processing", "true");
    field.setRequired(true);
    // Add the form to the command
    command.add(form.getElement());
}
Also used : DataForm(org.xmpp.forms.DataForm) FormField(org.xmpp.forms.FormField)

Example 7 with FormField

use of org.xmpp.forms.FormField in project Openfire by igniterealtime.

the class DeleteGroup method addStageInformation.

@Override
protected void addStageInformation(SessionData data, Element command) {
    DataForm form = new DataForm(DataForm.Type.form);
    form.setTitle("Delete group");
    form.addInstruction("Fill out this form to delete a group.");
    FormField field = form.addField();
    field.setType(FormField.Type.hidden);
    field.setVariable("FORM_TYPE");
    field.addValue("http://jabber.org/protocol/admin");
    field = form.addField();
    field.setType(FormField.Type.text_single);
    field.setLabel("Group Name");
    field.setVariable("group");
    field.setRequired(true);
    // Add the form to the command
    command.add(form.getElement());
}
Also used : DataForm(org.xmpp.forms.DataForm) FormField(org.xmpp.forms.FormField)

Example 8 with FormField

use of org.xmpp.forms.FormField in project Openfire by igniterealtime.

the class GroupModified method addStageInformation.

@Override
protected void addStageInformation(SessionData data, Element command) {
    DataForm form = new DataForm(DataForm.Type.form);
    form.setTitle("Dispatching a group created event.");
    form.addInstruction("Fill out this form to dispatch a group created event.");
    FormField field = form.addField();
    field.setType(FormField.Type.hidden);
    field.setVariable("FORM_TYPE");
    field.addValue("http://jabber.org/protocol/admin");
    field = form.addField();
    field.setType(FormField.Type.text_single);
    field.setLabel("The group name of the group that was created");
    field.setVariable("groupName");
    field.setRequired(true);
    field.setType(FormField.Type.list_single);
    field.setLabel("Change type");
    field.setVariable("changeType");
    field.addOption("Name modified", "nameModified");
    field.addOption("Description modified", "descriptionModified");
    field.addOption("Property modified", "propertyModified");
    field.addOption("Property added", "propertyAdded");
    field.addOption("Property deleted", "propertyDeleted");
    field.addOption("Other", "other");
    field.setRequired(true);
    field = form.addField();
    field.setType(FormField.Type.text_single);
    field.setLabel("Original value");
    field.setVariable("originalValue");
    field = form.addField();
    field.setType(FormField.Type.text_single);
    field.setLabel("Name of the property");
    field.setVariable("propertyKey");
    // Add the form to the command
    command.add(form.getElement());
}
Also used : DataForm(org.xmpp.forms.DataForm) FormField(org.xmpp.forms.FormField)

Example 9 with FormField

use of org.xmpp.forms.FormField in project Openfire by igniterealtime.

the class UserCreated method addStageInformation.

@Override
protected void addStageInformation(SessionData data, Element command) {
    DataForm form = new DataForm(DataForm.Type.form);
    form.setTitle("Dispatching a user created event.");
    form.addInstruction("Fill out this form to dispatch a user created event.");
    FormField field = form.addField();
    field.setType(FormField.Type.hidden);
    field.setVariable("FORM_TYPE");
    field.addValue("http://jabber.org/protocol/admin");
    field = form.addField();
    field.setType(FormField.Type.text_single);
    field.setLabel("The username of the user that was created");
    field.setVariable("username");
    field.setRequired(true);
    // Add the form to the command
    command.add(form.getElement());
}
Also used : DataForm(org.xmpp.forms.DataForm) FormField(org.xmpp.forms.FormField)

Example 10 with FormField

use of org.xmpp.forms.FormField in project Openfire by igniterealtime.

the class UserModified method addStageInformation.

@Override
protected void addStageInformation(SessionData data, Element command) {
    DataForm form = new DataForm(DataForm.Type.form);
    form.setTitle("Dispatching a user updated event.");
    form.addInstruction("Fill out this form to dispatch a user updated event.");
    FormField field = form.addField();
    field.setType(FormField.Type.hidden);
    field.setVariable("FORM_TYPE");
    field.addValue("http://jabber.org/protocol/admin");
    field = form.addField();
    field.setType(FormField.Type.text_single);
    field.setLabel("The username of the user that was updated");
    field.setVariable("username");
    field.setRequired(true);
    field.setType(FormField.Type.list_single);
    field.setLabel("Change type");
    field.setVariable("changeType");
    field.addOption("Name modified", "nameModified");
    field.addOption("Email modified", "emailModified");
    field.addOption("Password modified", "passwordModified");
    field.addOption("Creation date modified", "creationDateModified");
    field.addOption("Modification date modified", "modificationDateModified");
    field.addOption("Property modified", "propertyModified");
    field.addOption("Property added", "propertyAdded");
    field.addOption("Property deleted", "propertyDeleted");
    field.addOption("Other", "other");
    field.setRequired(true);
    field = form.addField();
    field.setType(FormField.Type.text_single);
    field.setLabel("Original value");
    field.setVariable("originalValue");
    field = form.addField();
    field.setType(FormField.Type.text_single);
    field.setLabel("Name of the property");
    field.setVariable("propertyKey");
    // Add the form to the command
    command.add(form.getElement());
}
Also used : DataForm(org.xmpp.forms.DataForm) FormField(org.xmpp.forms.FormField)

Aggregations

FormField (org.xmpp.forms.FormField)76 DataForm (org.xmpp.forms.DataForm)67 Element (org.dom4j.Element)16 JID (org.xmpp.packet.JID)12 ArrayList (java.util.ArrayList)9 IQ (org.xmpp.packet.IQ)7 ClientSession (org.jivesoftware.openfire.session.ClientSession)6 Date (java.util.Date)4 List (java.util.List)4 UnauthorizedException (org.jivesoftware.openfire.auth.UnauthorizedException)3 Group (org.jivesoftware.openfire.group.Group)3 UserNotFoundException (org.jivesoftware.openfire.user.UserNotFoundException)3 ParseException (java.text.ParseException)2 HashSet (java.util.HashSet)2 Iterator (java.util.Iterator)2 CopyOnWriteArrayList (java.util.concurrent.CopyOnWriteArrayList)2 PacketException (org.jivesoftware.openfire.PacketException)2 GroupJID (org.jivesoftware.openfire.group.GroupJID)2 GroupNotFoundException (org.jivesoftware.openfire.group.GroupNotFoundException)2 MUCRoom (org.jivesoftware.openfire.muc.MUCRoom)2