Java 类org.jivesoftware.smackx.pubsub.ConfigureForm 实例源码

项目:mangosta-android    文件:XMPPSession.java   
public void createNodeToAllowComments(String blogPostId) {
    String nodeName = PublishCommentExtension.NODE + "/" + blogPostId;

    PubSubManager pubSubManager = PubSubManager.getInstance(XMPPSession.getInstance().getXMPPConnection());
    try {
        // create node
        ConfigureForm configureForm = new ConfigureForm(DataForm.Type.submit);
        configureForm.setPublishModel(PublishModel.open);
        configureForm.setAccessModel(AccessModel.open);
        Node node = pubSubManager.createNode(nodeName, configureForm);

        // subscribe to comments
        String myJIDString = getUser().toString();
        node.subscribe(myJIDString);
    } catch (SmackException.NoResponseException | XMPPException.XMPPErrorException | SmackException.NotConnectedException | InterruptedException e) {
        e.printStackTrace();
    }
}
项目:Smack    文件:ConfigEventProvider.java   
@Override
protected ConfigurationEvent createReturnExtension(String currentElement, String currentNamespace, Map<String, String> attMap, List<? extends ExtensionElement> content)
{
    if (content.size() == 0)
        return new ConfigurationEvent(attMap.get("node"));
    else
        return new ConfigurationEvent(attMap.get("node"), new ConfigureForm((DataForm)content.iterator().next()));
}
项目:Smack    文件:PubSubTestCase.java   
protected LeafNode getRandomPubnode(PubSubManager pubMgr, boolean persistItems, boolean deliverPayload) throws XMPPException
{
    ConfigureForm form = new ConfigureForm(FormType.submit);
    form.setPersistentItems(persistItems);
    form.setDeliverPayloads(deliverPayload);
    form.setAccessModel(AccessModel.open);
    return (LeafNode)pubMgr.createNode("/test/Pubnode" + System.currentTimeMillis(), form);
}
项目:EIM    文件:ConfigEventProvider.java   
@Override
protected PacketExtension createReturnExtension(String currentElement, String currentNamespace, Map<String, String> attMap, List<? extends PacketExtension> content)
{
    if (content.size() == 0)
        return new ConfigurationEvent(attMap.get("node"));
    else
        return new ConfigurationEvent(attMap.get("node"), new ConfigureForm((DataForm)content.iterator().next()));
}
项目:EIM    文件:NodeUtils.java   
/** 
 * Get a {@link ConfigureForm} from a packet.
 * 
 * @param packet
 * @param elem
 * @return The configuration form
 */
public static ConfigureForm getFormFromPacket(Packet packet, PubSubElementType elem)
{
    FormNode config = (FormNode)packet.getExtension(elem.getElementName(), elem.getNamespace().getXmlns());
    Form formReply = config.getForm();
    return new ConfigureForm(formReply);

}
项目:androidPN-client.    文件:ConfigEventProvider.java   
@Override
protected PacketExtension createReturnExtension(String currentElement, String currentNamespace, Map<String, String> attMap, List<? extends PacketExtension> content)
{
    if (content.size() == 0)
        return new ConfigurationEvent(attMap.get("node"));
    else
        return new ConfigurationEvent(attMap.get("node"), new ConfigureForm((DataForm)content.iterator().next()));
}
项目:androidPN-client.    文件:NodeUtils.java   
/** 
 * Get a {@link ConfigureForm} from a packet.
 * 
 * @param packet
 * @param elem
 * @return The configuration form
 */
public static ConfigureForm getFormFromPacket(Packet packet, PubSubElementType elem)
{
    FormNode config = (FormNode)packet.getExtension(elem.getElementName(), elem.getNamespace().getXmlns());
    Form formReply = config.getForm();
    return new ConfigureForm(formReply);

}
项目:xmppsupport_v2    文件:ConfigEventProvider.java   
@Override
protected PacketExtension createReturnExtension(String currentElement,
        String currentNamespace, Map<String, String> attMap,
        List<? extends PacketExtension> content) {
    if (content.size() == 0)
        return new ConfigurationEvent(attMap.get("node"));
    else
        return new ConfigurationEvent(attMap.get("node"),
                new ConfigureForm((DataForm) content.iterator().next()));
}
项目:xmppsupport_v2    文件:NodeUtils.java   
/**
 * Get a {@link ConfigureForm} from a packet.
 * 
 * @param packet
 * @param elem
 * @return The configuration form
 */
public static ConfigureForm getFormFromPacket(Packet packet,
        PubSubElementType elem) {
    FormNode config = (FormNode) packet.getExtension(elem.getElementName(),
            elem.getNamespace().getXmlns());
    Form formReply = config.getForm();
    return new ConfigureForm(formReply);

}
项目:java-bells    文件:ConfigEventProvider.java   
@Override
protected PacketExtension createReturnExtension(String currentElement, String currentNamespace, Map<String, String> attMap, List<? extends PacketExtension> content)
{
    if (content.size() == 0)
        return new ConfigurationEvent(attMap.get("node"));
    else
        return new ConfigurationEvent(attMap.get("node"), new ConfigureForm((DataForm)content.iterator().next()));
}
项目:java-bells    文件:NodeUtils.java   
/** 
 * Get a {@link ConfigureForm} from a packet.
 * 
 * @param packet
 * @param elem
 * @return The configuration form
 */
public static ConfigureForm getFormFromPacket(Packet packet, PubSubElementType elem)
{
    FormNode config = (FormNode)packet.getExtension(elem.getElementName(), elem.getNamespace().getXmlns());
    Form formReply = config.getForm();
    return new ConfigureForm(formReply);

}
项目:java-bells    文件:PubSubTestCase.java   
protected LeafNode getRandomPubnode(PubSubManager pubMgr, boolean persistItems, boolean deliverPayload) throws XMPPException
{
    ConfigureForm form = new ConfigureForm(FormType.submit);
    form.setPersistentItems(persistItems);
    form.setDeliverPayloads(deliverPayload);
    form.setAccessModel(AccessModel.open);
    return (LeafNode)pubMgr.createNode("/test/Pubnode" + System.currentTimeMillis(), form);
}
项目:telegraph    文件:ConfigEventProvider.java   
@Override
protected PacketExtension createReturnExtension(String currentElement, String currentNamespace, Map<String, String> attMap, List<? extends PacketExtension> content)
{
    if (content.size() == 0)
        return new ConfigurationEvent(attMap.get("node"));
    else
        return new ConfigurationEvent(attMap.get("node"), new ConfigureForm((DataForm)content.iterator().next()));
}
项目:telegraph    文件:NodeUtils.java   
/** 
 * Get a {@link ConfigureForm} from a packet.
 * 
 * @param packet
 * @param elem
 * @return The configuration form
 */
public static ConfigureForm getFormFromPacket(Packet packet, PubSubElementType elem)
{
    FormNode config = (FormNode)packet.getExtension(elem.getElementName(), elem.getNamespace().getXmlns());
    Form formReply = config.getForm();
    return new ConfigureForm(formReply);

}
项目:NewCommunication-Android    文件:ConfigEventProvider.java   
@Override
protected PacketExtension createReturnExtension(String currentElement, String currentNamespace, Map<String, String> attMap, List<? extends PacketExtension> content)
{
    if (content.size() == 0)
        return new ConfigurationEvent(attMap.get("node"));
    else
        return new ConfigurationEvent(attMap.get("node"), new ConfigureForm((DataForm)content.iterator().next()));
}
项目:NewCommunication-Android    文件:NodeUtils.java   
/** 
 * Get a {@link ConfigureForm} from a packet.
 * 
 * @param packet
 * @param elem
 * @return The configuration form
 */
public static ConfigureForm getFormFromPacket(Packet packet, PubSubElementType elem)
{
    FormNode config = (FormNode)packet.getExtension(elem.getElementName(), elem.getNamespace().getXmlns());
    Form formReply = config.getForm();
    return new ConfigureForm(formReply);

}
项目:Smack    文件:NodeUtils.java   
/** 
 * Get a {@link ConfigureForm} from a packet.
 * 
 * @param packet
 * @param elem
 * @return The configuration form
 */
public static ConfigureForm getFormFromPacket(Stanza packet, PubSubElementType elem)
{
    FormNode config = packet.getExtension(elem.getElementName(), elem.getNamespace().getXmlns());
    Form formReply = config.getForm();
    return new ConfigureForm(formReply);
}