[LON-CAPA-cvs] cvs: loncom /imspackages imsimport.pm imsimportdocs.pm imsprocessor.pm

raeburn raeburn@source.lon-capa.org
Mon, 17 Aug 2009 03:52:09 -0000


This is a MIME encoded message

--raeburn1250481129
Content-Type: text/plain

raeburn		Mon Aug 17 03:52:09 2009 EDT

  Modified files:              
    /loncom/imspackages	imsimportdocs.pm imsprocessor.pm imsimport.pm 
  Log:
  - CMS option "ANGEL" changed to "ANGEL 5.5" to emphasize that existing support is for the IMS packages generated by the 5.5 version.
    (More recent releases create IMS content packages with different packaging).
  
  
--raeburn1250481129
Content-Type: text/plain
Content-Disposition: attachment; filename="raeburn-20090817035209.txt"

Index: loncom/imspackages/imsimportdocs.pm
diff -u loncom/imspackages/imsimportdocs.pm:1.22 loncom/imspackages/imsimportdocs.pm:1.23
--- loncom/imspackages/imsimportdocs.pm:1.22	Mon May  4 16:45:51 2009
+++ loncom/imspackages/imsimportdocs.pm	Mon Aug 17 03:52:09 2009
@@ -1,6 +1,6 @@
 # The LearningOnline Network with CAPA
 #
-# $Id: imsimportdocs.pm,v 1.22 2009/05/04 16:45:51 bisitz Exp $
+# $Id: imsimportdocs.pm,v 1.23 2009/08/17 03:52:09 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -237,7 +237,7 @@
          <option value='-1' selected="true">Please select</option>
          <option value='bb5'>Blackboard 5</option>
          <option value='bb6'>Blackboard 6</option>
-         <option value='angel'>ANGEL</option>
+         <option value='angel5'>ANGEL 5.5</option>
          <option value='webctce4'>WebCT 4 Campus Edition</option>
         </select>
         </font>
@@ -346,7 +346,7 @@
                             $count{$area} ++;
                         }
                     }
-                } elsif ($cms eq 'angel') {
+                } elsif ($cms eq 'angel5') {
                     foreach my $area (keys %{$cmsmap{$cms}}) {
                         if ($area eq 'doc') {
                             if (grep/^$resources{$res}{type}$/,@{$cmsmap{$cms}{doc}}) {
@@ -553,7 +553,7 @@
 
     foreach my $area (@{$areas}) {
         if (defined($env{"form.$area"}) && ($env{'form.'.$area} ne '')) {
-            if ($cms eq 'angel' && $area eq 'doc') {
+            if ($cms eq 'angel5' && $area eq 'doc') {
                 foreach (@{$cmsmap{$cms}{$area}}) {
                     $importareas{$_} = 1;
                 }
Index: loncom/imspackages/imsprocessor.pm
diff -u loncom/imspackages/imsprocessor.pm:1.47 loncom/imspackages/imsprocessor.pm:1.48
--- loncom/imspackages/imsprocessor.pm:1.47	Wed Jul 15 08:26:55 2009
+++ loncom/imspackages/imsprocessor.pm	Mon Aug 17 03:52:09 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Processor for IMS Packages
 #
-# $Id: imsprocessor.pm,v 1.47 2009/07/15 08:26:55 bisitz Exp $
+# $Id: imsprocessor.pm,v 1.48 2009/08/17 03:52:09 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -62,14 +62,14 @@
                 users => 'course/x-bb-user',
                 );
     $$cmsmap{bb6}{conference} = 'resource/x-bb-conference';
-    %{$$cmsmap{angel}} =  (
+    %{$$cmsmap{angel5}} =  (
                 board => 'BOARD',
                 extlink => 'LINK',
                 msg => 'MESSAGE',
                 quiz => 'QUIZ',
                 survey => 'FORM',
                 );
-    @{$$cmsmap{angel}{doc}} = ('FILE','PAGE');
+    @{$$cmsmap{angel5}{doc}} = ('FILE','PAGE');
     %{$$cmsmap{webctce4}} = (
                 quiz => 'webctquiz',
                 survey => 'webctsurvey',
@@ -170,7 +170,7 @@
     my %toc = (
               bb6 => 'organization',
               bb5 => 'tableofcontents',
-              angel => 'organization',
+              angel5 => 'organization',
               webctce4 => 'organization',
               webctvista4 => 'organization'
               );
@@ -183,7 +183,7 @@
                                   revitm => 'Top'
                                  );
  
-    if ($cms eq 'angel') {
+    if ($cms eq 'angel5') {
         $$resources{'toplevel'}{type} = "FOLDER";
     } elsif ($cms eq 'bb5' || $cms eq 'bb6') {
         $$resources{'toplevel'}{type} = 'resource/x-bb-document';
@@ -230,7 +230,7 @@
                                 if ($cms eq 'bb5') {
                                     $$items{$itm}{title} = $attr->{title};
                                 }
-                            } elsif ($cms eq 'angel') {
+                            } elsif ($cms eq 'angel5') {
                                 if ($attr->{identifierref} =~ m/^res(.+)$/) {
                                     $$items{$itm}{resnum} = $1;
                                 }
@@ -298,7 +298,7 @@
                         } elsif ($cms eq 'webctvista4') {
                             $$resources{$identifier}{type} = $attr->{type};
                             $$resources{$identifier}{'webct:coType'} = $attr->{'webct:coType'};
-                        } elsif ($cms eq 'angel') {
+                        } elsif ($cms eq 'angel5') {
                             $identifier = substr($identifier,3);
                             if ($attr->{href} =~ m-^_assoc/$identifier/(.+)$-) {
                                 $$resources{$identifier}{file} = $1;
@@ -327,7 +327,7 @@
                                                 $items,$resources,$resinfo,
                                                 $hrefs,$currseqref);
                             }
-                        } elsif ($cms eq 'angel') {
+                        } elsif ($cms eq 'angel5') {
                             if ($attr->{href} =~ m/^_assoc\\$identifier\\(.+)$/) {
                                 push @{$$hrefs{$identifier}},$1;
                             } elsif ($attr->{href} =~ m/^Icons\\icon(\w+)\.gif/) {
@@ -351,7 +351,7 @@
                 }
                 if ($state[0] eq "manifest" && $state[1] eq "organizations" && $state[2] eq $$toc{$cms} && $state[-1] eq "title") {
                     if ($$includeditems{$itm} || $phase ne 'build') {
-                        if ($cms eq 'angel' || $cms eq 'bb6' || $cms eq 'webctvista4') {
+                        if ($cms eq 'angel5' || $cms eq 'bb6' || $cms eq 'webctvista4') {
                             $$items{$itm}{title} = $text;
                         }
                         if ($cms eq 'webctce4') {
@@ -426,7 +426,7 @@
                     }
                     my $filename = '';
                     my $fpath = $timenow.'/resfiles/'.$key.'/';
-                    if ($cms eq 'angel') {
+                    if ($cms eq 'angel5') {
                         if ($file eq 'pg'.$key.'.htm') {
                             next;
                         }
@@ -456,7 +456,7 @@
             if (grep/^$key$/,@{$targets}) {
                 foreach my $file (@{$$hrefs{$key}}) {
                     $file =~ s-\\-/-g;
-                    if ( ($cms eq 'angel' && $file ne 'pg'.$key.'.htm') || ($cms eq 'bb5') || ($cms eq 'bb6')) {
+                    if ( ($cms eq 'angel5' && $file ne 'pg'.$key.'.htm') || ($cms eq 'bb5') || ($cms eq 'bb6')) {
                         if (!-e "$destdir/resfiles/$key") {
                             mkdir("$destdir/resfiles/$key",0770);
                         }
@@ -472,7 +472,7 @@
                             }
                         }
                         my $renameres;
-                        if ($cms eq 'angel') {
+                        if ($cms eq 'angel5') {
                             $renameres = rename("$tempdir/_assoc/$key/$file","$destdir/resfiles/$key/$file");
                         } elsif ($cms eq 'bb5' || $cms eq 'bb6') {
                             $renameres = rename("$tempdir/$key/$file","$destdir/resfiles/$key/$file");
@@ -537,7 +537,7 @@
             mkdir("$destdir/resfiles",0770);
         }
     }
-    if ($cms eq 'angel') {
+    if ($cms eq 'angel5') {
         my $currboard = '';
         foreach my $key (sort keys %{$resources}) {
           if (grep/^$key$/,@{$targets}) {
@@ -764,7 +764,7 @@
         $seqtitle =~ s|/+|_|g;
         $seqtitle =~ s/\s+/_/g;
         $seqtitle .= '_'.$key;
-        if (($cms eq 'angel' && $type eq "FOLDER") || (($cms eq 'bb5' || $cms eq 'bb6') && $$resinfo{$resnum}{'isfolder'} eq "true") && (($type eq "resource/x-bb-document") || ($type eq "resource/x-bb-staffinfo") || ($type eq "resource/x-bb-externallink")) || ($cms eq 'webctce4' &&  $contentscount > 0)) {
+        if (($cms eq 'angel5' && $type eq "FOLDER") || (($cms eq 'bb5' || $cms eq 'bb6') && $$resinfo{$resnum}{'isfolder'} eq "true") && (($type eq "resource/x-bb-document") || ($type eq "resource/x-bb-staffinfo") || ($type eq "resource/x-bb-externallink")) || ($cms eq 'webctce4' &&  $contentscount > 0)) {
             unless (($cms eq 'bb5') && $key eq 'Top') {
                 $seqtext{$key} = "<map>\n";
             }
@@ -1007,7 +1007,7 @@
 sub make_structure {
     my ($cms,$key,$srcstem,$flag,$count,$timestamp,$boardnum,$hrefs,$pagecontents,$res,$type,$file,$resinfo,$contitem,$uname,$cdom,$contcount,$packageflag,$contitemcount,$randompick,$title) = @_;
     my $src ='';
-    if (($cms eq 'angel' && $type eq 'FOLDER') || (($cms eq 'bb5' || $cms eq 'bb6') && (($$resinfo{$res}{'isfolder'} eq 'true') || $key eq 'Top')) || ($cms eq 'webctce4' && $contitemcount > 0)) {
+    if (($cms eq 'angel5' && $type eq 'FOLDER') || (($cms eq 'bb5' || $cms eq 'bb6') && (($$resinfo{$res}{'isfolder'} eq 'true') || $key eq 'Top')) || ($cms eq 'webctce4' && $contitemcount > 0)) {
         $src = $srcstem.'/sequences/'.$contitem.'.sequence';
         if ($cms eq 'webctce4') {
             $title =~ s|/+|_|g;
@@ -1023,12 +1023,12 @@
         $$flag{$key}{page} = 0;
         $$flag{$key}{seq} = 1;
         $$count{$key}{seq} ++;
-    } elsif ($cms eq 'angel' && $type eq 'BOARD') {
+    } elsif ($cms eq 'angel5' && $type eq 'BOARD') {
         $src = '/adm/'.$cdom.'/'.$uname.'/'.$$timestamp[$$boardnum{$res}].'/bulletinboard'; 
         $$flag{$key}{page} = 0;
         $$flag{$key}{board} = 1;
         $$count{$key}{board} ++;
-    } elsif ($cms eq 'angel' && $type eq "FILE") {
+    } elsif ($cms eq 'angel5' && $type eq "FILE") {
         foreach my $file (@{$$hrefs{$res}}) {
             unless ($file eq 'pg'.$res.'.htm') {
                 $src = $srcstem.'/resfiles/'.$res.'/'.$file;
@@ -1036,7 +1036,7 @@
         }
         $$flag{$key}{page} = 0;
         $$flag{$key}{file} = 1;
-    } elsif ($cms eq 'angel' && (($type eq "PAGE") || ($type eq "LINK")) )  {
+    } elsif ($cms eq 'angel5' && (($type eq "PAGE") || ($type eq "LINK")) )  {
         if ($$flag{$key}{page}) {
             if ($$count{$key}{page} == -1) {
                 &Apache::lonnet::logthis("IMS Angel import error in array index for page: value = -1, resource is $key, type is $type.");
Index: loncom/imspackages/imsimport.pm
diff -u loncom/imspackages/imsimport.pm:1.31 loncom/imspackages/imsimport.pm:1.32
--- loncom/imspackages/imsimport.pm:1.31	Thu May 14 14:24:26 2009
+++ loncom/imspackages/imsimport.pm	Mon Aug 17 03:52:09 2009
@@ -1,6 +1,6 @@
 # The LearningOnline Network with CAPA
 # 
-# $Id: imsimport.pm,v 1.31 2009/05/14 14:24:26 bisitz Exp $
+# $Id: imsimport.pm,v 1.32 2009/08/17 03:52:09 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -299,7 +299,7 @@
          <option value="-1" selected="selected">Please select</option>
          <option value="bb5">Blackboard 5</option>
          <option value="bb6">Blackboard 6</option>
-         <option value="angel">ANGEL</option>
+         <option value="angel5">ANGEL 5.5</option>
          <option value="webctce4">WebCT 4 Campus Edition</option>
          <option value="webctvista4">WebCT Vista 4</option>
         </select><br />'."\n".
@@ -380,7 +380,7 @@
                             $count{$area} ++;
                         }
                     }
-                } elsif ($cms eq 'angel') {
+                } elsif ($cms eq 'angel5') {
                     foreach my $area (keys %{$$cmsmap{$cms}}) {
                         if ($area eq 'doc') {
                             if (grep/^$resources{$res}{type}$/,@{$$cmsmap{$cms}{doc}}) {
@@ -526,7 +526,7 @@
 
     foreach my $area (@{$areas}) {
         if (defined($env{"form.$area"}) ) {
-            if ($cms eq 'angel' && $area eq 'doc') {
+            if ($cms eq 'angel5' && $area eq 'doc') {
                 foreach (@{$$cmsmap{$cms}{$area}}) {
                     $importareas{$_} = 1;
                 }
@@ -599,7 +599,7 @@
 
         $r->print("<h3>IMS import completed</h3>");
 
-        if ($cms eq 'angel') {
+        if ($cms eq 'angel5') {
             $r->print($lt{'yims'}.' '.&mt('A total of [quant,_1,sequence], [quant,_2,composite page], and [quant,_3,bulletin board] have been created, and [quant,_4,file] copied.',$total{seq},$total{page},$total{board},$total{file})."\n");
         } else {
             $r->print($lt{'yims'}.' '.&mt('A total of [quant,_1,sequence], [quant,_2,composite page], [quant,_3,bulletin board], [quant,_4,quiz,quizzes], [quant,_5,survey], and [quant,_6,problem] have been created, and [quant,_7,file] copied.',$total{seq},$total{page},$total{board},$total{quiz},$total{surv},$total{prob},$total{file})."\n");

--raeburn1250481129--