Tue Sep 29 07:07:34 PDT 2009
e/t/hk/accts_subscription
HKPwdPreReq
e/t/hk/accts_forms
HKPwdPreReq
e/t/hk/custtradingpage
BasicPrereq
e/t/hk/accts_userinfo
HKPwdPreReq
e/t/hk/headermain
e/t/hk/custservicepage
e/t/hk/accts_transfermoney
HKPwdPreReq
e/t/hk/userprereq
e/t/hk/indices_us
e/t/hk/homeloggedmessage
e/t/hk/lead
e/t/hk/orderviewmin
e/t/hk/accts_changelogin
SessionPreReq
e/t/intl/quotesandresearch
e/t/intl/intltablesubnavviewcomponent
e/t/intl/intltablemetaviewcomponent
e/t/intl/disclaimer
e/t/intl/headermain
e/t/intl/indices_us
e/t/intl/lead
e/t/intl/selectlanguage
e/t/intl/get-screen
BasicPrereq
e/t/intl/page_f
e/t/intl/basicprereq
e/t/intl/page
BasicPrereq
####
#!/usr/bin/perl
use strict;
use warnings;
use XML::Twig;
use Data::Dumper;
my $AFXML='xmlexample.xml';
#the hashes of the appropriate data files
our %AFURLS; our %SMG = (); our %REALMS; our %SMCUST;
# Read the XML from the maven plugin for AF that delineates the URL's
sub AFXMLtoEM {
print "Slurping $AFXML....";
my $TWIG = new XML::Twig ( twig_handlers => {'appDeploymentFile' => \&parseURL} );
#my $TWIG = new XML::Twig ( twig_handlers => {'appDeploymentFile/application' => \&parseURL} );
$TWIG -> parsefile ($AFXML) or die "Can't open $AFXML\n" ;
#$TWIG->flush;
# Now we want to change every value from the XML name to an EM instance identifier
#print Dumper(\%AFURLS); exit 1;
while ((my $K, my $ITEM) = each %AFURLS) {
my ($G1,$G2,$APP,$INST) = split /\./,$ITEM,4;
unless ($APP eq "") {
$ITEM = "prd:" . $APP . ":web:" . $INST;
} #Cheesy kludge - fiox when Durai confirms
$AFURLS{$K} = $ITEM;
}
print scalar keys %AFURLS, " records slurped in.\n";
}
sub parseURL {
my ($T, $ADEP) = @_;
#print Dumper($T) ."," . Dumper($ADEP) ."\n";
my $NAME= $ADEP->att('name');
print $ADEP->first_child('application')->text() . "\n";
#print "$NAME\n";
for my $URLI ($ADEP->first_child('application')->children('urlInfo')) {
# for my $URLI ($ADEP->children('application')) {
# $NAME2 = $ADEP->att('name');
#print "$NAME2\n";
# leading slash added for matching SM filters
$AFURLS{ "/" . $URLI->first_child('url')->text() } = $NAME;
# $AFURLS{ "/" . $URLI->first_child('urlInfo')->children('url')->text() } = $NAME . "-" . $NAME2;
}
}
#
# Main program START
#
AFXMLtoEM();
print Dumper(\%AFURLS);