void addRevisionInfoRelation(Element anyMapping) { anyMapping.add( cloneAndSetupRevisionInfoRelationMapping() ); }
private void sendPacketError(Element stanza, PacketError.Condition condition) { Element reply = stanza.createCopy(); reply.addAttribute("type", "error"); reply.addAttribute("to", stanza.attributeValue("from")); reply.addAttribute("from", stanza.attributeValue("to")); reply.add(new PacketError(condition).getElement()); deliver(reply.asXML()); }
private String createSessionRestartResponse() { final Element response = DocumentHelper.createElement( QName.get( "body", "http://jabber.org/protocol/httpbind" ) ); response.addNamespace("stream", "http://etherx.jabber.org/streams"); final Element features = response.addElement("stream:features"); for (Element feature : getAvailableStreamFeaturesElements()) { features.add(feature); } return response.asXML(); }
public Sent(Forwarded forwarded) { super("sent", "urn:xmpp:carbons:2"); element.add(forwarded.getElement()); } }
/** * Returns an Element with the privacy list XML representation. * * @return an Element with the privacy list XML representation. */ public Element asElement() { //Element listElement = DocumentFactory.getInstance().createDocument().addElement("list"); Element listElement = DocumentFactory.getInstance().createDocument() .addElement("list", "jabber:iq:privacy"); listElement.addAttribute("name", getName()); // Add the list items to the result for (PrivacyItem item : items) { listElement.add(item.asElement()); } return listElement; }
public Received(Forwarded forwarded) { super("received", "urn:xmpp:carbons:2"); element.add(forwarded.getElement()); } }
/** * Sets the wrapped stanza by this Route packet. ClientRoute packets may have a single child * element. This is a convenience method to avoid manipulating this underlying packet's * Element instance directly. * * @param childElement the child element. */ public void setChildElement(Element childElement) { for (Iterator i=element.elementIterator(); i.hasNext(); ) { element.remove((Element)i.next()); } element.add(childElement); }
/** * Adds mapping of the id of a related entity to the given xml mapping, prefixing the id with the given prefix. * * @param xmlMapping Mapping, to which to add the xml. * @param prefix Prefix for the names of properties which will be prepended to properties that form the id. * @param columnNameIterator Iterator over the column names that will be used for properties that form the id. * @param relatedIdMapping Id mapping data of the related entity. */ @SuppressWarnings({"unchecked"}) private void addRelatedToXmlMapping( Element xmlMapping, String prefix, MetadataTools.ColumnNameIterator columnNameIterator, IdMappingData relatedIdMapping) { final Element properties = (Element) relatedIdMapping.getXmlRelationMapping().clone(); MetadataTools.prefixNamesInPropertyElement( properties, prefix, columnNameIterator, true, true ); for ( Element idProperty : (java.util.List<Element>) properties.elements() ) { xmlMapping.add( (Element) idProperty.clone() ); } }
private void updatePresence() { if (extendedInformation != null && presence != null) { // Remove any previous extendedInformation, then re-add it. Element mucUser = presence.getElement().element(QName.get("x", "http://jabber.org/protocol/muc#user")); if (mucUser != null) { // Remove any previous extendedInformation, then re-add it. presence.getElement().remove(mucUser); } Element exi = extendedInformation.createCopy(); presence.getElement().add(exi); } }
@Override public void execute(SessionData data, Element command) { DataForm form = new DataForm(DataForm.Type.result); FormField field = form.addField(); field.setType(FormField.Type.hidden); field.setVariable("FORM_TYPE"); field.addValue("http://jabber.org/protocol/admin"); List<String> accounts = data.getData().get("accountjids"); if (accounts != null && accounts.size() > 0) { populateResponseFields(form, accounts); } command.add(form.getElement()); }
/** * Generate a conflict packet to indicate that the nickname being requested/used is already in * use by another user. * * @param packet the packet to be bounced. */ void sendErrorPacket(IQ packet, PacketError.Condition error, Element pubsubError) { IQ reply = IQ.createResultIQ(packet); reply.setChildElement(packet.getChildElement().createCopy()); reply.setError(error); if (pubsubError != null) { // Add specific pubsub error if available reply.getError().getElement().add(pubsubError); } router.route(reply); }
@Override public void execute(SessionData data, Element command) { DataForm form = new DataForm(DataForm.Type.result); FormField field = form.addField(); field.setType(FormField.Type.hidden); field.setVariable("FORM_TYPE"); field.addValue("http://jabber.org/protocol/admin"); field = form.addField(); field.setLabel(getLabel()); field.setVariable("onlineuserssessionsnum"); SessionManager sessionManager = SessionManager.getInstance(); field.addValue(sessionManager.getUserSessionsCount(false)); command.add(form.getElement()); }
@Override protected void addStageInformation(SessionData data, Element command) { DataForm form = new DataForm(DataForm.Type.form); form.setTitle("Deleting a user"); form.addInstruction("Fill out this form to delete 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 deleted"); field.setVariable("accountjid"); field.setRequired(true); // Add the form to the command command.add(form.getElement()); }
@Override protected void addStageInformation(SessionData data, Element command) { DataForm form = new DataForm(DataForm.Type.form); form.setTitle("Dispatching a vCard deleting event."); form.addInstruction("Fill out this form to dispatch a vCard deleting 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 who's vCard is being deleted"); field.setVariable("username"); field.setRequired(true); // Add the form to the command command.add(form.getElement()); }
@Override protected void addStageInformation(SessionData data, Element command) { DataForm form = new DataForm(DataForm.Type.form); form.setTitle("Delete group"); form.addInstruction("Fill out this form to delete a group."); 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("Group Name"); field.setVariable("group"); field.setRequired(true); // Add the form to the command command.add(form.getElement()); }
@Override protected void addStageInformation(SessionData data, Element command) { DataForm form = new DataForm(DataForm.Type.form); form.setTitle("Dispatching a user deleting event."); form.addInstruction("Fill out this form to dispatch a user deleting 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 is being deleted"); field.setVariable("username"); field.setRequired(true); // Add the form to the command command.add(form.getElement()); }
@Override protected void addStageInformation(SessionData data, Element command) { DataForm form = new DataForm(DataForm.Type.form); form.setTitle("Dispatching a vCard created event."); form.addInstruction("Fill out this form to dispatch a vCard created 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 who's vCard was created"); field.setVariable("username"); field.setRequired(true); // Add the form to the command command.add(form.getElement()); }
@Override protected void addStageInformation(SessionData data, Element command) { DataForm form = new DataForm(DataForm.Type.form); form.setTitle("Requesting List of Group Members"); form.addInstruction("Fill out this form to request list of group members and admins."); 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("Group Name"); field.setVariable("group"); field.setRequired(true); // Add the form to the command command.add(form.getElement()); }
@Override protected void addStageInformation(SessionData data, Element command) { DataForm form = new DataForm(DataForm.Type.form); form.setTitle("Dispatching a group created event."); form.addInstruction("Fill out this form to dispatch a group created 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 that was created"); field.setVariable("groupName"); field.setRequired(true); // Add the form to the command command.add(form.getElement()); }
@Override protected void addStageInformation(SessionData data, Element command) { DataForm form = new DataForm(DataForm.Type.form); form.setTitle("Dispatching a vCard updated event."); form.addInstruction("Fill out this form to dispatch a vCard 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 who's vCard was updated"); field.setVariable("username"); field.setRequired(true); // Add the form to the command command.add(form.getElement()); }