[EP-tech] resize name-Field
Stenger, Avischai
avischai.stenger at ulb.tu-darmstadt.de
Wed Oct 24 09:54:08 BST 2018
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 at ecs.soton.ac.uk<mailto:eprints-tech at 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 at ecs.soton.ac.uk<mailto:eprints-tech-bounces at ecs.soton.ac.uk> [mailto:eprints-tech-bounces at ecs.soton.ac.uk] On Behalf Of Stenger, Avischai via Eprints-tech
Sent: 16 October 2018 12:40
To: eprints-tech at ecs.soton.ac.uk<mailto:eprints-tech at 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: https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.eprints.org%2Ftech.php%2F&data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C1d563c3a34db471e4bf308d6398e4f8e%7C4a5378f929f44d3ebe89669d03ada9d8%7C1&sdata=7o5QgBCF%2BTf9syT3OHC%2FcpD5DXDEVCQKuwoth55bBFE%3D&reserved=0
*** EPrints community wiki: https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwiki.eprints.org%2F&data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C1d563c3a34db471e4bf308d6398e4f8e%7C4a5378f929f44d3ebe89669d03ada9d8%7C1&sdata=sA%2FSSWsQHpl%2Fnt7ZZT0IKFlXMOJPDzesml0BNPBlAeo%3D&reserved=0
*** EPrints developers Forum: https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fforum.eprints.org%2F&data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C1d563c3a34db471e4bf308d6398e4f8e%7C4a5378f929f44d3ebe89669d03ada9d8%7C1&sdata=oLisQoEFJ0cgXrIK2bkOx%2FeZQcpXBJ5pqrwqXBk5dZY%3D&reserved=0
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20181024/551eb26f/attachment-0001.html
More information about the Eprints-tech
mailing list