New eperson metadata field in register form

334 views
Skip to first unread message

Karol S

unread,
Oct 24, 2017, 10:27:25 AM10/24/17
to DSpace Technical Support
Hi,

I need add a new field metadata to "register form" and eperson profile.
At the moment is:

First name *
Last name *
Contact telephone
language

I need additional field like a "faculty". In the internet i found something like this:
"You have to add this field to eperson-types.xml and add this field to eperson schema via web interface"
I do this but still does not see any additional fields. What i doing wrong? Cheers,

Karol

Karol S

unread,
Nov 2, 2017, 2:34:46 PM11/2/17
to DSpace Technical Support
up

Tim Donohue

unread,
Nov 22, 2017, 11:24:33 AM11/22/17
to Karol S, DSpace Technical Support
Hi Karol,

You will need to modify the code behind the Eperson registration form in order to enable this new field in the User Interface.  At this time, this registration form is hardcoded within DSpace, so simply updating the eperson-types.xml will not automatically update the registration form.

- 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

Karol S

unread,
Nov 23, 2017, 4:37:52 AM11/23/17
to DSpace Technical Support
Hi Tim,

thanks for your respond. I updated  "eperson-types,xml" and  "http://dspace.org/eperson" schema via dspace browser interface. 

I tried edit a profile-form.jsp and i added similarly:

<%
    Locale[] supportedLocales = I18nUtil.getSupportedLocales();
    EPerson epersonForm = (EPerson) request.getAttribute("eperson");

    String lastName = "";
    String firstName = "";
    String faculty = "";
    String phone = "";
    String language = "";


 // Get non-null values
        lastName = epersonForm.getLastName();
        if (lastName == null) lastName = "";

        firstName = epersonForm.getFirstName();
        if (firstName == null) firstName = "";

        faculty = epersonForm.getMetadata("faculty");
        if (faculty == null) faculty = "";

        phone = epersonForm.getMetadata("phone");
        if (phone == null) phone = "";

        language = epersonForm.getMetadata("language");
        if (language == null) language = "";

and

    <div class="form-group">
                <label class="col-md-offset-3 col-md-2 control-label" for="faculty"><fmt:message key="jsp.register.profile-form.fname.faculty"/></label>
        <div class="col-md-3"><input class="form-control" type="text" name="faculty" id="tfaculty" size="40" value="<%= Utils.addEntities(faculty) %>"/></div>
        </div>

and when i trying "edit profile" my administrator account in web interface  i see internal system error, in logs i see:

Caused by: org.apache.jasper.JasperException: An exception occurred processing JSP page /register/profile-form.jsp at line 53

50:         firstName = epersonForm.getFirstName();
51:         if (firstName == null) firstName = "";
52:         
53:         faculty = epersonForm.getMetadata("faculty");
54:         if (faculty == null) faculty = "";
55: 
56:         phone = epersonForm.getMetadata("phone");



When i commented out 53.54 line i see new field, but when i tried add something, there nothing happend, the field was empty. 

What file i have to change? I have to create new field in database? Maybe i did it something wrong in profile-form.jsp ?

Best wishes,

Karol

Fury Jimmy

unread,
Jul 13, 2020, 11:38:08 AM7/13/20
to DSpace Technical Support
Hi. I have the same problem. Have you finally found a solution ?
Best regards

Mohd Suhair Embong

unread,
Aug 20, 2021, 7:43:23 AM8/20/21
to DSpace Technical Support
Hi, I have the same problem. Any help even to edit and recompile .java source code?
Regards
Reply all
Reply to author
Forward
0 new messages