Skip to content

Commit

Permalink
Move the joda-time library down into the Xalan tool bundle. Centralis…
Browse files Browse the repository at this point in the history
…e and generalise classpath generation for access to Xalan, particularly for Perl scripts.
  • Loading branch information
iay committed Aug 18, 2009
1 parent 9b87fb6 commit 68c97a0
Show file tree
Hide file tree
Showing 11 changed files with 68 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
<classpathentry kind="src" output="test-bin" path="test"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/>
<classpathentry kind="lib" path="lib/joda-time-1.6.jar"/>
<classpathentry kind="lib" path="tools/xalan/lib/joda-time-1.6.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
12 changes: 9 additions & 3 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,9 @@
<sequential>
<java fork="true" maxmemory="384m" failonerror="true" classname="org.apache.xalan.xslt.Process">
<classpath>
<pathelement location="${lib.dir}/joda-time-1.6.jar"/>
<fileset dir="${tools.xalan}/lib">
<include name="**/*.jar"/>
</fileset>
<pathelement path="${bin.dir}"/>
</classpath>
<jvmarg value="-Djava.endorsed.dirs=${tools.xalan}/endorsed"/>
Expand Down Expand Up @@ -541,7 +543,9 @@
<echo>Importing metadata from ${entities.dir}/import.xml</echo>
<java fork="true" maxmemory="384m" failonerror="true" classname="org.apache.xalan.xslt.Process">
<classpath>
<pathelement location="${lib.dir}/joda-time-1.6.jar"/>
<fileset dir="${tools.xalan}/lib">
<include name="**/*.jar"/>
</fileset>
<pathelement path="${bin.dir}"/>
</classpath>
<jvmarg value="-Djava.endorsed.dirs=${tools.xalan}/endorsed"/>
Expand Down Expand Up @@ -581,7 +585,9 @@
<java classname="uk.org.ukfederation.apps.mdcheck.MetadataCheck"
fork="true" failonerror="true" maxmemory="384m">
<classpath>
<pathelement location="${lib.dir}/joda-time-1.6.jar"/>
<fileset dir="${tools.xalan}/lib">
<include name="**/*.jar"/>
</fileset>
<pathelement path="${bin.dir}"/>
</classpath>
<jvmarg value="-Djava.endorsed.dirs=${tools.xalan}/endorsed"/>
Expand Down
38 changes: 38 additions & 0 deletions build/Xalan.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/usr/bin/perl -w

#
# Simplified access to the Xalan XSLT processor.
#

#
# xalanCall
#
# Provides the stem of a "system" call string to access Xalan with the
# required extensions.
#
sub xalanCall
{
my $xalanRoot = "../tools/xalan";

my $res = "java";

# Endorsed Xalan and Xerces
$res .= " -Djava.endorsed.dirs=$xalanRoot/endorsed";

# Classpath
my $classpath = '../bin';
while (glob "$xalanRoot/lib/*") {
$classpath .= ':' unless $classpath eq '';
$classpath .= $_;
}

$res .= " -cp $classpath";

# Class to invoke
$res .= " org.apache.xalan.xslt.Process";
$res;
}

#print ">>>" . xalanCall . "<<<\n";

1;
4 changes: 3 additions & 1 deletion build/addresses.pl
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/perl

use Xalan;

#
# Load list addresses.
#
Expand Down Expand Up @@ -27,7 +29,7 @@
#
# UK addresses
#
open(XML,"java -Djava.endorsed.dirs=../tools/xalan/endorsed org.apache.xalan.xslt.Process -IN ../xml/ukfederation-metadata-master.xml -XSL extract_addresses.xsl|") || die "could not open input file";
open(XML, xalanCall . " -IN ../xml/ukfederation-metadata-master.xml -XSL extract_addresses.xsl|") || die "could not open input file";
while (<XML>) {
if (/<EmailAddress>(mailto:)?(.*)<\/EmailAddress>/) {
$metadata{$2} = 1;
Expand Down
3 changes: 2 additions & 1 deletion build/check_entity.pl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/perl -w
use Xalan;
use File::Temp qw(tempfile);
use Date::Parse;
use Digest::SHA1 qw(sha1 sha1_hex sha1_base64);
Expand Down Expand Up @@ -29,7 +30,7 @@
unlink($temp) if -e $temp;

# extract embedded certificates
open(EXTRACT, "java -Djava.endorsed.dirs=../tools/xalan/endorsed org.apache.xalan.xslt.Process -IN $fn -OUT $temp -XSL extract_embedded.xsl|")
open(EXTRACT, xalanCall . " -IN $fn -OUT $temp -XSL extract_embedded.xsl|")
|| die "could not open certificate extract process";
while (<EXTRACT>) {
print $_;
Expand Down
4 changes: 3 additions & 1 deletion build/count_scopes.pl
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/perl -w

open(XML,"java -Djava.endorsed.dirs=../tools/xalan/endorsed org.apache.xalan.xslt.Process -IN ../xml/ukfederation-metadata-unsigned.xml -XSL extract_scopes.xsl|") || die "could not open input file";
use Xalan;

open(XML, xalanCall . " -IN ../xml/ukfederation-metadata-unsigned.xml -XSL extract_scopes.xsl|") || die "could not open input file";
while (<XML>) {
# print $_;
chop;
Expand Down
4 changes: 3 additions & 1 deletion build/extract_locs.pl
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/perl -w

open(XML,"java -Djava.endorsed.dirs=../tools/xalan/endorsed org.apache.xalan.xslt.Process -IN ../xml/ukfederation-metadata-unsigned.xml -XSL extract_locs.xsl|") || die "could not open input file";
use Xalan;

open(XML, xalanCall . " -IN ../xml/ukfederation-metadata-unsigned.xml -XSL extract_locs.xsl|") || die "could not open input file";
while (<XML>) {
chop;
if (/^https:\/\/([^\/:]+(:\d+)?)(\/|$)/) {
Expand Down
4 changes: 3 additions & 1 deletion build/import.pl
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/perl -w

use Xalan;

#
# Import an entity metadata fragment file.
#
Expand All @@ -10,4 +12,4 @@
# in entities/imported.xml.
#

system("java -cp ../bin:../lib/joda-time-1.6.jar -Djava.endorsed.dirs=../tools/xalan/endorsed org.apache.xalan.xslt.Process -IN ../entities/import.xml -OUT ../entities/imported.xml -XSL import.xsl");
system(xalanCall . " -IN ../entities/import.xml -OUT ../entities/imported.xml -XSL import.xsl");
4 changes: 3 additions & 1 deletion build/probe_certs.pl
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/perl -w

open(XML,"java -Djava.endorsed.dirs=../tools/xalan/endorsed org.apache.xalan.xslt.Process -IN ../xml/ukfederation-metadata.xml -XSL extract_cert_locs.xsl|") || die "could not open input file";
use Xalan;

open(XML, xalanCall . " -IN ../xml/ukfederation-metadata.xml -XSL extract_cert_locs.xsl|") || die "could not open input file";
while (<XML>) {
if (/^http:/) {
print "skipping http location: $_";
Expand Down
4 changes: 3 additions & 1 deletion build/probe_nocerts.pl
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#!/usr/bin/perl -w

use Xalan;

$known_bad{'census.data-archive.ac.uk:8080'} = 1; # it is really http, not https

open(XML,"java -Djava.endorsed.dirs=../tools/xalan/endorsed org.apache.xalan.xslt.Process -IN ../xml/ukfederation-metadata.xml -XSL extract_nocert_locs.xsl|") || die "could not open input file";
open(XML, xalanCall . " -IN ../xml/ukfederation-metadata.xml -XSL extract_nocert_locs.xsl|") || die "could not open input file";
while (<XML>) {
chop;
if (/^http:/) {
Expand Down
Binary file added tools/xalan/lib/joda-time-1.6.jar
Binary file not shown.

0 comments on commit 68c97a0

Please sign in to comment.