Skip to content

Commit

Permalink
Move scope counting stuff into charting package. Make it possible to …
Browse files Browse the repository at this point in the history
…get historic data.
  • Loading branch information
iay committed Jul 1, 2010
1 parent b7ca8ac commit 4fc2cd3
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 19 deletions.
14 changes: 0 additions & 14 deletions build/count_scopes.pl

This file was deleted.

43 changes: 43 additions & 0 deletions charting/scopes.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/usr/bin/perl -w

#
# scopes.pl
#
# Extracts statistics about number of scopes from the published metadata.
#
use lib "../build";
use Xalan;
use Months;

# Parse command line arguments
use Getopt::Long;
my $allMonths;
GetOptions('all' => \$allMonths);

# By default, only show results for the most recent month
if (!$allMonths) {
# reduce months table to one element
my $oneMonth = pop @months;
@months = ( $oneMonth );
}

# ingest files
foreach $month (@months) {
my $fn = "cache/$month.xml";
my %scopes;
open(TXT, xalanCall . " -IN $fn -XSL scopes.xsl|") || die "could not open input file";
while (<TXT>) {
chop;
my $scope = $_;
$scopes{$scope} = 1;
}
push @count, scalar(keys(%scopes));
close TXT;
}

print "count\n";
foreach $n (@count) {
print "$n\n";
}

1;
8 changes: 3 additions & 5 deletions build/extract_scopes.xsl → charting/scopes.xsl
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
extract_nocert_locs.xsl
scopes.xsl
XSL stylesheet that takes a SAML 2.0 metadata file and extracts
a list of scopes used. Regular expression scopes are ignored.
Duplicates are not removed, and the result is unsorted.
Author: Ian A. Young <ian@iay.org.uk>
-->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
xmlns:shibmd="urn:mace:shibboleth:metadata:1.0"
xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:wayf="http://sdss.ac.uk/2006/06/WAYF"
exclude-result-prefixes="shibmd md ds wayf">
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<!-- Output is plain text -->
<xsl:output method="text"/>
Expand Down

0 comments on commit 4fc2cd3

Please sign in to comment.