Wiki » History » Version 3

Marco Fabiani, 2012-05-29 12:15 PM

1 1 Marco Fabiani
h1. Wiki
2 1 Marco Fabiani
3 3 Marco Fabiani
h2. Usage
4 3 Marco Fabiani
5 3 Marco Fabiani
SWORD2 DSpace bulk uploader
6 3 Marco Fabiani
--------------------
7 3 Marco Fabiani
8 3 Marco Fabiani
A python script to submit large numbers of files to a SWORD2-compatible repository, specifically DSpace 1.8x.
9 3 Marco Fabiani
Built on the SWORD2 python client library: https://github.com/swordapp/python-client-sword2
10 3 Marco Fabiani
11 3 Marco Fabiani
-----------------------------------------------
12 3 Marco Fabiani
Installation:
13 3 Marco Fabiani
14 3 Marco Fabiani
- no installation required, simply copy the script sworduploader.py to a suitable location. The first time you run the script, it will create the sword2_logging.conf file.
15 3 Marco Fabiani
- a server.cfg file is also available. If the --servicedoc option is not used, sworduploader will read the first line of server.cfg and use it as the server's URL. If the server.cfg is missing, it will default to C4DM's server.
16 3 Marco Fabiani
17 3 Marco Fabiani
-----------------------------------------------
18 3 Marco Fabiani
Usage:
19 3 Marco Fabiani
20 3 Marco Fabiani
sworduploader[-h] [--username USER_NAME] [--title TITLE]
21 3 Marco Fabiani
                        [--author AUTHOR [AUTHOR ...]] [--date DATE]
22 3 Marco Fabiani
                        [--servicedoc DSPACEURL]
23 3 Marco Fabiani
                        data
24 3 Marco Fabiani
25 3 Marco Fabiani
Bulk upload to DSpace using SWORDv2.
26 3 Marco Fabiani
27 3 Marco Fabiani
positional arguments:
28 3 Marco Fabiani
  data                  Accepts: METSDSpaceSIP and BagIt packages, simple zip
29 3 Marco Fabiani
                        files, directories, single files. NOTE: METSDSpaceSIP
30 3 Marco Fabiani
                        packages are only accepted by Collections with a
31 3 Marco Fabiani
                        workflow!
32 3 Marco Fabiani
33 3 Marco Fabiani
optional arguments:
34 3 Marco Fabiani
  -h, --help            show this help message and exit
35 3 Marco Fabiani
  --username USER_NAME  DSpace username.
36 3 Marco Fabiani
  --title TITLE         Title (ignored for METS packages).
37 3 Marco Fabiani
  --author AUTHOR [AUTHOR ...]
38 3 Marco Fabiani
                        Author(s) (ignored for METS packages). Accepts
39 3 Marco Fabiani
                        multiple entries in the format "Surname, Name"
40 3 Marco Fabiani
  --date DATE           Date of creation (string) (ignored for METS packages).
41 3 Marco Fabiani
  --zip                 If "data" is a directory, compress it and post it as a
42 3 Marco Fabiani
                        single file. The zip file will be saved along with the
43 3 Marco Fabiani
                        individual files.
44 3 Marco Fabiani
  --servicedoc SD  		Url of the SWORDv2 service document (default: use
45 3 Marco Fabiani
                        server.cfg if available, otherwise http://c4dm.eecs.qm
46 3 Marco Fabiani
                        ul.ac.uk/rdr/swordv2/servicedocument
47 3 Marco Fabiani
48 3 Marco Fabiani
If the submission is created successfully, it will remain open to be completed
49 3 Marco Fabiani
with the necessary metadata and licenses, using the DSpace web interface. The
50 3 Marco Fabiani
submission can be found in the "My Account -> Submissions" section of the
51 3 Marco Fabiani
user's area.
52 3 Marco Fabiani
53 2 Marco Fabiani
h2. Updates
54 2 Marco Fabiani
55 2 Marco Fabiani
Version 0.6:
56 2 Marco Fabiani
- Uploading a directory will maintain the path structure (i.e. subdirectories).
57 2 Marco Fabiani
- A different server can be specified in the server.cfg file. This is overridden if the --servicedoc option is used. If the file is missing, sworduploader will default to C4DM's repository.
58 2 Marco Fabiani
59 1 Marco Fabiani
h2. Possible problems
60 1 Marco Fabiani
61 1 Marco Fabiani
Version 0.4 is based on the modified python-sword2 library that can be found on bitbucket/marcofabiani.
62 1 Marco Fabiani
63 1 Marco Fabiani
The script has been tested with the version now on github (richardjones), and it works IF DSpace is patched with the latest version of the sword-server-2.0 which corrects a mistake in the service document.
64 1 Marco Fabiani
65 1 Marco Fabiani
Issue 1: Service document verification fails (DSpace server)
66 1 Marco Fabiani
https://bitbucket.org/richardjones/python-sword2/issue/1/service-document-verification-fails-dspace
67 1 Marco Fabiani
68 1 Marco Fabiani
richardjones on Fri, 20 Apr 2012 12:45:26 +0200:
69 1 Marco Fabiani
70 1 Marco Fabiani
The bug was in the Java common library used by default
71 1 Marco Fabiani
72 1 Marco Fabiani
See http://tools.ietf.org/html/draft-gregorio-atompub-multipart-04 for details of multipart support requirements.
73 1 Marco Fabiani
74 1 Marco Fabiani
This has now been fixed in the java server library, which is hosted at http://sword-app.svn.sourceforge.net/viewvc/sword-app/JavaServer2.0/trunk/
75 1 Marco Fabiani
76 1 Marco Fabiani
Changes:
77 1 Marco Fabiani
 status: new -> resolved