[12863] | 1 | .. _export: |
---|
| 2 | |
---|
| 3 | Data Export |
---|
| 4 | *********** |
---|
| 5 | |
---|
[12870] | 6 | Regular data exporters (1) collect objects from specific containers, |
---|
| 7 | (2) iterate over the collected objects, (3) extract and mangle |
---|
| 8 | information from each object, (4) write the information of each object |
---|
| 9 | into a row of a CSV file and (5) finally provide the file for |
---|
| 10 | download. The CSV file is neither stored in the database nor archived |
---|
| 11 | in the filesystem. (3) and (4) means a flattening of the hierarchical |
---|
| 12 | data structure, i.e. a mapping of objects to flat relational data to |
---|
| 13 | be stored in a CSV table. The extracted information must not |
---|
| 14 | necessarily be based only on static attributes of the collected |
---|
| 15 | object. The data, finally stored in the CSV file, can also be derived |
---|
| 16 | from parent or child objects, or dynamically computed by the object's |
---|
| 17 | methods and property attributes. These methods and properties can |
---|
| 18 | retrieve information from everywhere in the portal's database. In the |
---|
| 19 | following we list all exporter classes including two attributes and a |
---|
| 20 | method description. The `fields` attribute contain the column titles |
---|
| 21 | of the export file. These are not necessarily only attributes of the |
---|
| 22 | exported objects. |
---|
[12863] | 23 | |
---|
| 24 | .. note:: |
---|
| 25 | |
---|
[12883] | 26 | The list of exported columns usually underlies heavy customizations. |
---|
| 27 | In the Kofa base package only very few columns are being exported. In |
---|
| 28 | some Kofa custom packages tons of data are being gathered from |
---|
[13104] | 29 | applicants and students and the number of columns increases |
---|
| 30 | accordingly. |
---|
[12863] | 31 | |
---|
[12870] | 32 | The `title` attribute unveils the name of the exporter under which |
---|
| 33 | this exporter will be displayed in the user interface. The |
---|
| 34 | `mangle_value()` method shows how some of fields are being dynamically |
---|
| 35 | computed. |
---|
[12863] | 36 | |
---|
| 37 | Regular Exporters |
---|
| 38 | ================= |
---|
| 39 | |
---|
| 40 | User Exporter |
---|
| 41 | ------------- |
---|
| 42 | |
---|
| 43 | .. autoclass:: waeup.kofa.userscontainer.UserExporter() |
---|
| 44 | |
---|
| 45 | .. autoattribute:: waeup.kofa.userscontainer.UserExporter.fields |
---|
| 46 | .. autoattribute:: waeup.kofa.userscontainer.UserExporter.title |
---|
| 47 | .. automethod:: waeup.kofa.userscontainer.UserExporter.mangle_value() |
---|
| 48 | |
---|
| 49 | Faculty Exporter |
---|
| 50 | ---------------- |
---|
| 51 | |
---|
| 52 | .. autoclass:: waeup.kofa.university.export.FacultyExporter() |
---|
| 53 | |
---|
| 54 | .. autoattribute:: waeup.kofa.university.export.FacultyExporter.fields |
---|
| 55 | .. autoattribute:: waeup.kofa.university.export.FacultyExporter.title |
---|
| 56 | .. automethod:: waeup.kofa.university.export.FacultyExporter.mangle_value() |
---|
| 57 | |
---|
| 58 | Department Exporter |
---|
| 59 | ------------------- |
---|
| 60 | |
---|
| 61 | .. autoclass:: waeup.kofa.university.export.DepartmentExporter() |
---|
| 62 | |
---|
| 63 | .. autoattribute:: waeup.kofa.university.export.DepartmentExporter.fields |
---|
| 64 | .. autoattribute:: waeup.kofa.university.export.DepartmentExporter.title |
---|
| 65 | .. automethod:: waeup.kofa.university.export.DepartmentExporter.mangle_value() |
---|
| 66 | |
---|
| 67 | Course Exporter |
---|
| 68 | --------------- |
---|
| 69 | |
---|
| 70 | .. autoclass:: waeup.kofa.university.export.CourseExporter() |
---|
| 71 | |
---|
| 72 | .. autoattribute:: waeup.kofa.university.export.CourseExporter.fields |
---|
| 73 | .. autoattribute:: waeup.kofa.university.export.CourseExporter.title |
---|
| 74 | .. automethod:: waeup.kofa.university.export.CourseExporter.mangle_value() |
---|
| 75 | |
---|
| 76 | Certificate Exporter |
---|
| 77 | -------------------- |
---|
| 78 | |
---|
| 79 | .. autoclass:: waeup.kofa.university.export.CertificateExporter() |
---|
| 80 | |
---|
| 81 | .. autoattribute:: waeup.kofa.university.export.CertificateExporter.fields |
---|
| 82 | .. autoattribute:: waeup.kofa.university.export.CertificateExporter.title |
---|
| 83 | .. automethod:: waeup.kofa.university.export.CertificateExporter.mangle_value() |
---|
| 84 | |
---|
| 85 | Certificate Course Exporter |
---|
| 86 | --------------------------- |
---|
| 87 | |
---|
| 88 | .. autoclass:: waeup.kofa.university.export.CertificateCourseExporter() |
---|
| 89 | |
---|
| 90 | .. autoattribute:: waeup.kofa.university.export.CertificateCourseExporter.fields |
---|
| 91 | .. autoattribute:: waeup.kofa.university.export.CertificateCourseExporter.title |
---|
| 92 | .. automethod:: waeup.kofa.university.export.CertificateCourseExporter.mangle_value() |
---|
| 93 | |
---|
| 94 | Access Code Batch Exporter |
---|
| 95 | -------------------------- |
---|
| 96 | |
---|
| 97 | .. autoclass:: waeup.kofa.accesscodes.export.AccessCodeBatchExporter() |
---|
| 98 | |
---|
| 99 | .. autoattribute:: waeup.kofa.accesscodes.export.AccessCodeBatchExporter.fields |
---|
| 100 | .. autoattribute:: waeup.kofa.accesscodes.export.AccessCodeBatchExporter.title |
---|
| 101 | |
---|
| 102 | Access Code Exporter |
---|
| 103 | -------------------- |
---|
| 104 | |
---|
| 105 | .. autoclass:: waeup.kofa.accesscodes.export.AccessCodeExporter() |
---|
| 106 | |
---|
| 107 | .. autoattribute:: waeup.kofa.accesscodes.export.AccessCodeExporter.fields |
---|
| 108 | .. autoattribute:: waeup.kofa.accesscodes.export.AccessCodeExporter.title |
---|
| 109 | .. automethod:: waeup.kofa.accesscodes.export.AccessCodeExporter.mangle_value() |
---|
| 110 | |
---|
| 111 | Hostel Exporter |
---|
| 112 | --------------- |
---|
| 113 | |
---|
| 114 | .. autoclass:: waeup.kofa.hostels.export.HostelExporter() |
---|
| 115 | |
---|
| 116 | .. autoattribute:: waeup.kofa.hostels.export.HostelExporter.fields |
---|
| 117 | .. autoattribute:: waeup.kofa.hostels.export.HostelExporter.title |
---|
| 118 | |
---|
| 119 | Bed Exporter |
---|
| 120 | ------------ |
---|
| 121 | |
---|
| 122 | .. autoclass:: waeup.kofa.hostels.export.BedExporter() |
---|
| 123 | |
---|
| 124 | .. autoattribute:: waeup.kofa.hostels.export.BedExporter.fields |
---|
| 125 | .. autoattribute:: waeup.kofa.hostels.export.BedExporter.title |
---|
| 126 | |
---|
[13144] | 127 | Document Exporter |
---|
| 128 | ----------------- |
---|
| 129 | |
---|
| 130 | .. autoclass:: waeup.kofa.documents.export.DocumentExporterBase() |
---|
| 131 | |
---|
| 132 | .. automethod:: waeup.kofa.documents.export.DocumentExporterBase.mangle_value() |
---|
| 133 | |
---|
[12863] | 134 | Application Data Exporters |
---|
| 135 | ========================== |
---|
| 136 | |
---|
| 137 | Applicants Container Exporter |
---|
| 138 | ----------------------------- |
---|
| 139 | |
---|
| 140 | .. autoclass:: waeup.kofa.applicants.export.ApplicantsContainerExporter() |
---|
| 141 | |
---|
| 142 | .. autoattribute:: waeup.kofa.applicants.export.ApplicantsContainerExporter.fields |
---|
| 143 | .. autoattribute:: waeup.kofa.applicants.export.ApplicantsContainerExporter.title |
---|
| 144 | |
---|
| 145 | Applicant Exporter |
---|
| 146 | ------------------ |
---|
| 147 | |
---|
| 148 | .. autoclass:: waeup.kofa.applicants.export.ApplicantExporter() |
---|
| 149 | |
---|
| 150 | .. autoattribute:: waeup.kofa.applicants.export.ApplicantExporter.fields |
---|
| 151 | .. autoattribute:: waeup.kofa.applicants.export.ApplicantExporter.title |
---|
| 152 | .. automethod:: waeup.kofa.applicants.export.ApplicantExporter.mangle_value() |
---|
| 153 | |
---|
[13949] | 154 | Applicant Payment Exporter |
---|
| 155 | -------------------------- |
---|
| 156 | |
---|
| 157 | .. autoclass:: waeup.kofa.applicants.export.ApplicantPaymentExporter() |
---|
| 158 | |
---|
| 159 | .. autoattribute:: waeup.kofa.applicants.export.ApplicantPaymentExporter.fields |
---|
| 160 | .. autoattribute:: waeup.kofa.applicants.export.ApplicantPaymentExporter.title |
---|
| 161 | .. automethod:: waeup.kofa.applicants.export.ApplicantPaymentExporter.mangle_value() |
---|
| 162 | |
---|
[12863] | 163 | Student Data Exporters |
---|
[12865] | 164 | ====================== |
---|
[12863] | 165 | |
---|
[12870] | 166 | When starting a Student Data Exporter in the Data Center all student |
---|
| 167 | records will be taken into consideration, no matter what or where a |
---|
| 168 | student is studying. The exporter can also be started 'locally' at |
---|
| 169 | various levels in the academic section. Starting one of the exporters |
---|
| 170 | e.g. at faculty or department level means that only the data of |
---|
| 171 | students are exported who study in this faculty or department |
---|
| 172 | respectively. The exporter can also be started at certificate level. |
---|
| 173 | Then only the data of students, who are studying the named study |
---|
| 174 | course, will be taken into account. At course level the data of those |
---|
| 175 | students are being exported who have attended or taken this specific |
---|
| 176 | course. |
---|
[12863] | 177 | |
---|
[12870] | 178 | Student Data Exporter can be further configured through a |
---|
| 179 | configuration page. Search parameters like the student's current level, |
---|
[12883] | 180 | current session and current study mode can be set to filter sets of |
---|
[12870] | 181 | students in order to decrease the size of the export file. The set of |
---|
| 182 | filter parameters varies and depends on the 'locatation' from where |
---|
| 183 | the exporter is called. A completely different set of filter |
---|
| 184 | parameters is provided for courses. In this case the session and level |
---|
| 185 | can be selected when the course was taken by the student. |
---|
[12863] | 186 | |
---|
| 187 | Student Exporter |
---|
| 188 | ---------------- |
---|
| 189 | |
---|
| 190 | .. autoclass:: waeup.kofa.students.export.StudentExporter() |
---|
| 191 | |
---|
| 192 | .. autoattribute:: waeup.kofa.students.export.StudentExporter.fields |
---|
| 193 | .. autoattribute:: waeup.kofa.students.export.StudentExporter.title |
---|
| 194 | .. automethod:: waeup.kofa.students.export.StudentExporter.mangle_value() |
---|
| 195 | |
---|
| 196 | Student Study Course Exporter |
---|
| 197 | ----------------------------- |
---|
| 198 | |
---|
| 199 | .. autoclass:: waeup.kofa.students.export.StudentStudyCourseExporter() |
---|
| 200 | |
---|
| 201 | .. autoattribute:: waeup.kofa.students.export.StudentStudyCourseExporter.fields |
---|
| 202 | .. autoattribute:: waeup.kofa.students.export.StudentStudyCourseExporter.title |
---|
| 203 | .. automethod:: waeup.kofa.students.export.StudentStudyCourseExporter.mangle_value() |
---|
| 204 | |
---|
| 205 | Student Study Level Exporter |
---|
| 206 | ---------------------------- |
---|
| 207 | |
---|
| 208 | .. autoclass:: waeup.kofa.students.export.StudentStudyLevelExporter() |
---|
| 209 | |
---|
| 210 | .. autoattribute:: waeup.kofa.students.export.StudentStudyLevelExporter.fields |
---|
| 211 | .. autoattribute:: waeup.kofa.students.export.StudentStudyLevelExporter.title |
---|
| 212 | .. automethod:: waeup.kofa.students.export.StudentStudyLevelExporter.mangle_value() |
---|
| 213 | |
---|
| 214 | Course Ticket Exporter |
---|
| 215 | ---------------------- |
---|
| 216 | |
---|
| 217 | .. autoclass:: waeup.kofa.students.export.CourseTicketExporter() |
---|
| 218 | |
---|
| 219 | .. autoattribute:: waeup.kofa.students.export.CourseTicketExporter.fields |
---|
| 220 | .. autoattribute:: waeup.kofa.students.export.CourseTicketExporter.title |
---|
| 221 | .. automethod:: waeup.kofa.students.export.CourseTicketExporter.mangle_value() |
---|
| 222 | |
---|
[15873] | 223 | Student Outstanding Courses Exporter |
---|
| 224 | ---------------------- |
---|
| 225 | |
---|
| 226 | .. autoclass:: waeup.kofa.students.export.StudentOutstandingCoursesExporter() |
---|
| 227 | |
---|
| 228 | .. autoattribute:: waeup.kofa.students.export.StudentOutstandingCoursesExporter.fields |
---|
| 229 | .. autoattribute:: waeup.kofa.students.export.StudentOutstandingCoursesExporter.title |
---|
| 230 | .. automethod:: waeup.kofa.students.export.StudentOutstandingCoursesExporter.mangle_value() |
---|
| 231 | |
---|
[12865] | 232 | Student Payment Exporter |
---|
| 233 | ------------------------ |
---|
[12863] | 234 | |
---|
[12865] | 235 | .. autoclass:: waeup.kofa.students.export.StudentPaymentExporter() |
---|
[12863] | 236 | |
---|
[12865] | 237 | .. autoattribute:: waeup.kofa.students.export.StudentPaymentExporter.fields |
---|
| 238 | .. autoattribute:: waeup.kofa.students.export.StudentPaymentExporter.title |
---|
| 239 | .. automethod:: waeup.kofa.students.export.StudentPaymentExporter.mangle_value() |
---|
[12863] | 240 | |
---|
[12971] | 241 | Student Unpaid Payment Exporter |
---|
| 242 | ------------------------------- |
---|
| 243 | |
---|
| 244 | .. autoclass:: waeup.kofa.students.export.StudentUnpaidPaymentExporter() |
---|
| 245 | |
---|
| 246 | .. autoattribute:: waeup.kofa.students.export.StudentUnpaidPaymentExporter.title |
---|
| 247 | |
---|
[12865] | 248 | Bed Ticket Exporter |
---|
| 249 | ------------------- |
---|
[12863] | 250 | |
---|
[12865] | 251 | .. autoclass:: waeup.kofa.students.export.BedTicketExporter() |
---|
[12863] | 252 | |
---|
[12865] | 253 | .. autoattribute:: waeup.kofa.students.export.BedTicketExporter.fields |
---|
| 254 | .. autoattribute:: waeup.kofa.students.export.BedTicketExporter.title |
---|
| 255 | .. automethod:: waeup.kofa.students.export.BedTicketExporter.mangle_value() |
---|
[12863] | 256 | |
---|
[12884] | 257 | .. note:: |
---|
[12863] | 258 | |
---|
[12884] | 259 | The above exporters refer to a specific content type (object class). |
---|
| 260 | They export all attributes of these objects and a few additional |
---|
| 261 | parameters derived from the parent objects. These exporters can be |
---|
| 262 | used for reimport, or more precisely for backing up and restoring |
---|
| 263 | data. The following 'special' exporters are made on request of some |
---|
| 264 | universities to collect and compose student data for analysis and |
---|
| 265 | postprocessing by the university. |
---|
| 266 | |
---|
[15047] | 267 | Data For Bursary Exporter |
---|
| 268 | ------------------------- |
---|
[12863] | 269 | |
---|
| 270 | .. autoclass:: waeup.kofa.students.export.DataForBursaryExporter() |
---|
| 271 | |
---|
| 272 | .. autoattribute:: waeup.kofa.students.export.DataForBursaryExporter.fields |
---|
| 273 | .. autoattribute:: waeup.kofa.students.export.DataForBursaryExporter.title |
---|
| 274 | .. automethod:: waeup.kofa.students.export.DataForBursaryExporter.mangle_value() |
---|
| 275 | |
---|
[15277] | 276 | Accommodation Payments Exporter |
---|
| 277 | ------------------------------- |
---|
| 278 | |
---|
| 279 | .. autoclass:: waeup.kofa.students.export.AccommodationPaymentsExporter() |
---|
| 280 | |
---|
| 281 | .. autoattribute:: waeup.kofa.students.export.AccommodationPaymentsExporter.fields |
---|
| 282 | .. autoattribute:: waeup.kofa.students.export.AccommodationPaymentsExporter.title |
---|
| 283 | .. automethod:: waeup.kofa.students.export.AccommodationPaymentsExporter.mangle_value() |
---|
| 284 | |
---|
[15047] | 285 | School Fee Payments Overview Exporter |
---|
| 286 | ------------------------------------- |
---|
[12863] | 287 | |
---|
[15047] | 288 | .. autoclass:: waeup.kofa.students.export.SchoolFeePaymentsOverviewExporter() |
---|
[12863] | 289 | |
---|
[15047] | 290 | .. autoattribute:: waeup.kofa.students.export.SchoolFeePaymentsOverviewExporter.fields |
---|
| 291 | .. autoattribute:: waeup.kofa.students.export.SchoolFeePaymentsOverviewExporter.title |
---|
| 292 | .. autoattribute:: waeup.kofa.students.export.SchoolFeePaymentsOverviewExporter.curr_year |
---|
| 293 | .. automethod:: waeup.kofa.students.export.SchoolFeePaymentsOverviewExporter.mangle_value() |
---|
[12863] | 294 | |
---|
[15051] | 295 | Session Payments Overview Exporter |
---|
| 296 | ---------------------------------- |
---|
| 297 | |
---|
| 298 | .. autoclass:: waeup.kofa.students.export.SessionPaymentsOverviewExporter() |
---|
| 299 | |
---|
| 300 | .. autoattribute:: waeup.kofa.students.export.SessionPaymentsOverviewExporter.fields |
---|
| 301 | .. autoattribute:: waeup.kofa.students.export.SessionPaymentsOverviewExporter.title |
---|
| 302 | .. automethod:: waeup.kofa.students.export.SessionPaymentsOverviewExporter.mangle_value() |
---|
| 303 | |
---|
[12863] | 304 | Student Study Levels Overview Exporter |
---|
| 305 | -------------------------------------- |
---|
| 306 | |
---|
| 307 | .. autoclass:: waeup.kofa.students.export.StudentStudyLevelsOverviewExporter() |
---|
| 308 | |
---|
| 309 | .. autoattribute:: waeup.kofa.students.export.StudentStudyLevelsOverviewExporter.fields |
---|
| 310 | .. autoattribute:: waeup.kofa.students.export.StudentStudyLevelsOverviewExporter.title |
---|
| 311 | .. automethod:: waeup.kofa.students.export.StudentStudyLevelsOverviewExporter.mangle_value() |
---|
| 312 | |
---|
| 313 | Combo Card Data Exporter |
---|
| 314 | ------------------------ |
---|
| 315 | |
---|
| 316 | .. autoclass:: waeup.kofa.students.export.ComboCardDataExporter() |
---|
| 317 | |
---|
| 318 | .. autoattribute:: waeup.kofa.students.export.ComboCardDataExporter.fields |
---|
| 319 | .. autoattribute:: waeup.kofa.students.export.ComboCardDataExporter.title |
---|
[13162] | 320 | .. automethod:: waeup.kofa.students.export.ComboCardDataExporter.mangle_value() |
---|
| 321 | |
---|
[15047] | 322 | Data For Lecturer Exporter |
---|
| 323 | -------------------------- |
---|
| 324 | |
---|
| 325 | .. autoclass:: waeup.kofa.students.export.DataForLecturerExporter() |
---|
| 326 | |
---|
| 327 | .. autoattribute:: waeup.kofa.students.export.DataForLecturerExporter.fields |
---|
| 328 | .. autoattribute:: waeup.kofa.students.export.DataForLecturerExporter.title |
---|
| 329 | .. automethod:: waeup.kofa.students.export.DataForLecturerExporter.mangle_value() |
---|
| 330 | |
---|
[13162] | 331 | File Export |
---|
| 332 | =========== |
---|
| 333 | |
---|
| 334 | You want to export files (passport images, pdf slips), for instance |
---|
| 335 | of all students in a department or applicants in an applicants |
---|
| 336 | container? There is no facility in Kofa which does this job for you, |
---|
| 337 | but you can batch-download files by means of your operating system |
---|
| 338 | on your local machine. This works perfectly with the the `wget` |
---|
| 339 | command on Linux or MacOS computers. Windows does not provide such a |
---|
| 340 | command. |
---|
| 341 | |
---|
| 342 | If ``numbers.txt`` contains the application numbers of applicants in |
---|
| 343 | the applicants container ``xyz``, the following bash script will |
---|
| 344 | download all passport images directly onto you computer:: |
---|
| 345 | |
---|
| 346 | wget --save-cookies cookies.txt --keep-session-cookies --post-data 'form.login=my-username&form.password=my-password' https://my-kofa-site/login |
---|
| 347 | |
---|
| 348 | for i in $(cat numbers.txt) |
---|
| 349 | do |
---|
[13189] | 350 | wget --load-cookies cookies.txt --output-document=$i.jpg https://my-kofa-site/applicants/xyz/$i/passport.jpg |
---|
[13162] | 351 | done |
---|
| 352 | |
---|
| 353 | If ``numbers.txt`` contains the ids of students in a department, the |
---|
| 354 | following bash script will download all passport images directly |
---|
| 355 | onto you computer. The script is a slightly extended, more user |
---|
| 356 | friendly version of the script above:: |
---|
| 357 | |
---|
| 358 | if [ $# -lt 3 ] |
---|
| 359 | then |
---|
| 360 | echo "usage: $0 username password filename" |
---|
| 361 | exit 1 |
---|
| 362 | fi |
---|
| 363 | |
---|
| 364 | wget --save-cookies cookies.txt --keep-session-cookies --post-data "form.login=$1&form.password=$2" https://my-kofa-site/login |
---|
| 365 | |
---|
[14780] | 366 | counter=0 |
---|
| 367 | |
---|
[13162] | 368 | while read variable |
---|
| 369 | do |
---|
[14780] | 370 | counter=$((counter+1)) |
---|
[13162] | 371 | wget --load-cookies cookies.txt --output-document $variable.jpg https://my-kofa-site/students/$variable/passport.jpg |
---|
[14780] | 372 | if [[ "$counter" -gt 1000 ]]; then |
---|
| 373 | wget --save-cookies cookies.txt --keep-session-cookies --post-data "form.login=$1&form.password=$2" https://my-kofa-site/login |
---|
| 374 | counter=0 |
---|
| 375 | fi |
---|
[13162] | 376 | done < $3 |
---|