Search in sources :

Example 76 with FormField

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

the class GetUsersPresence method addStageInformation.

@Override
protected void addStageInformation(SessionData data, Element command) {
    DataForm form = new DataForm(DataForm.Type.form);
    form.setTitle("Requesting Presence of Active Users");
    form.addInstruction("Fill out this form to request the active users presence of this service.");
    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_single);
    field.setLabel("Maximum number of items to return");
    field.setVariable("max_items");
    field.addOption("25", "25");
    field.addOption("50", "50");
    field.addOption("75", "75");
    field.addOption("100", "100");
    field.addOption("150", "150");
    field.addOption("200", "200");
    field.addOption("None", "none");
    // Add the form to the command
    command.add(form.getElement());
}
Also used : DataForm(org.xmpp.forms.DataForm) FormField(org.xmpp.forms.FormField)

Example 77 with FormField

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

the class AddGroup method addStageInformation.

@Override
protected void addStageInformation(SessionData data, Element command) {
    DataForm form = new DataForm(DataForm.Type.form);
    form.setTitle("Create new group");
    form.addInstruction("Fill out this form to create a new 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);
    field = form.addField();
    field.setType(FormField.Type.text_multi);
    field.setLabel("Description");
    field.setVariable("desc");
    field = form.addField();
    field.setType(FormField.Type.jid_multi);
    field.setLabel("Initial members");
    field.setVariable("members");
    field = form.addField();
    field.setType(FormField.Type.list_single);
    field.setLabel("Shared group visibility");
    field.setVariable("showInRoster");
    field.addValue("nobody");
    field.addOption("Disable sharing group in rosters", "nobody");
    field.addOption("Show group in all users' rosters", "everybody");
    field.addOption("Show group in group members' rosters", "onlyGroup");
    field.addOption("Show group to members' rosters of these groups", "spefgroups");
    field.setRequired(true);
    field = form.addField();
    field.setType(FormField.Type.list_multi);
    field.setVariable("groupList");
    for (Group group : GroupManager.getInstance().getGroups()) {
        field.addOption(group.getName(), group.getName());
    }
    field = form.addField();
    field.setType(FormField.Type.text_single);
    field.setLabel("Group Display Name");
    field.setVariable("displayName");
    // Add the form to the command
    command.add(form.getElement());
}
Also used : Group(org.jivesoftware.openfire.group.Group) DataForm(org.xmpp.forms.DataForm) FormField(org.xmpp.forms.FormField)

Example 78 with FormField

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

the class GetListGroupUsers method addStageInformation.

@Override
protected void addStageInformation(SessionData data, Element command) {
    DataForm form = new DataForm(DataForm.Type.form);
    form.setTitle("Requesting List of Group Members");
    form.addInstruction("Fill out this form to request list of group members and admins.");
    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 79 with FormField

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

the class GroupMemberAdded method addStageInformation.

@Override
protected void addStageInformation(SessionData data, Element command) {
    DataForm form = new DataForm(DataForm.Type.form);
    form.setTitle("Dispatching a group member added event.");
    form.addInstruction("Fill out this form to dispatch a group member added 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");
    field.setVariable("groupName");
    field.setRequired(true);
    field = form.addField();
    field.setType(FormField.Type.text_single);
    field.setLabel("Member");
    field.setVariable("member");
    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 80 with FormField

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

the class UserDeleting method addStageInformation.

@Override
protected void addStageInformation(SessionData data, Element command) {
    DataForm form = new DataForm(DataForm.Type.form);
    form.setTitle("Dispatching a user deleting event.");
    form.addInstruction("Fill out this form to dispatch a user deleting 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 is being deleted");
    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)

Aggregations

FormField (org.xmpp.forms.FormField)92 DataForm (org.xmpp.forms.DataForm)80 Element (org.dom4j.Element)21 JID (org.xmpp.packet.JID)13 IQ (org.xmpp.packet.IQ)7 HashSet (java.util.HashSet)6 ClientSession (org.jivesoftware.openfire.session.ClientSession)6 ArrayList (java.util.ArrayList)4 UserNotFoundException (org.jivesoftware.openfire.user.UserNotFoundException)4 ParseException (java.text.ParseException)3 Date (java.util.Date)3 UnauthorizedException (org.jivesoftware.openfire.auth.UnauthorizedException)3 Group (org.jivesoftware.openfire.group.Group)3 Test (org.junit.Test)3 List (java.util.List)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