@Override
    protected void addStageInformation(@Nonnull final SessionData data, Element command) {
        final Locale preferredLocale = SessionManager.getInstance().getLocaleForSession(data.getOwner());

        DataForm form = new DataForm(DataForm.Type.form);
        form.setTitle(LocaleUtils.getLocalizedString("commands.admin.group.addgroup.form.title", preferredLocale));
        form.addInstruction(LocaleUtils.getLocalizedString("commands.admin.group.addgroup.form.instruction", preferredLocale));

        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(LocaleUtils.getLocalizedString("commands.admin.group.addgroup.form.field.group.label", preferredLocale));
        field.setVariable("group");
        field.setRequired(true);

        field = form.addField();
        field.setType(FormField.Type.text_multi);
        field.setLabel(LocaleUtils.getLocalizedString("commands.admin.group.addgroup.form.field.desc.label", preferredLocale));
        field.setVariable("desc");

        field = form.addField();
        field.setType(FormField.Type.jid_multi);
        field.setLabel(LocaleUtils.getLocalizedString("commands.admin.group.addgroup.form.field.members.label", preferredLocale));
        field.setVariable("members");

        field = form.addField();
        field.setType(FormField.Type.list_single);
        field.setLabel(LocaleUtils.getLocalizedString("commands.admin.group.addgroup.form.field.showinroster.label", preferredLocale));
        field.setVariable("showInRoster");
        field.addValue("nobody");
        field.addOption(LocaleUtils.getLocalizedString("commands.admin.group.addgroup.form.field.showinroster.option.nobody.label", preferredLocale), "nobody");
        field.addOption(LocaleUtils.getLocalizedString("commands.admin.group.addgroup.form.field.showinroster.option.everybody.label", preferredLocale), "everybody");
        field.addOption(LocaleUtils.getLocalizedString("commands.admin.group.addgroup.form.field.showinroster.option.onlygroup.label", preferredLocale), "onlyGroup");
        field.addOption(LocaleUtils.getLocalizedString("commands.admin.group.addgroup.form.field.showinroster.option.spefgroups.label", preferredLocale), "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(LocaleUtils.getLocalizedString("commands.admin.group.addgroup.form.field.displayname.label", preferredLocale));
        field.setVariable("displayName");

        // Add the form to the command
        command.add(form.getElement());
    }
Command that allows to create and configure new groups.

@author Gaston Dombiak
xmppserver/src/main/java/org/jivesoftware/openfire/commands/admin/group/AddGroup.java