EPrints Technical Mailing List Archive
Message: #04434
< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First
[EP-tech] Re: Finding selected lang from configuration
- To: eprints-tech@ecs.soton.ac.uk
- Subject: [EP-tech] Re: Finding selected lang from configuration
- From: Adam Field <af05v@ecs.soton.ac.uk>
- Date: Thu, 2 Jul 2015 11:38:04 +0100
It's always good practice to make as few changes to the default configuration files as possible -- this will make managing upgrades far, *far* easier. However, with the case of field definitions, this can be a little tricky. What I've done in the past is create a new configuration file called eprint_fields_local.pl (this will be loaded immediately after eprints_fields.pl), and have code in there that swaps out field definitions. Something like this: #define local fields my $local_fields = [ { name => 'foo', type => 'text' }, { name => 'title', type => 'virtualwithvalue', ....}, ] #create lookup hash of local field names my $local_fieldnames = {}; foreach my $f (@{$local_fields}) { $local_fieldnames->{$f->{name}} = 1; } #merge in existing field configurations foreach my $f (@{$c->{fields}->{eprint}}) { if (!$local_fieldnames->{$f->{name}}) { push @{$local_fields}, $f; } } #overwrite original array of configured fields $c->{fields}->{eprint} = $local_fields; ...note that I've simply typed this into my email, so it probably won't compile, but hopefully you get the idea. -- Adam Field Business Relationship Manager and Community Lead EPrints Services
|
- References:
- [EP-tech] MySQL version
- From: Matthew Brady <Matthew.Brady@usq.edu.au>
- [EP-tech] Re: MySQL version
- From: George Mamalakis <mamalos@eng.auth.gr>
- [EP-tech] Re: MySQL version
- From: Ian Stuart <Ian.Stuart@ed.ac.uk>
- [EP-tech] Finding selected lang from configuration
- From: George Mamalakis <mamalos@eng.auth.gr>
- [EP-tech] Re: Finding selected lang from configuration
- From: "Field A.N." <af05v@ecs.soton.ac.uk>
- [EP-tech] Re: Finding selected lang from configuration
- From: George Mamalakis <mamalos@eng.auth.gr>
- [EP-tech] Re: Finding selected lang from configuration
- From: "Field A.N." <af05v@ecs.soton.ac.uk>
- [EP-tech] Re: Finding selected lang from configuration
- From: George Mamalakis <mamalos@eng.auth.gr>
- [EP-tech] Re: Finding selected lang from configuration
- From: George Mamalakis <mamalos@eng.auth.gr>
- [EP-tech] MySQL version
- Prev by Date: [EP-tech] Re: Bulk export/import
- Next by Date: [EP-tech] Re: Finding selected lang from configuration
- Previous by thread: [EP-tech] Re: Finding selected lang from configuration
- Next by thread: [EP-tech] Re: Finding selected lang from configuration
- Index(es):