olah
committed
on 13 Jun 03
Removed dummy curriculums that was created after instantiation.
/tcl/apm-callback-procs.tcl (+1 -46)
27 27     }
28 28 }
29 29
30 30
31 31 ad_proc -private curriculum::apm::before_uninstall {} {
32 32     Package un-installation callback proc.
33 33 } {
34 34     db_transaction {
35 35         curriculum::workflow_delete
36 36         curriculum::apm::unregister_implementations
37 37     }
38 38 }
39 39
40 40
41 41 ad_proc -private curriculum::apm::after_instantiate {
42 42     {-package_id:required}
43 43 } {
44 44     Package instantiation callback proc.
45 45 } {
46 46     curriculum::instance_workflow_create -package_id $package_id
47      
48       ###
49       # FIXME. We just set this up for convenience during development.
50       ###
51      
52       db_transaction {
53  
54           set subsite_url [curriculum::conn subsite_url]
55  
56           # Create a curriculum.
57           set curriculum_id [curriculum::new \
58                                  -name [set name "Demo Curriculum A"] \
59                                  -description "$name description." \
60                                  -package_id $package_id]
61           
62           # Add some elements.
63           foreach { url label } [list ${subsite_url}api-doc/ "API Documentation" ${subsite_url} "Home" ${subsite_url}doc/ "Package Documentation"] {
64               curriculum::element::new \
65                   -curriculum_id $curriculum_id \
66                   -name $label \
67                   -description "Description of <i>$label</i>." \
68                   -desc_format "text/html" \
69                   -url $url
70 47 }
71 48
72           # Create a curriculum.
73           set curriculum_id [curriculum::new \
74                                  -name [set name "Demo Curriculum B"] \
75                                  -description "$name description." \
76                                  -package_id $package_id]
77 49
78           # Add some elements.
79           foreach { url label } [list ${subsite_url}curriculum/ "Curriculum Home" ${subsite_url}admin/ "Admin" ${subsite_url}acs-service-contract/ "Service Contracts" http://openacs.org "OpenACS Website"] {
80               curriculum::element::new \
81                   -curriculum_id $curriculum_id \
82                   -name $label \
83                   -description "Description of <i>$label</i>." \
84                   -desc_format "text/fixed-width" \
85                   -url $url
86           }
87           
88       }
89  
90       curriculum::elements_flush
91  
92   }
93  
94  
95 50 ad_proc -private curriculum::apm::before_uninstantiate {
96 51     {-package_id:required}
97 52 } {
98 53     Package un-instantiation callback proc.
99 54 } {
100 55     db_transaction {
101 56         # Deletes the curriculum(s) in a package instance including
102 57         # their data and associated workflow cases.
103 58         curriculum::delete_instance -package_id $package_id
104 59
105 60         curriculum::instance_workflow_delete -package_id $package_id
106 61     }
107 62 }
108 63
109 64
110 65 #####
111 66 #
112 67 # Service contract implementations.
113 68 #
114 69 #####