本文整理汇总了Java中org.xmpp.forms.DataForm类的典型用法代码示例。如果您正苦于以下问题:Java DataForm类的具体用法?Java DataForm怎么用?Java DataForm使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DataForm类属于org.xmpp.forms包,在下文中一共展示了DataForm类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: deserialze
import org.xmpp.forms.DataForm; //导入依赖的package包/类
public <T> T deserialze(DefaultJSONParser parser, Type type,Object fieldName) {
Element element = super.deserialze(parser, type,fieldName);
if (element == null) {
return null;
}
String nameSpace = null;
if (element.getNamespace() != null) {
nameSpace = element.getNamespace().getText();
}
if ("x".equals(element.getName()) && "jabber:x:data".equals(nameSpace)) {
DataForm form = new DataForm(element);
return (T) form;
}
return null;
}
开发者ID:blusechen,项目名称:venus,代码行数:20,代码来源:DataFormDeserializer.java
示例2: createObject
import org.xmpp.forms.DataForm; //导入依赖的package包/类
protected DataForm createObject(Element element) {
if (element == null) {
return null;
}
String nameSpace = null;
if (element.getNamespace() != null) {
nameSpace = element.getNamespace().getText();
}
if ("x".equals(element.getName()) && "jabber:x:data".equals(nameSpace)) {
DataForm form = new DataForm(element);
return form;
}
return null;
}
开发者ID:blusechen,项目名称:venus,代码行数:18,代码来源:DataFormObjectSerializer.java
示例3: addStageInformation
import org.xmpp.forms.DataForm; //导入依赖的package包/类
@Override
protected void addStageInformation(SessionData data, Element command) {
DataForm form = new DataForm(DataForm.Type.form);
form.setTitle("Dispatching a group admin added event.");
form.addInstruction("Fill out this form to dispatch a group admin 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("The username of the new admin");
field.setVariable("admin");
field.setRequired(true);
// Add the form to the command
command.add(form.getElement());
}
开发者ID:coodeer,项目名称:g3server,代码行数:27,代码来源:GroupAdminAdded.java
示例4: populateResponseFields
import org.xmpp.forms.DataForm; //导入依赖的package包/类
private void populateResponseFields(DataForm form, List<String> accounts) {
FormField jidField = form.addField();
jidField.setVariable("accountjids");
FormField emailField = form.addField();
emailField.setVariable("email");
FormField nameField = form.addField();
nameField.setVariable("name");
UserManager manager = UserManager.getInstance();
for(String account : accounts) {
User user;
try {
JID jid = new JID(account);
user = manager.getUser(jid.getNode());
}
catch (Exception ex) {
continue;
}
jidField.addValue(account);
emailField.addValue(user.getEmail());
nameField.addValue(user.getName());
}
}
开发者ID:idwanglu2010,项目名称:openfire,代码行数:27,代码来源:UserProperties.java
示例5: addStageInformation
import org.xmpp.forms.DataForm; //导入依赖的package包/类
@Override
protected void addStageInformation(SessionData data, Element command) {
DataForm form = new DataForm(DataForm.Type.form);
form.setTitle("Delete members or admins from a group");
form.addInstruction("Fill out this form to delete members or admins from 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);
field = form.addField();
field.setType(FormField.Type.jid_multi);
field.setLabel("Users");
field.setVariable("users");
field.setRequired(true);
// Add the form to the command
command.add(form.getElement());
}
开发者ID:igniterealtime,项目名称:Openfire,代码行数:27,代码来源:DeleteGroupUsers.java
示例6: execute
import org.xmpp.forms.DataForm; //导入依赖的package包/类
@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());
}
开发者ID:igniterealtime,项目名称:Openfire,代码行数:18,代码来源:UserProperties.java
示例7: addStageInformation
import org.xmpp.forms.DataForm; //导入依赖的package包/类
@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());
}
开发者ID:coodeer,项目名称:g3server,代码行数:21,代码来源:GroupCreated.java
示例8: processAuthorizationAnswer
import org.xmpp.forms.DataForm; //导入依赖的package包/类
private void processAuthorizationAnswer(PubSubService service, DataForm authForm, Message message) {
String nodeID = authForm.getField("pubsub#node").getValues().get(0);
String subID = authForm.getField("pubsub#subid").getValues().get(0);
String allow = authForm.getField("pubsub#allow").getValues().get(0);
boolean approved;
if ("1".equals(allow) || "true".equals(allow)) {
approved = true;
}
else if ("0".equals(allow) || "false".equals(allow)) {
approved = false;
}
else {
// Unknown allow value. Ignore completed form
Log.warn("Invalid allow value in completed authorization form: " + message.toXML());
return;
}
// Approve or cancel the pending subscription to the node
Node node = service.getNode(nodeID);
if (node != null) {
NodeSubscription subscription = node.getSubscription(subID);
if (subscription != null) {
node.approveSubscription(subscription, approved);
}
}
}
开发者ID:coodeer,项目名称:g3server,代码行数:26,代码来源:PubSubEngine.java
示例9: addStageInformation
import org.xmpp.forms.DataForm; //导入依赖的package包/类
@Override
protected void addStageInformation(SessionData data, Element command) {
DataForm form = new DataForm(DataForm.Type.form);
form.setTitle("Changing a User Password");
form.addInstruction("Fill out this form to change a user\u2019s password.");
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 this account");
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.setRequired(true);
// Add the form to the command
command.add(form.getElement());
}
开发者ID:igniterealtime,项目名称:Openfire,代码行数:27,代码来源:ChangeUserPassword.java
示例10: addStageInformation
import org.xmpp.forms.DataForm; //导入依赖的package包/类
@Override
protected void addStageInformation(SessionData data, Element command) {
DataForm form = new DataForm(DataForm.Type.form);
form.setTitle("Changing the share secret");
form.addInstruction("Fill out this form to change the shared secret.");
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_private);
field.setLabel("The old shared secret");
field.setVariable("oldSharedSecret");
field.setRequired(true);
field = form.addField();
field.setType(FormField.Type.text_private);
field.setLabel("The new shared secret");
field.setVariable("newSharedSecret");
field.setRequired(true);
// Add the form to the command
command.add(form.getElement());
}
开发者ID:coodeer,项目名称:g3server,代码行数:27,代码来源:ChangeSharedSecret.java
示例11: addStageInformation
import org.xmpp.forms.DataForm; //导入依赖的package包/类
@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());
}
开发者ID:igniterealtime,项目名称:Openfire,代码行数:21,代码来源:DeleteUser.java
示例12: addStageInformation
import org.xmpp.forms.DataForm; //导入依赖的package包/类
@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());
}
开发者ID:igniterealtime,项目名称:Openfire,代码行数:21,代码来源:GroupCreated.java
示例13: addStageInformation
import org.xmpp.forms.DataForm; //导入依赖的package包/类
@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());
}
开发者ID:igniterealtime,项目名称:Openfire,代码行数:21,代码来源:VCardCreated.java
示例14: execute
import org.xmpp.forms.DataForm; //导入依赖的package包/类
@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());
}
开发者ID:coodeer,项目名称:g3server,代码行数:18,代码来源:GetNumberUserSessions.java
示例15: addStageInformation
import org.xmpp.forms.DataForm; //导入依赖的package包/类
@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());
}
开发者ID:igniterealtime,项目名称:Openfire,代码行数:21,代码来源:UserDeleting.java
示例16: addStageInformation
import org.xmpp.forms.DataForm; //导入依赖的package包/类
@Override
protected void addStageInformation(SessionData data, Element command) {
DataForm form = new DataForm(DataForm.Type.form);
form.setTitle("Dispatching a group member removed event.");
form.addInstruction("Fill out this form to dispatch a group member removed 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());
}
开发者ID:igniterealtime,项目名称:Openfire,代码行数:27,代码来源:GroupMemberRemoved.java
示例17: addStageInformation
import org.xmpp.forms.DataForm; //导入依赖的package包/类
@Override
protected void addStageInformation(SessionData data, Element command) {
DataForm form = new DataForm(DataForm.Type.form);
form.setTitle("Dispatching a group admin removed event.");
form.addInstruction("Fill out this form to dispatch a group admin removed 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("The username of the admin");
field.setVariable("admin");
field.setRequired(true);
// Add the form to the command
command.add(form.getElement());
}
开发者ID:igniterealtime,项目名称:Openfire,代码行数:27,代码来源:GroupAdminRemoved.java
示例18: addStageInformation
import org.xmpp.forms.DataForm; //导入依赖的package包/类
@Override
protected void addStageInformation(SessionData data, Element command) {
DataForm form = new DataForm(DataForm.Type.form);
form.setTitle("Dispatching a deleting group event.");
form.addInstruction("Fill out this form to dispatch a deleting group 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 is being deleted");
field.setVariable("groupName");
field.setRequired(true);
// Add the form to the command
command.add(form.getElement());
}
开发者ID:coodeer,项目名称:g3server,代码行数:21,代码来源:GroupDeleting.java
示例19: addStageInformation
import org.xmpp.forms.DataForm; //导入依赖的package包/类
@Override
protected void addStageInformation(SessionData data, Element command) {
DataForm form = new DataForm(DataForm.Type.form);
form.setTitle("Dispatching a group admin added event.");
form.addInstruction("Fill out this form to dispatch a group admin 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("The username of the new admin");
field.setVariable("admin");
field.setRequired(true);
// Add the form to the command
command.add(form.getElement());
}
开发者ID:igniterealtime,项目名称:Openfire,代码行数:27,代码来源:GroupAdminAdded.java
示例20: execute
import org.xmpp.forms.DataForm; //导入依赖的package包/类
@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("onlineusersnum");
// Make sure that we are only counting based on bareJIDs and not fullJIDs
Collection<ClientSession> sessions = SessionManager.getInstance().getSessions();
Set<String> users = new HashSet<String>(sessions.size());
for (ClientSession session : sessions) {
users.add(session.getAddress().toBareJID());
}
field.addValue(users.size());
command.add(form.getElement());
}
开发者ID:idwanglu2010,项目名称:openfire,代码行数:23,代码来源:GetNumberOnlineUsers.java
注:本文中的org.xmpp.forms.DataForm类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论