Wiki » History » Version 7

Marco Fabiani, 2012-05-29 12:34 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 6 Marco Fabiani
If the submission is created successfully, it will remain open to be completed with the necessary metadata and licenses, using the DSpace web interface. The submission can be found in the "My Account -> Submissions" section of the user's area.
50 3 Marco Fabiani
51 2 Marco Fabiani
h2. Updates
52 2 Marco Fabiani
53 2 Marco Fabiani
Version 0.6:
54 2 Marco Fabiani
- Uploading a directory will maintain the path structure (i.e. subdirectories).
55 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.
56 2 Marco Fabiani
57 1 Marco Fabiani
h2. Possible problems
58 1 Marco Fabiani
59 1 Marco Fabiani
Version 0.4 is based on the modified python-sword2 library that can be found on bitbucket/marcofabiani.
60 1 Marco Fabiani
61 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.
62 1 Marco Fabiani
63 1 Marco Fabiani
Issue 1: Service document verification fails (DSpace server)
64 1 Marco Fabiani
https://bitbucket.org/richardjones/python-sword2/issue/1/service-document-verification-fails-dspace
65 1 Marco Fabiani
66 1 Marco Fabiani
richardjones on Fri, 20 Apr 2012 12:45:26 +0200:
67 1 Marco Fabiani
68 1 Marco Fabiani
The bug was in the Java common library used by default
69 1 Marco Fabiani
70 1 Marco Fabiani
See http://tools.ietf.org/html/draft-gregorio-atompub-multipart-04 for details of multipart support requirements.
71 1 Marco Fabiani
72 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/
73 1 Marco Fabiani
74 1 Marco Fabiani
Changes:
75 1 Marco Fabiani
 status: new -> resolved
76 7 Marco Fabiani
77 7 Marco Fabiani
h2. Executables
78 7 Marco Fabiani
79 7 Marco Fabiani
The executables for Mac and Windows have been produced using <a href="http://www.pyinstaller.org/">PyInstaller</a>. Note that currently (v0.6) building the executables fails when using the latest version of the swordv2 python libraries from GitHub, although the script works when used with python. Thus, the executables are based on a different version of the the libraries.