Best practice to modify existing classes

15 views
Skip to first unread message

Wenz, Armin

unread,
Jun 17, 2019, 9:09:14 AM6/17/19
to dspac...@googlegroups.com
Hi all,

I want to modify existing class files in the dspace-api and dspace-
jspui tree, but keep the original files (the original source tree)
intact, so that I can still update Dspace without loosing my changes
with the next update. Therefore I copied the files I want to modify to
dspace/modules/additions (the api) and dspace/modules/jspui.

The problem (as you probably guess) is now, that I cannot compile my
classes due to missing import files.

Either my approach is wrong or I missed something. Searched the tech
group and the wiki but haven't found anything appropriate.

So, is there a HOWTO or Best Practice doc describing how to modify
existing files?

Thanks

--

Armin Wenz

Claudia Jürgen

unread,
Jun 17, 2019, 9:35:53 AM6/17/19
to dspac...@googlegroups.com
Hello Armin,

with which version of DSpace are you working and what are you trying to
overlay?

Depending on what you want to oververlay, you might be missing a
dependency in
[dspace-src]/dspace/modules/jspui/pom.xml
Most likely
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jsp-api</artifactId>
<version>2.0</version>
<scope>provided</scope>
</dependency>
as this is used in org.dspace.app.webui.jsptag and customizing the
ItemTag.java is a common use case.

Hope this helps

Claudia Jürgen
Claudia Juergen
Eldorado

Technische Universität Dortmund
Universitätsbibliothek
Vogelpothsweg 76
44227 Dortmund

Tel.: +49 231-755 40 43
Fax: +49 231-755 40 32
claudia...@tu-dortmund.de
www.ub.tu-dortmund.de


Wichtiger Hinweis: Die Information in dieser E-Mail ist vertraulich. Sie ist ausschließlich für den Adressaten bestimmt. Sollten Sie nicht der für diese E-Mail bestimmte Adressat sein, unterrichten Sie bitte den Absender und vernichten Sie diese Mail. Vielen Dank.
Unbeschadet der Korrespondenz per E-Mail, sind unsere Erklärungen ausschließlich final rechtsverbindlich, wenn sie in herkömmlicher Schriftform (mit eigenhändiger Unterschrift) oder durch Übermittlung eines solchen Schriftstücks per Telefax erfolgen.

Important note: The information included in this e-mail is confidential. It is solely intended for the recipient. If you are not the intended recipient of this e-mail please contact the sender and delete this message. Thank you. Without prejudice of e-mail correspondence, our statements are only legally binding when they are made in the conventional written form (with personal signature) or when such documents are sent by fax.

Wenz, Armin

unread,
Jun 19, 2019, 3:35:34 AM6/19/19
to dspac...@googlegroups.com
Hi Claudia,

I want to change the filename for uploaded files to a name composed of
author-title-timestamp.extension. Therefore I modfified
org.dspace.submit.step.UploadStep.processUploadFile() and
org.dspace.app.webui.servlet.admin.EditItemServlet.processUploadBitstre
am().

BTW: We are using DSpace 6.3 and your suggestion worked.

Thanks
--

Armin Wenz
Universitätsbibliothek Mainz
Leitung Bibliotheksanwendungen
Jakob-Welder-Weg 12
55128 Mainz
Tel.: +49 6131 39-29830
http://www.ub.uni-mainz.de
Reply all
Reply to author
Forward
0 new messages