Package org.apache.vysper.xmpp.stanza.dataforms

Examples of org.apache.vysper.xmpp.stanza.dataforms.Field


    public DataForm createForm() {
        DataForm form = new DataForm();
        form.setType(submit);
        form.setTitle(TITLE);
        form.addInstruction(INSTRUCTION);
        form.addField(new Field("FORM_TYPE", HIDDEN, null, NamespaceURIs.XEP0045_MUC_REQUEST));
        form.addField(new Field("muc#jid", TEXT_SINGLE, "User ID", requestor.getFullQualifiedName()));
        form.addField(new Field("muc#roomnick", TEXT_SINGLE, "Room Nickname", nick));
        form.addField(new Field("muc#request_allow", Type.BOOLEAN, "Grant voice to this person?", "false"));
       
        return form;
    }
View Full Code Here


        }
    }

    protected XMLElement sendForm() {
        final DataForm dataForm = createFormForm("Adding a User", "Fill out this form to add a user.");
        dataForm.addField(new Field("The Jabber ID for the account to be added", Field.Type.JID_SINGLE, "accountjid"));
        dataForm.addField(new Field("The password for this account", Field.Type.TEXT_PRIVATE, "password"));
        dataForm.addField(new Field("Retype password", Field.Type.TEXT_PRIVATE, "password-verify"));
        dataForm.addField(new Field("Email address", Field.Type.TEXT_SINGLE, "email"));
        dataForm.addField(new Field("Given name", Field.Type.TEXT_SINGLE, "given_name"));
        dataForm.addField(new Field("Family name", Field.Type.TEXT_SINGLE, "surname"));

        return DATA_FORM_ENCODER.getXML(dataForm);
    }
View Full Code Here

    public XMLElement process(List<XMLElement> commandElements, List<Note> notes) {
        final long sessionCount = resourceRegistry.getSessionCount();

        final DataForm dataForm = createResultForm();
        dataForm.addField(new Field("The number of online users", Field.Type.FIXED, "onlineusersnum", Long.toString(sessionCount)));

        isExecuting = false;

        return DATA_FORM_ENCODER.getXML(dataForm);
    }
View Full Code Here

    }

    protected XMLElement sendForm() {
        final DataForm dataForm = createFormForm("Changing a User Password", "Fill out this form to change a user&apos;s password.");
        if (constrainedJID == null) {
            dataForm.addField(new Field("The Jabber ID whose password will be changed.", Field.Type.JID_SINGLE, "accountjid"));
        } else {
            dataForm.addField(new Field("The Jabber ID whose password will be changed.", Field.Type.JID_SINGLE, "accountjid", constrainedJID.getFullQualifiedName()));
        }
        dataForm.addField(new Field("The new password for this account", Field.Type.TEXT_PRIVATE, "password"));
        dataForm.addField(new Field("Retype new password", Field.Type.TEXT_PRIVATE, "password-verify"));

        return DATA_FORM_ENCODER.getXML(dataForm);
    }
View Full Code Here

    public boolean isNextAllowed() {
        return isNextAllowed;
    }

    protected void addFormTypeField(DataForm dataForm) {
        dataForm.addField(new Field("", Field.Type.HIDDEN, Field.FORM_TYPE, NamespaceURIs.XEP0133_SERVICE_ADMIN));
    }
View Full Code Here

        Occupant requestor = room.addOccupant(OCCUPANT2_JID, "Nick 2");
        requestor.setRole(Role.Visitor);
       
        DataForm form = new DataForm();
        form.setType(submit);
        form.addField(new Field(null, null, "FORM_TYPE", NamespaceURIs.XEP0045_MUC_REQUEST));

        form.addField(new Field("Requested role", TEXT_SINGLE, "muc#role", "participant"));

        sendMessage(OCCUPANT2_JID, ROOM1_JID, new DataFormEncoder().getXML(form));

        Stanza request = occupant1Queue.getNext();
        assertMessageStanza(ROOM1_JID, OCCUPANT1_JID, null, new VoiceRequestForm(OCCUPANT2_JID, "Nick 2").createFormXML(), request);
View Full Code Here

        Occupant requestor = room.addOccupant(OCCUPANT2_JID, "Nick 2");
        requestor.setRole(Role.Visitor);
       
        DataForm form = new DataForm();
        form.setType(submit);
        form.addField(new Field(null, null, "FORM_TYPE", NamespaceURIs.XEP0045_MUC_REQUEST));
        form.addField(new Field(null, null, "muc#role", "participant"));
        form.addField(new Field(null, null, "muc#jid", OCCUPANT2_JID.getFullQualifiedName()));
        form.addField(new Field(null, null, "muc#roomnick", "Nick 2"));
        form.addField(new Field(null, null, "muc#request_allow", "true"));

        sendMessage(OCCUPANT1_JID, ROOM1_JID, new DataFormEncoder().getXML(form));

        assertEquals(Role.Participant, room.findOccupantByNick("Nick 2").getRole());
View Full Code Here

TOP

Related Classes of org.apache.vysper.xmpp.stanza.dataforms.Field

Copyright © 2018 www.massapicom. 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.