Index: /trunk/PS-IPP-Config/lib/PS/IPP/Config.pm
===================================================================
--- /trunk/PS-IPP-Config/lib/PS/IPP/Config.pm	(revision 13723)
+++ /trunk/PS-IPP-Config/lib/PS/IPP/Config.pm	(revision 13724)
@@ -1,5 +1,5 @@
 # Copyright (c) 2006  Paul Price, Joshua Hoblitt
 #
-# $Id: Config.pm,v 1.58 2007-06-07 02:29:11 price Exp $
+# $Id: Config.pm,v 1.59 2007-06-08 22:53:39 eugene Exp $
 
 package PS::IPP::Config;
@@ -166,4 +166,5 @@
     close $file;
     $self->{camera} = $parser->parse( join '', @contents); # The parsed metadata config
+    $self->{cameraName} = $name;
 
     unless (defined $self->{camera}) {
@@ -222,5 +223,5 @@
     my $pathname = metadataLookupStr($path_list, $name); # Path of interest
     unless (defined $pathname) {
-	carp "Unable to find camera configuration file $pathname\n" ;
+	carp "Unable to find datapath $name\n" ;
 	exit($PS_EXIT_CONFIG_ERROR);
     }
@@ -548,5 +549,5 @@
 
     unless (defined $self->{rejection}) {
-	my $camera = $self->{camera}; # Camera configuration
+	my $camera = $self->{cameraName}; # Camera name
 	unless (defined $camera) {
 	    carp "Camera has not yet been defined.\n";
@@ -554,23 +555,11 @@
 	}
 	
-	my $rejName = metadataLookupStr($camera, 'REJECTIONS'); # Name of rejection file
-	unless (defined $rejName) {
-	    carp "Can't find REJECTIONS list in camera configuration.\n";
-	    return undef;
-	}
+	# rejections are saved as a recipe: REJECTIONS
+	my @rejContents = `ppConfigDump -dump-recipe REJECTIONS -camera $camera -`;
 	
-	my $rejRealName = $self->_find_config($rejName); # Resolved filename, after hunting the PATH
-
-	my $rejFile;		# Rejection file handle
-	unless (open $rejFile, $rejRealName) {
-	    carp "Unable to open rejection file $rejRealName: $!";
-	    exit($PS_EXIT_CONFIG_ERROR);
-	}
-	my @rejContents = <$rejFile>; # Contents of the rejection file
-	close $rejFile;
-
+	# load from resulting psMetadataConfig
 	$self->{rejection} = $parser->parse( join '', @rejContents); # The rejection metadata
 	unless (defined $self->{rejection}) {
-	    carp "Unable to parse rejection file $rejRealName.";
+	    carp "Unable to parse REJECTION recipe for $camera.";
 	    exit($PS_EXIT_CONFIG_ERROR);
 	}
