EPrints Technical Mailing List Archive
See the EPrints wiki for instructions on how to join this mailing list and related information.
Message: #04928
< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First
[EP-tech] Re: citation modification
- To: eprints-tech@ecs.soton.ac.uk
- Subject: [EP-tech] Re: citation modification
- From: Thomas Lauke <th.lauke@arcor.de>
- Date: Tue, 13 Oct 2015 16:09:30 +0200 (CEST)
Hi Adam,
there's obviously something wrong, although I think to follow all your instructions :(
I modified eprint_fields.pl:
{
        name => 'creators',
        type => 'compound',
        multiple => 1,
        fields => [
                {
                        sub_name => 'name',
                        type => 'name',
                        hide_honourific => 1,
                        hide_lineage => 1,
                        family_first => 1,
                },
                {
                        sub_name => 'id',
                        type => 'text',
                        input_cols => 20,
                        allow_null => 1,
                }
        ],
        render_single_value => 'render_name_with_initials',
        input_boxes => 2,
},
I introduced eprint_render_single.pl:
print STDERR "It's Me :)\n";
$c->{render_name_with_initials} = sub
{
        print STDERR "It's You :)\n";
        my( $field, $repo, $value ) = @_;
        my $family = $value->{family};
        my $given = $value->{given};
        return $repo->xml->create_text_node( 'foo' );
}
I used Test.pl
#!/usr/bin/perl -I/opt/eprints3/perl_lib
use strict;
use warnings;
use EPrints;
my $ep = EPrints->new;
my $repo = $ep->repository('b40literatur');
my $eprint = $repo->dataset('eprint')->dataobj(3);
print STDERR EPrints::Utils::tree_to_utf8($eprint->render_value('creators'));
But I got finally for perl Test.pl 
It's Me :)
CreatorsEmailFoote, H.W.UNSPECIFIEDLevy, L.H.UNSPECIFIED
Thus my extra subroutine is never called even after apache's restart and database update?!
Thanks for any hint
Thomas
- Follow-Ups:
- [EP-tech] Re: citation modification
- From: Adam Field <af05v@ecs.soton.ac.uk>
 
 
- [EP-tech] Re: citation modification
- Prev by Date: [EP-tech] Re: Call for Action: Video Training Course
- Next by Date: [EP-tech] Re: citation modification
- Previous by thread: [EP-tech] Re: citation modification
- Next by thread: [EP-tech] Re: citation modification
- Index(es):
