input-forms.xml - can I split it ?

141 views
Skip to first unread message

Monika Mevenkamp

unread,
Mar 22, 2018, 1:41:29 PM3/22/18
to dspac...@googlegroups.com

Can I split the input-forms.xml file into multiple files using some kind of include directive

Monika


Monika Mevenkamp
Digital Repository Infrastructure Developer
Princeton University
Phone: 609-258-4161
Skype: mo-meven




Tim Donohue

unread,
Mar 22, 2018, 5:08:29 PM3/22/18
to Monika Mevenkamp, dspac...@googlegroups.com
Hi Monika,

Unfortunately, at this time, there's no way to split up the input-forms.xml.  It's a completely custom XML config file, with a completely custom DTD (https://github.com/DSpace/DSpace/blob/dspace-6_x/dspace/config/input-forms.dtd).  Currently, it doesn't have an option to link or import settings from another file.

In DSpace 7, there has been some effort to rethink these configurations (both item-submission.xml and input-forms.xml), but I don't believe this sort of linking is possible yet in DSpace 7 either (hopefully Andrea Bollini will correct me if I'm wrong).  In case it is of interest, the very early notes on this DSpace 7 effort are at https://wiki.duraspace.org/display/DSPACE/Configuration+changes+in+the+submission+process 

- Tim

--
You received this message because you are subscribed to the Google Groups "DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dspace-tech...@googlegroups.com.
To post to this group, send email to dspac...@googlegroups.com.
Visit this group at https://groups.google.com/group/dspace-tech.
For more options, visit https://groups.google.com/d/optout.
--
Tim Donohue
Technical Lead for DSpace & DSpaceDirect
DuraSpace.org | DSpace.org | DSpaceDirect.org

Monika Mevenkamp

unread,
Mar 22, 2018, 5:39:17 PM3/22/18
to dspac...@googlegroups.com
Tim 

thanks for the answer even if it is not what I hoped.

I am thinking of writing a command /main program that creates a collection with a given name, parent, authorizations and maps the newly created collection to a given form. 
The first part is easy enough - but mucking around in the input-forms.xml config file is a bit uncomfortable. For some reason I had assumed that these config files would be ‘moved’ to database tables.  I see I am wrong on that account too   :) 

What is your favorite XML Parser / Mangler class  to use for this kind input-formns.xml manipulation ? 

Related to this: is there a simple way that allows me to add a form/page  to the DSpace 5 JSPUI that accepts parameter values for a given curation task ? 

Monika 

Tim Donohue

unread,
Mar 22, 2018, 5:49:00 PM3/22/18
to Monika Mevenkamp, dspac...@googlegroups.com
Hi Monika,

Just a quick response to your first note... it's not out of the question that these configs will eventually move to the database (or somewhere similarly more easy to manage).  It just is not likely to happen in DSpace 7, as the concentration in DSpace 7 is on the new UI and REST API.  We very purposefully are *not* trying to change the DSpace API or backend configurations *except* in areas where we have to do so in order to support the new REST API or UI.  This is necessary in order to keep the scope of DSpace 7 manageable -- we simply cannot fix/change everything at once.  :) 

So, you are not wrong in your assumption that configuration will likely change in the future -- ideally, it will eventually be mostly manageable from an Admin UI (as is on the RoadMap [1]). But, that is not likely to happen immediately in DSpace 7...it'd be more likely to occur in DSpace 8.

As for your other questions, I'll leave them to others. I haven't used the JSPUI in some time, and I'll admit I'm not as much in the code these days. So, you might want to simply see which XML parser class is in use already where the input-forms.xml is being read by the Java API.

Good luck!

- Tim

Claudia Jürgen

unread,
Mar 23, 2018, 4:27:51 AM3/23/18
to dspac...@googlegroups.com
Hello Monika,

we have split the input forms as a couple of collection/type specific
forms made it unwielding.
We kept the value-pairs in it and put the forms and form map in
different files
<?xml version="1.0" encoding='iso-8859-1' ?>
<!DOCTYPE input-forms SYSTEM "input-forms.dtd" [
<!ENTITY map SYSTEM "input-form-elements/form-map.xml">
<!ENTITY standardUniDo SYSTEM
"input-form-elements/de/form-standardUniDo.xml">
...

]>
<input-forms>
&map;
<form-definitions>
&standardUniDo;
...
</form-definitions>
...
</input-forms>

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.

helix84

unread,
Mar 23, 2018, 4:52:24 AM3/23/18
to Claudia Jürgen, DSpace Technical Support
Wow, I didn't know that was possible. Thanks for the tip, Claudia, I'm sure it will come in handy in the future.

I was going to suggest another solution but it has an extra step - to generate the xml from multiple xml files using XSLT. The xsl file would be just a skeleton which would include the secondary xml files. In Java you can choose from several xslt processors and there is at least one in the DSpace classpath already.


Regards,
~~helix84

Compulsory reading: DSpace Mailing List Etiquette
https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette



--
You received this message because you are subscribed to the Google Groups "DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dspace-tech+unsubscribe@googlegroups.com.

Mark H. Wood

unread,
Mar 23, 2018, 8:52:24 AM3/23/18
to DSpace Technical Support
On Thursday, March 22, 2018 at 1:41:29 PM UTC-4, momeven wrote:

Can I split the input-forms.xml file into multiple files using some kind of include directive



I have not tried it in this application, but I wonder if XInclude would work?

Claudia Jürgen

unread,
Mar 23, 2018, 9:04:39 AM3/23/18
to dspac...@googlegroups.com
I've tried it ages ago on a 3 or 4 instance and it did not work, thus
came up with the entity solution.

<?xml version="1.0" encoding='iso-8859-1' ?>
<!DOCTYPE input-forms SYSTEM "input-forms.dtd" [
<!ENTITY map SYSTEM "input-form-elements/form-map.xml">
<!ENTITY standardUniDo SYSTEM
"input-form-elements/de/form-standardUniDo.xml">
...

]>
<input-forms>
&map;
<form-definitions>
&standardUniDo;
...
</form-definitions>
...
</input-forms>



Cheers

Claudia

Mark H. Wood

unread,
Mar 23, 2018, 9:15:28 AM3/23/18
to DSpace Technical Support
On Friday, March 23, 2018 at 9:04:39 AM UTC-4, Claudia Jürgen wrote:
I've tried it ages ago on a 3 or 4 instance and it did not work, thus
came up with the entity solution.



That's useful to know.  A small adjustment to the parser configuration (to enable namespace support) might be required.

There was a question about external tools.  I was able to get 'xmllint --xinclude' to process a host document which refers to two XIncluded documents, and it merged them as desired.

mwood@mhw ~ $ cat host.xml
<?xml version='1.0'?>
<whole xmlns:xi='http://www.w3.org/2001/XInclude'>
 <xi:include href='part1.xml'/>
 <xi:include href='part2.xml'/>
</whole>
mwood@mhw ~ $ cat part1.xml
<?xml version='1.0'?>
<part1 thing='thing'/>
mwood@mhw ~ $ cat part2.xml
<?xml version='1.0'?>
<part2>
 <stuff>
  <nonsense/>
 </stuff>
</part2>
mwood@mhw ~ $ xmllint --xinclude host.xml
<?xml version="1.0"?>
<whole xmlns:xi="http://www.w3.org/2001/XInclude">
 <part1 thing="thing"/>
 <part2>
 <stuff>
  <nonsense/>
 </stuff>
</part2>
</whole>

So, one could do the merging manually, outside of DSpace, whenever one of the documents has changed.
Reply all
Reply to author
Forward
0 new messages