#!/usr/bin/perl -w
## xmlrpc-test.pl for XML/RPC XWiki Test
## 
## Made by Raffaello Pelagalli
## 
## Started on  Thu Sep 27 17:06:34 2007 Raffaello Pelagalli
## Last update Thu Sep 27 18:05:57 2007 Raffaello Pelagalli
## 
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Lesser General Public
## License as published by the Free Software Foundation; either
## version 2.1 of the License, or (at your option) any later version.
## 
## This library is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
## Lesser General Public License for more details.
## 
## You should have received a copy of the GNU Lesser General Public
## License along with this library; if not, write to the Free Software
## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
## 02111-1307  USA
##

use strict;
use Frontier::Client;

my $wikispace = "Main";
my $wikipage = "WebHome";

# Make an object to represent the XML-RPC server.
my $server_url = 'http://www.xwiki.org/xwiki/xmlrpc/confluence';
my $server = Frontier::Client->new(url => $server_url);

# Call the remote server and get our result.
my $token = $server->call('confluence1.login', 'RafTest', 'skol07');
print "token: $token\n";
my $page = $server->call('confluence1.getPage', $token, "$wikispace.$wikipage");
while (my ($key, $value) = each (%$page)) 
{
    print ("$key : $value\n");
}
my $rpage = $server->call('confluence1.renderContent', $token, $wikispace, $wikipage, "<% print ((1 + 1) * 21) %>");
print ("rpage = $rpage\n");
my $logoutres = $server->call('confluence1.logout', $token);
print "logout: $logoutres\n";
