This is Info file pm.info, produced by Makeinfo version 1.68 from the input file bigpm.texi.  File: pm.info, Node: Net/Jabber/X, Next: Net/Jabber/X/AutoUpdate, Prev: Net/Jabber/Transport, Up: Module List Jabber X Module *************** NAME ==== Net::Jabber::X - Jabber X Module SYNOPSIS ======== Net::Jabber::X is a companion to the Net::Jabber module. It provides the user a simple interface to set and retrieve all parts of a Jabber X. DESCRIPTION =========== Net::Jabber::X differs from the other Net::Jabber::* modules in that the XMLNS of the query is split out into more submodules under X. For specifics on each module please view the documentation for each Net::Jabber::X::* module. The available modules are: Net::Jabber::X::AutoUpdate - Auto Update information Net::Jabber::X::Delay - Message Routing and Delay Information Net::Jabber::X::GC - GroupChat Net::Jabber::X::Ident - Rich Identification Net::Jabber::X::Oob - Out Of Band File Transfers Net::Jabber::X::Roster - Roster Items for embedding in messages Each of these modules provide Net::Jabber::X with the functions to access the data. By using delegates and the AUTOLOAD function the functions for each namespace is used when that namespace is active. To access an X object you must create a Message object and use the access functions there to get to the X. To initialize the Message with a Jabber you must pass it the XML::Parser Tree array from the Net::Jabber::Client module. In the callback function for the message you can access the x tags for the namespace "my:namespace" by doing the following: use Net::Jabber; sub messageCB { my $message = new Net::Jabber::Message(@_); my @xTags = $mesage->GetX("my:namespace"); my $xTag; foreach $xTag (@xTags) { . . . } } You now have access to all of the retrieval functions available. To create a new x to send to the server: use Net::Jabber; my $message = new Net::Jabber::Message(); my $x = $message->NewX("jabber:x:ident"); Now you can call the creation functions for the X as defined in the proper namespace. See below for the general functions, and in each query module for those functions. For more information about the array format being passed to the CallBack please read the Net::Jabber::Client documentation. Retrieval functions ------------------- $xmlns = $X->GetXMLNS(); $str = $X->GetXML(); @x = $X->GetTree(); Creation functions ------------------ $X->SetXMLNS("jabber:x:delay"); METHODS ======= Retrieval functions ------------------- GetXMLNS() - returns a string with the namespace of the query that the contains. GetXML() - returns the XML string that represents the . This is used by the Send() function in Client.pm to send this object as a Jabber X. GetTree() - returns an array that contains the tag in XML::Parser Tree format. Creation functions ------------------ SetXMLNS(string) - sets the xmlns of the to the string. CUSTOM X MODULES ================ Part of the flexability of this module is that you can write your own module to handle a new namespace if you so choose. The SetDelegates function is your way to register the xmlns and which module will provide the missing access functions. To register your namespace and module, you can either create an X object and register it once, or you can use the SetDelegates function in Client.pm to do it for you: my $Client = new Net::Jabber::Client(); $Client->AddDelegate(namespace=>"blah:blah", parent=>"Net::Jabber::X", delegate=>"Blah::Blah"); or my $Transport = new Net::Jabber::Transport(); $Transport->AddDelegate(namespace=>"blah:blah", parent=>"Net::Jabber::X", delegate=>"Blah::Blah"); Once you have the delegate registered you need to define the access functions. Here is a an example module: package Blah::Blah; sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = { }; $self->{VERSION} = $VERSION; bless($self, $proto); return $self; } sub SetBlah { shift; my $self = shift; my ($blah) = @_; return &Net::Jabber::SetXMLData("single",$self->{X},"blah","$blah",{}); } sub GetBlah { shift; my $self = shift; return &Net::Jabber::GetXMLData("value",$self->{X},"blah",""); } 1; Now when you create a new X object and call GetBlah on that object it will AUTOLOAD the above function and handle the request. AUTHOR ====== By Ryan Eatmon in May of 2000 for http://jabber.org.. COPYRIGHT ========= This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.  File: pm.info, Node: Net/Jabber/X/AutoUpdate, Next: Net/Jabber/X/Delay, Prev: Net/Jabber/X, Up: Module List Jabber X AutoUpdate Delegate **************************** NAME ==== Net::Jabber::X::AutoUpdate - Jabber X AutoUpdate Delegate SYNOPSIS ======== Net::Jabber::X::AutoUpdate is a companion to the Net::Jabber::X module. It provides the user a simple interface to set and retrieve all parts of a Jabber X AutoUpdate. DESCRIPTION =========== To initialize the AutoUpdate with a Jabber you must pass it the XML::Parser Tree array from the module trying to access the . In the callback function: use Net::Jabber; sub iq { my $foo = new Net::Jabber::Foo(@_); my @xTags = $foo->GetX("jabber:x:autoupdate"); my $xTag; foreach $xTag (@xTags) { $xTag->.... } . . . } You now have access to all of the retrieval functions available. To create a new AutoUpdate to send to the server: use Net::Jabber; $foo = new Net::Jabber::Foo(); $x = $foo->NewX("jabber:x:autoupdate"); Now you can call the creation functions below. For more information about the array format being passed to the CallBack please read the Net::Jabber::Client documentation. Retrieval functions ------------------- $jid = $xTag->GetJID(); Creation functions ------------------ $xTag->SetX(jid=>"update.jabber.org"); $xTag->SetJID("update.jabber.com"); METHODS ======= Retrieval functions ------------------- GetJID() - returns a string with the Jabber Identifier of the agent that is going to handle the update. Creation functions ------------------ SetX(jid=>string) - set multiple fields in the at one time. This is a cumulative and over writing action. If you set the "jid" attribute twice, the second setting is what is used. For valid settings read the specific Set functions below. SetJID(string) - sets the JID of the agent that is going to handle the update. AUTHOR ====== By Ryan Eatmon in May of 2000 for http://jabber.org.. COPYRIGHT ========= This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.  File: pm.info, Node: Net/Jabber/X/Delay, Next: Net/Jabber/X/Encrypted, Prev: Net/Jabber/X/AutoUpdate, Up: Module List Jabber X Delay Delegate *********************** NAME ==== Net::Jabber::X::Delay - Jabber X Delay Delegate SYNOPSIS ======== Net::Jabber::X::Delay is a companion to the Net::Jabber::X module. It provides the user a simple interface to set and retrieve all parts of a Jabber X Delay. DESCRIPTION =========== To initialize the Delay with a Jabber you must pass it the XML::Parser Tree array from the module trying to access the . In the callback function: use Net::Jabber; sub iq { my $foo = new Net::Jabber::Foo(@_); my @xTags = $foo->GetX("jabber:x:delay"); my $xTag; foreach $xTag (@xTags) { $xTag->.... } . . . } You now have access to all of the retrieval functions available. To create a new Delay to send to the server: use Net::Jabber; $foo = new Net::Jabber::Foo(); $xTag = $foo->NewX("jabber:x:delay"); Now you can call the creation functions below. For more information about the array format being passed to the CallBack please read the Net::Jabber::Client documentation. Retrieval functions ------------------- $from = $xTag->GetFrom(); $stamp = $xTag->GetStamp(); $message = $xTag->GetMessage(); Creation functions ------------------ $xTag->SetDelay(FRom=>"jabber:foo.bar.com", message=>"Stored offline"); $xTag->SetFrom("bob@jabber.org"); $xTag->SetStamp(); $xTag->SetStamp("20000124T10:54:00"); $xTag->SetMessage("Stored Offline"); METHODS ======= Retrieval functions ------------------- GetFrom() - returns a string with the Jabber Identifier of the person who added the delay. GetStamp() - returns a string that represents the time stamp of the delay. GetMessage() - returns a string with the message that describes the nature of the delay. Creation functions ------------------ SetDelay(from=>string, - set multiple fields in the at one stamp=>string, time. This is a cumulative and over message=>string) writing action. If you set the "from" attribute twice, the second setting is what is used. If you set the status, and then set the priority then both will be in the tag. For valid settings read the specific Set functions below. SetFrom(string) - sets the from attribute of the server adding the delay. SetStamp(string) - sets the timestamp of the delay. If the string is left blank then the module adds the current date/time in the proper format as the stamp. SetMessage(string) - sets description of the delay. =head2 Test functions DefinedFrom() - returns 1 if the from attribute exists in the x, 0 otherwise. DefinedStamp() - returns 1 if the stamp attribute exists in the x, 0 otherwise. AUTHOR ====== By Ryan Eatmon in May of 2000 for http://jabber.org.. COPYRIGHT ========= This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.  File: pm.info, Node: Net/Jabber/X/Encrypted, Next: Net/Jabber/X/Form, Prev: Net/Jabber/X/Delay, Up: Module List Jabber X Encrypted Module ************************* NAME ==== Net::Jabber::X::Encrypted - Jabber X Encrypted Module SYNOPSIS ======== Net::Jabber::X::Encrypted is a companion to the Net::Jabber::X module. It provides the user a simple interface to set and retrieve all parts of a Jabber X Encrypted. DESCRIPTION =========== To initialize the Encrypted with a Jabber you must pass it the XML::Parser Tree array from the module trying to access the . In the callback function: use Net::Jabber; sub iq { my $foo = new Net::Jabber::Foo(@_); my @xTags = $foo->GetX("jabber:x:encrypted"); my $xTag; foreach $xTag (@xTags) { $xTag->.... } . . . } You now have access to all of the retrieval functions available. To create a new Encrypted to send to the server: use Net::Jabber; $foo = new Net::Jabber::Foo(); $x = $foo->NewX("jabber:x:encrypted"); Now you can call the creation functions below. For more information about the array format being passed to the CallBack please read the Net::Jabber::Client documentation. Retrieval functions ------------------- $message = $xTag->GetMessage(); Creation functions ------------------ $xTag->SetEncrypted(message=>data); $xTag->SetMessage(data); METHODS ======= Retrieval functions ------------------- GetMessage() - returns a string with the message data. Creation functions ------------------ SetEncrypted(message=>string) - set multiple fields in the at one time. This is a cumulative and over writing action. If you set the "message" data twice, the second setting is what is used. If you set the message, and then set another field then both will be in the tag. For valid settings read the specific Set functions below. SetMessage(string) - sets the data for the message. AUTHOR ====== By Ryan Eatmon in December of 2000 for http://jabber.org.. COPYRIGHT ========= This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.  File: pm.info, Node: Net/Jabber/X/Form, Next: Net/Jabber/X/Form/Field, Prev: Net/Jabber/X/Encrypted, Up: Module List Jabber X Form Module ******************** NAME ==== Net::Jabber::X::Form - Jabber X Form Module SYNOPSIS ======== Net::Jabber::X::Form is a companion to the Net::Jabber::X module. It provides the user a simple interface to set and retrieve all parts of a Jabber X Form. DESCRIPTION =========== To initialize the X with a Jabber and then access the form query you must pass it the XML::Parser Tree array from the Net::Jabber::Client module. In the callback function for the x: use Net::Jabber; sub foo { my $foo = new Net::Jabber::Foo(@_); my $form = $foo->GetX(); . . . } You now have access to all of the retrieval functions available. To create a new X form to send to the server: use Net::Jabber; $client = new Net::Jabber::Client(); ... $foo = new Net::Jabber::Foo(); $form = $foo->NewX("jabber:x:form"); ... $client->Send($foo); Using $form you can call the creation functions below to populate the tag before sending it. For more information about the array format being passed to the CallBack please read the Net::Jabber::Client documentation. Retrieval functions ------------------- @fields = $form->GetFields(); @fieldTrees = $form->GetFieldTrees(); Creation functions ------------------ $field = $form->AddField(); $field = $form->AddField(jid=>"bob\@jabber.org", name=>"Bob", groups=>["school","friends"]); METHODS ======= Retrieval functions ------------------- GetFields() - returns an array of Net::Jabber::X::Form::Field objects. These can be modified or accessed with the functions available to them. GetFieldTrees() - returns an array of XML::Parser objects that contain the data for each field. Creation functions ------------------ AddField(hash) - creates and returns a new Net::Jabbber::X::Form::Field object. The argument hash is passed to the SetField function. Check the Net::Jabber::X::Form::Field for valid values. AUTHOR ====== By Ryan Eatmon in February of 2001 for http://jabber.org.. COPYRIGHT ========= This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.  File: pm.info, Node: Net/Jabber/X/Form/Field, Next: Net/Jabber/X/Form/Field/Option, Prev: Net/Jabber/X/Form, Up: Module List Jabber X Form Field Module ************************** NAME ==== Net::Jabber::X::Form::Field - Jabber X Form Field Module SYNOPSIS ======== Net::Jabber::X::Form::Field is a companion to the Net::Jabber::X::Form module. It provides the user a simple interface to set and retrieve all parts of a Jabber Form Field. DESCRIPTION =========== To initialize the Field with a Jabber and then access the you must pass it the XML::Parser Tree array from the Net::Jabber::Client module. In the callback function for the object type foo: use Net::Jabber; sub foo { my $foo = new Net::Jabber::Foo(@_); my @xTags = $foo->GetX("jabber:x:form"); my $xTag; foreach $xTag (@xTags) { my @fields = $xTag->GetFields(); my $field; foreach $field (@fields) { $field->GetXXXX(); . . . } } . . . } You now have access to all of the retrieval functions available below. To create a new X Form Field to send to another user: use Net::Jabber; $Client = new Net::Jabber::Client(); ... $foo = new Net::Jabber::Foo(); $form = $foo->NewX("jabber:x:form"); $foo = $form->AddField(); ... $client->Send($foo); Using $field you can call the creation functions below to populate the tag before sending it. For more information about the array format being passed to the CallBack please read the Net::Jabber::Client documentation. Retrieval functions ------------------- $type = $field->GetType(); $var = $field->GetVar(); $label = $field->GetLabel(); $value = $field->GetValue(); $order = $field->GetOrder(); @options = $field->GetOptions(); @field = $field->GetTree(); $str = $field->GetXML(); Creation functions ------------------ $field->SetField(type=>"entry", var=>"icqnum", label=>"ICQ #", order=>1); $field->SetType('pulldown'); $field->SetVar('sex'); $field->SetLabel('Sex'); $field->SetOrder('2'); $field->AddOption(value=>"m", label=>"Male"); $field->AddOption(value=>"f", label=>"Female"); $field->AddOption(value=>"u", label=>"Unknown"); Test functions -------------- $test = $field->DefinedType(); $test = $field->DefinedVar(); $test = $field->DefinedLabel(); $test = $field->DefinedOrder(); METHODS ======= Retrieval functions ------------------- GetType() - returns a string with type of field this is. GetVar() - returns a string with variable name that the field sets. This is meant to be used as an index to a hash, but mainly so that when returned to the server the thing parsing it can quickly see which value goes with what variable. GetLabel() - returns a string with label that should be displayed in front of the widget for this field. GetValue() - returns a string with the value that this is field is set to. If set then this should be the default value for the field in the widget, otherwise it is the value that the program returned. GetOrder() - returns an integer with the order that this field should be displayed in on the form. So a field with order=1 should be displayed, or prompted, before the field with order=2. GetXML() - returns the XML string that represents the . GetTree() - returns an array that contains the tag in XML::Parser Tree format. Creation functions ------------------ SetField(type=>string, - set multiple fields in the var=>string, at one time. This is a cumulative label=>string, and overwriting action. If you value=>string, set the "var" twice, the second order=>integer) setting is what is used. If you set the tpe, and then set the label then both will be in the tag. For valid settings read the specific Set functions below. SetType(string) - sets the type of field that this is. SetVar(string) - sets the var name for the . SetLabel(string) - sets the label that should be shown next to the widget in the form. SetValue(string) - sets the value of the field. SetOrder(integer) - sets the order to show the field in. Test functions -------------- DefinedType() - returns 1 if the type attribute is set in the , 0 otherwise. DefinedVar() - returns 1 if the var attribute is set in the , 0 otherwise. DefinedLabel() - returns 1 if the label attribute is set in the , 0 otherwise. DefinedOrder() - returns 1 if the order attribute is set in the , 0 otherwise. AUTHOR ====== By Ryan Eatmon in February of 2001 for http://jabber.org.. COPYRIGHT ========= This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.  File: pm.info, Node: Net/Jabber/X/Form/Field/Option, Next: Net/Jabber/X/GC, Prev: Net/Jabber/X/Form/Field, Up: Module List Jabber X Form Field Option Module ********************************* NAME ==== Net::Jabber::X::Form::Field::Option - Jabber X Form Field Option Module SYNOPSIS ======== Net::Jabber::X::Form::Field::Option is a companion to the Net::Jabber::X::Form::Field module. It provides the user a simple interface to set and retrieve all parts of a Jabber Form Field Option. DESCRIPTION =========== To initialize the Option with a Jabber and then access the you must pass it the XML::Parser Tree array from the Net::Jabber::Client module. In the callback function for the object type foo: use Net::Jabber; sub foo { my $foo = new Net::Jabber::Foo(@_); my @xTags = $foo->GetX("jabber:x:form"); my $xTag; foreach $xTag (@xTags) { my @fields = $xTag->GetFields(); my $field; foreach $field (@fields) { if ($field->GetType() eq "option") { foreach my $option ($field->GetOptions()) { $option->GetXXXX(); } } . . . } } . . . } You now have access to all of the retrieval functions available below. To create a new X Form Field Option to send to another user: use Net::Jabber; $Client = new Net::Jabber::Client(); ... $foo = new Net::Jabber::Foo(); $form = $foo->NewX("jabber:x:form"); $field = $form->AddField(tpye=>"option"); $option = $field->AddOption(); ... $client->Send($foo); Using $field you can call the creation functions below to populate the tag before sending it. For more information about the array format being passed to the CallBack please read the Net::Jabber::Client documentation. Retrieval functions ------------------- $label = $option->GetLabel(); $value = $option->GetValue(); @option = $option->GetTree(); $str = $option->GetXML(); Creation functions ------------------ $option->SetOption(label=>"Male", value=>"m"); $option->SetLabel('Yes'); $option->SetValue('1'); Test functions -------------- $test = $option->DefinedLabel(); $test = $option->DefinedValue(); METHODS ======= Retrieval functions ------------------- GetLabel() - returns a string with the label that the option should have in the GUI. GetValuel() - returns a string with the value that the option should have when selected. GetXML() - returns the XML string that represents the . This is used by the Send() function in Client.pm to send this object as a Jabber Presence. GetTree() - returns an array that contains the tag in XML::Parser Tree format. Creation functions ------------------ SetOption(label=>string, - set multiple options in the