-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.txt
176 lines (120 loc) · 5.37 KB
/
README.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
CONTENTS
0. DISCLAIMER
1. INSTALL
1.1 REQUIREMENTS
1.2 DOWNLOAD AND EXTRACT
1.3 EDITING THE CONFIGURATION FILE
1.4 EDIT THE BUILD FILE
1.5 RUN THE BUILD SCRIPT
1.6 VIEW RESULTS
2. MAINTENANCE
2.1 ADDING USERS
3. EXTENDING THE FEDORA CODE BASE
3.1 CHANGING THE WAY SERVICE DOCUMENTS ARE GENERATED
3.2 ADDING NEW FILE HANDLERS
3.3 CLASS HIERARCHY
0. DISCLAIMER
-------------
This is a Git fork of the SVN project at http://sourceforge.net/p/sword-app
The conversion was manuell and not via GitHub project import. There will be no
update to the master branch if code changes on Source Forge.
1. Install
----------
1.1 Requirements
----------------
This software requires the following packages:
Fedora 2.2 or higher
tomcat
java 1.5+
ant
1.2 DOWNLOAD AND EXTRACT
------------------------
Download
Extract
tar zxvf sword-fedora.tar.gz
1.3 Editing the configuration file
----------------------------------
Edit sword-fedora/conf/properties.xml
change the following:
1. external_obj_url to http://FEDORA_HOST:FEDORA_PORT/fedora/get/##PID##
where
* FEDORA_HOST is the public hostname of fedora
* FEDORA_PORT is the port number fedora is running on
2. external_ds_url to http://FEDORA_HOST:FEDORA_PORT/fedora/get/##PID##
where
* FEDORA_HOST is the public hostname of fedora
* FEDORA_PORT is the port number fedora is running on
3. host to the fedora host (can be localhost or the public hostname)
4. port change the port to the fedora port
5. pid_namespace change to your pid namespace default can be found in $FEDORA_HOME/server/config/fedora.fcfg property pidNamespace
6. temp_dir change to where you would like the temp directory to be
7. reposiotry_uri change to a unique identifier for your repository
8. Edit the service document to your requirements see config file for comments
1.4 Edit the build file
-----------------------
edit build.xml
change the following:
<property name="tomcat" location="/usr/local/jakarta-tomcat-5.0.28"/>
to the location of your tomcat instillation
1.5 Run the build script
------------------------
ant dist
1.6 View Results
-----------------
Point the client to http://TOMCAT_HOST:TOMCAT_PORT/sword/app/servicedocument to retrieve a service document (this link also work in a web browser). If you haven't added any new users you can use the fedoraAdmin username and password.
Where
* TOMCAT_HOST is the public host name for the tomcat server where the sword code is installed. This can be the Fedora installed tomcat
* TOMCAT_PORT is the port number tomcat runs off
There are some example deposits in the doc directory to try out.
2. Maintenance
2.1 Adding Users
Edit $FEDORA_HOME/server/config/fedora-users.xml and add the following:
<user name="sword" password="sword">
<attribute name="fedoraRole">
<value>administrator</value>
</attribute>
</user>
3. EXTENDING THE FEDORA CODE BASE
3.1 CHANGING THE WAY SERVICE DOCUMENTS ARE GENERATED
Currently the service document is generated from the config file but this could be replaced by a more dynamically generated service document. To do this create a new class which extends org.purl.sword.server.fedora.FedoraServer and override the method:
protected ServiceDocument getServiceDocument(final String pOnBehalfOf) throws SWORDException {
To get the new sub class to be used instead of FedoraServer edit the web.conf and change the following:
<context-param>
<param-name>server-class</param-name>
<param-value>org.purl.sword.server.fedora.FedoraServer</param-value>
<description>
The SWORSServer class name
</description>
</context-param>
so that param-value points to the new sub class.
3.2 ADDING NEW FILE HANDLERS
To add a new file handler create a class which implements org.purl.sword.server.fedora.fileHandlers.FileHandler and has a default constructor that takes no arguments and throws no exceptions. Then edit the configuration file and add your new class to the following section:
<file_handlers>
<handler class="org.purl.sword.server.fedora.fileHandlers.JpegHandler" />
<handler class="org.purl.sword.server.fedora.fileHandlers.METSFileHandler" />
<handler class="org.purl.sword.server.fedora.fileHandlers.ZipFileHandler" />
<handler class="org.purl.sword.server.fedora.fileHandlers.ZipMETSFileHandler" />
</file_handlers>
Ensure your new class is in the CLASSPATH when the application gets copied to tomcat.
To make things easier you can extend org.purl.sword.server.fedora.fileHandlers.DefaultFileHandler and only overload the methods which you are interested in. See the api for more details.
To create Fedora objects use the Classes in org.purl.sword.server.fedora.fedoraObjects and then call FedoraObject.ingest to get them into Fedora.
3.3 Class Hierarchy
The Hierarchy for the datastream package is a bit complicated so it is shown below:
DATASTREAM
|
|
|
------------------------------------------------------------------------------------------------
| | |
| | |
| | |
LocalDatastream InlineDatastream ManagedDatastream
|
|
|
--------------------------------------------------
| | |
| | |
| | |
DublinCore Relationship XMLInlineDatastream
The fileHandlers all extend DefaultFileHandler