{
    "content": [
        {
            "type": "text",
            "text": "# Net::Jabber::Data (perldoc)\n\n## NAME\n\nNet::Jabber::Data - Jabber Data Library\n\n## SYNOPSIS\n\nNet::Jabber::Data is a companion to the Net::Jabber::XDB module. It\nprovides the user a simple interface to set and retrieve all\nparts of a Jabber XDB Data.\n\n## DESCRIPTION\n\nNet::Jabber::Data differs from the other modules in that its behavior\nand available functions are based off of the XML namespace that is\nset in it.  The current list of supported namespaces is:\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **METHODS** (2 subsections)\n- **CUSTOM NAMESPACES**\n- **AUTHOR**\n- **COPYRIGHT**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Net::Jabber::Data",
        "section": "",
        "mode": "perldoc",
        "summary": "Net::Jabber::Data - Jabber Data Library",
        "synopsis": "Net::Jabber::Data is a companion to the Net::Jabber::XDB module. It\nprovides the user a simple interface to set and retrieve all\nparts of a Jabber XDB Data.",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 58,
                "subsections": []
            },
            {
                "name": "METHODS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "Retrieval functions",
                        "lines": 13
                    },
                    {
                        "name": "Creation functions",
                        "lines": 49
                    }
                ]
            },
            {
                "name": "CUSTOM NAMESPACES",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "COPYRIGHT",
                "lines": 3,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "Net::Jabber::Data - Jabber Data Library\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "Net::Jabber::Data is a companion to the Net::Jabber::XDB module. It\nprovides the user a simple interface to set and retrieve all\nparts of a Jabber XDB Data.\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "Net::Jabber::Data differs from the other modules in that its behavior\nand available functions are based off of the XML namespace that is\nset in it.  The current list of supported namespaces is:\n\njabber:iq:auth\njabber:iq:auth:0k\njabber:iq:register\njabber:iq:roster\n\nFor more information on what these namespaces are for, visit\nhttp://www.jabber.org and browse the Jabber Programmers Guide.\n\nEach of these namespaces provide Net::Jabber::Data with the functions\nto access the data.  By using the AUTOLOAD function the functions for\neach namespace is used when that namespace is active.\n\nTo access a Data object you must create an XDB object and use the\naccess functions there to get to the Data.  To initialize the XDB with\na Jabber <xdb/> you must pass it the XML::Stream hash from the\nNet::Jabber::Client module.\n\nmy $xdb = new Net::Jabber::XDB(%hash);\n\nThere has been a change from the old way of handling the callbacks.\nYou no longer have to do the above yourself, a Net::Jabber::XDB\nobject is passed to the callback function for the message.  Also,\nthe first argument to the callback functions is the session ID from\nXML::Streams.  There are some cases where you might want this\ninformation, like if you created a Client that connects to two servers\nat once, or for writing a mini server.\n\nuse Net::Jabber qw(Client);\n\nsub xdbCB {\nmy ($sid,$XDB) = @;\nmy $data = $XDB->GetData();\n.\n.\n.\n}\n\nYou now have access to all of the retrieval functions available for\nthat namespace.\n\nTo create a new xdb to send to the server:\n\nuse Net::Jabber;\n\nmy $xdb = new Net::Jabber::XDB();\n$data = $xdb->NewData(\"jabber:iq:auth\");\n\nNow you can call the creation functions for the Data as defined in the\nproper namespaces.  See below for the general <data/> functions, and\nin each data module for those functions.\n\nFor more information about the array format being passed to the\nCallBack please read the Net::Jabber::Client documentation.\n",
                "subsections": []
            },
            "METHODS": {
                "content": "",
                "subsections": [
                    {
                        "name": "Retrieval functions",
                        "content": "GetXMLNS() - returns a string with the namespace of the data that\nthe <xdb/> contains.\n\n$xmlns  = $XDB->GetXMLNS();\n\nGetData() - since the behavior of this module depends on the\nnamespace, a Data object may contain Data objects.\nThis helps to leverage code reuse by making children\nbehave in the same manner.  More than likely this\nfunction will never be called.\n\n@data = GetData()\n"
                    },
                    {
                        "name": "Creation functions",
                        "content": "SetXMLNS(string) - sets the xmlns of the <data/> to the string.\n\n$data->SetXMLNS(\"jabber:xdb:roster\");\n\nIn an effort to make maintaining this document easier, I am not going to go into full detail on\neach of these functions. Rather I will present the functions in a list with a type in the first\ncolumn to show what they return, or take as arguments. Here is the list of types I will use:\n\nstring  - just a string\narray   - array of strings\nflag    - this means that the specified child exists in the\nXML <child/> and acts like a flag.  get will return\n0 or 1.\nJID     - either a string or Net::Jabber::JID object.\nobjects - creates new objects, or returns an array of\nobjects.\nspecial - this is a special case kind of function.  Usually\njust by calling Set() with no arguments it will\ndefault the value to a special value, like OS or time.\nSometimes it will modify the value you set, like\nin jabber:xdb:version SetVersion() the function\nadds on the Net::Jabber version to the string\njust for advertisement purposes. =)\nmaster  - this desribes a function that behaves like the\nSetMessage() function in Net::Jabber::Message.\nIt takes a hash and sets all of the values defined,\nand the Set returns a hash with the values that\nare defined in the object.\n\njabber:iq:\nType     Get               Set               Defined\n=======  ================  ================  ==================\n\njabber:iq:\nType     Get               Set               Defined\n=======  ================  ================  ==================\n\njabber:iq:\nType     Get               Set               Defined\n=======  ================  ================  ==================\n\njabber:iq:\nType     Get               Set               Defined\n=======  ================  ================  ==================\n\njabber:iq:\nType     Get               Set               Defined\n=======  ================  ================  ==================\n"
                    }
                ]
            },
            "CUSTOM NAMESPACES": {
                "content": "Part of the flexability of this module is that you can define your own\nnamespace.  For more information on this topic, please read the\nNet::Jabber::Namespaces man page.\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "By Ryan Eatmon in May of 2001 for http://jabber.org..\n",
                "subsections": []
            },
            "COPYRIGHT": {
                "content": "This module is free software; you can redistribute it and/or modify it under the same terms as\nPerl itself.\n",
                "subsections": []
            }
        }
    }
}