Skip to content

Instantly share code, notes, and snippets.

John Salter jesusbagpuss

Block or report user

Report or block jesusbagpuss

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jesusbagpuss
jesusbagpuss / eprints_to_reindex
Created Feb 18, 2020
Find EPrints which have a non-public document who's indexcodes have been added to the full-text index
View eprints_to_reindex
#!/usr/bin/perl -w
### SAVE FILE TO ~/bin/local/eprints_to_reindex, or edit the FindBin path below according to where you've saved it.
use FindBin;
use lib "$FindBin::Bin/../../perl_lib";
use EPrints;
use strict;
@jesusbagpuss
jesusbagpuss / get_user_preference_screen_items_ep_status
Created Jul 23, 2019
EPrints User preference for Screen::Items/eprint_status (file to be saved in EPRINTS_ROOT/bin/local/)
View get_user_preference_screen_items_ep_status
#!/usr/bin/perl -w
# Usage: ~/bin/local/get_user_preferences ARCHIVEID USERID
# NOTE: If you save this to a location other that EPRINTS_ROOT/bin/local/ the 'use lib' statement
# below will need to be adjusted accordingly
use FindBin;
use lib "$FindBin::Bin/../../perl_lib";
@jesusbagpuss
jesusbagpuss / z_wrro_epscript_additions.pl
Created May 16, 2019
EPScript to limit authors in citation
View z_wrro_epscript_additions.pl
{
package EPrints::Script::Compiled;
use strict;
sub run_wrro_people_limited
{
my( $self, $state, $value, $limit ) = @_;
my $session = $state->{session};
@jesusbagpuss
jesusbagpuss / README
Created May 16, 2019
Symplectic merge items fix for mangled documents
View README
################################################################################
#
# This fix was submitted to Symplectic April 2018
# As yet they haven't made a new release of the connector with it included :o\
#
#
# The changes below consist of:
# - new method in Symplectic::RepoProcess::MergeManager
# - replace two method calls with calls to the new method
#
@jesusbagpuss
jesusbagpuss / crosswalk_snippet.xsl
Created Jan 22, 2019
Symplectic RT1 Exceptions mapping (Elements v5.1 and above)
View crosswalk_snippet.xsl
<!-- ##################### oa-policy-exceptions ##################### -->
<!--
<pubs:oa-policy-exception>
<pubs:type>Access1</pubs:type>
<pubs:type-description>The output depends on the reproduction of
third party content for which open access rights could not be
granted (either within the specified timescales, or at all).</pubs:type-description>
<pubs:comment>This is a test exception</pubs:comment>
</pubs:oa-policy-exception>
@jesusbagpuss
jesusbagpuss / Symplectic_RepoProcess_MergeManager.pm
Created Aug 15, 2018
Additiopnal code to deal with document pos when merging EPrints.
View Symplectic_RepoProcess_MergeManager.pm
# Based on EPrints::DataObj::Document::clone
# NB Code duplication with Symplectic::RepoProcess::MergeManager
#
# Cloning documents can result in:
# - two documents with the same 'pos' field - and therefore sharing the same folder
# - 'spaces' in the document structure (e.g. pos=1 and pos=3, but no pos=2)
# this isn't what is needed. The code below manages these scenarios.
# EPrints' default behaviour is to remove the 'pos' during a clone *only* when the doc is being cloned to the same parent.
sub clone_document
{
@jesusbagpuss
jesusbagpuss / z_custom_epscript.pl
Created Aug 6, 2018
EPrints - render event dates in a human-friendly way (when they are stored in a database in 'YYYY-MM-DD - YYYY-MM-DD' format)
View z_custom_epscript.pl
# Render event dates when used in citation
# This will not affect them when exported/in the database.
{
# Write into EPrints::Script::Compiled
package EPrints::Script::Compiled;
use strict;
sub run_custom_human_event_dates
{
@jesusbagpuss
jesusbagpuss / example.pl
Last active Mar 6, 2018
EPrints: render reference test in paragraphs
View example.pl
{
name => 'referencetext',
type => 'longtext',
input_rows => 15,
render_value => sub {
my( $session , $field , $value ) = @_; # see: https://wiki.eprints.org/w/Category:EPrints_Metadata_Fields#Rendering_Properties
my $frag = $session->make_doc_fragment;
# split value on a double-new line (possibly with other whitespace in between
@jesusbagpuss
jesusbagpuss / OAI_DC_ORCID.pm
Last active Aug 14, 2017
Include ORCIDs (stored in an creator->orcid field) in OAI output format - with info:eu-repo/dai/mx/orcid/ prefix
View OAI_DC_ORCID.pm
=head1 NAME
EPrints::Plugin::Export::OAI_DC_ORCID
=cut
package EPrints::Plugin::Export::OAI_DC_ORCID;
use EPrints::Plugin::Export::OAI_DC;
@jesusbagpuss
jesusbagpuss / EPrintsMetaFieldName.pm
Created Jun 1, 2017
EPrints 3.3.10 search fixes. Save into [eprints_root]/lib/plugins/EPrints/Plugin/Core/
View EPrintsMetaFieldName.pm
package EPrints::Plugin::Core::EPrintsMetaFieldName;
use strict;
our @ISA = qw/EPrints::Plugin/;
package EPrints::MetaField::Name;
use strict;
no warnings 'redefine';
You can’t perform that action at this time.