gustafn
committed
on 30 Jul 22
file upgrade-5.10.1d9-5.10.1d10.sql was initially added on branch oacs-5-10.
/tcl/content-keyword-procs.tcl (+17 -8)
9 9     @arch-tag: dc56be97-e611-4f34-a5b6-264b46a6ad7b
10 10     @cvs-id $Id$
11 11 }
12 12
13 13 namespace eval ::content::keyword {}
14 14
15 15 ad_proc -public content::keyword::write_to_file {
16 16     -item_id:required
17 17     -root_path:required
18 18 } {
19 19     @param item_id
20 20     @param root_path
21 21 } {
22 22     return [package_exec_plsql -var_list [list \
23 23         [list item_id $item_id ] \
24 24         [list root_path $root_path ] \
25 25     ] content_keyword write_to_file]
26 26 }
27 27
28 28
29   ad_proc -public content::keyword::del {
  29 ad_proc -public content::keyword::delete {
30 30     -keyword_id:required
31 31 } {
32 32     @param keyword_id
  33     @return 0
33 34 } {
34 35     return [package_exec_plsql -var_list [list \
35 36         [list keyword_id $keyword_id ] \
36 37     ] content_keyword del]
37 38 }
38 39
39 40
40 41 ad_proc -public content::keyword::get_description {
41 42     -keyword_id:required
42 43 } {
43 44     @param keyword_id
44 45
45       @return VARCHAR2
  46     @return string with description
46 47 } {
47 48     return [package_exec_plsql -var_list [list \
48 49         [list keyword_id $keyword_id ] \
49 50     ] content_keyword get_description]
50 51 }
51 52
52 53
53 54 ad_proc -public content::keyword::get_heading {
54 55     -keyword_id:required
55 56 } {
56 57     @param keyword_id
57 58
58       @return VARCHAR2
  59     @return string with heading
59 60 } {
60 61     return [package_exec_plsql -var_list [list \
61 62         [list keyword_id $keyword_id ] \
62 63     ] content_keyword get_heading]
63 64 }
64 65
65 66
66 67 ad_proc -public content::keyword::get_path {
67 68     -keyword_id:required
68 69 } {
69 70     @param keyword_id
70 71
71       @return VARCHAR2
  72     @return "/" delimited path in the keyword tree to the supplied keyword
72 73 } {
73 74     return [package_exec_plsql -var_list [list \
74 75         [list keyword_id $keyword_id ] \
75 76     ] content_keyword get_path]
76 77 }
77 78
78 79
79 80 ad_proc -public content::keyword::is_assigned {
80 81     -item_id:required
81 82     -keyword_id:required
82 83     {-recurse ""}
83 84 } {
84 85     @param item_id
85 86     @param keyword_id
86 87     @param recurse
87 88
88       @return VARCHAR2
  89     @return t or f
89 90 } {
90 91     return [package_exec_plsql -var_list [list \
91 92         [list item_id $item_id ] \
92 93         [list keyword_id $keyword_id ] \
93 94         [list recurse $recurse ] \
94 95     ] content_keyword is_assigned]
95 96 }
96 97
97 98
98 99 ad_proc -public content::keyword::is_leaf {
99 100     -keyword_id:required
100 101 } {
101 102     @param keyword_id
102 103
103       @return VARCHAR2
  104     @return t or f
104 105 } {
105 106     return [package_exec_plsql -var_list [list \
106 107         [list keyword_id $keyword_id ] \
107 108     ] content_keyword is_leaf]
108 109 }
109 110
110 111
111 112 ad_proc -public content::keyword::item_assign {
112 113     -item_id:required
113 114     -keyword_id:required
114 115     {-context_id ""}
115 116     {-creation_user ""}
116 117     {-creation_ip ""}
117 118 } {
118 119     @param item_id
119 120     @param keyword_id
120 121     @param context_id
121 122     @param creation_user
122 123     @param creation_ip
  124
  125     Associate a keyword with a CR item.
  126
  127     @return 0
123 128 } {
124 129     return [package_exec_plsql -var_list [list \
125 130         [list item_id $item_id ] \
126 131         [list keyword_id $keyword_id ] \
127 132         [list context_id $context_id ] \
128 133         [list creation_user $creation_user ] \
129 134         [list creation_ip $creation_ip ] \
130 135     ] content_keyword item_assign]
131 136 }
132 137
133 138
134 139 ad_proc -public content::keyword::item_unassign {
135 140     -item_id:required
136 141     -keyword_id:required
137 142 } {
138 143     @param item_id
139 144     @param keyword_id
  145
  146     @return 0
140 147 } {
141 148     return [package_exec_plsql -var_list [list \
142 149         [list item_id $item_id ] \
143 150         [list keyword_id $keyword_id ] \
144 151     ] content_keyword item_unassign]
145 152 }
146 153
147 154
148 155 ad_proc -public content::keyword::new {
149 156     -heading:required
150 157     {-description ""}
151 158     {-parent_id ""}
152 159     {-keyword_id ""}
153 160     {-creation_date ""}
154 161     {-creation_user ""}
155 162     {-creation_ip ""}
156 163     {-object_type ""}
157 164 } {
158 165     @param heading
159 166     @param description
160 167     @param parent_id
161 168     @param keyword_id
162 169     @param creation_date
163 170     @param creation_user
164 171     @param creation_ip
165 172     @param object_type
166 173
167       @return NUMBER(38)
  174     @return keyword_id of created keyword
168 175 } {
169 176     return [package_exec_plsql -var_list [list \
170 177         [list heading $heading ] \
171 178         [list description $description ] \
172 179         [list parent_id $parent_id ] \
173 180         [list keyword_id $keyword_id ] \
174 181         [list creation_date $creation_date ] \
175 182         [list creation_user $creation_user ] \
176 183         [list creation_ip $creation_ip ] \
177 184         [list object_type $object_type ] \
178 185     ] content_keyword new]
179 186 }
180 187
181 188
182 189 ad_proc -public content::keyword::set_description {
183 190     -keyword_id:required
184 191     -description:required
185 192 } {
186 193     @param keyword_id
187 194     @param description
  195     @return 0
188 196 } {
189 197     return [package_exec_plsql -var_list [list \
190 198         [list keyword_id $keyword_id ] \
191 199         [list description $description ] \
192 200     ] content_keyword set_description]
193 201 }
194 202
195 203
196 204 ad_proc -public content::keyword::set_heading {
197 205     -keyword_id:required
198 206     -heading:required
199 207 } {
200 208     @param keyword_id
201 209     @param heading
  210     @return 0
202 211 } {
203 212     return [package_exec_plsql -var_list [list \
204 213         [list keyword_id $keyword_id ] \
205 214         [list heading $heading ] \
206 215     ] content_permission set_heading]
207 216 }