exit;
}
-my $parser = XML::LibXML->new();
-my $specfile = "";
-my $setfile = "";
+my $parser = XML::LibXML->new();
+my $specfile = "";
+my $setfile = "";
my $specfileName = "";
my $setfileName = "";
my $spectree;
if ( $cgiHash{'print'} eq 'fileSelection' ) {
print "<div class='header'>File Selection</div>";
- print_fileSelection($cgiHash{'configFile'});
+ print_fileSelection( $cgiHash{'configFile'} );
}
if ( $cgiHash{'print'} eq 'spectree' ) {
print "<div class='header'>Available Settings</div>\n";
parseSetAndSpec( $cgiHash{'configFile'} );
- print "<div class='ancestorInfo' align='center'>specifications loaded from $specfileName</div>";
+ print
+"<div class='ancestorInfo' align='center'>specifications loaded from $specfileName</div>";
print_registers($specfile);
}
if ( $cgiHash{'print'} eq 'settree' ) {
print "<div class='header'>Selected Settings</div>\n";
parseSetAndSpec( $cgiHash{'configFile'} );
+ buildAncestry($setfileName);
print "<div class='ancestorInfo' align='center'>";
- print "inherit settings from";
+ print "inherit settings from:<br>";
+ print join("<br>",@ancestryList);
print "</div>";
print_registers($setfile);
}
}
sub parseSetAndSpec {
- parseSet($_[0]);
+ parseSet( $_[0] );
$specfileName = $settree->findvalue("/MAPS/\@specDbFile");
- $specfile = $specDir . "/" . $specfileName;
- $spectree = $parser->parse_file($specfile);
+ $specfile = $specDir . "/" . $specfileName;
+ $spectree = $parser->parse_file($specfile);
}
sub parseSet {
$setfileName = $_[0];
- $setfile = $confDir . "/" . $_[0];
- $settree = $parser->parse_file($setfile);
+ $setfile = $confDir . "/" . $_[0];
+ $settree = $parser->parse_file($setfile);
}
-sub buildAncestry { # recursive
+sub buildAncestry { # recursive
+ my $xmlfileName = $_[0];
+ if ( $xmlfileName eq "" ) {
+ return;
+ }
+ my $xmlfile = $confDir . "/" . $xmlfileName;
+ my $xmltree;
+ if ( $xmlfile eq $setfile ) {
+ $xmltree = $settree;
+ }
+ else {
+ $xmltree = $parser->parse_file($xmlfile);
+ }
+
+ my $ancestorFileName = $xmltree->findvalue("/MAPS/\@inheritSettingsFrom") || "";
+ unless ($ancestorFileName eq ""){
+ buildAncestry($ancestorFileName);
+ push(@ancestryList,$ancestorFileName);
+ }
}
+
+
sub del {
my $registerName = $_[0];
close SCHREIBEN;
}
-
sub print_fileSelection {
-
- my $configFile= $_[0];
+
+ my $configFile = $_[0];
print "<table>";
print "<tr>";
print "</td>";
print "<td>";
- print "<input type='button' onclick='loadFile()' value='load file' class='stdbutton'>";
+ print
+"<input type='button' onclick='loadFile()' value='load file' class='stdbutton'>";
print "</td>";
print "</tr>";
sub changeAncestor {
my $ancestorFileName = $_[0];
- my $xmltree=$settree;
- my $maps = $xmltree->findnodes("/MAPS")->shift();
-
- $maps->setAttribute("inheritSettingsFrom",$ancestorFileName);
+ my $xmltree = $settree;
+ my $maps = $xmltree->findnodes("/MAPS")->shift();
+
+ $maps->setAttribute( "inheritSettingsFrom", $ancestorFileName );
}
sub getAncestor {
- my $xmltree=$settree;
- return ($xmltree->findvalue("/MAPS/\@inheritSettingsFrom")||"");
+ my $xmltree = $settree;
+ return ( $xmltree->findvalue("/MAPS/\@inheritSettingsFrom") || "" );
}
sub save {