EPrints Technical Mailing List Archive

Message: #09229


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

Re: [EP-tech] {Suspected SPAM} Re: {Suspected SPAM} Re: Eprints 3.4.3: adding new options for editing items


Hi Chris,


If you are adding additional options to a field like thesis_name or thesis_type this will not require an update to the database.  These type of fields (set) are just VARCHAR fields in the database, which in theory means any text string up to a certain length could be saved to the database.  However, EPrints API restricts the values that can be set to those defined in the options attribute of that fields configuration.


If you are just adding new options to a fields like these rather than change the phrases for existing options, there should be no need to regenerate abstract pages, browse views or any other static pages, as there is not way these options could have been previously (server-side) cached.  Unless you have a third-party application that is pushing to your EPrints repository, which has already using one or more of these new options you needed to add. 


Normally, an "epadmin test" followed by a graceful restart of Apache should be sufficient.  However, clicking on the "Regenerate Views" and "Regenerate Abstracts" buttons in the Admin menu, should not do any real harm.  However, I tend to avoid this unless I know it is needed.  As here "Regenerate" means refresh the server-side cache.  This means pages will take longer to load, as the server-side cache is only regenerated on request.  Also, depending on the level of traffic (I am mainly talking about bots) on your EPrints repository, this may increase the load and decrease the responsiveness of your  repository, if pages are being requested in parallel that all need their server-side caches refreshing.


Regards


David Newman



On 08/03/2023 11:40, Chris Halliwell via Eprints-tech wrote:
CAUTION: This e-mail originated outside the University of Southampton.
Hi John,

I can confirm that copying eprint_fields_pub.pl to the archive specific subdirectory and modifying it, alongside adding the corresponding new phrase to zz_webcfg.xml, was successful.

I took one further step in addition to regenerating static pages and views and restarting the webserver, which was to run /bin/epadmin update ARCHIVEID prior to the Apache restart. This returned that zero fields had been modified, and having now looked at the table eprints__ordervalues_en I think I see why, so that may have been an un-necessary step.

Thanks again for your help.

All the best,

Chris

Chris Halliwell  I  IT Manager
City & Guilds of London Art School, 124 Kennington Park Road, London SE11 4DJ
Charity Registration no. 1144708  I  Company no. 7817519
www.cityandguildsartschool.ac.uk


From: John Salter <J.Salter@leeds.ac.uk>
Sent: 07 March 2023 15:40
To: eprints-tech@ecs.soton.ac.uk <eprints-tech@ecs.soton.ac.uk>; Chris Halliwell <c.halliwell@cityandguildsartschool.ac.uk>
Subject: RE: [EP-tech] {Suspected SPAM} Re: Eprints 3.4.3: adding new options for editing items
 

Hi Chris,
I think the correct option is to copy the file into the archive cfg.d directory, and edit it in there.

That comes from guidance on this page: https://wiki.eprints.org/w/Upgrading_3.3.12%2B_to_3.4


I have to admit to being a laggard, and not on 3.4 yet - so can't provide a properly validated answer.

If I'm way off the mark, I'm sure someone will shout soon!

 

Cheers,

John

 

PS Welcome to EPrints - good to have you on board! J

 

 

From: eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk] On Behalf Of Chris Halliwell via Eprints-tech
Sent: 07 March 2023 12:22
To: eprints-tech@ecs.soton.ac.uk
Subject: [EP-tech] {Suspected SPAM} Re: Eprints 3.4.3: adding new options for editing items

 

CAUTION: This e-mail originated outside the University of Southampton.

HI John, David,

 

Thanks, changes to eprint_fields_pub.pl sounds like what I'm looking for, however, [EPRINTS_ROOT]/archives/[ARCHIVE_ID]/cfg/cfg.d/eprint_fields_pub.pl does not exist.

 

I do have ..flavours/pub_lib/cfg.d/eprint_fields_pub.pl

 

Should I create a file of that name in the archive directory, and then edit it to contain only additions to the fields defined in ..flavours/pub_lib/cfg.d/eprint_fields_pub.pl? E.g, I might write in:

 

push @{$c->{fields}->{eprint}},

 

{

name => 'thesis_type',

type => 'set',

options => [qw(

my_new_option

)],

input_style => 'medium',

},

;


 

Or should I copy the existing file from ..flavours/pub_lib/cfg.d and add to it?

 

Or does its absence perhaps indicate a deeper problem, like some fundamental step I've missed when building the archive?

 

Currently ../archives/[ARCHIVE_ID]/cfg/cfg.d/ contains only these files:

 

00_flavour.pl

10_core.pl

adminemail.pl

citationcaches.pl

csrf_protection.pl

database.pl

zz_webcfg_metafield_fields.pl

 

All the best,

 

Chris

 

Chris Halliwell  I  IT Manager

City & Guilds of London Art School, 124 Kennington Park Road, London SE11 4DJ

Charity Registration no. 1144708  I  Company no. 7817519

www.cityandguildsartschool.ac.uk

 


From: John Salter <J.Salter@leeds.ac.uk>
Sent: 07 March 2023 10:33
To: eprints-tech@ecs.soton.ac.uk <eprints-tech@ecs.soton.ac.uk>; David R Newman <drn@ecs.soton.ac.uk>; Chris Halliwell <c.halliwell@cityandguildsartschool.ac.uk>
Subject: RE: [EP-tech] Eprints 3.4.3: adding new options for editing items

 

Hi Chris, David,
I thing you need to update the repository config to add a new option to the field - which is then displayed in the editing workflow itself.

You need to add an option to the file:

[EPRINTS_ROOT]/archives/[ARCHIVE_ID]/cfg/cfg.d/eprint_fields_pub.pl (see details here: https://wiki.eprints.org/w/Eprint_fields_pub.pl)

 

There is a definition for 'thesis_type' and 'thesis_name' - should be something like this: https://github.com/eprints/eprints3.4/blob/master/flavours/pub_lib/cfg.d/eprint_fields_pub.pl#L130-L153

 

Add a new option, and also a phrase. If your new option was 'my_thesis_type', the phrase would be:
<epp:phrase id="eprint_fieldopt_thesis_type_new_thesis_type">New thesis type</epp:phrase>
This can be added to the phrase file you identified.

 

You then need to restart the webserver (apache) for the new value to be visible.

 

Cheers,

John

 

From: eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk] On Behalf Of David R Newman via Eprints-tech
Sent: 07 March 2023 10:21
To: eprints-tech@ecs.soton.ac.uk; Chris Halliwell <c.halliwell@cityandguildsartschool.ac.uk>
Subject: Re: [EP-tech] Eprints 3.4.3: adding new options for editing items

 

Hi Chris,

I think you are referring to the abstract pages not updating with your changes to thesis_name and thesis_type phrases.  These are cached server side the first time they are requested after a change to their underlying metadata.  As changing a phrase does not change the underlying metadata, then these pages will not be re-cached.  It does not sound like you have run "Regenerate Abstracts", which has a button you can click in the "System Tools" tab of the Admin page (although this may be what your mean by "rebuilding static pages").

The other issue could be that the phrases for thesis_name and thesis_type are already set in a phrase file that loads after zz_webcfg.xml.  I would check your archive's cfg/lang/en/phrases/ directory for a file that starts zzz_ or similar, (i.e. anything alphabetically later).  One further possible issue is that zz_webcfg.xml has become corrupted and no longer applies any of its phrases.  If you have command line access, you could try running:

xmllint zz_webcfg.xml > /dev/null

And see if you see any errors are output.  You may need to install install xmllint which comes in the libxml2-utils APT package.

Regards

David Newman

On 07/03/2023 10:04 am, Chris Halliwell via Eprints-tech wrote:

CAUTION: This e-mail originated outside the University of Southampton.

Hello,

 

I have recently built an eprints repository, running eprints 3.4.3 on an Ubuntu 20.04.5 LTS server with Maria DB 10.3.37. The repository is live.

 

Both the Librarian and myself are currently stumped by how to add options to a field such as Thesis Type or Thesis Name when editing an item.

 

If an option is added using "edit page phrases", then that change is reflected in archives/ARCHIVE_NAME/cfg/lang/en/phrases/zz_webcfg.xml, but no amount of reloading the configuration, rebuilding static pages, or restarting Apache, will cause that addition to be reflected in the webpage. By contrast, modifying an existing option works as expected.

 

My guess is that what is needed is a direct update to the database. I don't see an option for this through the eprints front end, but that's not a problem.

 

What I'd really like to know is what is best practice here? Is it a matter of updating the database along with editing the page phrase, or are there additional steps to take? Should such edits be made on a live repo at all, and if not, how do we toggle its live state?

 

Thanks and best regards,

 

Chris

 

Chris Halliwell  I  IT Manager

City & Guilds of London Art School, 124 Kennington Park Road, London SE11 4DJ

Charity Registration no. 1144708  I  Company no. 7817519

www.cityandguildsartschool.ac.uk

 

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

 


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