--- /dev/null
+#!/usr/bin/perl -w
+use strict;
+
+my $confile = $ENV{"UWOBO_PANEL_CONF"} || die "UWOBO_PANEL_CONF not defined";
+
+use LWP::UserAgent;
+use URI::Escape;
+
+sub getPredefinedStylesheets () {
+ my %stylesconf;
+ my $inForm = 0; # currenlty inside 'predefinedStylesheets' form
+ open(CONF, "< $confile") || die "Can't open $confile";
+ while(my $l = <CONF>) {
+ chomp($l);
+ if (not $inForm) {
+ if ($l =~ /<form name="predefinedStylesheets">/) {
+ $inForm = 1;
+ }
+ } else { # in form
+ if ($l =~ /<\/form>/) {
+ $inForm = 0;
+ } elsif ($l =~ /<option value="[^"]+">/) {
+ my $val = $l;
+ $val =~ s/.*<option value="([^"]+)".*>/$1/;
+ my ($key, $ur, $use_getter) = split /,/, $val;
+ $stylesconf{$key}[0] = $ur;
+ if ($use_getter =~ /true/) {
+ $use_getter = 1;
+ } elsif ($use_getter =~ /false/) {
+ $use_getter = 0;
+ } else {
+ die "Unknown value '$use_getter' for 'use_getter' field.";
+ }
+ $stylesconf{$key}[1] = $use_getter;
+ }
+ }
+ }
+ close(CONF);
+ return %stylesconf;
+}
+
+sub main () {
+ my $getter_url = $ENV{"HELM_GETTER_URL"} || die "HELM_GETTER_URL not defined";
+ my $uwobo_url = $ENV{"HELM_UWOBO_URL"} || die "HELM_UWOBO_URL not defined";
+ my %styles = getPredefinedStylesheets();
+ my $request_url = "";
+ foreach my $k (keys %styles) {
+ $request_url .= "&" unless ($request_url eq "");
+ my $ur = $styles{$k}[0];
+ my $use_getter = $styles{$k}[1];
+ $request_url .= "bind=$k,";
+ my $tmp = "";
+ if ($use_getter) {
+ $tmp .= $getter_url . "getxslt?uri="
+ }
+ $tmp .= $ur;
+ $request_url .= uri_escape($tmp);
+ }
+ $request_url = $uwobo_url . "add?$request_url";
+ my $agent = LWP::UserAgent->new();
+ my $response = $agent->get($request_url);
+ print $response->as_string();
+# print "$request_url\n";
+}
+
+main();
+