Changeset 13162


Ignore:
Timestamp:
11 Jul 2015, 09:34:26 (9 years ago)
Author:
Henrik Bettermann
Message:

More docs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/docs/source/userdocs/datacenter/export.rst

    r13144 r13162  
    283283  .. autoattribute:: waeup.kofa.students.export.ComboCardDataExporter.title
    284284  .. automethod:: waeup.kofa.students.export.ComboCardDataExporter.mangle_value()
     285
     286File Export
     287===========
     288
     289You want to export files (passport images, pdf slips), for instance
     290of all students in a department or applicants in an applicants
     291container? There is no facility in Kofa which does this job for you,
     292but you can batch-download files by means of your operating system
     293on your local machine. This works perfectly with the the `wget`
     294command on Linux or MacOS computers. Windows does not provide such a
     295command.
     296
     297If ``numbers.txt`` contains the application numbers of applicants in
     298the applicants container ``xyz``, the following bash script will
     299download all passport images directly onto you computer::
     300
     301  wget --save-cookies cookies.txt --keep-session-cookies --post-data 'form.login=my-username&form.password=my-password' https://my-kofa-site/login
     302
     303  for i in $(cat numbers.txt)
     304  do
     305   wget --load-cookies cookies.txt --output-document=$i.pdf https://my-kofa-site/applicants/xyz/$i/passport.jpg
     306  done
     307
     308If ``numbers.txt`` contains the ids of students in a department, the
     309following bash script will download all passport images directly
     310onto you computer. The script is a slightly extended, more user
     311friendly version of the script above::
     312
     313  if [ $# -lt 3 ]
     314  then
     315     echo "usage: $0 username password filename"
     316     exit 1
     317  fi
     318
     319  wget --save-cookies cookies.txt --keep-session-cookies --post-data "form.login=$1&form.password=$2" https://my-kofa-site/login
     320
     321  while read variable
     322  do
     323     echo https://my-kofa-site/students/$variable/passport.jpg
     324     wget --load-cookies cookies.txt --output-document $variable.jpg https://my-kofa-site/students/$variable/passport.jpg
     325  done < $3
     326
     327
Note: See TracChangeset for help on using the changeset viewer.