/** * Create a decorator from an existing {@link Form} for node configuration. * Typically, this can be used to create a decorator for an answer form * by using the result of {@link #createAnswerForm()} as the input parameter. * * @param nodeConfigForm */ public ConfigureForm(Form nodeConfigForm) { super(nodeConfigForm.getDataFormToSend()); }
public SubscribeForm(Form subscribeOptionsForm) { super(subscribeOptionsForm.getDataFormToSend()); }
/** * Sets the form of the current stage. This should be used when setting a * response. It could be a form to fill out the information needed to go to * the next stage or the result of an execution. * * @param form the form of the current stage to fill out or the result of the * execution. */ protected void setForm(Form form) { data.setForm(form.getDataFormToSend()); }
@Override public CharSequence toXML(String enclosingNamespace) { if (configForm == null) { return super.toXML(enclosingNamespace); } else { StringBuilder builder = new StringBuilder("<"); builder.append(getElementName()); if (getNode() != null) { builder.append(" node='"); builder.append(getNode()); builder.append("'>"); } else builder.append('>'); builder.append(configForm.getDataFormToSend().toXML(null)); builder.append("</"); builder.append(getElementName() + '>'); return builder.toString(); } }
private JoinQueuePacket(EntityBareJid workgroup, Form answerForm, Jid userID) { super("join-queue", "http://jabber.org/protocol/workgroup"); this.userID = userID; setTo(workgroup); setType(IQ.Type.set); form = answerForm.getDataFormToSend(); addExtension(form); }
/** * Sends the completed configuration form to the server. The room will be configured * with the new settings defined in the form. * * @param form the form with the new settings. * @throws XMPPErrorException if an error occurs setting the new rooms' configuration. * @throws NoResponseException if there was no response from the server. * @throws NotConnectedException * @throws InterruptedException */ public void sendConfigurationForm(Form form) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { MUCOwner iq = new MUCOwner(); iq.setTo(room); iq.setType(IQ.Type.set); iq.addExtension(form.getDataFormToSend()); connection.createStanzaCollectorAndSend(iq).nextResultOrThrow(); }
/** * Sends the completed registration form to the server. After the user successfully submits * the form, the room may queue the request for review by the room admins or may immediately * add the user to the member list by changing the user's affiliation from "none" to "member.<p> * * If the desired room nickname is already reserved for that room, the room will return a * "Conflict" error to the user (error code 409). If the room does not support registration, * it will return a "Service Unavailable" error to the user (error code 503). * * @param form the completed registration form. * @throws XMPPErrorException if an error occurs submitting the registration form. In particular, a * 409 error can occur if the desired room nickname is already reserved for that room; * or a 503 error can occur if the room does not support registration. * @throws NoResponseException if there was no response from the server. * @throws NotConnectedException * @throws InterruptedException */ public void sendRegistrationForm(Form form) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { Registration reg = new Registration(); reg.setType(IQ.Type.set); reg.setTo(room); reg.addExtension(form.getDataFormToSend()); connection.createStanzaCollectorAndSend(reg).nextResultOrThrow(); }
/** * Sends the filled out answer form to be sent and queried by the search service. * * @param con the current XMPPConnection. * @param searchForm the <code>Form</code> to send for querying. * @param searchService the search service to use. (ex. search.jivesoftware.com) * @return ReportedData the data found from the query. * @throws XMPPErrorException * @throws NoResponseException * @throws NotConnectedException * @throws InterruptedException */ public ReportedData sendSearchForm(XMPPConnection con, Form searchForm, DomainBareJid searchService) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { UserSearch search = new UserSearch(); search.setType(IQ.Type.set); search.setTo(searchService); search.addExtension(searchForm.getDataFormToSend()); IQ response = con.createStanzaCollectorAndSend(search).nextResultOrThrow(); return ReportedData.getReportedDataFrom(response); }
/** * Submits the completed form and returns the result of the transcript search. The result * will include all the data returned from the server so be careful with the amount of * data that the search may return. * * @param serviceJID the address of the workgroup service. * @param completedForm the filled out search form. * @return the result of the transcript search. * @throws XMPPErrorException * @throws NoResponseException * @throws NotConnectedException * @throws InterruptedException */ public ReportedData submitSearch(DomainBareJid serviceJID, Form completedForm) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { TranscriptSearch search = new TranscriptSearch(); search.setType(IQ.Type.get); search.setTo(serviceJID); search.addExtension(completedForm.getDataFormToSend()); TranscriptSearch response = connection.createStanzaCollectorAndSend( search).nextResultOrThrow(); return ReportedData.getReportedDataFrom(response); } }
data.setForm(form.getDataFormToSend());
msg.addExtension(formToSend.getDataFormToSend()); msg2.setBody("To enter a case please fill out this form and send it back to me"); msg2.addExtension(completedForm.getDataFormToSend());