Rev 11312 | Blame | Compare with Previous | Last modification | View Log | RSS feed
# Make index of subclasses for the gateway.
# No calling parameter.
!nocache
!if $wims_superclass=$empty
!exit
!endif
D_=wimshome/log/classes/$wims_superclass
E_=$wims_home/log/classes/$wims_superclass
levels=!sh cd $E_; find . -maxdepth 1 -mindepth 1 -type d -name '[0-9]*' | sed 's!^\./!!'
classes=!sh cd $E_; find . -maxdepth 2 -mindepth 2 -type d -name '1[0-9][0-9]' | sed 's!^\./!!'
progs=!sh cd $E_; find . -maxdepth 2 -mindepth 2 -type d -name '2[0-9][0-9]' | sed 's!^\./!!'
courses=!sh cd $E_; find . -maxdepth 3 -mindepth 3 -type d -name '2[0-9][0-9]' | sed 's!^\./!!'
icourses=!sh cd $E_; find . -maxdepth 3 -mindepth 3 -type d -name '3[0-9][0-9]' | sed 's!^\./!!'
!for n_ in levels,classes,progs,courses,icourses
$n_=!words2items $($n_)
!next n_
cp_=!append item $classes to $progs
cp_=!translate internal / to _ in $cp_
idata=
rdata=
!for c in $cp_
rdata_$c=
idata_$c=
!next c
!for c in $levels
cdata_$c=
pdata_$c=
idata_$c=
!next c
!for c in $courses
c_=!translate internal / to , in $c
cc=!char 1 to 3 of $(c_[3])
l_=$(c_[1])
C_=$(c_[1])_$(c_[2])
p_=$(c_[1])_$cc
t_=!defof class_Supervisor\
class_supervisor\
class_description\
class_connections\
in $D_/$c/.def
!distribute lines $t_ into s_,n_,t_,co_
co_=!items2words $co_
L_=$c,$s_,$t_,$n_,$co_
rdata_$l_=!append line $L_ to $(rdata_$l_)
rdata_$C_=!append line $L_ to $(rdata_$C_)
rdata_$p_=!append line $L_ to $(rdata_$p_)
rdata=!append line $L_ to $(rdata)
!next c
!for c in $icourses
c_=!translate internal / to , in $c
l_=$(c_[1])
p_=$(c_[1])_$(c_[2])
t_=!defof class_Supervisor\
class_supervisor\
class_description\
class_connections\
in $D_/$c/.def
!distribute lines $t_ into s_,n_,t_
L_=$c,$s_,$t_,$n_
idata_$l_=!append line $L_ to $(idata_$l_)
idata_$p_=!append line $L_ to $(idata_$p_)
vistest=!defof class_visibility in $D_/$c/.def
!!ifval $vistest=2
idata=!append line $L_ to $idata
!!endif
!next c
cdata=
!for c in $classes
c_=!translate internal / to , in $c
c_=!item 1 of $c_
t_=!defof class_Supervisor\
class_supervisor\
class_description\
class_connections\
in $D_/$c/.def
!distribute lines $t_ into s_,n_,t_,co_
co_=!items2words $co_
cdata=!append line $c,$s_,$t_,$n_,$co_ to $cdata
cdata_$c_=!append line $c,$s_,$t_,$n_ to $(cdata_$c_)
c_=!translate internal / to _ in $c
!writefile $D_/$c/courses $(rdata_$c_)
!next c
!writefile $D_/courses $(rdata_$c_)
pdata=
!for c in $progs
c_=!translate internal / to , in $c
c_=!item 1 of $c_
t_=!defof class_Supervisor\
class_supervisor\
class_description\
class_connections\
in $D_/$c/.def
!distribute lines $t_ into s_,n_,t_,co_
co_=!items2words $co_
pdata=!append line $c,$s_,$t_,$n_,$co_ to $pdata
pdata_$c_=!append line $c,$s_,$t_,$n_,$co_ to $(pdata_$c_)
c_=!translate internal / to _ in $c
!writefile $D_/$c/courses $(rdata_$c_)
!writefile $D_/$c/icourses $(idata_$c_)
!next c
ldata=
!for c in $levels
t_=!defof class_Supervisor\
class_supervisor\
class_description\
class_connections\
in $D_/$c/.def
!distribute lines $t_ into s_,n_,t_,co_
co_=!items2words $co_
ldata=!append line $c,$s_,$t_,$n_,$co_ to $ldata
!writefile $D_/$c/classes $(cdata_$c)
!writefile $D_/$c/programs $(pdata_$c)
!writefile $D_/$c/courses $(rdata_$c)
!writefile $D_/$c/icourses $(idata_$c)
!next c
!writefile $D_/levels $ldata
!writefile $D_/classes $cdata
!writefile $D_/programs $pdata
!writefile $D_/icourses $idata
!writefile $D_/courses $rdata