NAME
Net::Jabber::Query::Register - Jabber IQ Registration Module
SYNOPSIS
Net::Jabber::Query::Register is a companion to the Net::Jabber::Query module.
It provides the user a simple interface to set and retrieve all parts
of a Jabber IQ Registration query.
DESCRIPTION
To initialize the IQ with a Jabber <iq/> and then access the register
query you must pass it the XML::Parser Tree array from the
Net::Jabber::Client module. In the callback function for the iq:
use Net::Jabber;
sub iq {
my $iq = new Net::Jabber::IQ(@_);
my $register = $iq->GetQuery();
.
.
.
}
You now have access to all of the retrieval functions available.
To create a new IQ register to send to the server:
use Net::Jabber;
$client = new Net::Jabber::Client();
...
$iq = new Net::Jabber::IQ();
$register = $iq->NewQuery("jabber:iq:register");
...
$client->Send($iq);
Using $register 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
$instructions = $register->GetInstructions();
$username = $register->GetUsername();
$password = $register->GetPassword();
$name = $register->GetName();
$email = $register->GetEmail();
$address = $register->GetAddress();
$city = $register->GetCity();
$state = $register->GetState();
$zip = $register->GetZip();
$phone = $register->GetPhone();
$url = $register->GetURL();
$date = $register->GetDate();
$misc = $register->GetMisc();
$text = $register->GetText();
$key = $register->GetKey();
$remove = $register->GetRemove();
%fields = $register->GetFields();
Client Creation functions
$register->SetRegister(username=>'test',
password=>'user',
name=>'Test Account');
$register->SetUsername('bob');
$register->SetPassword('bobrulez');
$register->SetName('Bob the Great');
$register->SetEmail('bob\@bob.net');
$register->SetAddress('121 Bob St.');
$register->SetCity('Bobville');
$register->SetState('TX');
$register->SetZip('70000');
$register->SetPhone('(555)555-5555');
$register->SetURL('http://www.bob.net');
$register->SetDate('04/17/2000');
$register->SetMisc('...');
$register->SetText('...');
$register->SetKey('...');
$register->SetRemove();
Server Creation functions
$register->SetRegister(instructions=>'Fill out the following fields...',
username=>'',
password=>'',
name=>'',
email=>'');
$register->SetInstructions('Fill out all of the fields...');
$register->SetUsername();
$register->SetPassword();
$register->SetName();
$register->SetEmail();
$register->SetAddress();
$register->SetCity();
$register->SetState();
$register->SetZip();
$register->SetPhone();
$register->SetURL();
$register->SetDate();
$register->SetMisc();
$register->SetText();
$register->SetKey();
$register->SetRemove();
Test functions
$test = $register->DefinedUsername();
$test = $register->DefinedPassword();
$test = $register->DefinedName();
$test = $register->DefinedEmail();
$test = $register->DefinedAddress();
$test = $register->DefinedCity();
$test = $register->DefinedState();
$test = $register->DefinedZip();
$test = $register->DefinedPhone();
$test = $register->DefinedURL();
$test = $register->DefinedDate();
$test = $register->DefinedMisc();
$test = $register->DefinedText();
$test = $register->DefinedKey();
$test = $register->DefinedRemove();
METHODS
Retrieval functions
GetInstructions() - returns a string with the instructions in the <query/>.
GetUsername() - returns a string with the username in the <query/>.
GetPassword() - returns a string with the password in the <query/>.
GetName() - returns a string with the name in the <query/>.
GetEmail() - returns a string with the email in the <query/>.
GetAddress() - returns a string with the address in the <query/>.
GetCity() - returns a string with the city in the <query/>.
GetState() - returns a string with the state in the <query/>.
GetZip() - returns a string with the zip in the <query/>.
GetPhone() - returns a string with the phone in the <query/>.
GetURL() - returns a string with the URL in the <query/>.
GetDate() - returns a string with the date in the <query/>.
GetMisc() - returns a string with the misc in the <query/>.
GetText() - returns a string with the text in the <query/>.
GetKey() - returns a string with the key in the <query/>.
GetRemove() - returns a string with the remove in the <query/>.
GetFields() - returns a hash with the keys being the fields
contained in the <query/> and the values the
contents of the tags.
Creation functions
SetRegister(instructions=>string, - set multiple fields in the <iq/>
username=>string, at one time. This is a cumulative
password=>string, and over writing action. If you
name=>string, set the "username" twice, the second
email=>string, setting is what is used. If you set
address=>string, the password, and then set the
city=>string, name then both will be in the
state=>string, <query/> tag. For valid settings
zip=>string, read the specific Set functions below.
phone=>string,
url=>string,
date=>string,
misc=>string,
text=>string,
key=>string,
remove=>string)
SetUsername(string) - sets the username for the account you are
trying to create. Set string to "" to send
<username/> for instructions.
SetPassword(string) - sets the password for the account you are
trying to create. Set string to "" to send
<password/> for instructions.
SetName(string) - sets the name for the account you are
trying to create. Set string to "" to send
<name/> for instructions.
SetEmail(string) - sets the email for the account you are
trying to create. Set string to "" to send
<email/> for instructions.
SetAddress(string) - sets the addess for the account you are
trying to create. Set string to "" to send
<address/> for instructions.
SetCity(string) - sets the city for the account you are
trying to create. Set string to "" to send
<city/> for instructions.
SetState(string) - sets the state for the account you are
trying to create. Set string to "" to send
<state/> for instructions.
SetZip(string) - sets the zip code for the account you are
trying to create. Set string to "" to send
<zip/> for instructions.
SetPhone(string) - sets the phone for the account you are
trying to create. Set string to "" to send
<phone/> for instructions.
SetURL(string) - sets the url for the account you are
trying to create. Set string to "" to send
<url/> for instructions.
SetDate(string) - sets the date for the account you are
trying to create. Set string to "" to send
<date/> for instructions.
SetMisc(string) - sets the misc for the account you are
trying to create. Set string to "" to send
<misc/> for instructions.
SetText(string) - sets the text for the account you are
trying to create. Set string to "" to send
<text/> for instructions.
SetKey(string) - sets the key for the server/transport you are trying
to regsiter to.
SetRemove() - sets the remove for the account you are
trying to create so that the account will
be removed from the server/transport.
Test functions
DefinedUsername() - returns 1 if there is a <username/> in the query,
0 if not.
DefinedPassword() - returns 1 if there is a <password/> in the query,
0 if not.
DefinedName() - returns 1 if there is a <name/> in the query,
0 if not.
DefinedEmail() - returns 1 if there is a <email/> in the query,
0 if not.
DefinedAddress() - returns 1 if there is a <address/> in the query,
0 if not.
DefinedCity() - returns 1 if there is a <city/> in the query,
0 if not.
DefinedState() - returns 1 if there is a <state/> in the query,
0 if not.
DefinedZip() - returns 1 if there is a <zip/> in the query,
0 if not.
DefinedPhone() - returns 1 if there is a <phone/> in the query,
0 if not.
DefinedURL() - returns 1 if there is a <url/> in the query,
0 if not.
DefinedDate() - returns 1 if there is a <date/> in the query,
0 if not.
DefinedMisc() - returns 1 if there is a <misc/> in the query,
0 if not.
DefinedText() - returns 1 if there is a <text/> in the query,
0 if not.
DefinedKey() - returns 1 if there is a <key/> in the query,
0 if not.
DefinedRemove() - returns 1 if there is a <remove/> in the query,
0 if not.
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.