--- loncom/lonnet/perl/lonnet.pm 2001/03/19 22:27:06 1.109 +++ loncom/lonnet/perl/lonnet.pm 2001/03/27 21:50:52 1.118 @@ -3,8 +3,9 @@ # # Functions for use by content handlers: # -# metadata_query(sql-query-string) : returns file handle of where sql -# results will be stored for query +# metadata_query(sql-query-string,custom-metadata-regex) : +# returns file handle of where sql and +# regex results will be stored for query # plaintext(short) : plain text explanation of short term # fileembstyle(ext) : embed style in page for file extension # filedescription(ext) : descriptor text for file extension @@ -91,7 +92,8 @@ # 02/27/01 Scott Harrison # 3/2 Gerd Kortemeyer # 3/15 Scott Harrison -# 3/19 Gerd Kortemeyer +# 3/19,3/20 Gerd Kortemeyer +# 3/22,3/27 Scott Harrison package Apache::lonnet; @@ -628,6 +630,23 @@ sub log { return critical("log:$dom:$nam:$what",$hom); } +# --------------------------------------------- Set Expire Date for Spreadsheet + +sub expirespread { + my ($uname,$udom,$stype,$usymb)=@_; + my $cid=$ENV{'request.course.id'}; + if ($cid) { + my $now=time; + my $key=$uname.':'.$udom.':'.$stype.':'.$usymb; + return &reply('put:'.$ENV{'course.'.$cid.'.domain'}.':'. + $ENV{'course.'.$cid.'.num'}. + ':nohist_expirationdates:'. + &escape($key).'='.$now, + $ENV{'course.'.$cid.'.home'}) + } + return 'ok'; +} + # ----------------------------------------------------- Devalidate Spreadsheets sub devalidate { @@ -1224,8 +1243,25 @@ sub definerole { # ---------------- Make a metadata query against the network of library servers sub metadata_query { - my ($query)=@_; - my $reply=&reply("querysend:".&escape($query),'msul3'); + my ($query,$custom,$customshow)=@_; + # need to put in a library server loop here and return a hash +# for my $server (keys %libserv) { + my %rhash; + for my $server ('msul3') { + unless ($custom or $customshow) { + my $reply=&reply("querysend:".&escape($query),$server); + $rhash{$server}=$reply; + return $reply; + } + else { + my $reply=&reply("querysend:".&escape($query).':'. + &escape($custom).':'.&escape($customshow), + $server); + $rhash{$server}=$reply; + return $reply; + } + } + return \%rhash; } # ------------------------------------------------------------------ Plain Text