Package com.calclab.emite.xep.dataforms

Examples of com.calclab.emite.xep.dataforms.Form.addInstruction()


        // This is not a extended search. Try to create a form
        // with returned fields
        final SearchFields fieldResults = processFieldsResults(session.getCurrentUserURI(), iq.getQuery(XmppNamespaces.SEARCH));
        final Form form = new Form(Form.Type.form);
        form.addInstruction(fieldResults.getInstructions());
        for (final String fieldName : fieldResults.getFieldNames()) {
          final Field field = new Field();
          field.setType(Field.Type.TEXT_SINGLE);
          field.setVar(fieldName);
          form.addField(field);
View Full Code Here


  @Test
  public void testTypeForm() {
    final Form form = new Form(Form.Type.form).WithField(new Field(FieldType.TEXT_SINGLE).Var("search_request").Required(true));
    form.setTitle("Joogle Search");
    form.addInstruction("Fill out this form to search for information!");
    session.send(form);
    session.verifySent(parse(XEP_0004_5_2_SAMPLE_6).x());
  }

  private Form parse(final String xml) {
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.