Examples of DataForm


Examples of com.caucho.xmpp.data.DataForm

        return mucOwner;
      }

      if (XMLStreamReader.START_ELEMENT == tag
          && "jabber:x:data".equals(in.getNamespaceURI())) {
        DataForm form = (DataForm) in.readValue();

        mucOwner = new MucOwnerFormQuery(form);
      }
      else if (XMLStreamReader.START_ELEMENT == tag
               && "destroy".equals(in.getLocalName())) {
View Full Code Here

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

       
        ServiceCollector serviceCollector = new ServiceCollector();
        serviceCollector.addInfoRequestListener(new InfoRequestListener() {
            public List<InfoElement> getInfosFor(InfoRequest request) throws ServiceDiscoveryRequestException {

                DataForm form = new DataForm();
                form.setTitle("formtitle");
                form.setType(DataForm.Type.form);

                List<InfoElement> infoElements = new ArrayList<InfoElement>();
                infoElements.add(new Feature("TEST:NAMESPACE"));
                infoElements.add(new Identity("testCat", "testType"));
                infoElements.add(new InfoDataForm(form));
View Full Code Here

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

        ServiceCollector serviceCollector = new ServiceCollector();
        serviceCollector.addInfoRequestListener(new InfoRequestListener() {
            public List<InfoElement> getInfosFor(InfoRequest request) throws ServiceDiscoveryRequestException {

                DataForm form = new DataForm();
                form.setTitle("formtitle");
                form.setType(DataForm.Type.form);

                List<InfoElement> infoElements = new ArrayList<InfoElement>();
                infoElements.add(new Feature("TEST:NAMESPACE"));
                infoElements.add(new Identity("testCat", "testType"));
                infoElements.add(new InfoDataForm(form));
View Full Code Here

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

        this.requestor = requestor;
        this.nick = nick;
    }
   
    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

Examples of org.jivesoftware.smackx.packet.DataForm

                        }
                    }
                } else if (elementName.equals("feature")) {
                } else if (elementName.equals("x") && namespace.equals("jabber:x:data")) {
                    DataFormProvider dataFormProvider = new DataFormProvider();
                    DataForm dataForm = (DataForm)dataFormProvider.parseExtension(parser);
                    feature = new StreamInitiation.Feature(dataForm.getType());
                    feature.setDataForm(dataForm);
                }
            } else if (eventType == XmlPullParser.END_TAG && elementName.equals("si")) {
                done = true;
            }
View Full Code Here

Examples of org.jivesoftware.smackx.packet.DataForm

  private void showResults( SearchIQ results ){
    Hashtable<String,String> columns = new Hashtable<String,String>();
    Vector<Object> rowData = new Vector<Object>();
    Iterator extensions = results.getExtensions();
    while( extensions.hasNext() ){
      DataForm dataForm = (DataForm)extensions.next();
      ReportedData rData = dataForm.getReportedData();
      Iterator fields = rData.getFields();
      while( fields.hasNext() ){
        FormField fField = (FormField)fields.next();
        columns.put( fField.getVariable(), fField.getLabel() );
      }
     
      Iterator items = dataForm.getItems();
      while( items.hasNext() ){
        DataForm.Item item = (DataForm.Item)items.next();
        int a = 0;
        String [] strArray = new String[ columns.size() ];
        Iterator field = item.getFields();
View Full Code Here

Examples of org.xmpp.forms.DataForm

                                    // <prompt>xxx</prompt>
            }
          } else if(element.getNamespaceURI().equals("jabber:iq:register")) {
            Map<String, Object> registration = getRegistration(iq.getFrom());
            if(iq.getType() == IQ.Type.get) {
              DataForm form = new DataForm(DataForm.Type.form);
              form.setTitle("Enter Your LFS Username");
              form.addInstruction("Enter Your LFS Username");
              FormField username = form.addField();
              username.setVariable("username");
              username.setLabel("LFS Username");
              username.setType(FormField.Type.text_single);
              username.setRequired(true);
              username.setDescription("Your LFS Username");
              childResult.add(form.getElement());
              childResult.addElement("instructions").addText("Enter Your LFS Username");
              Element username_element = childResult.addElement("username");
              if(registration != null) {
                username_element.setText((String) registration.get("username"));
                username.addValue(registration.get("username"));
              }
            } else if(iq.getType() == IQ.Type.set) {
              String username = null;
              DataForm form = (DataForm)iq.getExtension(DataForm.ELEMENT_NAME,DataForm.NAMESPACE);
              if(form != null) {
                List<FormField> fields = form.getFields();
                for(FormField field : fields) {
                  if(!field.getVariable().equals("username")) continue;
                  List<String> vals = field.getValues();
                  if(vals != null && vals.size() > 0)
                    username = vals.get(0);
View Full Code Here

Examples of org.xmpp.forms.DataForm

        note.setText("Operation finished successfully");
    }

    @Override
  protected void addStageInformation(SessionData data, Element command) {
        DataForm form = new DataForm(DataForm.Type.form);
        form.setTitle("Adding a user");
        form.addInstruction("Fill out this form to add a user.");

        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.jid_single);
        field.setLabel("The Jabber ID for the account to be added");
        field.setVariable("accountjid");
        field.setRequired(true);

        field = form.addField();
        field.setType(FormField.Type.text_private);
        field.setLabel("The password for this account");
        field.setVariable("password");

        field = form.addField();
        field.setType(FormField.Type.text_private);
        field.setLabel("Retype password");
        field.setVariable("password-verify");

        field = form.addField();
        field.setType(FormField.Type.text_single);
        field.setLabel("Email address");
        field.setVariable("email");

        field = form.addField();
        field.setType(FormField.Type.text_single);
        field.setLabel("Given name");
        field.setVariable("given_name");

        field = form.addField();
        field.setType(FormField.Type.text_single);
        field.setLabel("Family name");
        field.setVariable("surname");

        // Add the form to the command
        command.add(form.getElement());
    }
View Full Code Here

Examples of org.xmpp.forms.DataForm

        note.setText("Operation finished successfully");
    }

    @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());
    }
View Full Code Here

Examples of org.xmpp.forms.DataForm

        note.setText("Operation finished successfully");
    }

    @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());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.