Changing the create Collection and create Community pages programmatically

53 views
Skip to first unread message

Pierre Roozmon

unread,
Sep 15, 2022, 7:34:09 PM9/15/22
to DSpace Technical Support
Hi Tim,

I'm trying to programmatically add new fields for the create Community and create Collection pages in DSpace v7.x. I've determined how to use various dynamic controls (e.g. DynamicSelect, DynamicTextArea, etc) to create different types of input fields.

Meanwhile, I can use the xml files to modify and add fields in the create Item page (i.e Edit Submission). This is well-documented, though I've had difficulty with some style issues. For excmpale, I could move the Upload step to the top of the page, but I couldn't make it sticky.

The Confluence DSpace documentation suggests that "input-forms.xml" was integrated into "submision-forms.xml" in v7.x, but this doesn't seem to be the case. This led to the conclusion that we need to make changes to create Community and create Collection programmatically.

Hence I'm trying to determine how the xml files "item-submission.xml" and "submission-forms.xml" are parsed by the code and converted into HTML. I believe that this will explain how the submission fields are defined for Items via xml and thus how they can be modified programmatically for Collections and Communities,

Can you please point me to where this parsing occurs? It seems to me that this would provide the key to understanding how all of these fields are converted into HTML, either dynamically via .ts files or statically via xml files.

Thanks for your attention,
-Pierre-

Mark H. Wood

unread,
Sep 16, 2022, 8:29:56 AM9/16/22
to dspac...@googlegroups.com
On Thu, Sep 15, 2022 at 04:27:59PM -0700, Pierre Roozmon wrote:
> Hi Tim,
>
> I'm trying to programmatically add new fields for the create Community and
> create Collection pages in DSpace v7.x. I've determined how to use various
> dynamic controls (e.g. DynamicSelect, DynamicTextArea, etc) to create
> different types of input fields.
>
> Meanwhile, I can use the xml files to modify and add fields in the create
> Item page (i.e Edit Submission). This is well-documented, though I've had
> difficulty with some style issues. For excmpale, I could move the Upload
> step to the top of the page, but I couldn't make it sticky.
>
> The Confluence DSpace documentation suggests that "input-forms.xml" was
> integrated into "submision-forms.xml" in v7.x, but this doesn't seem to be
> the case. This led to the conclusion that we need to make changes to create
> Community and create Collection programmatically.

I believe that input-forms.xml was split up. Some of the information
went into item-submission.xml and the rest into submission-forms.xml.

But I don't believe that any of this is connected with the
create-Community and create-Collection pages. I think that what
follows is not helpful for what I understand that you are trying to do.

> Hence I'm trying to determine how the xml files "item-submission.xml" and
> "submission-forms.xml" are parsed by the code and converted into HTML. I
> believe that this will explain how the submission fields are defined for
> Items via xml and thus how they can be modified programmatically for
> Collections and Communities,

The submission configuration is converted into logical structures by
dspace-api. These are provided to the UI, which uses them to generate
HTML (in the case of dspace-angular -- another front-end could use the
same information quite differently, which is why it is done this way.)

> Can you please point me to where this parsing occurs? It seems to me that
> this would provide the key to understanding how all of these fields are
> converted into HTML, either dynamically via .ts files or statically via xml
> files.

item-submission.xml is read in dspace-api/app/util/SubmissionConfigReader.
submission-forms.xml is read in dspace-api/app/util/DCInputsReader.

--
Mark H. Wood
Lead Technology Analyst

University Library
Indiana University - Purdue University Indianapolis
755 W. Michigan Street
Indianapolis, IN 46202
317-274-0749
www.ulib.iupui.edu
signature.asc

Yanan Zhao

unread,
Sep 18, 2022, 6:30:59 PM9/18/22
to dspac...@googlegroups.com

Hello all, 


Can I please ask you a DSpace v5 question? We are currently on v5.8.


Does anyone here know where I can make changes to the metadata displays under the Recent submissions list? I have attached a screenshot and highlighted the question area. Most of the publication types show authors, publication dates etc but our Edited volume type also shows other metadata fields.

 

receent submission.JPG

I tried to make changes to xsl/aspect/discovery/discovery.xsl but it didn't work. Is this the right .xsl file to make the changes? Do I need to restart the server or rebuild the index for the changes to take effect? 


Many thanks in advance, 

Yanan



yanan...@lincoln.ac.nz

ltl.lincoln.ac.nz 

––––––––––––––––––––––––––––––––––

Lincoln University

Te Whare Wānaka o Aoraki

––––––––––––––––––––––––––––––––––


recent submission metedata display.jpg

Yanan Zhao

unread,
Sep 18, 2022, 7:30:17 PM9/18/22
to dspac...@googlegroups.com
Dear all, 

I have sorted out this issue by editing item-list.xsl file. 

Regards, 
Yanan

Tim Donohue

unread,
Sep 19, 2022, 1:00:37 PM9/19/22
to DSpace Technical Support
Hi Pierre,

The "input-forms.xml" was migrated into "submission-forms.xml" in 7.x.  However, it is *specific* to Item creation, and it will NOT work for Collection/Community creation/edit pages.

There is not a single area of code to point you to where the "submission-forms.xml" becomes HTML.   Instead, the configuration in "sumission-forms.xml" is transformed into JSON responses in the /submissionforms REST API endpoint: https://github.com/DSpace/RestContract/blob/main/submissionforms.md   

Those JSON responses are then read by the UI and translated into the HTML forms you see in the Item Submission form -- this is done through a variety of *.ts files all under "src/app/submission" :  https://github.com/DSpace/dspace-angular/tree/main/src/app/submission

However, all of this is again *specific* to the Item submission process.  None of this code is used for Collection/Community editing & it'd likely be highly complex to adapt it to work for the Collection/Community forms (that's not something I can walk you through).

Overall, your conclusion is correct that editing the Collection/Community forms currently requires directly modifying the *.ts files which build those pages.  Those forms are not dynamically built.

Not sure if that helps any, but that gives an overview of how this all works.  (If you need more specific help in this area, you may need to dig much deeper into the code or ask more specific questions... I didn't write any of this code, so I'm not the foremost expert on the full Item Submission UI, but those are the basics)

Tim

Reply all
Reply to author
Forward
0 new messages