Codota Logo
Form.getFormFrom
Code IndexAdd Codota to your IDE (free)

How to use
getFormFrom
method
in
org.jivesoftware.smackx.xdata.Form

Best Java code snippets using org.jivesoftware.smackx.xdata.Form.getFormFrom (Showing top 9 results out of 315)

  • Common ways to obtain Form
private void myMethod () {
Form f =
  • Codota IconStanza packet;Form.getFormFrom(packet)
  • Codota IconMultiUserChat multiUserChat;multiUserChat.getConfigurationForm()
  • Codota IconDataForm.Type type;new Form(type)
  • Smart code suggestions by Codota
}
origin: igniterealtime/Smack

private String getItemsToSearch() {
  StringBuilder buf = new StringBuilder();
  if (form == null) {
    form = Form.getFormFrom(this);
  }
  if (form == null) {
    return "";
  }
  for (FormField field : form.getFields()) {
    String name = field.getVariable();
    String value = getSingleValue(field);
    if (value.trim().length() > 0) {
      buf.append('<').append(name).append('>').append(value).append("</").append(name).append('>');
    }
  }
  return buf.toString();
}
origin: igniterealtime/Smack

/**
 * Returns the number of offline messages for the user of the connection.
 *
 * @return the number of offline messages for the user of the connection.
 * @throws XMPPErrorException If the user is not allowed to make this request or the server does
 *                       not support offline message retrieval.
 * @throws NoResponseException if there was no response from the server.
 * @throws NotConnectedException
 * @throws InterruptedException
 */
public int getMessageCount() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
  DiscoverInfo info = ServiceDiscoveryManager.getInstanceFor(connection).discoverInfo(null,
      namespace);
  Form extendedInfo = Form.getFormFrom(info);
  if (extendedInfo != null) {
    String value = extendedInfo.getField("number_of_messages").getFirstValue();
    return Integer.parseInt(value);
  }
  return 0;
}
origin: igniterealtime/Smack

/**
 * Returns the form for all search fields supported by the search service.
 *
 * @param con           the current XMPPConnection.
 * @param searchService the search service to use. (ex. search.jivesoftware.com)
 * @return the search form received by the server.
 * @throws XMPPErrorException
 * @throws NoResponseException
 * @throws NotConnectedException
 * @throws InterruptedException
 */
public Form getSearchForm(XMPPConnection con, DomainBareJid searchService) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
  UserSearch search = new UserSearch();
  search.setType(IQ.Type.get);
  search.setTo(searchService);
  IQ response = con.createStanzaCollectorAndSend(search).nextResultOrThrow();
  return Form.getFormFrom(response);
}
origin: igniterealtime/Smack

/**
 * Returns the Form to use for searching transcripts. It is unlikely that the server
 * will change the form (without a restart) so it is safe to keep the returned form
 * for future submissions.
 *
 * @param serviceJID the address of the workgroup service.
 * @return the Form to use for searching transcripts.
 * @throws XMPPErrorException
 * @throws NoResponseException
 * @throws NotConnectedException
 * @throws InterruptedException
 */
public Form getSearchForm(DomainBareJid serviceJID) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException  {
  TranscriptSearch search = new TranscriptSearch();
  search.setType(IQ.Type.get);
  search.setTo(serviceJID);
  TranscriptSearch response = connection.createStanzaCollectorAndSend(
          search).nextResultOrThrow();
  return Form.getFormFrom(response);
}
origin: igniterealtime/Smack

/**
 * Returns the room's configuration form that the room's owner can use or <tt>null</tt> if
 * no configuration is possible. The configuration form allows to set the room's language,
 * enable logging, specify room's type, etc..
 *
 * @return the Form that contains the fields to complete together with the instrucions or
 * <tt>null</tt> if no configuration is possible.
 * @throws XMPPErrorException if an error occurs asking the configuration form for the room.
 * @throws NoResponseException if there was no response from the server.
 * @throws NotConnectedException
 * @throws InterruptedException
 */
public Form getConfigurationForm() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
  MUCOwner iq = new MUCOwner();
  iq.setTo(room);
  iq.setType(IQ.Type.get);
  IQ answer = connection.createStanzaCollectorAndSend(iq).nextResultOrThrow();
  return Form.getFormFrom(answer);
}
origin: igniterealtime/Smack

  /**
   * Returns the Form to use for all clients of a workgroup. It is unlikely that the server
   * will change the form (without a restart) so it is safe to keep the returned form
   * for future submissions.
   *
   * @return the Form to use for searching transcripts.
   * @throws XMPPErrorException
   * @throws NoResponseException
   * @throws NotConnectedException
   * @throws InterruptedException
   */
  public Form getWorkgroupForm() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
    WorkgroupForm workgroupForm = new WorkgroupForm();
    workgroupForm.setType(IQ.Type.get);
    workgroupForm.setTo(workgroupJID);

    WorkgroupForm response = connection.createStanzaCollectorAndSend(
            workgroupForm).nextResultOrThrow();
    return Form.getFormFrom(response);
  }
}
origin: igniterealtime/Smack

/**
 * Returns the room's registration form that an unaffiliated user, can use to become a member
 * of the room or <tt>null</tt> if no registration is possible. Some rooms may restrict the
 * privilege to register members and allow only room admins to add new members.<p>
 *
 * If the user requesting registration requirements is not allowed to register with the room
 * (e.g. because that privilege has been restricted), the room will return a "Not Allowed"
 * error to the user (error code 405).
 *
 * @return the registration Form that contains the fields to complete together with the
 * instrucions or <tt>null</tt> if no registration is possible.
 * @throws XMPPErrorException if an error occurs asking the registration form for the room or a
 * 405 error if the user is not allowed to register with the room.
 * @throws NoResponseException if there was no response from the server.
 * @throws NotConnectedException
 * @throws InterruptedException
 */
public Form getRegistrationForm() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
  Registration reg = new Registration();
  reg.setType(IQ.Type.get);
  reg.setTo(room);
  IQ result = connection.createStanzaCollectorAndSend(reg).nextResultOrThrow();
  return Form.getFormFrom(result);
}
origin: igniterealtime/Smack

String pubsub = null;
form = Form.getFormFrom(info);
if (form != null) {
  FormField descField = form.getField("muc#roominfo_description");
origin: igniterealtime/Smack

assertNotNull("Message not found", msg2);
Form formToRespond = Form.getFormFrom(msg2);
assertNotNull(formToRespond);
assertNotNull(formToRespond.getField("name"));
assertNotNull("Message not found", msg3);
completedForm = Form.getFormFrom(msg3);
assertNotNull(completedForm);
assertNotNull(completedForm.getField("name"));
org.jivesoftware.smackx.xdataFormgetFormFrom

Javadoc

Returns a new ReportedData if the stanza is used for gathering data and includes an extension that matches the elementName and namespace "x","jabber:x:data".

Popular methods of Form

  • createAnswerForm
    Returns a new Form to submit the completed values. The new Form will include all the fields of the o
  • setAnswer
    Sets a new Object value to a given form's field. In fact, the object representation (i.e. #toString)
  • <init>
    Creates a new Form that will wrap an existing DataForm. The wrapped DataForm must be used for gather
  • addField
    Adds a new field to complete as part of the form.
  • getDataFormToSend
    Returns a DataForm that serves to send this Form to the server. If the form is of type submit, it ma
  • getField
    Returns the field of the form whose variable matches the specified variable. The fields of type FIXE
  • getFields
    Returns a List of the fields that are part of the form.
  • setDefaultAnswer
    Sets the default value as the value of a given form's field. The field whose variable matches the re
  • getInstructions
    Returns the instructions that explain how to fill out the form and what the form is about.
  • getType
    Returns the meaning of the data within the context. The data could be part of a form to fill out, a
  • hasField
    Check if a field with the given variable exists.
  • isFormType
    Returns true if the form is a form to fill out.
  • hasField,
  • isFormType,
  • isSubmitType,
  • setInstructions,
  • setTitle,
  • validateThatFieldIsText

Popular in Java

  • Finding current android device location
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • setContentView (Activity)
  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • IOException (java.io)
    Signals that an I/O exception of some sort has occurred. This class is the general class of exceptio
  • PrintStream (java.io)
    A PrintStream adds functionality to another output stream, namely the ability to print representatio
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • KeyStore (java.security)
    This class represents an in-memory collection of keys and certificates. It manages two types of entr
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now