Wiki » History » Version 5

Marco Fabiani, 2012-05-29 12:16 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 5 Marco Fabiani
<pre>
21 3 Marco Fabiani
sworduploader[-h] [--username USER_NAME] [--title TITLE]
22 3 Marco Fabiani
                        [--author AUTHOR [AUTHOR ...]] [--date DATE]
23 3 Marco Fabiani
                        [--servicedoc DSPACEURL]
24 3 Marco Fabiani
                        data
25 3 Marco Fabiani
26 3 Marco Fabiani
Bulk upload to DSpace using SWORDv2.
27 3 Marco Fabiani
28 3 Marco Fabiani
positional arguments:
29 3 Marco Fabiani
  data                  Accepts: METSDSpaceSIP and BagIt packages, simple zip
30 3 Marco Fabiani
                        files, directories, single files. NOTE: METSDSpaceSIP
31 3 Marco Fabiani
                        packages are only accepted by Collections with a
32 3 Marco Fabiani
                        workflow!
33 3 Marco Fabiani
34 3 Marco Fabiani
optional arguments:
35 3 Marco Fabiani
  -h, --help            show this help message and exit
36 3 Marco Fabiani
  --username USER_NAME  DSpace username.
37 3 Marco Fabiani
  --title TITLE         Title (ignored for METS packages).
38 3 Marco Fabiani
  --author AUTHOR [AUTHOR ...]
39 3 Marco Fabiani
                        Author(s) (ignored for METS packages). Accepts
40 3 Marco Fabiani
                        multiple entries in the format "Surname, Name"
41 3 Marco Fabiani
  --date DATE           Date of creation (string) (ignored for METS packages).
42 3 Marco Fabiani
  --zip                 If "data" is a directory, compress it and post it as a
43 3 Marco Fabiani
                        single file. The zip file will be saved along with the
44 3 Marco Fabiani
                        individual files.
45 3 Marco Fabiani
  --servicedoc SD  		Url of the SWORDv2 service document (default: use
46 3 Marco Fabiani
                        server.cfg if available, otherwise http://c4dm.eecs.qm
47 1 Marco Fabiani
                        ul.ac.uk/rdr/swordv2/servicedocument
48 5 Marco Fabiani
</pre>
49 3 Marco Fabiani
If the submission is created successfully, it will remain open to be completed
50 3 Marco Fabiani
with the necessary metadata and licenses, using the DSpace web interface. The
51 3 Marco Fabiani
submission can be found in the "My Account -> Submissions" section of the
52 3 Marco Fabiani
user's area.
53 3 Marco Fabiani
54 2 Marco Fabiani
h2. Updates
55 2 Marco Fabiani
56 2 Marco Fabiani
Version 0.6:
57 2 Marco Fabiani
- Uploading a directory will maintain the path structure (i.e. subdirectories).
58 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.
59 2 Marco Fabiani
60 1 Marco Fabiani
h2. Possible problems
61 1 Marco Fabiani
62 1 Marco Fabiani
Version 0.4 is based on the modified python-sword2 library that can be found on bitbucket/marcofabiani.
63 1 Marco Fabiani
64 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.
65 1 Marco Fabiani
66 1 Marco Fabiani
Issue 1: Service document verification fails (DSpace server)
67 1 Marco Fabiani
https://bitbucket.org/richardjones/python-sword2/issue/1/service-document-verification-fails-dspace
68 1 Marco Fabiani
69 1 Marco Fabiani
richardjones on Fri, 20 Apr 2012 12:45:26 +0200:
70 1 Marco Fabiani
71 1 Marco Fabiani
The bug was in the Java common library used by default
72 1 Marco Fabiani
73 1 Marco Fabiani
See http://tools.ietf.org/html/draft-gregorio-atompub-multipart-04 for details of multipart support requirements.
74 1 Marco Fabiani
75 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/
76 1 Marco Fabiani
77 1 Marco Fabiani
Changes:
78 1 Marco Fabiani
 status: new -> resolved