Project

General

Profile

« Previous | Next » 

Revision 2808

Added by sgarg almost 19 years ago

modified mod_revise so that Revision Requested is added to the document in additionalMetadata/moderatorComment which can be used by the skin in searching for documents which havnt been requested for revision

View differences:

src/perl/register-dataset.cgi
87 87
$config->define("spatialRequired", { DEFAULT => 'true'} );
88 88
$config->define("contactEmailAddressRequired", { DEFAULT => 'false'} );
89 89
$config->define("publicReadable", { DEFAULT => 'true'} );
90
$config->define("adminIsOwner", { DEFAULT => 'false'} );
90
$config->define("adminIsDocOwner", { DEFAULT => 'false'} );
91 91
$config->define("moderators", { DEFAULT => ''} );
92 92
$config->define("mailhost");
93 93
$config->define("sender");
......
2880 2880
    	if ($xmldoc eq "" || $doc=~ /<error/) {
2881 2881
			# not able to parse
2882 2882
	       	$errorMessage = $errorMessage." Error in reading the docid:".$docid;
2883
		} else {
2883
	} else {
2884 2884
		    my $findNodes = $xmldoc->findnodes('//dataset/contact');
2885 2885
		    if($findNodes->size() > 0){
2886 2886
				# found contact email address
......
2913 2913
			}
2914 2914

  
2915 2915
		}
2916

  
2917
 		my ($emldoc, $temp) = split('</dataset>', $doc);
2918
                $emldoc .= "</dataset>\n<additionalMetadata>\n<moderatorComment>Revision Requested</moderatorComment>\n</additionalMetadata>";
2919
                $emldoc .= "\n</eml:eml>\n";
2920
                debug($emldoc);
2921
                #debug("Document created by handleModAccept is " . $emldoc);
2922
                # update the document
2923
                my $docid = $FORM::docid;
2924

  
2925
                my $x;
2926
                my $y;
2927
                my $z;
2928

  
2929
                ($x, $y, $z) = split(/\./, $docid);
2930
                $z++;
2931
                $docid = "$x.$y.$z";
2932

  
2933
                $emldoc =~ s/packageId=\"docid\"/packageId=\"$docid\"/;
2934
                $response = $metacat->update($docid, $emldoc);
2935

  
2936
                if (! $response) {
2937
                        debug("Error while updating in handleModAccept.".$metacat->getMessage());
2938
                        #push(@errorMessages, $metacat->getMessage());
2939
			$errorMessage = $errorMessage." Failed while updating the document with additional Metadata.";
2940
                }
2941

  
2916 2942
	}
2917 2943
    if ($errorMessage eq '') {
2918 2944
	# send notifications

Also available in: Unified diff