version 1.44, 2003/12/28 20:12:59
|
version 1.45, 2003/12/29 15:10:54
|
Line 201 sub metadata_col_to_hash {
|
Line 201 sub metadata_col_to_hash {
|
return %hash; |
return %hash; |
} |
} |
|
|
|
# ============================================================= The field names |
|
|
|
sub fieldnames { |
|
return &Apache::lonlocal::texthash( |
|
'title' => 'Title', |
|
'author' =>'Author(s)', |
|
'subject' => 'Subject', |
|
'keywords' => 'Keyword(s)', |
|
'notes' => 'Notes', |
|
'abstract' => 'Abstract', |
|
'lowestgradelevel' => 'Lowest Grade Level', |
|
'highestgradelevel' => 'Highest Grade Level', |
|
'standards' => 'Standards', |
|
'mime' => 'MIME Type', |
|
'language' => 'Language', |
|
'creationdate' => 'Creation Date', |
|
'lastrevisiondate' => 'Last Revision Date', |
|
'owner' => 'Publisher/Owner', |
|
'copyright' => 'Copyright/Distribution', |
|
'customdistributionfile' => 'Custom Distribution File', |
|
'obsolete' => 'Obsolete', |
|
'obsoletereplacement' => 'Suggested Replacement for Obsolete File', |
|
'count' => 'Network-wide number of accesses (hits)', |
|
'course' => 'Network-wide number of courses using resource', |
|
'usage' => 'Number of resources using or importing resource', |
|
'goto' => 'Number of resources that follow this resource in maps', |
|
'comefrom' => 'Number of resources that lead up to this resource in maps', |
|
'clear' => 'Material presented in clear way', |
|
'depth' => 'Material covered with sufficient depth', |
|
'helpful' => 'Material is helpful', |
|
'correct' => 'Material appears to be correct', |
|
'technical' => 'Resource is technically correct', |
|
'avetries' => 'Average number of tries till solved', |
|
'stdno' => 'Total number of students who have worked on this problem', |
|
'difficulty' => 'Degree of difficulty' |
|
); |
|
} |
# ================================================================ Main Handler |
# ================================================================ Main Handler |
|
|
sub handler { |
sub handler { |
Line 244 sub handler {
|
Line 281 sub handler {
|
} |
} |
|
|
# --------------------------------------------------------------- Render Output |
# --------------------------------------------------------------- Render Output |
my ($thisversion)=($uri=~/\.(\d+)\.(\w+)\.meta$/); |
my ($thisversion)=($uri=~/\.(\d+)\.(\w+)\.meta$/); |
my $creationdate=&Apache::lonlocal::locallocaltime( |
$content{'creationdate'}=&Apache::lonlocal::locallocaltime( |
&Apache::lonmysql::unsqltime($content{'creationdate'})); |
&Apache::lonmysql::unsqltime($content{'creationdate'})); |
my $lastrevisiondate=&Apache::lonlocal::locallocaltime( |
$content{'lastrevisiondate'}=&Apache::lonlocal::locallocaltime( |
&Apache::lonmysql::unsqltime($content{'lastrevisiondate'})); |
&Apache::lonmysql::unsqltime($content{'lastrevisiondate'})); |
my $language=&Apache::loncommon::languagedescription($content{'language'}); |
$content{'language'}=&Apache::loncommon::languagedescription($content{'language'}); |
my $mime=&Apache::loncommon::filedescription($content{'mime'}); |
$content{'mime'}=&Apache::loncommon::filedescription($content{'mime'}); |
my $disuri=&Apache::lonnet::declutter($uri); |
my $disuri=&Apache::lonnet::declutter($uri); |
$disuri=~s/\.meta$//; |
$disuri=~s/\.meta$//; |
my $currentversion=&Apache::lonnet::getversion($disuri); |
my $currentversion=&Apache::lonnet::getversion($disuri); |
my $author=$content{'author'}; |
my $author=$content{'author'}; |
$author=~s/(\w+)(\:|\@)(\w+)/&authordisplay($1,$3)/gse; |
$content{'author'}=~s/(\w+)(\:|\@)(\w+)/&authordisplay($1,$3)/gse; |
my $owner=$content{'owner'}; |
$content{'owner'}=~s/(\w+)(\:|\@)(\w+)/&authordisplay($1,$3)/gse; |
$owner=~s/(\w+)(\:|\@)(\w+)/&authordisplay($1,$3)/gse; |
my $versiondisplay=''; |
my $versiondisplay=''; |
if ($thisversion) { |
if ($thisversion) { |
$versiondisplay=&mt('Version').': '.$thisversion. |
$versiondisplay=&mt('Version').': '.$thisversion. |
' ('.&mt('most recent version').': '.$currentversion.')'; |
' ('.&mt('most recent version').': '.$currentversion.')'; |
} else { |
} else { |
$versiondisplay='Version: '.$currentversion; |
$versiondisplay='Version: '.$currentversion; |
} |
} |
if ($content{'customdistributionfile'}) { |
my $customdistributionfile=''; |
$content{'customdistributionfile'}='<a href="'.$content{'customdistributionfile'}. |
if ($content{'customdistributionfile'}) { |
'"><tt>'.$content{'customdistributionfile'}.'</tt></a>'; |
$customdistributionfile='<a href="'.$content{'customdistributionfile'}. |
} else { |
'"><tt>'.$content{'customdistributionfile'}.'</tt></a>'; |
$content{'customdistributionfile'}=''; |
} |
} |
|
my $obsolete=$content{'obsolete'}; |
my $obsolete=$content{'obsolete'}; |
my $obsoletewarning=''; |
my $obsoletereplace=$content{'obsoletereplacement'}; |
if (($obsolete) && ($ENV{'user.adv'})) { |
my $obsoletewarning=''; |
$obsoletewarning='<p><font color="red">'. |
if (($obsolete) && ($ENV{'user.adv'})) { |
&mt('This resource has been marked obsolete by the author(s)').'</font></p>'; |
$obsoletewarning='<p><font color="red">'.&mt('This resource has been marked obsolete by the author(s)').'</font></p>'; |
} |
} |
|
|
my %lt=&fieldnames(); |
my %lt=&Apache::lonlocal::texthash( |
my $table=''; |
'au' =>'Author(s)', |
my $bodytag=&Apache::loncommon::bodytag |
'sb' => 'Subject', |
|
'kw' => 'Keyword(s)', |
|
'no' => 'Notes', |
|
'ab' => 'Abstract', |
|
'lg' => 'Lowest Grade Level', |
|
'hg' => 'Highest Grade Level', |
|
'st' => 'Standards', |
|
'mi' => 'MIME Type', |
|
'la' => 'Language', |
|
'cd' => 'Creation Date', |
|
'pu' => 'Publisher/Owner', |
|
'co' => 'Copyright/Distribution', |
|
'cf' => 'Custom Distribution File', |
|
'ob' => 'Obsolete', |
|
'or' => |
|
'Suggested Replacement for Obsolete File'); |
|
my $bodytag=&Apache::loncommon::bodytag |
|
('Catalog Information','','','',$resdomain); |
('Catalog Information','','','',$resdomain); |
|
foreach ('title', |
|
'author', |
|
'subject', |
|
'keywords', |
|
'notes', |
|
'abstract', |
|
'mime', |
|
'language', |
|
'creationdate', |
|
'lastrevisiondate', |
|
'owner', |
|
'copyright', |
|
'customdistributionfile', |
|
'obsolete', |
|
'obsoletereplacement') { |
|
$table.='<tr><td bgcolor="#AAAAAA">'.$lt{$_}. |
|
'</td><td bgcolor="#CCCCCC">'. |
|
$content{$_}.' </td></tr>'; |
|
delete $content{$_}; |
|
} |
|
|
$r->print(<<ENDHEAD); |
$r->print(<<ENDHEAD); |
<html><head><title>Catalog Information</title></head> |
<html><head><title>Catalog Information</title></head> |
$bodytag |
$bodytag |
Line 306 $bodytag
|
Line 347 $bodytag
|
$obsoletewarning |
$obsoletewarning |
$versiondisplay<br /> |
$versiondisplay<br /> |
<table cellspacing=2 border=0> |
<table cellspacing=2 border=0> |
<tr><td bgcolor='#AAAAAA'>$lt{'au'}</td> |
$table |
<td bgcolor="#CCCCCC">$author </td></tr> |
|
<tr><td bgcolor='#AAAAAA'>$lt{'sb'}</td> |
|
<td bgcolor="#CCCCCC">$content{'subject'} </td></tr> |
|
<tr><td bgcolor='#AAAAAA'>$lt{'kw'}</td> |
|
<td bgcolor="#CCCCCC">$content{'keywords'} </td></tr> |
|
<tr><td bgcolor='#AAAAAA'>$lt{'no'}</td> |
|
<td bgcolor="#CCCCCC">$content{'notes'} </td></tr> |
|
<tr><td bgcolor='#AAAAAA'>$lt{'ab'}</td> |
|
<td bgcolor="#CCCCCC">$content{'abstract'} </td></tr> |
|
<tr><td bgcolor='#AAAAAA'>$lt{'lg'}</td> |
|
<td bgcolor="#CCCCCC">$content{'lowestgradelevel'} </td></tr> |
|
<tr><td bgcolor='#AAAAAA'>$lt{'hg'}</td> |
|
<td bgcolor="#CCCCCC">$content{'highestgradelevel'} </td></tr> |
|
<tr><td bgcolor='#AAAAAA'>$lt{'st'}</td> |
|
<td bgcolor="#CCCCCC">$content{'standards'} </td></tr> |
|
<tr><td bgcolor='#AAAAAA'>$lt{'mi'}</td> |
|
<td bgcolor="#CCCCCC">$mime ($content{'mime'}) </td></tr> |
|
<tr><td bgcolor='#AAAAAA'>$lt{'la'}</td> |
|
<td bgcolor="#CCCCCC">$language </td></tr> |
|
<tr><td bgcolor='#AAAAAA'>$lt{'cd'}</td> |
|
<td bgcolor="#CCCCCC">$creationdate </td></tr> |
|
<tr><td bgcolor='#AAAAAA'> |
|
Last Revision Date</td><td bgcolor="#CCCCCC">$lastrevisiondate </td></tr> |
|
<tr><td bgcolor='#AAAAAA'>$lt{'pu'}</td> |
|
<td bgcolor="#CCCCCC">$owner </td></tr> |
|
<tr><td bgcolor='#AAAAAA'>$lt{'co'}</td> |
|
<td bgcolor="#CCCCCC">$content{'copyright'} </td></tr> |
|
<tr><td bgcolor='#AAAAAA'>$lt{'cf'}</td> |
|
<td bgcolor="#CCCCCC">$customdistributionfile </td></tr> |
|
<tr><td bgcolor='#AAAAAA'>$lt{'ob'}</td> |
|
<td bgcolor="#CCCCCC">$obsolete </td></tr> |
|
<tr><td bgcolor='#AAAAAA'>$lt{'or'}</td> |
|
<td bgcolor="#CCCCCC">$obsoletereplace </td></tr> |
|
</table> |
</table> |
ENDHEAD |
ENDHEAD |
delete($content{'title'}); |
|
delete($content{'author'}); |
|
delete($content{'subject'}); |
|
delete($content{'keywords'}); |
|
delete($content{'notes'}); |
|
delete($content{'abstract'}); |
|
delete($content{'mime'}); |
|
delete($content{'language'}); |
|
delete($content{'creationdate'}); |
|
delete($content{'lastrevisiondate'}); |
|
delete($content{'owner'}); |
|
delete($content{'copyright'}); |
|
delete($content{'customdistributionfile'}); |
|
delete($content{'obsolete'}); |
|
delete($content{'obsoletereplacement'}); |
|
if ($ENV{'user.adv'}) { |
if ($ENV{'user.adv'}) { |
# ------------------------------------------------------------ Dynamic Metadata |
# ------------------------------------------------------------ Dynamic Metadata |
$r->print( |
$r->print( |
Line 364 ENDHEAD
|
Line 357 ENDHEAD
|
&mt('updated periodically').')</h3>'.&mt('Processing'). |
&mt('updated periodically').')</h3>'.&mt('Processing'). |
' ...<br>'); |
' ...<br>'); |
$r->rflush(); |
$r->rflush(); |
my %items=&Apache::lonlocal::texthash( |
my %items=&fieldnames(); |
'count' => 'Network-wide number of accesses (hits)', |
|
'course' => 'Network-wide number of courses using resource', |
|
'usage' => 'Number of resources using or importing resource', |
|
'goto' => 'Number of resources that follow this resource in maps', |
|
'comefrom' => 'Number of resources that lead up to this resource in maps', |
|
'clear' => 'Material presented in clear way', |
|
'depth' => 'Material covered with sufficient depth', |
|
'helpful' => 'Material is helpful', |
|
'correct' => 'Material appears to be correct', |
|
'technical' => 'Resource is technically correct', |
|
'avetries' => 'Average number of tries till solved', |
|
'stdno' => 'Total number of students who have worked on this problem', |
|
'difficulty' => 'Degree of difficulty'); |
|
my %dynmeta=&dynamicmeta($uri); |
my %dynmeta=&dynamicmeta($uri); |
$r->print( |
$r->print( |
'</table><h4>'.&mt('Access and Usage Statistics').'</h4><table cellspacing=2 border=0>'); |
'</table><h4>'.&mt('Access and Usage Statistics').'</h4><table cellspacing=2 border=0>'); |
Line 476 $dynmeta{$_}." </td></tr>\n");
|
Line 456 $dynmeta{$_}." </td></tr>\n");
|
|
|
# ----------------------------------------------------------- Set document type |
# ----------------------------------------------------------- Set document type |
|
|
$r->content_type('text/html'); |
&Apache::loncommon::content_type($r,'text/html'); |
$r->send_http_header; |
$r->send_http_header; |
|
|
return OK if $r->header_only; |
return OK if $r->header_only; |
Line 502 $bodytag
|
Line 482 $bodytag
|
<h1>$displayfile</h1> |
<h1>$displayfile</h1> |
<form method="post"> |
<form method="post"> |
ENDEDIT |
ENDEDIT |
|
my %lt=&fieldnames(); |
foreach ('author','title','subject','keywords','abstract','notes', |
foreach ('author','title','subject','keywords','abstract','notes', |
'copyright','customdistributionfile','language', |
'copyright','customdistributionfile','language', |
'obsolete','obsoletereplacement') { |
'obsolete','obsoletereplacement') { |
Line 509 ENDEDIT
|
Line 490 ENDEDIT
|
$Apache::lonpublisher::metadatafields{$_}=$ENV{'form.new_'.$_}; |
$Apache::lonpublisher::metadatafields{$_}=$ENV{'form.new_'.$_}; |
} |
} |
if (m/copyright/) { |
if (m/copyright/) { |
$r->print(&Apache::lonpublisher::selectbox($_,'new_'.$_, |
$r->print(&Apache::lonpublisher::selectbox($lt{$_},'new_'.$_, |
($Apache::lonpublisher::metadatafields{$_}? |
($Apache::lonpublisher::metadatafields{$_}? |
$Apache::lonpublisher::metadatafields{$_}:'default'), |
$Apache::lonpublisher::metadatafields{$_}:'default'), |
\&Apache::loncommon::copyrightdescription, |
\&Apache::loncommon::copyrightdescription, |
(&Apache::loncommon::copyrightids))); |
(&Apache::loncommon::copyrightids))); |
} elsif (m/language/) { |
} elsif (m/language/) { |
$r->print(&Apache::lonpublisher::selectbox($_,'new_'.$_, |
$r->print(&Apache::lonpublisher::selectbox($lt{$_},'new_'.$_, |
$Apache::lonpublisher::metadatafields{$_}, |
$Apache::lonpublisher::metadatafields{$_}, |
\&Apache::loncommon::languagedescription, |
\&Apache::loncommon::languagedescription, |
(&Apache::loncommon::languageids))); |
(&Apache::loncommon::languageids))); |
} else { |
} else { |
$r->print(&Apache::lonpublisher::textfield($_,'new_'.$_, |
$r->print(&Apache::lonpublisher::textfield($lt{$_},'new_'.$_, |
$Apache::lonpublisher::metadatafields{$_})); |
$Apache::lonpublisher::metadatafields{$_})); |
} |
} |
} |
} |