EPrints Technical Mailing List Archive

Message: #07540


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

Re: [EP-tech] resize name-Field


Hi John,

tnks. Yes, it is much better to copy and overwrite it locally for this repository.



Beste Grüße 

Avi






Am 23.10.2018 um 12:00 schrieb John Salter via Eprints-tech <eprints-tech@ecs.soton.ac.uk>:

Hi Avi,
I haven't had to do this.
Your approach should work, but I think it can be done in a different (better) way - without altering core files in perl_lib/EPrints.
In the eprints configuration file, you can override the default field lengths (e.g. for a name):
{
    name => 'creators',
    type => 'compound',
    multiple => 1,
    fields => [
        {
            sub_name => 'name',
            type => 'name',
            hide_honourific => 1,
            hide_lineage => 1,
            family_first => 1,
            # duplicated from Metafield::Name, and altered to suit
            fields => [
                { sub_name => "family", type => "text", maxlength => 64, input_cols => 25, },
                { sub_name => "given", type => "text", maxlength => 100, input_cols => 25, },
                { sub_name => "lineage", type => "text", maxlength => 10, },
                { sub_name => "honourific", type => "text", maxlength => 10, },
            ],
        },
        {
            sub_name => 'id',
            type => 'text',
            input_cols => 20,
            allow_null => 1,
        }
    ],
    input_boxes => 4,
},
 
If you add this for a new field, it will be created with the correct length fields.
If you add this for an existing field, it will not alter the existing table configuration - so you will still need to run the 'alter table' SQL.
 
Hope that helps!
 
Cheers,
John
 
 
From: eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk] On Behalf Of Stenger, Avischai via Eprints-tech
Sent: 16 October 2018 12:40
To: eprints-tech@ecs.soton.ac.uk
Subject: [EP-tech] resize name-Field
 
Hi, 
 
i need to resized the eprint_creators_name.creators_name_given because we really have a creator with 9(!) given names…
 
 
did someone „out there“ did that?   do i need to do something else but:
 
1. DB-change: ALTER Table eprint_creators_name Modify  COLUMN creators_name_given varchar(100) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL;
2. change the maxlength  in EPrints/MetaField/Name.pm   for sub_name „given“:     { sub_name => „given“, type => „text", maxlength => 100, input_cols => 25, },




Tanks & Regards
 
 
Avi 
  



 
 
 
 
*** 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/