[LON-CAPA-cvs] cvs: loncom / loncapa_apache.conf /interface filetypes.tab lonmeta.pm /lonnet/perl lonnet.pm /publisher copyright.tab lonpublisher.pm lonrights.pm doc/loncapafiles loncapafiles.lpml
www
lon-capa-cvs@mail.lon-capa.org
Fri, 14 Mar 2003 02:26:13 -0000
This is a MIME encoded message
--www1047608773
Content-Type: text/plain
www Thu Mar 13 21:26:13 2003 EDT
Added files:
/loncom/publisher lonrights.pm
Modified files:
/doc/loncapafiles loncapafiles.lpml
/loncom loncapa_apache.conf
/loncom/interface filetypes.tab lonmeta.pm
/loncom/lonnet/perl lonnet.pm
/loncom/publisher copyright.tab lonpublisher.pm
Log:
Towards bugs #662 - add customized rights of use (multiple domains,
specific courses, etc).
* Adds new extension ".rights" and handler lonrights.pm for editing and
viewing (not implemented yet)
* Adds new "copyright" metadata value "custom"
* Adds new metadata-field "customdistributionfile" to ".rights" file
(active only if copyright=custom)
* Author can cover large number of resources by one ".rights" file -
if distribution changes, only that one files needs republishing (like
a ".library" file)
--www1047608773
Content-Type: text/plain
Content-Disposition: attachment; filename="www-20030313212613.txt"
Index: doc/loncapafiles/loncapafiles.lpml
diff -u doc/loncapafiles/loncapafiles.lpml:1.220 doc/loncapafiles/loncapafiles.lpml:1.221
--- doc/loncapafiles/loncapafiles.lpml:1.220 Wed Mar 12 19:27:15 2003
+++ doc/loncapafiles/loncapafiles.lpml Thu Mar 13 21:26:12 2003
@@ -2,7 +2,7 @@
"http://lpml.sourceforge.net/DTD/lpml.dtd">
<!-- loncapafiles.lpml -->
-<!-- $Id: loncapafiles.lpml,v 1.220 2003/03/13 00:27:15 www Exp $ -->
+<!-- $Id: loncapafiles.lpml,v 1.221 2003/03/14 02:26:12 www Exp $ -->
<!--
@@ -2032,6 +2032,15 @@
<categoryname>handler</categoryname>
<description>
Handler to show difference between two files.
+</description>
+<status>works/unverified</status>
+</file>
+<file>
+<source>loncom/publisher/lonrights.pm</source>
+<target dist='default'>home/httpd/lib/perl/Apache/lonrights.pm</target>
+<categoryname>handler</categoryname>
+<description>
+Handler to show and edit custom distribution rights
</description>
<status>works/unverified</status>
</file>
Index: loncom/loncapa_apache.conf
diff -u loncom/loncapa_apache.conf:1.38 loncom/loncapa_apache.conf:1.39
--- loncom/loncapa_apache.conf:1.38 Fri Mar 7 20:44:04 2003
+++ loncom/loncapa_apache.conf Thu Mar 13 21:26:12 2003
@@ -1,7 +1,7 @@
##
## loncapa_apache.conf -- Apache HTTP LON-CAPA configuration file
##
-## $Id: loncapa_apache.conf,v 1.38 2003/03/08 01:44:04 www Exp $
+## $Id: loncapa_apache.conf,v 1.39 2003/03/14 02:26:12 www Exp $
##
#
@@ -172,6 +172,11 @@
<LocationMatch "^/(res|\~).*\.meta$>
SetHandler perl-script
PerlHandler Apache::lonmeta
+</LocationMatch>
+
+<LocationMatch "^/(res|\~).*\.rights$>
+SetHandler perl-script
+PerlHandler Apache::lonrights
</LocationMatch>
<LocationMatch "^/(res|\~).*\.(xml|html|htm|xhtml|xhtm)$">
Index: loncom/interface/filetypes.tab
diff -u loncom/interface/filetypes.tab:1.18 loncom/interface/filetypes.tab:1.19
--- loncom/interface/filetypes.tab:1.18 Mon Sep 16 09:05:49 2002
+++ loncom/interface/filetypes.tab Thu Mar 13 21:26:12 2003
@@ -1,7 +1,7 @@
# The LearningOnline Network
# file extension description file
#
-# $Id: filetypes.tab,v 1.18 2002/09/16 13:05:49 www Exp $
+# $Id: filetypes.tab,v 1.19 2003/03/14 02:26:12 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -3253,3 +3253,4 @@
meta hdn Hidden Meta File
log hdn Hidden Log File
bak hdn Hidden Backup File
+rights prv Hidden Custom Distribution Rights File
Index: loncom/interface/lonmeta.pm
diff -u loncom/interface/lonmeta.pm:1.26 loncom/interface/lonmeta.pm:1.27
--- loncom/interface/lonmeta.pm:1.26 Tue Feb 18 17:39:18 2003
+++ loncom/interface/lonmeta.pm Thu Mar 13 21:26:12 2003
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Metadata display handler
#
-# $Id: lonmeta.pm,v 1.26 2003/02/18 22:39:18 www Exp $
+# $Id: lonmeta.pm,v 1.27 2003/03/14 02:26:12 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -380,7 +380,7 @@
<form method="post">
ENDEDIT
foreach ('author','title','subject','keywords','abstract','notes',
- 'copyright','language') {
+ 'copyright','customdistributionfile','language') {
if ($ENV{'form.new_'.$_}) {
$Apache::lonpublisher::metadatafields{$_}=$ENV{'form.new_'.$_};
}
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.337 loncom/lonnet/perl/lonnet.pm:1.338
--- loncom/lonnet/perl/lonnet.pm:1.337 Mon Mar 10 22:22:45 2003
+++ loncom/lonnet/perl/lonnet.pm Thu Mar 13 21:26:12 2003
@@ -1,7 +1,7 @@
# The LearningOnline Network
# TCP networking package
#
-# $Id: lonnet.pm,v 1.337 2003/03/11 03:22:45 albertel Exp $
+# $Id: lonnet.pm,v 1.338 2003/03/14 02:26:12 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -3184,7 +3184,25 @@
# the next is the end of "start tag"
}
}
- $metacache{$uri.':keys'}=join(',',keys %metathesekeys);
+# are there custom rights to evaluate
+ if ($metacache{$uri.':copyright'} eq 'custom') {
+
+ #
+ # Importing a rights file here
+ #
+ unless ($depthcount) {
+ my $location=$metacache{$uri.':customdistributionfile'};
+ my $dir=$filename;
+ $dir=~s|[^/]*$||;
+ $location=&filelocation($dir,$location);
+ foreach (sort(split(/\,/,&metadata($uri,'keys',
+ $location,'_rights',
+ $depthcount+1)))) {
+ $metathesekeys{$_}=1;
+ }
+ }
+ }
+ $metacache{$uri.':keys'}=join(',',keys %metathesekeys);
&metadata_generate_part0(\%metathesekeys,\%metacache,$uri);
$metacache{$uri.':allpossiblekeys'}=join(',',keys %metathesekeys);
$metacache{$uri.':cachedtimestamp'}=time;
Index: loncom/publisher/copyright.tab
diff -u loncom/publisher/copyright.tab:1.5 loncom/publisher/copyright.tab:1.6
--- loncom/publisher/copyright.tab:1.5 Tue Feb 25 11:23:06 2003
+++ loncom/publisher/copyright.tab Thu Mar 13 21:26:12 2003
@@ -1,4 +1,6 @@
-default LON-CAPA Default
-public Public - no authentication required
-priv Private - visible to author only
-domain Domain only - limited to courses in the domain
+default System wide - can be used for any courses system wide
+public Public - no authentication or authorization required for use
+free System wide - open source to all authors
+priv Private - visible to author only for testing purposes
+domain Domain only - use limited to courses in the domain
+custom Customized right of use ...
Index: loncom/publisher/lonpublisher.pm
diff -u loncom/publisher/lonpublisher.pm:1.114 loncom/publisher/lonpublisher.pm:1.115
--- loncom/publisher/lonpublisher.pm:1.114 Fri Mar 7 12:55:05 2003
+++ loncom/publisher/lonpublisher.pm Thu Mar 13 21:26:12 2003
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Publication Handler
#
-# $Id: lonpublisher.pm,v 1.114 2003/03/07 17:55:05 albertel Exp $
+# $Id: lonpublisher.pm,v 1.115 2003/03/14 02:26:12 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1105,7 +1105,8 @@
$metadatafields{'owner'});
# -------------------------------------------------- Correct copyright for rat.
- if ($style eq 'rat') {
+ unless ($style eq 'prv') {
+ if ($style eq 'rat') {
if ($metadatafields{'copyright'} eq 'public') {
delete $metadatafields{'copyright'};
}
@@ -1113,17 +1114,22 @@
$metadatafields{'copyright'},
\&Apache::loncommon::copyrightdescription,
(grep !/^public$/,(&Apache::loncommon::copyrightids)));
- }
- else {
+ } else {
$scrout.=&selectbox('Copyright/Distribution','copyright',
$metadatafields{'copyright'},
\&Apache::loncommon::copyrightdescription,
- (&Apache::loncommon::copyrightids));
- }
+ (&Apache::loncommon::copyrightids));
+ }
- my $copyright_help =
+ my $copyright_help =
Apache::loncommon::help_open_topic('Publishing_Copyright');
- $scrout =~ s/DISTRIBUTION:/'DISTRIBUTION: ' . $copyright_help/ge;
+ $scrout =~ s/DISTRIBUTION:/'DISTRIBUTION: ' . $copyright_help/ge;
+ $scrout.=&textfield('Custom Distribution File','customdistributionfile',
+ $metadatafields{'customdistributionfile'}).
+ $copyright_help;
+ } else {
+ $scrout.=&hiddenfield('copyright','private');
+ }
return ($scrout.'<p><input type="submit" value="Finalize Publication" /></p></form>',0);
# =============================================================================
# BATCH MODE
@@ -1231,6 +1237,8 @@
$metadatafields{'lastrevisiondate'}=$ENV{'form.lastrevisiondate'};
$metadatafields{'owner'}=$ENV{'form.owner'};
$metadatafields{'copyright'}=$ENV{'form.copyright'};
+ $metadatafields{'customdistributionfile'}=
+ $ENV{'form.customdistributionfile'};
$metadatafields{'dependencies'}=$ENV{'form.dependencies'};
my $allkeywords=$ENV{'form.addkey'};
Index: loncom/publisher/lonrights.pm
+++ loncom/publisher/lonrights.pm
# The LearningOnline Network with CAPA
# Handler to show and edit custom distribution rights
#
# $Id: lonrights.pm,v 1.1 2003/03/14 02:26:12 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
# This file is part of the LearningOnline Network with CAPA (LON-CAPA).
#
# LON-CAPA is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# LON-CAPA is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with LON-CAPA; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# /home/httpd/html/adm/gpl.txt
#
# http://www.lon-capa.org/
#
#
###
package Apache::lonrights;
use strict;
use Apache::Constants qw(:common :http);
use Apache::lonnet();
use Apache::loncommon();
sub handler {
my $r=shift;
$r->content_type('text/html');
$r->send_http_header;
$r->print('<html><head><title>LON-CAPA Custom Distribution Rights</title></head>');
$r->print(&Apache::loncommon::bodytag('Custom Distribution Rights'));
$r->print('</body></html>');
return OK;
}
1;
__END__
--www1047608773--