EPrints Technical Mailing List Archive

Message: #06722


< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First

Re: [EP-tech] Tweaking the "creators" section on the workflow


Thanks, Adam and also Chris, however I’ve had a look at both methods and I’m not sure on the implementation. The issue with this field also seems to be having an impact elsewhere.

 

Bit of background, I’ve implemented this new InternalID along with associated browse views based on David Newman’s wiki guide here:

 

https://wiki.eprints.org/w/Using_Internal_IDs_for_Staff_Browse_Views

 

The Internal ID’s are being populated from an LDAP script which is also logging users in – all working fine. I’ve ported our old creator_id table over to the creator_internalid to retain associations and generate browse views. Working fine.

 

The issue now seems to be the workflow and, subsequently, the summary view which seem to be connected to the old ID.

 

This is what the workflow looks like:

 

https://drive.google.com/file/d/0B67FaE28LeB-MkpVam5JMjA2T28/view?usp=sharing

 

The Internal ID was added using the above, while the Unique ID seems to be tied (as far as I can tell) to creator_id; this is just from grepping through the code – I can’t actually find any hard evidence of this and almost all of the references to this in the code seem to be commented out. The lookup on those fields works and populates as so:

 

https://drive.google.com/open?id=0B67FaE28LeB-OHJQSExxVU5NdTA

 

This saves, valid, no problem, however the summary view throws a 500 error with the following in the log:

 

Undefined or invalid function: internalid_to_name

at /usr/share/eprints3/perl_lib/EPrints/Repository.pm line 1719.

                EPrints::Repository::call('EPrints::Repository=HASH(0x55ccd3fd78f8)', 'internalid_to_name', 'EPrints::Repository=HASH(0x55ccd3fd78f8)', 'EPrints::MetaField::Internalidname=HASH(0x55ccd6d332a8)', 3762, 'EPrints::DataObj::EPrint=HASH(0x55ccd9db2a80)') called at /usr/share/eprints3/perl_lib/EPrints/MetaField.pm line 1024

                EPrints::MetaField::call_property('EPrints::MetaField::Internalidname=HASH(0x55ccd6d332a8)', 'render_single_value', 'EPrints::Repository=HASH(0x55ccd3fd78f8)', 'EPrints::MetaField::Internalidname=HASH(0x55ccd6d332a8)', 3762, 'EPrints::DataObj::EPrint=HASH(0x55ccd9db2a80)') called at /usr/share/eprints3/perl_lib/EPrints/MetaField.pm line 909

                EPrints::MetaField::render_value_withopts('EPrints::MetaField::Internalidname=HASH(0x55ccd6d332a8)', 'EPrints::Repository=HASH(0x55ccd3fd78f8)', 3762, undef, 'EPrints::DataObj::EPrint=HASH(0x55ccd9db2a80)') called at /usr/share/eprints3/perl_lib/EPrints/MetaField.pm line 806

                EPrints::MetaField::render_value_no_multiple('EPrints::MetaField::Internalidname=HASH(0x55ccd6d332a8)', 'EPrints::Repository=HASH(0x55ccd3fd78f8)', 3762, 1, undef, 'EPrints::DataObj::EPrint=HASH(0x55ccd9db2a80)') called at /usr/share/eprints3/perl_lib/EPrints/MetaField/Compound.pm line 145

     EPrints::MetaField::Compound::render_single_value_row('EPrints::MetaField::Compound=HASH(0x55ccd6d300b0)', 'EPrints::Repository=HASH(0x55ccd3fd78f8)', 'HASH(0x55ccd9e2b8d0)', 1, undef, 'EPrints::DataObj::EPrint=HASH(0x55ccd9db2a80)') called at /usr/share/eprints3/perl_lib/EPrints/MetaField/Compound.pm line 124

                EPrints::MetaField::Compound::render_value('EPrints::MetaField::Compound=HASH(0x55ccd6d300b0)', 'EPrints::Repository=HASH(0x55ccd3fd78f8)', 'ARRAY(0x55ccd9dc33d8)', 1, undef, 'EPrints::DataObj::EPrint=HASH(0x55ccd9db2a80)') called at /usr/share/eprints3/perl_lib/EPrints/DataObj.pm line 1112

                EPrints::DataObj::render_value('EPrints::DataObj::EPrint=HASH(0x55ccd9db2a80)', 'creators', 1) called at /usr/share/eprints3/perl_lib/EPrints/Plugin/Screen/EPrint/Details.pm line 142

             EPrints::Plugin::Screen::EPrint::Details::render('EPrints::Plugin::Screen::EPrint::Details=HASH(0x55ccd9db0668)', 'ep_eprint_view_1') called at /usr/share/eprints3/perl_lib/EPrints/Plugin/Screen/EPrint/View.pm line 188

                EPrints::Plugin::Screen::EPrint::View::render('EPrints::Plugin::Screen::EPrint::View=HASH(0x55ccd9db03e0)') called at /usr/share/eprints3/perl_lib/EPrints/ScreenProcessor.pm line 377

                EPrints::ScreenProcessor::process('EPrints::ScreenProcessor', 'session', 'EPrints::Repository=HASH(0x55ccd3fd78f8)', 'template', undef, 'url', '/cgi/users/home') called at /usr/share/eprints3/cgi/users/home line 25

ModPerl::ROOT::ModPerl::Registry::usr_share_eprints3_cgi_users_home::handler('Apache2::RequestRec=SCALAR(0x55ccd9cb8438)') called at /usr/lib/perl5/ModPerl/RegistryCooker.pm line 206

                eval {...} called at /usr/lib/perl5/ModPerl/RegistryCooker.pm line 206

                ModPerl::RegistryCooker::run('ModPerl::Registry=HASH(0x55ccd9d6eaf8)') called at /usr/lib/perl5/ModPerl/RegistryCooker.pm line 172

                ModPerl::RegistryCooker::default_handler('ModPerl::Registry=HASH(0x55ccd9d6eaf8)') called at /usr/lib/perl5/ModPerl/Registry.pm line 31

                ModPerl::Registry::handler('ModPerl::Registry', 'Apache2::RequestRec=SCALAR(0x55ccd9cb8438)') called at -e line 0

                eval {...} called at -e line 0

[Wed Jul 12 11:00:51.795175 2017] [:error] [pid 40316] XML::LibXML::Node::appendChild() -- nNode is not a blessed SV reference at /usr/share/eprints3/perl_lib/EPrints/MetaField/Compound.pm line 145.\n

 

Internalid_to_name is a function defined in the Internal ID For User Browse method and it’s this function that seems to be causing the problem. So, I did some digging.

 

It turns out that the default information that gets put into the creator fields does not make the system happy. This, however, does:

 

https://drive.google.com/file/d/0B67FaE28LeB-TFE1cmNadmtHVkk/view?usp=sharing

 

And allows the summary screen with all data correct to render without error. This, does not:

 

https://drive.google.com/open?id=0B67FaE28LeB-b2k3ZzRXbVdoTjQ

 

Also, including anything other than a valid ID number in Unique ID, such as an email address, will throw an error. So, the way to get the summary screen to render is, valid ID in Unique ID, NOTHING AT ALL in the Internal ID.

 

What I think I need to do is remove one of the ID fields, or somehow combine them into one so that:

 

  • The ID of the user is populated on lookup
  • The summary view uses this ID field to build a users name, and not the original Unique ID field, and ideally throws graceful errors rather than full on 500’s

 

So.., any thoughts on how I go forward with this? I’ve torn down the code as much as I can but I still really don’t know my way around and how things slot together. As I said above, I thought I’d found some relevant entries in field definitions but they were commented out.

 

Thanks in advance and sorry for the info dump!

 

Andrew

 

From: eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk] On Behalf Of Adam Field
Sent: 12 July 2017 11:08
To: eprints-tech@ecs.soton.ac.uk
Subject: Re: [EP-tech] Tweaking the "creators" section on the workflow

 

Hi Andrew

 

                What you need is an input renderer.  See https://wiki.eprints.org/w/Category:EPrints_Metadata_Fields#Input_and_Validation_Properties

 

                render_input is a function that can be added to the configuration of a field in the .pl configuration file.  Something like this:

 

 

                {

                                ‘name’ => ‘foo’,

                                ‘type’ => ‘int’,

                                ‘render_input’ => ‘wibbly_renderer’

                }

 

…and then:

 

                $c->{wibbly_renderer} = sub

                {

                                my ($field, $repo, $value, $dataset, $staff, $hidden_field, $obj, $basename) = @_;

 

                                my $frag = $repo->xml->create_document_fragment;

                               

                                #build DOM here, explore the code-base for how to do that.  Here’s your jumping-off point:

                                # https://github.com/eprints/eprints/blob/392474eec1b8125a66ed2d3e12b02aeb67dc07c4/perl_lib/EPrints/MetaField.pm#L499

 

                                return $frag;

                }

 

--

Adam

 

 

From: <eprints-tech-bounces@ecs.soton.ac.uk> on behalf of Andrew Beeken <anbeeken@lincoln.ac.uk>
Reply-To: <
eprints-tech@ecs.soton.ac.uk>
Date: Wednesday, 12 July 2017 10:28
To: "
eprints-tech@ecs.soton.ac.uk" <eprints-tech@ecs.soton.ac.uk>
Subject: [EP-tech] Tweaking the "creators" section on the workflow

 

Hello all,

 

I’m trying to alter the output on the “Creators” section on the EPrints workflow however I’m not sure how to go about doing this. I’ve added, to my new installation, a field for Internal ID to handle a lookup for the new LDAP based user management. This appears at the end of the available fields in the Creator View which is comprised of:

 

Family Name

Given Name

Unique ID (I think that this a field added by some previous system alterations)

Role (Dropdown)

Internal ID (New field)

 

 

What I’d like to do is get rid of the Unique ID field and move the Internal ID field so that it looks like:

 

Family Name

Given Name

Internal ID

Role

 

 

Any thoughts?

 

Andrew


The University of Lincoln, located in the heart of the city of Lincoln, has established an international reputation based on high student satisfaction, excellent graduate employment and world-class research.


The information in this e-mail and any attachments may be confidential. If you have received this email in error please notify the sender immediately and remove it from your system. Do not disclose the contents to another person or take copies.

Email is not secure and may contain viruses. The University of Lincoln makes every effort to ensure email is sent without viruses, but cannot guarantee this and recommends recipients take appropriate precautions.

The University may monitor email traffic data and content in accordance with its policies and English law. Further information can be found at:
http://www.lincoln.ac.uk/legal.

*** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech *** Archive: http://www.eprints.org/tech.php/ *** EPrints community wiki: http://wiki.eprints.org/ *** EPrints developers Forum: http://forum.eprints.org/