<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://wiki.eprints.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Libjlrs%40leeds.ac.uk</id>
	<title>EPrints Documentation - User contributions [en-gb]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.eprints.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Libjlrs%40leeds.ac.uk"/>
	<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/Special:Contributions/Libjlrs@leeds.ac.uk"/>
	<updated>2026-05-15T15:19:01Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.8</generator>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=How_to_customise_thumbnails&amp;diff=10654</id>
		<title>How to customise thumbnails</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=How_to_customise_thumbnails&amp;diff=10654"/>
		<updated>2012-10-30T17:11:19Z</updated>

		<summary type="html">&lt;p&gt;Libjlrs@leeds.ac.uk: Added categories&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Based on EPrints-3.3.10.&lt;br /&gt;
&lt;br /&gt;
To customise the size and type of thumbnails generated by eprints you can create archive-based configuration.&lt;br /&gt;
The steps below show how to add a new thumbnail size, and render it the way *I* want it.&lt;br /&gt;
&lt;br /&gt;
The default thumbnails are generated by: &amp;lt;code&amp;gt;~/perl_lib/EPrints/Plugin/Convert/Thumbnails.pm&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I wanted to add a new size 160x90px, called 'homepage' (to fit in with the institution's branding).&lt;br /&gt;
To make your own set of thumbnail sizes, edit &amp;lt;code&amp;gt;~/archives/ARCHIVEID/cfg/cfg.d/plugins.pl&amp;lt;/code&amp;gt;.&lt;br /&gt;
I added the following to the file:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;perl&amp;quot;&amp;gt;&lt;br /&gt;
$c-&amp;gt;{plugins}-&amp;gt;{'Convert::Thumbnails'}-&amp;gt;{params}-&amp;gt;{sizes} = {(&lt;br /&gt;
        small =&amp;gt; [66,50],&lt;br /&gt;
        homepage =&amp;gt; [160, 90], # new size - others are copied from Thumbnails.pm&lt;br /&gt;
        medium =&amp;gt; [200,150],&lt;br /&gt;
        preview =&amp;gt; [400,300],&lt;br /&gt;
        lightbox =&amp;gt; [640,480],&lt;br /&gt;
)};&lt;br /&gt;
$c-&amp;gt;{thumbnail_types} = sub {&lt;br /&gt;
        my( $list, $repo, $doc ) = @_;&lt;br /&gt;
        push @$list, qw( homepage ); # add new size to list of files to be generated&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By default this will produce a thumbnail that will fit into a box 160x90px - a proportionally scaled down version of the original. The 'small' thumbnail size produces a cropped version of the original. This is a better option for my needs, but it has a grey 1px border around it - that I don't want.&lt;br /&gt;
&lt;br /&gt;
To alter the thumbnails I need to add the following to &amp;lt;code&amp;gt;~/archives/ARCHIVEID/cfg/cfg.d/plugins.pl&amp;lt;/code&amp;gt; - which is a slightly modified version of the &amp;lt;code&amp;gt;sub call_convert&amp;lt;/code&amp;gt; copied from Thumbnails.pl&lt;br /&gt;
&amp;lt;source lang=&amp;quot;perl&amp;quot;&amp;gt;&lt;br /&gt;
$c-&amp;gt;{plugins}-&amp;gt;{'Convert::Thumbnails'}-&amp;gt;{params}-&amp;gt;{call_convert} = sub {&lt;br /&gt;
	my( $self, $dir, $doc, $src, $geom, $size ) = @_;&lt;br /&gt;
&lt;br /&gt;
	my $convert = $self-&amp;gt;{'convert'};&lt;br /&gt;
	my $version = $self-&amp;gt;convert_version;&lt;br /&gt;
&lt;br /&gt;
	if (!defined($geom)) {&lt;br /&gt;
		EPrints::abort(&amp;quot;NO GEOM&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	my $fn = $size . &amp;quot;.jpg&amp;quot;;&lt;br /&gt;
	my $dst = &amp;quot;$dir/$fn&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
	$geom = &amp;quot;$geom-&amp;gt;[0]x$geom-&amp;gt;[1]&amp;quot;;&lt;br /&gt;
# JPEG&lt;br /&gt;
# Read this: http://www.imagemagick.org/script/command-line-processing.php#geometry&lt;br /&gt;
# for details of the convert geom options.&lt;br /&gt;
#&lt;br /&gt;
	if( $size eq &amp;quot;small&amp;quot; )&lt;br /&gt;
	{&lt;br /&gt;
		# attempt to create a thumbnail that fits within the given dimensions&lt;br /&gt;
		# geom^ requires 6.3.8&lt;br /&gt;
		if( $version &amp;gt; 6.3 )&lt;br /&gt;
		{&lt;br /&gt;
			$self-&amp;gt;_system($convert, &amp;quot;-strip&amp;quot;, &amp;quot;-colorspace&amp;quot;, &amp;quot;RGB&amp;quot;, &amp;quot;-background&amp;quot;, &amp;quot;white&amp;quot;, &amp;quot;-thumbnail&amp;quot;,&amp;quot;$geom^&amp;quot;, &amp;quot;-gravity&amp;quot;, &amp;quot;center&amp;quot;, &amp;quot;-extent&amp;quot;, $geom, &amp;quot;-bordercolor&amp;quot;, &amp;quot;gray&amp;quot;, &amp;quot;-border&amp;quot;, &amp;quot;1x1&amp;quot;, $src.&amp;quot;[0]&amp;quot;, &amp;quot;JPEG:$dst&amp;quot;);&lt;br /&gt;
		}&lt;br /&gt;
		else&lt;br /&gt;
		{&lt;br /&gt;
			$self-&amp;gt;_system($convert, &amp;quot;-strip&amp;quot;, &amp;quot;-colorspace&amp;quot;, &amp;quot;RGB&amp;quot;, &amp;quot;-background&amp;quot;, &amp;quot;white&amp;quot;, &amp;quot;-thumbnail&amp;quot;,&amp;quot;$geom&amp;gt;&amp;quot;, &amp;quot;-extract&amp;quot;, $geom, &amp;quot;-bordercolor&amp;quot;, &amp;quot;gray&amp;quot;, &amp;quot;-border&amp;quot;, &amp;quot;1x1&amp;quot;, $src.&amp;quot;[0]&amp;quot;, &amp;quot;JPEG:$dst&amp;quot;);&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
	elsif( $size eq &amp;quot;homepage&amp;quot; ) # This is the new section to deal with the new 'homepage' size&lt;br /&gt;
	{&lt;br /&gt;
		# attempt to create a thumbnail that fits within the given dimensions&lt;br /&gt;
		# geom^ requires 6.3.8&lt;br /&gt;
		if( $version &amp;gt; 6.3 )&lt;br /&gt;
		{&lt;br /&gt;
			# homepage thumbnails don't want a border on them!&lt;br /&gt;
			$self-&amp;gt;_system($convert, &amp;quot;-strip&amp;quot;, &amp;quot;-colorspace&amp;quot;, &amp;quot;RGB&amp;quot;, &amp;quot;-background&amp;quot;, &amp;quot;white&amp;quot;, &amp;quot;-thumbnail&amp;quot;,&amp;quot;$geom^&amp;quot;, &amp;quot;-gravity&amp;quot;, &amp;quot;center&amp;quot;, &amp;quot;-extent&amp;quot;, $geom, &amp;quot;-bordercolor&amp;quot;, &amp;quot;white&amp;quot;, &amp;quot;-border&amp;quot;, &amp;quot;0x0&amp;quot;, $src.&amp;quot;[0]&amp;quot;, &amp;quot;JPEG:$dst&amp;quot;);&lt;br /&gt;
		}&lt;br /&gt;
		else&lt;br /&gt;
		{&lt;br /&gt;
			# homepage thumbnails don't want a border on them!&lt;br /&gt;
			$self-&amp;gt;_system($convert, &amp;quot;-strip&amp;quot;, &amp;quot;-colorspace&amp;quot;, &amp;quot;RGB&amp;quot;, &amp;quot;-background&amp;quot;, &amp;quot;white&amp;quot;, &amp;quot;-thumbnail&amp;quot;,&amp;quot;$geom&amp;gt;&amp;quot;, &amp;quot;-extract&amp;quot;, $geom, &amp;quot;-bordercolor&amp;quot;, &amp;quot;white&amp;quot;, &amp;quot;-border&amp;quot;, &amp;quot;0x0&amp;quot;, $src.&amp;quot;[0]&amp;quot;, &amp;quot;JPEG:$dst&amp;quot;);&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
	elsif( $size eq &amp;quot;medium&amp;quot; )&lt;br /&gt;
	{&lt;br /&gt;
		$self-&amp;gt;_system($convert, &amp;quot;-strip&amp;quot;, &amp;quot;-colorspace&amp;quot;, &amp;quot;RGB&amp;quot;, &amp;quot;-trim&amp;quot;, &amp;quot;+repage&amp;quot;, &amp;quot;-size&amp;quot;, &amp;quot;$geom&amp;quot;, &amp;quot;-thumbnail&amp;quot;,&amp;quot;$geom&amp;gt;&amp;quot;, &amp;quot;-background&amp;quot;, &amp;quot;white&amp;quot;, &amp;quot;-gravity&amp;quot;, &amp;quot;center&amp;quot;, &amp;quot;-extent&amp;quot;, $geom, &amp;quot;-bordercolor&amp;quot;, &amp;quot;white&amp;quot;, &amp;quot;-border&amp;quot;, &amp;quot;0x0&amp;quot;, $src.&amp;quot;[0]&amp;quot;, &amp;quot;JPEG:$dst&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
	else&lt;br /&gt;
	{&lt;br /&gt;
		$self-&amp;gt;_system($convert, &amp;quot;-strip&amp;quot;, &amp;quot;-colorspace&amp;quot;, &amp;quot;RGB&amp;quot;, &amp;quot;-background&amp;quot;, &amp;quot;white&amp;quot;, &amp;quot;-thumbnail&amp;quot;,&amp;quot;$geom&amp;gt;&amp;quot;, &amp;quot;-extract&amp;quot;, $geom, &amp;quot;-bordercolor&amp;quot;, &amp;quot;white&amp;quot;, &amp;quot;-border&amp;quot;, &amp;quot;0x0&amp;quot;, $src.&amp;quot;[0]&amp;quot;, &amp;quot;JPEG:$dst&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	if( -s $dst )&lt;br /&gt;
	{&lt;br /&gt;
		return ($fn);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	return ();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To test the new thumbnail generation, find an eprint with some good images attached to it. In the example below I'll use '1234', and assume the original image is called 'file.jpg' and is the first docuemtn in the eprint (this only matters for the URL to view the image in the browser with).&lt;br /&gt;
&lt;br /&gt;
Run &amp;lt;code&amp;gt;~/bin/epadmin/redo_thumbnails ARCHIVEID 1234 --verbose&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should see the convert command being run - and the new size filename being created e.g.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
Starting EPrints Repository.&lt;br /&gt;
Connecting to DB ... done.&lt;br /&gt;
Redoing thumbnails for document 1234&lt;br /&gt;
/usr/bin/convert -strip -colorspace RGB -background white -thumbnail 160x90^ -gravity center -extent 160x90 -bordercolor white -border 0x0 /opt/eprints3/archives/digitallibrary/documents/disk0/00/00/12/34/01/file.jpg[0] JPEG:/tmp/_NyUoqmsuZ/homepage.jpg&lt;br /&gt;
/usr/bin/convert ... JPEG:/tmp/XR51ieKBCj/lightbox.jpg&lt;br /&gt;
/usr/bin/convert ... JPEG:/tmp/fCOP2BPoa2/preview.jpg&lt;br /&gt;
/usr/bin/convert ... JPEG:/tmp/zLEip1ewUq/medium.jpg&lt;br /&gt;
/usr/bin/convert ... JPEG:/tmp/weRJwQPgNT/small.jpg&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
NB The lines for lightbox, preview, medium and small.jpg have been truncated for clarity.&lt;br /&gt;
&lt;br /&gt;
You should new be able to view the new thumbnails in a browser: &lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;http://your.repo.url/1234/1.hashomepageThumbnailVersion/file.jpg&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Howto]][[Category:Snippets]][[Category:Contribute]]&lt;/div&gt;</summary>
		<author><name>Libjlrs@leeds.ac.uk</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=How_to_customise_thumbnails&amp;diff=10653</id>
		<title>How to customise thumbnails</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=How_to_customise_thumbnails&amp;diff=10653"/>
		<updated>2012-10-30T17:09:38Z</updated>

		<summary type="html">&lt;p&gt;Libjlrs@leeds.ac.uk: Created page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Based on EPrints-3.3.10.&lt;br /&gt;
&lt;br /&gt;
To customise the size and type of thumbnails generated by eprints you can create archive-based configuration.&lt;br /&gt;
The steps below show how to add a new thumbnail size, and render it the way *I* want it.&lt;br /&gt;
&lt;br /&gt;
The default thumbnails are generated by: &amp;lt;code&amp;gt;~/perl_lib/EPrints/Plugin/Convert/Thumbnails.pm&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I wanted to add a new size 160x90px, called 'homepage' (to fit in with the institution's branding).&lt;br /&gt;
To make your own set of thumbnail sizes, edit &amp;lt;code&amp;gt;~/archives/ARCHIVEID/cfg/cfg.d/plugins.pl&amp;lt;/code&amp;gt;.&lt;br /&gt;
I added the following to the file:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;perl&amp;quot;&amp;gt;&lt;br /&gt;
$c-&amp;gt;{plugins}-&amp;gt;{'Convert::Thumbnails'}-&amp;gt;{params}-&amp;gt;{sizes} = {(&lt;br /&gt;
        small =&amp;gt; [66,50],&lt;br /&gt;
        homepage =&amp;gt; [160, 90], # new size - others are copied from Thumbnails.pm&lt;br /&gt;
        medium =&amp;gt; [200,150],&lt;br /&gt;
        preview =&amp;gt; [400,300],&lt;br /&gt;
        lightbox =&amp;gt; [640,480],&lt;br /&gt;
)};&lt;br /&gt;
$c-&amp;gt;{thumbnail_types} = sub {&lt;br /&gt;
        my( $list, $repo, $doc ) = @_;&lt;br /&gt;
        push @$list, qw( homepage ); # add new size to list of files to be generated&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By default this will produce a thumbnail that will fit into a box 160x90px - a proportionally scaled down version of the original. The 'small' thumbnail size produces a cropped version of the original. This is a better option for my needs, but it has a grey 1px border around it - that I don't want.&lt;br /&gt;
&lt;br /&gt;
To alter the thumbnails I need to add the following to &amp;lt;code&amp;gt;~/archives/ARCHIVEID/cfg/cfg.d/plugins.pl&amp;lt;/code&amp;gt; - which is a slightly modified version of the &amp;lt;code&amp;gt;sub call_convert&amp;lt;/code&amp;gt; copied from Thumbnails.pl&lt;br /&gt;
&amp;lt;source lang=&amp;quot;perl&amp;quot;&amp;gt;&lt;br /&gt;
$c-&amp;gt;{plugins}-&amp;gt;{'Convert::Thumbnails'}-&amp;gt;{params}-&amp;gt;{call_convert} = sub {&lt;br /&gt;
	my( $self, $dir, $doc, $src, $geom, $size ) = @_;&lt;br /&gt;
&lt;br /&gt;
	my $convert = $self-&amp;gt;{'convert'};&lt;br /&gt;
	my $version = $self-&amp;gt;convert_version;&lt;br /&gt;
&lt;br /&gt;
	if (!defined($geom)) {&lt;br /&gt;
		EPrints::abort(&amp;quot;NO GEOM&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	my $fn = $size . &amp;quot;.jpg&amp;quot;;&lt;br /&gt;
	my $dst = &amp;quot;$dir/$fn&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
	$geom = &amp;quot;$geom-&amp;gt;[0]x$geom-&amp;gt;[1]&amp;quot;;&lt;br /&gt;
# JPEG&lt;br /&gt;
# Read this: http://www.imagemagick.org/script/command-line-processing.php#geometry&lt;br /&gt;
# for details of the convert geom options.&lt;br /&gt;
#&lt;br /&gt;
	if( $size eq &amp;quot;small&amp;quot; )&lt;br /&gt;
	{&lt;br /&gt;
		# attempt to create a thumbnail that fits within the given dimensions&lt;br /&gt;
		# geom^ requires 6.3.8&lt;br /&gt;
		if( $version &amp;gt; 6.3 )&lt;br /&gt;
		{&lt;br /&gt;
			$self-&amp;gt;_system($convert, &amp;quot;-strip&amp;quot;, &amp;quot;-colorspace&amp;quot;, &amp;quot;RGB&amp;quot;, &amp;quot;-background&amp;quot;, &amp;quot;white&amp;quot;, &amp;quot;-thumbnail&amp;quot;,&amp;quot;$geom^&amp;quot;, &amp;quot;-gravity&amp;quot;, &amp;quot;center&amp;quot;, &amp;quot;-extent&amp;quot;, $geom, &amp;quot;-bordercolor&amp;quot;, &amp;quot;gray&amp;quot;, &amp;quot;-border&amp;quot;, &amp;quot;1x1&amp;quot;, $src.&amp;quot;[0]&amp;quot;, &amp;quot;JPEG:$dst&amp;quot;);&lt;br /&gt;
		}&lt;br /&gt;
		else&lt;br /&gt;
		{&lt;br /&gt;
			$self-&amp;gt;_system($convert, &amp;quot;-strip&amp;quot;, &amp;quot;-colorspace&amp;quot;, &amp;quot;RGB&amp;quot;, &amp;quot;-background&amp;quot;, &amp;quot;white&amp;quot;, &amp;quot;-thumbnail&amp;quot;,&amp;quot;$geom&amp;gt;&amp;quot;, &amp;quot;-extract&amp;quot;, $geom, &amp;quot;-bordercolor&amp;quot;, &amp;quot;gray&amp;quot;, &amp;quot;-border&amp;quot;, &amp;quot;1x1&amp;quot;, $src.&amp;quot;[0]&amp;quot;, &amp;quot;JPEG:$dst&amp;quot;);&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
	elsif( $size eq &amp;quot;homepage&amp;quot; ) # This is the new section to deal with the new 'homepage' size&lt;br /&gt;
	{&lt;br /&gt;
		# attempt to create a thumbnail that fits within the given dimensions&lt;br /&gt;
		# geom^ requires 6.3.8&lt;br /&gt;
		if( $version &amp;gt; 6.3 )&lt;br /&gt;
		{&lt;br /&gt;
			# homepage thumbnails don't want a border on them!&lt;br /&gt;
			$self-&amp;gt;_system($convert, &amp;quot;-strip&amp;quot;, &amp;quot;-colorspace&amp;quot;, &amp;quot;RGB&amp;quot;, &amp;quot;-background&amp;quot;, &amp;quot;white&amp;quot;, &amp;quot;-thumbnail&amp;quot;,&amp;quot;$geom^&amp;quot;, &amp;quot;-gravity&amp;quot;, &amp;quot;center&amp;quot;, &amp;quot;-extent&amp;quot;, $geom, &amp;quot;-bordercolor&amp;quot;, &amp;quot;white&amp;quot;, &amp;quot;-border&amp;quot;, &amp;quot;0x0&amp;quot;, $src.&amp;quot;[0]&amp;quot;, &amp;quot;JPEG:$dst&amp;quot;);&lt;br /&gt;
		}&lt;br /&gt;
		else&lt;br /&gt;
		{&lt;br /&gt;
			# homepage thumbnails don't want a border on them!&lt;br /&gt;
			$self-&amp;gt;_system($convert, &amp;quot;-strip&amp;quot;, &amp;quot;-colorspace&amp;quot;, &amp;quot;RGB&amp;quot;, &amp;quot;-background&amp;quot;, &amp;quot;white&amp;quot;, &amp;quot;-thumbnail&amp;quot;,&amp;quot;$geom&amp;gt;&amp;quot;, &amp;quot;-extract&amp;quot;, $geom, &amp;quot;-bordercolor&amp;quot;, &amp;quot;white&amp;quot;, &amp;quot;-border&amp;quot;, &amp;quot;0x0&amp;quot;, $src.&amp;quot;[0]&amp;quot;, &amp;quot;JPEG:$dst&amp;quot;);&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
	elsif( $size eq &amp;quot;medium&amp;quot; )&lt;br /&gt;
	{&lt;br /&gt;
		$self-&amp;gt;_system($convert, &amp;quot;-strip&amp;quot;, &amp;quot;-colorspace&amp;quot;, &amp;quot;RGB&amp;quot;, &amp;quot;-trim&amp;quot;, &amp;quot;+repage&amp;quot;, &amp;quot;-size&amp;quot;, &amp;quot;$geom&amp;quot;, &amp;quot;-thumbnail&amp;quot;,&amp;quot;$geom&amp;gt;&amp;quot;, &amp;quot;-background&amp;quot;, &amp;quot;white&amp;quot;, &amp;quot;-gravity&amp;quot;, &amp;quot;center&amp;quot;, &amp;quot;-extent&amp;quot;, $geom, &amp;quot;-bordercolor&amp;quot;, &amp;quot;white&amp;quot;, &amp;quot;-border&amp;quot;, &amp;quot;0x0&amp;quot;, $src.&amp;quot;[0]&amp;quot;, &amp;quot;JPEG:$dst&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
	else&lt;br /&gt;
	{&lt;br /&gt;
		$self-&amp;gt;_system($convert, &amp;quot;-strip&amp;quot;, &amp;quot;-colorspace&amp;quot;, &amp;quot;RGB&amp;quot;, &amp;quot;-background&amp;quot;, &amp;quot;white&amp;quot;, &amp;quot;-thumbnail&amp;quot;,&amp;quot;$geom&amp;gt;&amp;quot;, &amp;quot;-extract&amp;quot;, $geom, &amp;quot;-bordercolor&amp;quot;, &amp;quot;white&amp;quot;, &amp;quot;-border&amp;quot;, &amp;quot;0x0&amp;quot;, $src.&amp;quot;[0]&amp;quot;, &amp;quot;JPEG:$dst&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	if( -s $dst )&lt;br /&gt;
	{&lt;br /&gt;
		return ($fn);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	return ();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To test the new thumbnail generation, find an eprint with some good images attached to it. In the example below I'll use '1234', and assume the original image is called 'file.jpg' and is the first docuemtn in the eprint (this only matters for the URL to view the image in the browser with).&lt;br /&gt;
&lt;br /&gt;
Run &amp;lt;code&amp;gt;~/bin/epadmin/redo_thumbnails ARCHIVEID 1234 --verbose&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should see the convert command being run - and the new size filename being created e.g.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
Starting EPrints Repository.&lt;br /&gt;
Connecting to DB ... done.&lt;br /&gt;
Redoing thumbnails for document 1234&lt;br /&gt;
/usr/bin/convert -strip -colorspace RGB -background white -thumbnail 160x90^ -gravity center -extent 160x90 -bordercolor white -border 0x0 /opt/eprints3/archives/digitallibrary/documents/disk0/00/00/12/34/01/file.jpg[0] JPEG:/tmp/_NyUoqmsuZ/homepage.jpg&lt;br /&gt;
/usr/bin/convert ... JPEG:/tmp/XR51ieKBCj/lightbox.jpg&lt;br /&gt;
/usr/bin/convert ... JPEG:/tmp/fCOP2BPoa2/preview.jpg&lt;br /&gt;
/usr/bin/convert ... JPEG:/tmp/zLEip1ewUq/medium.jpg&lt;br /&gt;
/usr/bin/convert ... JPEG:/tmp/weRJwQPgNT/small.jpg&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
NB The lines for lightbox, preview, medium and small.jpg have been truncated for clarity.&lt;br /&gt;
&lt;br /&gt;
You should new be able to view the new thumbnails in a browser: &lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;http://your.repo.url/1234/1.hashomepageThumbnailVersion/file.jpg&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Libjlrs@leeds.ac.uk</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=API:EPrints/Plugin/Convert/Thumbnails&amp;diff=10652</id>
		<title>API:EPrints/Plugin/Convert/Thumbnails</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=API:EPrints/Plugin/Convert/Thumbnails&amp;diff=10652"/>
		<updated>2012-10-30T16:24:48Z</updated>

		<summary type="html">&lt;p&gt;Libjlrs@leeds.ac.uk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!-- Pod2Wiki=_preamble_ &lt;br /&gt;
This page has been automatically generated from the EPrints 3.2 source. Any wiki changes made between the 'Pod2Wiki=*' and 'Edit below this comment' comments will be lost.&lt;br /&gt;
 --&amp;gt;{{API}}{{Pod2Wiki}}{{API:Source|file=perl_lib/EPrints/Plugin/Convert/Thumbnails.pm|package_name=EPrints::Plugin::Convert::Thumbnails}}[[Category:API|THUMBNAILS]][[Category:API:EPrints/Plugin/Convert|THUMBNAILS]][[Category:API:EPrints/Plugin/Convert/Thumbnails|THUMBNAILS]]&amp;lt;div&amp;gt;&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=_private_ --&amp;gt;&amp;lt;!-- Pod2Wiki=head_name --&amp;gt;&lt;br /&gt;
==NAME==&lt;br /&gt;
EPrints::Plugin::Convert::Thumbnails - thumbnail-sized versions of audio/video/images&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
The Thumbnail How-to may also be useful: [[How to customise thumbnails]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=head_synopsis --&amp;gt;&lt;br /&gt;
==SYNOPSIS==&lt;br /&gt;
&amp;lt;pre&amp;gt;  use EPrints;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;  # enable audio previews&lt;br /&gt;
  $c-&amp;amp;gt;{plugins}-&amp;amp;gt;{'Convert::Thumbnails'}-&amp;amp;gt;{params}-&amp;amp;gt;{audio} = 1;&lt;br /&gt;
  # disable video previews&lt;br /&gt;
  $c-&amp;amp;gt;{plugins}-&amp;amp;gt;{'Convert::Thumbnails'}-&amp;amp;gt;{params}-&amp;amp;gt;{video} = 0;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;  # enable audio_*/video_* previews&lt;br /&gt;
  $c-&amp;amp;gt;{thumbnail_types} = sub {&lt;br /&gt;
    my( $list, $repo, $doc ) = @_;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;    push @$list, qw( audio_mp4 audio_ogg video_mp4 video_ogg );&lt;br /&gt;
  };&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;  ...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;  my $plugin = $session-&amp;amp;gt;plugin( &amp;quot;Convert&amp;quot; );&lt;br /&gt;
  my %available = $plugin-&amp;amp;gt;can_convert( $doc );&lt;br /&gt;
  $plugin = $available{&amp;quot;thumbnail_video&amp;quot;}-&amp;amp;gt;{plugin};&lt;br /&gt;
  $new_doc = $plugin-&amp;amp;gt;convert( $doc, &amp;quot;thumbnail_video&amp;quot; );&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=head_description --&amp;gt;&lt;br /&gt;
==DESCRIPTION==&lt;br /&gt;
Conversion of images, videos and audio into preview/thumbnail versions.&lt;br /&gt;
&lt;br /&gt;
This plugin wraps the ImageMagick &amp;lt;em&amp;gt;convert&amp;lt;/em&amp;gt; and &amp;lt;em&amp;gt;ffmpeg&amp;lt;/em&amp;gt; tools.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=head_parameters --&amp;gt;&lt;br /&gt;
==PARAMETERS==&lt;br /&gt;
These parameters can be set through the '''plugins.pl''' configuration file. You must also configure the '''executables''' locations for &amp;lt;em&amp;gt;convert&amp;lt;/em&amp;gt; and &amp;lt;em&amp;gt;ffmpeg&amp;lt;/em&amp;gt; in [[API:EPrints/SystemSettings|EPrints::SystemSettings]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=item_convert_formats_ext_mime_type --&amp;gt;&lt;br /&gt;
===convert_formats = { ext =&amp;amp;gt; mime_type }===&lt;br /&gt;
&lt;br /&gt;
Define the formats supported for input by the call_convert() method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=item_ffmpeg_formats_ext_mime_type --&amp;gt;&lt;br /&gt;
===ffmpeg_formats = { ext =&amp;amp;gt; mime_type }===&lt;br /&gt;
&lt;br /&gt;
Define the formats supported for input by the call_ffmpeg() method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=item_sizes_size_w_h --&amp;gt;&lt;br /&gt;
===sizes = { size =&amp;amp;gt; [$w, $h] }===&lt;br /&gt;
&lt;br /&gt;
Define the size of thumbnails that can be generated e.g. &amp;quot;small =&amp;amp;gt; [66,50]&amp;quot;. The image dimensions generated may be smaller than those specified if the aspect ratio of the source document is different.&lt;br /&gt;
&lt;br /&gt;
Images are output in 8-bit paletted PNG.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=item_video_1 --&amp;gt;&lt;br /&gt;
===video = 1===&lt;br /&gt;
&lt;br /&gt;
Enable video previews.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=item_audio_1 --&amp;gt;&lt;br /&gt;
===audio = 1===&lt;br /&gt;
&lt;br /&gt;
Enable audio previews.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=item_video_height_480 --&amp;gt;&lt;br /&gt;
===video_height = &amp;quot;480&amp;quot;===&lt;br /&gt;
&lt;br /&gt;
Video preview vertical lines.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=item_audio_sampling_44100 --&amp;gt;&lt;br /&gt;
===audio_sampling = &amp;quot;44100&amp;quot;===&lt;br /&gt;
&lt;br /&gt;
Audio frequency sampling rate in Hz.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=item_audio_bitrate_96k --&amp;gt;&lt;br /&gt;
===audio_bitrate = &amp;quot;96k&amp;quot;===&lt;br /&gt;
&lt;br /&gt;
Audio bit rate in kb/s&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=item_audio_codec_libfaac --&amp;gt;&lt;br /&gt;
===audio_codec = &amp;quot;libfaac&amp;quot;===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;em&amp;gt;ffmpeg&amp;lt;/em&amp;gt; compiled-in AAC codec name.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=item_frame_rate_10_00 --&amp;gt;&lt;br /&gt;
===frame_rate = &amp;quot;10.00&amp;quot;===&lt;br /&gt;
&lt;br /&gt;
Video frame rate in fps.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=item_video_codec_h264 --&amp;gt;&lt;br /&gt;
===video_codec = &amp;quot;h264&amp;quot;===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;em&amp;gt;ffmpeg&amp;lt;/em&amp;gt; compiled-in H.264 codec name (may be libx264 on some platforms).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=item_video_rate_1500k --&amp;gt;&lt;br /&gt;
===video_rate = &amp;quot;1500k&amp;quot;===&lt;br /&gt;
&lt;br /&gt;
Video bit rate in kilobits.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=item_sub --&amp;gt;&lt;br /&gt;
===call_convert = sub( $plugin, $dst, $doc, $src, $geom, $size )===&lt;br /&gt;
&lt;br /&gt;
See [[API:EPrints/Plugin/Convert/Thumbnails#call_convert|call_convert]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=item_sub --&amp;gt;&lt;br /&gt;
===call_ffmpeg = sub( $plugin, $dst, $doc, $src, $geom, $size, $offset )===&lt;br /&gt;
&lt;br /&gt;
See [[API:EPrints/Plugin/Convert/Thumbnails#call_ffmpeg|call_ffmpeg]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=head_methods --&amp;gt;&lt;br /&gt;
==METHODS==&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=item_can_convert --&amp;gt;&lt;br /&gt;
===can_convert===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;perl&amp;quot;&amp;gt;%types = $plugin-&amp;gt;can_convert( $doc )&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Returns a hash map of types this plugin can convert $doc to.&lt;br /&gt;
&lt;br /&gt;
This may be relatively expensive to do if the plugin has to call an external tool to determine if it can export something.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=item_convert --&amp;gt;&lt;br /&gt;
===convert===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;perl&amp;quot;&amp;gt;$new_doc = $plugin-&amp;gt;convert( $eprint, $doc, $type )&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Request the plugin converts $doc to $type, as returned by [[API:EPrints/Plugin/Convert/Thumbnails#can_convert|can_convert]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=item_export --&amp;gt;&lt;br /&gt;
===export===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;perl&amp;quot;&amp;gt;@filelist = $plugin-&amp;gt;export( $dir, $doc, $type )&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Request the plugin converts $doc to $type, as returned by [[API:EPrints/Plugin/Convert/Thumbnails#can_convert|can_convert]]. Outputs the resulting files to $dir and returns their paths (excluding the leading $dir part).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=head_utility_methods --&amp;gt;&lt;br /&gt;
===Utility Methods===&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=item_convert_version --&amp;gt;&lt;br /&gt;
====convert_version====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;perl&amp;quot;&amp;gt;$ver = $plugin-&amp;gt;convert_version()&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Returns the MAJOR.MINOR version of ImageMagick.&lt;br /&gt;
&lt;br /&gt;
Returns 0.0 if the version can not be determined.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=item_is_video --&amp;gt;&lt;br /&gt;
====is_video====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;perl&amp;quot;&amp;gt;$ok = $plugin-&amp;gt;is_video( $doc )&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Returns true if $doc is a video.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=item_intermediate --&amp;gt;&lt;br /&gt;
====intermediate====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;perl&amp;quot;&amp;gt;$doc = $plugin-&amp;gt;intermediate( $doc, $src, $geom, $src )&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Attempt to find an intermediate document that we can use to convert from (e.g. make a thumbnail from a preview version).&lt;br /&gt;
&lt;br /&gt;
Returns the original $doc if not intermediate is found.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=item_call_convert --&amp;gt;&lt;br /&gt;
====call_convert====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;perl&amp;quot;&amp;gt;$plugin-&amp;gt;call_convert( $dst, $doc, $src, $geom, $size )&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Calls the ImageMagick &amp;lt;em&amp;gt;convert&amp;lt;/em&amp;gt; tool to convert $doc into a thumbnail image. Writes the image to $dst. $src is the full path to the main file from $doc. The resulting image should not exceed $geom dimensions ([w,h] array ref).&lt;br /&gt;
&lt;br /&gt;
$size is the thumbnail-defined size (as-in the keys to the '''sizes''' parameter).&lt;br /&gt;
&lt;br /&gt;
This method can be overridden with the '''call_convert''' parameter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=item_call_ffmpeg --&amp;gt;&lt;br /&gt;
====call_ffmpeg====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;perl&amp;quot;&amp;gt;$plugin-&amp;gt;call_ffmpeg( $dst, $doc, $src, $geom, $size, $offset )&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Uses the &amp;lt;em&amp;gt;ffmpeg&amp;lt;/em&amp;gt; tool to do the image conversion of $doc. $dst is the filename to write to, $src is the filename to read from and $geom is the image dimensions to write.&lt;br /&gt;
&lt;br /&gt;
$size is the thumbnail-defined size (as-in the keys to the '''sizes''' parameter or '''audio''' or '''video''').&lt;br /&gt;
&lt;br /&gt;
$offset is the time offset to extract (for '''audio'''/'''video'''). It is an array ref of [HOUR, MINUTE, SECOND, FRAME].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=item_export_mp3 --&amp;gt;&lt;br /&gt;
====export_mp3====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;perl&amp;quot;&amp;gt;$plugin-&amp;gt;export_mp3( $dst, $doc, $src, $rate )&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Export $src to $dst in MP3 format at sampling rate $rate.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=item_export_audio --&amp;gt;&lt;br /&gt;
====export_audio====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;perl&amp;quot;&amp;gt;$plugin-&amp;gt;export_audio( $dst, $doc, $src, $container )&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Export audio-only $src to $dst in $container format.&lt;br /&gt;
&lt;br /&gt;
Audio is encoded as &amp;lt;em&amp;gt;audio_codec&amp;lt;/em&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=item_export_video --&amp;gt;&lt;br /&gt;
====export_video====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;perl&amp;quot;&amp;gt;$plugin-&amp;gt;export_video( $dst, $doc, $src, $container )&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Export audio and video $src to $dst in $container format with vertical lines $lines maintaining aspect ratio.&lt;br /&gt;
&lt;br /&gt;
Video is encoded as &amp;lt;em&amp;gt;video_codec&amp;lt;/em&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Audio is encoded as &amp;lt;em&amp;gt;audio_codec&amp;lt;/em&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=item_export_cell --&amp;gt;&lt;br /&gt;
====export_cell====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;perl&amp;quot;&amp;gt;$plugin-&amp;gt;export_cell( $dir, $doc, $src, $geom, $size, $offset )&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Export $src to $dst in JPG format in dimensions $geom from offset $offset.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=item_calculate_offset --&amp;gt;&lt;br /&gt;
====calculate_offset====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;perl&amp;quot;&amp;gt;$secs = $plugin-&amp;gt;calculate_offset( $duration, $offset )&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Translates a seconds or percentage offset into seconds from the start time. If the resulting time is greater than $duration returns $duration.&lt;br /&gt;
&lt;br /&gt;
To specify seconds either use just a number (1234) or append 's' (1234s).&lt;br /&gt;
&lt;br /&gt;
To specify a percentage of $duration append '%' (52%).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=head_see_also --&amp;gt;&lt;br /&gt;
==SEE ALSO==&lt;br /&gt;
[[API:EPrints/Plugin|EPrints::Plugin]], [[API:EPrints/Plugin/Convert|EPrints::Plugin::Convert]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=head_author --&amp;gt;&lt;br /&gt;
==AUTHOR==&lt;br /&gt;
Copyright 2009 Tim Brody &amp;amp;lt;tdb2@ecs.soton.ac.uk&amp;amp;gt;, University of Southampton, UK.&lt;br /&gt;
&lt;br /&gt;
This module is released under the GPLv3 license.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=head_copyright --&amp;gt;&lt;br /&gt;
==COPYRIGHT==&lt;br /&gt;
Copyright 2000-2011 University of Southampton.&lt;br /&gt;
&lt;br /&gt;
This file is part of EPrints http://www.eprints.org/.&lt;br /&gt;
&lt;br /&gt;
EPrints is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.&lt;br /&gt;
&lt;br /&gt;
EPrints is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.&lt;br /&gt;
&lt;br /&gt;
You should have received a copy of the GNU Lesser General Public License along with EPrints.  If not, see http://www.gnu.org/licenses/.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=_postamble_ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;/div&gt;</summary>
		<author><name>Libjlrs@leeds.ac.uk</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=API:EPrints/Plugin/Convert/Thumbnails&amp;diff=10651</id>
		<title>API:EPrints/Plugin/Convert/Thumbnails</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=API:EPrints/Plugin/Convert/Thumbnails&amp;diff=10651"/>
		<updated>2012-10-30T16:23:58Z</updated>

		<summary type="html">&lt;p&gt;Libjlrs@leeds.ac.uk: Add link to new page for customising thumbnails&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!-- Pod2Wiki=_preamble_ &lt;br /&gt;
This page has been automatically generated from the EPrints 3.2 source. Any wiki changes made between the 'Pod2Wiki=*' and 'Edit below this comment' comments will be lost.&lt;br /&gt;
 --&amp;gt;{{API}}{{Pod2Wiki}}{{API:Source|file=perl_lib/EPrints/Plugin/Convert/Thumbnails.pm|package_name=EPrints::Plugin::Convert::Thumbnails}}[[Category:API|THUMBNAILS]][[Category:API:EPrints/Plugin/Convert|THUMBNAILS]][[Category:API:EPrints/Plugin/Convert/Thumbnails|THUMBNAILS]]&amp;lt;div&amp;gt;&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=_private_ --&amp;gt;&amp;lt;!-- Pod2Wiki=head_name --&amp;gt;&lt;br /&gt;
==NAME==&lt;br /&gt;
EPrints::Plugin::Convert::Thumbnails - thumbnail-sized versions of audio/video/images&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
The Thumbnail How-to may also be useful: [How to customise thumbnails]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=head_synopsis --&amp;gt;&lt;br /&gt;
==SYNOPSIS==&lt;br /&gt;
&amp;lt;pre&amp;gt;  use EPrints;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;  # enable audio previews&lt;br /&gt;
  $c-&amp;amp;gt;{plugins}-&amp;amp;gt;{'Convert::Thumbnails'}-&amp;amp;gt;{params}-&amp;amp;gt;{audio} = 1;&lt;br /&gt;
  # disable video previews&lt;br /&gt;
  $c-&amp;amp;gt;{plugins}-&amp;amp;gt;{'Convert::Thumbnails'}-&amp;amp;gt;{params}-&amp;amp;gt;{video} = 0;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;  # enable audio_*/video_* previews&lt;br /&gt;
  $c-&amp;amp;gt;{thumbnail_types} = sub {&lt;br /&gt;
    my( $list, $repo, $doc ) = @_;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;    push @$list, qw( audio_mp4 audio_ogg video_mp4 video_ogg );&lt;br /&gt;
  };&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;  ...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;  my $plugin = $session-&amp;amp;gt;plugin( &amp;quot;Convert&amp;quot; );&lt;br /&gt;
  my %available = $plugin-&amp;amp;gt;can_convert( $doc );&lt;br /&gt;
  $plugin = $available{&amp;quot;thumbnail_video&amp;quot;}-&amp;amp;gt;{plugin};&lt;br /&gt;
  $new_doc = $plugin-&amp;amp;gt;convert( $doc, &amp;quot;thumbnail_video&amp;quot; );&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=head_description --&amp;gt;&lt;br /&gt;
==DESCRIPTION==&lt;br /&gt;
Conversion of images, videos and audio into preview/thumbnail versions.&lt;br /&gt;
&lt;br /&gt;
This plugin wraps the ImageMagick &amp;lt;em&amp;gt;convert&amp;lt;/em&amp;gt; and &amp;lt;em&amp;gt;ffmpeg&amp;lt;/em&amp;gt; tools.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=head_parameters --&amp;gt;&lt;br /&gt;
==PARAMETERS==&lt;br /&gt;
These parameters can be set through the '''plugins.pl''' configuration file. You must also configure the '''executables''' locations for &amp;lt;em&amp;gt;convert&amp;lt;/em&amp;gt; and &amp;lt;em&amp;gt;ffmpeg&amp;lt;/em&amp;gt; in [[API:EPrints/SystemSettings|EPrints::SystemSettings]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=item_convert_formats_ext_mime_type --&amp;gt;&lt;br /&gt;
===convert_formats = { ext =&amp;amp;gt; mime_type }===&lt;br /&gt;
&lt;br /&gt;
Define the formats supported for input by the call_convert() method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=item_ffmpeg_formats_ext_mime_type --&amp;gt;&lt;br /&gt;
===ffmpeg_formats = { ext =&amp;amp;gt; mime_type }===&lt;br /&gt;
&lt;br /&gt;
Define the formats supported for input by the call_ffmpeg() method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=item_sizes_size_w_h --&amp;gt;&lt;br /&gt;
===sizes = { size =&amp;amp;gt; [$w, $h] }===&lt;br /&gt;
&lt;br /&gt;
Define the size of thumbnails that can be generated e.g. &amp;quot;small =&amp;amp;gt; [66,50]&amp;quot;. The image dimensions generated may be smaller than those specified if the aspect ratio of the source document is different.&lt;br /&gt;
&lt;br /&gt;
Images are output in 8-bit paletted PNG.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=item_video_1 --&amp;gt;&lt;br /&gt;
===video = 1===&lt;br /&gt;
&lt;br /&gt;
Enable video previews.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=item_audio_1 --&amp;gt;&lt;br /&gt;
===audio = 1===&lt;br /&gt;
&lt;br /&gt;
Enable audio previews.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=item_video_height_480 --&amp;gt;&lt;br /&gt;
===video_height = &amp;quot;480&amp;quot;===&lt;br /&gt;
&lt;br /&gt;
Video preview vertical lines.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=item_audio_sampling_44100 --&amp;gt;&lt;br /&gt;
===audio_sampling = &amp;quot;44100&amp;quot;===&lt;br /&gt;
&lt;br /&gt;
Audio frequency sampling rate in Hz.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=item_audio_bitrate_96k --&amp;gt;&lt;br /&gt;
===audio_bitrate = &amp;quot;96k&amp;quot;===&lt;br /&gt;
&lt;br /&gt;
Audio bit rate in kb/s&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=item_audio_codec_libfaac --&amp;gt;&lt;br /&gt;
===audio_codec = &amp;quot;libfaac&amp;quot;===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;em&amp;gt;ffmpeg&amp;lt;/em&amp;gt; compiled-in AAC codec name.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=item_frame_rate_10_00 --&amp;gt;&lt;br /&gt;
===frame_rate = &amp;quot;10.00&amp;quot;===&lt;br /&gt;
&lt;br /&gt;
Video frame rate in fps.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=item_video_codec_h264 --&amp;gt;&lt;br /&gt;
===video_codec = &amp;quot;h264&amp;quot;===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;em&amp;gt;ffmpeg&amp;lt;/em&amp;gt; compiled-in H.264 codec name (may be libx264 on some platforms).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=item_video_rate_1500k --&amp;gt;&lt;br /&gt;
===video_rate = &amp;quot;1500k&amp;quot;===&lt;br /&gt;
&lt;br /&gt;
Video bit rate in kilobits.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=item_sub --&amp;gt;&lt;br /&gt;
===call_convert = sub( $plugin, $dst, $doc, $src, $geom, $size )===&lt;br /&gt;
&lt;br /&gt;
See [[API:EPrints/Plugin/Convert/Thumbnails#call_convert|call_convert]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=item_sub --&amp;gt;&lt;br /&gt;
===call_ffmpeg = sub( $plugin, $dst, $doc, $src, $geom, $size, $offset )===&lt;br /&gt;
&lt;br /&gt;
See [[API:EPrints/Plugin/Convert/Thumbnails#call_ffmpeg|call_ffmpeg]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=head_methods --&amp;gt;&lt;br /&gt;
==METHODS==&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=item_can_convert --&amp;gt;&lt;br /&gt;
===can_convert===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;perl&amp;quot;&amp;gt;%types = $plugin-&amp;gt;can_convert( $doc )&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Returns a hash map of types this plugin can convert $doc to.&lt;br /&gt;
&lt;br /&gt;
This may be relatively expensive to do if the plugin has to call an external tool to determine if it can export something.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=item_convert --&amp;gt;&lt;br /&gt;
===convert===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;perl&amp;quot;&amp;gt;$new_doc = $plugin-&amp;gt;convert( $eprint, $doc, $type )&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Request the plugin converts $doc to $type, as returned by [[API:EPrints/Plugin/Convert/Thumbnails#can_convert|can_convert]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=item_export --&amp;gt;&lt;br /&gt;
===export===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;perl&amp;quot;&amp;gt;@filelist = $plugin-&amp;gt;export( $dir, $doc, $type )&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Request the plugin converts $doc to $type, as returned by [[API:EPrints/Plugin/Convert/Thumbnails#can_convert|can_convert]]. Outputs the resulting files to $dir and returns their paths (excluding the leading $dir part).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=head_utility_methods --&amp;gt;&lt;br /&gt;
===Utility Methods===&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=item_convert_version --&amp;gt;&lt;br /&gt;
====convert_version====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;perl&amp;quot;&amp;gt;$ver = $plugin-&amp;gt;convert_version()&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Returns the MAJOR.MINOR version of ImageMagick.&lt;br /&gt;
&lt;br /&gt;
Returns 0.0 if the version can not be determined.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=item_is_video --&amp;gt;&lt;br /&gt;
====is_video====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;perl&amp;quot;&amp;gt;$ok = $plugin-&amp;gt;is_video( $doc )&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Returns true if $doc is a video.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=item_intermediate --&amp;gt;&lt;br /&gt;
====intermediate====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;perl&amp;quot;&amp;gt;$doc = $plugin-&amp;gt;intermediate( $doc, $src, $geom, $src )&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Attempt to find an intermediate document that we can use to convert from (e.g. make a thumbnail from a preview version).&lt;br /&gt;
&lt;br /&gt;
Returns the original $doc if not intermediate is found.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=item_call_convert --&amp;gt;&lt;br /&gt;
====call_convert====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;perl&amp;quot;&amp;gt;$plugin-&amp;gt;call_convert( $dst, $doc, $src, $geom, $size )&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Calls the ImageMagick &amp;lt;em&amp;gt;convert&amp;lt;/em&amp;gt; tool to convert $doc into a thumbnail image. Writes the image to $dst. $src is the full path to the main file from $doc. The resulting image should not exceed $geom dimensions ([w,h] array ref).&lt;br /&gt;
&lt;br /&gt;
$size is the thumbnail-defined size (as-in the keys to the '''sizes''' parameter).&lt;br /&gt;
&lt;br /&gt;
This method can be overridden with the '''call_convert''' parameter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=item_call_ffmpeg --&amp;gt;&lt;br /&gt;
====call_ffmpeg====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;perl&amp;quot;&amp;gt;$plugin-&amp;gt;call_ffmpeg( $dst, $doc, $src, $geom, $size, $offset )&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Uses the &amp;lt;em&amp;gt;ffmpeg&amp;lt;/em&amp;gt; tool to do the image conversion of $doc. $dst is the filename to write to, $src is the filename to read from and $geom is the image dimensions to write.&lt;br /&gt;
&lt;br /&gt;
$size is the thumbnail-defined size (as-in the keys to the '''sizes''' parameter or '''audio''' or '''video''').&lt;br /&gt;
&lt;br /&gt;
$offset is the time offset to extract (for '''audio'''/'''video'''). It is an array ref of [HOUR, MINUTE, SECOND, FRAME].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=item_export_mp3 --&amp;gt;&lt;br /&gt;
====export_mp3====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;perl&amp;quot;&amp;gt;$plugin-&amp;gt;export_mp3( $dst, $doc, $src, $rate )&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Export $src to $dst in MP3 format at sampling rate $rate.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=item_export_audio --&amp;gt;&lt;br /&gt;
====export_audio====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;perl&amp;quot;&amp;gt;$plugin-&amp;gt;export_audio( $dst, $doc, $src, $container )&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Export audio-only $src to $dst in $container format.&lt;br /&gt;
&lt;br /&gt;
Audio is encoded as &amp;lt;em&amp;gt;audio_codec&amp;lt;/em&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=item_export_video --&amp;gt;&lt;br /&gt;
====export_video====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;perl&amp;quot;&amp;gt;$plugin-&amp;gt;export_video( $dst, $doc, $src, $container )&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Export audio and video $src to $dst in $container format with vertical lines $lines maintaining aspect ratio.&lt;br /&gt;
&lt;br /&gt;
Video is encoded as &amp;lt;em&amp;gt;video_codec&amp;lt;/em&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Audio is encoded as &amp;lt;em&amp;gt;audio_codec&amp;lt;/em&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=item_export_cell --&amp;gt;&lt;br /&gt;
====export_cell====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;perl&amp;quot;&amp;gt;$plugin-&amp;gt;export_cell( $dir, $doc, $src, $geom, $size, $offset )&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Export $src to $dst in JPG format in dimensions $geom from offset $offset.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=item_calculate_offset --&amp;gt;&lt;br /&gt;
====calculate_offset====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;perl&amp;quot;&amp;gt;$secs = $plugin-&amp;gt;calculate_offset( $duration, $offset )&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Translates a seconds or percentage offset into seconds from the start time. If the resulting time is greater than $duration returns $duration.&lt;br /&gt;
&lt;br /&gt;
To specify seconds either use just a number (1234) or append 's' (1234s).&lt;br /&gt;
&lt;br /&gt;
To specify a percentage of $duration append '%' (52%).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=head_see_also --&amp;gt;&lt;br /&gt;
==SEE ALSO==&lt;br /&gt;
[[API:EPrints/Plugin|EPrints::Plugin]], [[API:EPrints/Plugin/Convert|EPrints::Plugin::Convert]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=head_author --&amp;gt;&lt;br /&gt;
==AUTHOR==&lt;br /&gt;
Copyright 2009 Tim Brody &amp;amp;lt;tdb2@ecs.soton.ac.uk&amp;amp;gt;, University of Southampton, UK.&lt;br /&gt;
&lt;br /&gt;
This module is released under the GPLv3 license.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=head_copyright --&amp;gt;&lt;br /&gt;
==COPYRIGHT==&lt;br /&gt;
Copyright 2000-2011 University of Southampton.&lt;br /&gt;
&lt;br /&gt;
This file is part of EPrints http://www.eprints.org/.&lt;br /&gt;
&lt;br /&gt;
EPrints is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.&lt;br /&gt;
&lt;br /&gt;
EPrints is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.&lt;br /&gt;
&lt;br /&gt;
You should have received a copy of the GNU Lesser General Public License along with EPrints.  If not, see http://www.gnu.org/licenses/.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Pod2Wiki= --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Pod2Wiki=_postamble_ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Edit below this comment --&amp;gt;&lt;/div&gt;</summary>
		<author><name>Libjlrs@leeds.ac.uk</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=How_to&amp;diff=10650</id>
		<title>How to</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=How_to&amp;diff=10650"/>
		<updated>2012-10-22T12:37:51Z</updated>

		<summary type="html">&lt;p&gt;Libjlrs@leeds.ac.uk: /* HOW TO: Set up a Complex Custom View */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Howto]]&lt;br /&gt;
==HOW TO: Set up a Complex Custom View==&lt;br /&gt;
'''NOTE: http://wiki.eprints.org/w/Adding_new_views is a better page to start with for newer version of EPrints.'''&lt;br /&gt;
&lt;br /&gt;
Simple instructions are in the ArchiveConfig.pm section.&lt;br /&gt;
&lt;br /&gt;
Example situation: On my main website www.foobars.ac.uk I have a page per research project, of which we have hundreds. Each project has a short unique id code, eg. &amp;quot;manticore&amp;quot;. I have a field in my eprints archive (eprints.foobars.ac.uk) which is configured:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 { name=&amp;gt;&amp;quot;projectcodes&amp;quot;, type=&amp;gt;&amp;quot;text&amp;quot;, multiple=&amp;gt;1 }&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
I add the following browse view:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 { id=&amp;gt;&amp;quot;by_project&amp;quot;, allow_null=&amp;gt;0, fields=&amp;gt;&amp;quot;projectcodes&amp;quot;, &lt;br /&gt;
 order=&amp;gt;&amp;quot;-year/title&amp;quot; }&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
This will generate a page http://eprints.foobars.ac.uk/views/by_project/manticore.html with a list of all papers in that project, we can link to that URL!&lt;br /&gt;
&lt;br /&gt;
===Making the Field link to the Browse Page===&lt;br /&gt;
If you want a subject to link the subject browse page of that value, add the '''browse_link''' property to the field (and regenerate the abstracts if you want).&lt;br /&gt;
&lt;br /&gt;
If you remove the browse view you should remove the browse_link or it will be a broken link.&lt;br /&gt;
&lt;br /&gt;
Values rendered inside citations which are used to link to the main record will not link into the browse view for obvious reasons.&lt;br /&gt;
&lt;br /&gt;
===Including a view in another page===&lt;br /&gt;
If you change that to:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 { id=&amp;gt;&amp;quot;by_project&amp;quot;, allow_null=&amp;gt;0, fields=&amp;gt;&amp;quot;projectcodes&amp;quot;, &lt;br /&gt;
 order=&amp;gt;&amp;quot;-year/title&amp;quot;, noindex=&amp;gt;1, nolink=&amp;gt;1, nohtml=&amp;gt;1, include=&amp;gt;1 }&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
This will generate a view which is NOT listed on the /view/ page and it will not skip making the .html file and make a .include file per value. This will only contain the &amp;quot;count&amp;quot; of items and the XHTML of their citations. This can be used as part of a page on the http://www.foobaars.ac.uk/ site; either by using php and capturing it on-the-fly using &amp;lt;tt&amp;gt;readfile&amp;lt;/tt&amp;gt; or scripting it with perl or NFS exporting the filesystem onto the main server (or just doing it all on one computer) and using server side includes to place it in a page.&lt;br /&gt;
&lt;br /&gt;
===Customising the way each item is cited===&lt;br /&gt;
I want to list the project papers in a strict format in a table with 4 columns: title, author(s), year and an icon which links to the document abstract page...&lt;br /&gt;
&lt;br /&gt;
I add some ''more'' options to the browse view:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 { id=&amp;gt;&amp;quot;by_project&amp;quot;, allow_null=&amp;gt;0, fields=&amp;gt;&amp;quot;projectcodes&amp;quot;, &lt;br /&gt;
 order=&amp;gt;&amp;quot;-year/title&amp;quot;, noindex=&amp;gt;1, nolink=&amp;gt;1, nohtml=&amp;gt;1, include=&amp;gt;1,&lt;br /&gt;
 nocount=&amp;gt;1, citation=&amp;gt;&amp;quot;project_table&amp;quot; }&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Now I add a new citation to the citations config file:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 &amp;lt;ep:citation type=&amp;quot;project_table&amp;quot;&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&amp;amp;title;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;amp;authors;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;td&amp;gt;&amp;amp;year;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;ep:linkhere&amp;gt;&amp;lt;img &lt;br /&gt;
 src=&amp;quot;http://www.foobars.ac.uk/images/paperlink.png&amp;quot; alt=&amp;quot;view&amp;quot; width=&amp;quot;32&amp;quot; &lt;br /&gt;
 height=&amp;quot;64&amp;quot; border=&amp;quot;0&amp;quot; /&amp;gt;&amp;lt;/ep:linkhere&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/ep:citation&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
That should generate for the manticore project, in the &amp;quot;.include&amp;quot; file (I've cut the contents of the &amp;quot;img&amp;quot; tag for readability:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 &amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Making Stuff&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Guy, A.&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;2001&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;a &lt;br /&gt;
 href=&amp;quot;http://eprints.foobar.ac.uk/archive/00000923/&amp;quot;&amp;gt;&amp;lt;img ... /&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;
 &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Eating Food&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Herring, Walter and Chips, Bob&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&lt;br /&gt;
 2000&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;a href=&amp;quot;http://eprints.foobar.ac.uk/archive/00000445/&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;img ... /&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
===A &amp;quot;CV&amp;quot; page - a list of all of Alices records===&lt;br /&gt;
This is where the authors and editors field having an ID comes in handy.&lt;br /&gt;
&lt;br /&gt;
Say we use local username to identify people in the &amp;quot;Person ID&amp;quot; fields, we can now set up a view:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 { id=&amp;gt;&amp;quot;by_person&amp;quot;, allow_null=&amp;gt;0, fields=&amp;gt;&amp;quot;authors.id/editors.id&amp;quot;, &lt;br /&gt;
 order=&amp;gt;&amp;quot;-year/title&amp;quot;, noindex=&amp;gt;1, include=&amp;gt;1 }&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
This will generate both .html pages and .include pages. An member of your organisation can get a list of their records either by linking to &amp;lt;tt&amp;gt;/views/by_person/alice.html&amp;lt;/tt&amp;gt; (where alice is their username) or by snarfing the URL &amp;lt;tt&amp;gt;/views/by_person/alice.include&amp;lt;/tt&amp;gt; into his own homepage.&lt;br /&gt;
&lt;br /&gt;
==HOW TO: Fields==&lt;br /&gt;
===Add a new Field&lt;br /&gt;
This covers adding a new field to a new system, not a live system. It is possible to add a new field to a live system but involves SQL hacking.&lt;br /&gt;
&lt;br /&gt;
In this example we add a new &amp;quot;set&amp;quot; field called &amp;quot;local&amp;quot; which will have 3 options &amp;quot;yes&amp;quot;, &amp;quot;no&amp;quot; and &amp;quot;partial&amp;quot; - this will indicate if the item in question was produced in our organisation or not.&lt;br /&gt;
&lt;br /&gt;
; Add the Field to ArchiveMetafieldConfig.pm : Add the field to the appropriate part of ArchiveMetafieldConfig.pm (the &amp;quot;eprint&amp;quot; section in our example)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 { name =&amp;gt; &amp;quot;local&amp;quot;, type =&amp;gt; &amp;quot;set&amp;quot;, input_rows =&amp;gt; 1, &lt;br /&gt;
    options =&amp;gt; [ &amp;quot;yes&amp;quot;, &amp;quot;no&amp;quot;, &amp;quot;partial&amp;quot; ] }&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
input_rows being set to one will make it appear as a pull-down menu.&lt;br /&gt;
; Add the Field to metadata-types.xml : If you want the user to be able to edit this field for any or all types of eprint/user then you need to add it to each appropriate type in metadata-types.xml (this can be changed on a live system without any serious consequences).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 &amp;lt;field name=&amp;quot;local&amp;quot; required=&amp;quot;yes&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
; Add the Field Information to the Archive Phrase File(s) : Normally we just need to add fieldname and fieldhelp, but this is an option field so we need to add names for each option. If we run the archive in more than one language then we add this to each phrase file (but in the appropriate language).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 &amp;lt;ep:phrase ref=&amp;quot;eprint_fieldname_local&amp;quot;&amp;gt;Produced Locally&amp;lt;/ep:phrase&amp;gt;&lt;br /&gt;
 &amp;lt;ep:phrase ref=&amp;quot;eprint_fieldhelp_local&amp;quot;&amp;gt;Please indicate if this item was produced in the foo organisation, or not.&amp;lt;/ep:phrase&amp;gt;&lt;br /&gt;
 &amp;lt;ep:phrase ref=&amp;quot;eprint_fieldopt_local_yes&amp;quot;&amp;gt;produced locally&amp;lt;/ep:phrase&amp;gt;&lt;br /&gt;
 &amp;lt;ep:phrase ref=&amp;quot;eprint_fieldopt_local_no&amp;quot;&amp;gt;not produced locally&amp;lt;/ep:phrase&amp;gt;&lt;br /&gt;
 &amp;lt;ep:phrase ref=&amp;quot;eprint_fieldopt_local_partial&amp;quot;&amp;gt;only partially produced locally&amp;lt;/ep:phrase&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Other things you may wish to change after adding a new field====&lt;br /&gt;
; Add it to the citations file : This is optional, only do this if you want it to appear in the citated forms.&lt;br /&gt;
In our example case we only want this to appear when citing technical reports, so we change that entry to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 &amp;lt;ep:citation type=&amp;quot;eprint_techreport&amp;quot;&amp;gt;&amp;lt;ep:linkhere&amp;gt;&amp;lt;span &lt;br /&gt;
 class=&amp;quot;citation&amp;quot;&amp;gt;&amp;amp;authors; &amp;lt;ep:ifset name=&amp;quot;year&amp;quot;&amp;gt;(&amp;amp;year;) &lt;br /&gt;
 &amp;lt;/ep:ifset&amp;gt;&amp;amp;title;. Technical Report&amp;lt;ep:ifset name=&amp;quot;reportno&amp;quot;&amp;gt; &lt;br /&gt;
 &amp;amp;reportno;&amp;lt;/ep:ifset&amp;gt;&amp;lt;ep:ifset name=&amp;quot;department&amp;quot;&amp;gt;, &amp;amp;department;&lt;br /&gt;
 &amp;lt;/ep:ifset&amp;gt;&amp;lt;ep:ifset name=&amp;quot;institution&amp;quot;&amp;gt;, &amp;amp;institution;&amp;lt;/ep:ifset&amp;gt;. &lt;br /&gt;
 &amp;amp;local;.&amp;lt;/span&amp;gt;&amp;lt;/ep:linkhere&amp;gt;&amp;lt;/ep:citation&amp;gt; &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
All we've done is add &amp;lt;tt&amp;gt;&amp;amp;local;.&amp;lt;/tt&amp;gt; to the end. It's not inside &amp;lt;tt&amp;gt; &amp;lt;ep:ifset name=&amp;quot;local&amp;quot;&amp;gt; &amp;lt;/tt&amp;gt; as it is a required field and will (should) always be set.&lt;br /&gt;
; Add it to the the Abstract (or View-User) page. : This is also optional. If you want it to appear on the web page for this item then edit ArchiveRenderConfig.pm and select the appropriate function, either eprint_render or user_render.&lt;br /&gt;
In our example we only want to mention items if an item was not produced locally. We'll add it below the documents and above the abstract...&lt;br /&gt;
Single language example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 if( $eprint-&amp;gt;get_value( &amp;quot;local&amp;quot; ) ne &amp;quot;yes&amp;quot; )&lt;br /&gt;
 {&lt;br /&gt;
      # don't need to &amp;quot;my $p&amp;quot; as it's done earlier.&lt;br /&gt;
      $p = $session-&amp;gt;make_element( &amp;quot;p&amp;quot; );&lt;br /&gt;
      $p-&amp;gt;appendChild( $session-&amp;gt;make_text( &amp;quot;This item was &amp;quot; ) );&lt;br /&gt;
      $p-&amp;gt;appendChild( $eprint-&amp;gt;render_value( &amp;quot;local&amp;quot; ) );&lt;br /&gt;
      $p-&amp;gt;appendChild( $session-&amp;gt;make_text( &amp;quot;.&amp;quot; ) );&lt;br /&gt;
&lt;br /&gt;
      # Append our new paragraph to the page.&lt;br /&gt;
      $page-&amp;gt;appendChild( $p );&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Multiple-language example:&lt;br /&gt;
If you want to make it handle more than language then we'll need to use the archive phrase file - we would add something like this to each languages file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 &amp;lt;ep:phrase ref=&amp;quot;page:itemnotlocal&amp;quot;&amp;gt;&amp;lt;p&amp;gt;This item was &amp;lt;pin ref=&amp;quot;status&amp;quot; /&amp;gt;.&amp;lt;/p&amp;gt;&amp;lt;/ep:phrase&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
And to the ArchiveRenderConfig.pm file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 if( $eprint-&amp;gt;get_value( &amp;quot;local&amp;quot; ) ne &amp;quot;yes&amp;quot; )&lt;br /&gt;
 {&lt;br /&gt;
      my $localmsg = $session-&amp;gt;html_phrase(&lt;br /&gt;
             &amp;quot;page:itemnotlocal&amp;quot;,&lt;br /&gt;
             status=&amp;gt;$eprint-&amp;gt;render_value( &amp;quot;local&amp;quot; ) );&lt;br /&gt;
      $page-&amp;gt;appendChild( $localmsg );&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
You may prefer to use this method even if you are only using a single language.&lt;br /&gt;
; Add extra Validation Routines : If you need to validate this field in a special way, add code into ArchiveValidateConfig.pm&lt;br /&gt;
; Add it to the OAI metadata (eprints only) : If this field can be rendered into Dublin Core (or other metadata formats you are using) then add it to the appropriate place in the ArchiveOAIConfig.pm file.&lt;br /&gt;
; Add a browse view (eprints only) : If you want to be able to browse this values items. See elsewhere in the docs for how to do this.&lt;br /&gt;
&lt;br /&gt;
If you add a field you will need to run erase_archive and create_tables before you will see a change. EPrints will fail to run if you change the fields and do rebuild the tables.&lt;br /&gt;
&lt;br /&gt;
===HOW TO: Remove a Field===&lt;br /&gt;
The quick answer is to say &amp;quot;the opposite of adding one&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
; Remove the Field to metadata-types.xml : Removing it from here will mean that nobody can enter values for that field. Which is possibly enough, and means you can put it back later.&lt;br /&gt;
; Remove the Field to ArchiveMetafieldConfig.pm : This will remove it from the database ( and require a rebuild as with adding a field ).&lt;br /&gt;
; Remove it from the phrase file(s) : This is optional, unused phrases are just ignored.&lt;br /&gt;
; Remove it from the citations file : If it's used there.&lt;br /&gt;
; Remove it from the the Abstract (or View-User) page. : If it's used there.&lt;br /&gt;
; Remove extra Validation Routines : In the unlikely event you added some validation which looks at this field.&lt;br /&gt;
; Remove it from the OAI metadata (eprints only) : If it's being used. Fields used to generate the default dublincore are: title, authors, subjects, abstract, year and month. It also uses &amp;quot;type&amp;quot; which is a system field so you can't remove it!&lt;br /&gt;
; Remove it from browse views (eprints only) : If it's used there.&lt;br /&gt;
&lt;br /&gt;
==HOW TO: EPrint types==&lt;br /&gt;
===Add a new eprint type===&lt;br /&gt;
Add the eprint type to '''metadata-types.xml'''. Some fields should probably be &amp;quot;required&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Add the name of the type to the phrase file.&lt;br /&gt;
&lt;br /&gt;
Add a citation for this type to the citations file.&lt;br /&gt;
&lt;br /&gt;
===Remove an eprint type===&lt;br /&gt;
Remove it from metadata-types.xml&lt;br /&gt;
&lt;br /&gt;
You can remove it from the phrase file &amp;amp; citations but it won't hurt to leave it there.&lt;br /&gt;
&lt;br /&gt;
==HOW TO: Add a new document type==&lt;br /&gt;
Add it to '''metadata-types.xml'''. This does not need any fields.&lt;br /&gt;
&lt;br /&gt;
Add the name of the document type to the phrase file.&lt;br /&gt;
&lt;br /&gt;
Add a citation for this document to the citations file.&lt;br /&gt;
&lt;br /&gt;
If you want this to be one of the must-have-one-of document types then add its id to the list in ArchiveConfig.pm&lt;br /&gt;
&lt;br /&gt;
If you want to do something &amp;quot;clever&amp;quot; on the abstract page then edit the ArchiveRenderConfig.pm file. If you don't then it will use the citation you created to render it in the list, as with PDF, HTML etc.&lt;br /&gt;
&lt;br /&gt;
==HOW TO: Add a Discussion Forum for Each EPrint==&lt;br /&gt;
The UK Open University (open.ac.uk) have set up a service which allows you to create a discussion for every EPrint in your archive.&lt;br /&gt;
&lt;br /&gt;
The really easy way to do this is to use their discussion server. If you want to run your own d3e server the software is available from http://d3e.sourceforge.net/&lt;br /&gt;
&lt;br /&gt;
===Using d3eprints.open.ac.uk===&lt;br /&gt;
Just add the following code to the ArchiveRenderConfig.pm file just before the &amp;lt;tt&amp;gt;if( $has_multiple_versions )&amp;lt;/tt&amp;gt; bit.&lt;br /&gt;
&lt;br /&gt;
Please note that this code is not internationalised.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
        #####################################&lt;br /&gt;
        # Begin D3Eprints links&lt;br /&gt;
&lt;br /&gt;
        my $ol = $session-&amp;gt;make_element( &amp;quot;ol&amp;quot; );&lt;br /&gt;
        my $li = $session-&amp;gt;make_element( &amp;quot;li&amp;quot; );&lt;br /&gt;
        $a = $session-&amp;gt;render_link(&lt;br /&gt;
                EPrints::Utils::url_escape(&lt;br /&gt;
                        &amp;quot;http://d3eprints.open.ac.uk/disc.php?url=&amp;quot;.$eprint-&amp;gt;get_url ),&lt;br /&gt;
                &amp;quot;_top&amp;quot; );&lt;br /&gt;
        $a-&amp;gt;appendChild( $session-&amp;gt;make_text(&lt;br /&gt;
                &amp;quot;View public discussion of this document&amp;quot; ) );&lt;br /&gt;
        $li-&amp;gt;appendChild( $a );&lt;br /&gt;
        $ol-&amp;gt;appendChild( $li );&lt;br /&gt;
&lt;br /&gt;
        $li = $session-&amp;gt;make_element( &amp;quot;li&amp;quot; );&lt;br /&gt;
        $a = $session-&amp;gt;render_link(&lt;br /&gt;
                EPrints::Utils::url_escape(&lt;br /&gt;
                        &amp;quot;http://d3eprints.open.ac.uk/private/disc.php?url=&amp;quot;.&lt;br /&gt;
                                $eprint-&amp;gt;get_url ),&lt;br /&gt;
                &amp;quot;_top&amp;quot; );&lt;br /&gt;
        $a-&amp;gt;appendChild( $session-&amp;gt;make_text(&lt;br /&gt;
                &amp;quot;Create private discussion of this document&amp;quot; ) );&lt;br /&gt;
        $li-&amp;gt;appendChild( $a );&lt;br /&gt;
        $ol-&amp;gt;appendChild( $li );&lt;br /&gt;
&lt;br /&gt;
        $table-&amp;gt;appendChild( _render_row(&lt;br /&gt;
                $session,&lt;br /&gt;
                $session-&amp;gt;make_text( &amp;quot;D3Eprints discussion&amp;quot; ),&lt;br /&gt;
                $ol ) );&lt;br /&gt;
&lt;br /&gt;
        # End of D3Eprints links&lt;br /&gt;
        #####################################&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
==HOW TO: Website Integration==&lt;br /&gt;
===Make the latest additions to your archive appear on your main website===&lt;br /&gt;
The contents of the &amp;quot;latest&amp;quot; page - /perl/latest - can be included via a cron tab using wget and a server side include or using something like PHP's command to do:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 readfile( &amp;quot;http://eprints.foo.org/perl/latest?mainonly=yes&amp;quot; );&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The &amp;quot;mainonly=yes&amp;quot; flag is a hack which supresses the template of any eprints page in the /perl/ area so that it can be included, but it is most useful for &amp;quot;latest&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
WARNING: If you have a script which imports 1000 records in one night then latest isn't currently bright enough to truncate the list so your homepage could get kinda messy.&lt;br /&gt;
&lt;br /&gt;
===RSS into HTML===&lt;br /&gt;
If you want to turn any search into a dynamically generated list of references with a link back to the EPrints page, then use this.  This solution uses PHP.  So, you will need PHP enabled on the server.&lt;br /&gt;
&lt;br /&gt;
'''Dependency:''' This code depends on [http://magpierss.sourceforge.net/ MagpieRSS].&lt;br /&gt;
&lt;br /&gt;
'''Original Context:''' It was developed for use in a [http://www.terminalfour.com/ Terminal4 'SiteManager'] template, but can be used with almost no modification.&lt;br /&gt;
&lt;br /&gt;
The code implements local caching of the generated HTML in a text file which is never more than an hour old, unless there is a problem with the server whereupon the last good cached version is used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 require_once('D:/website/[path to]/magpierss/rss_fetch.inc');&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color: green; font-weight: bold&amp;quot;&amp;gt;//set some variables here:&amp;lt;/span&amp;gt;&lt;br /&gt;
 $anchor = '&amp;lt;t4 type=&amp;quot;meta&amp;quot; meta=&amp;quot;html_anchor&amp;quot; /&amp;gt;';&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color: green; font-weight: bold&amp;quot;&amp;gt;# All items in Terminal4's cms have an anchor - we like break it apart to get the Unique id, to name the cache file.&amp;lt;/span&amp;gt;&lt;br /&gt;
 $TTL = 3600;&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color: green; font-weight: bold&amp;quot;&amp;gt;# Time to live - one hour only.&amp;lt;/span&amp;gt;&lt;br /&gt;
 $feed = '&amp;lt;t4 type=&amp;quot;content&amp;quot; name=&amp;quot;RSS_Feed_URL&amp;quot; output=&amp;quot;normal&amp;quot; modifiers=&amp;quot;&amp;quot;  /&amp;gt;';&lt;br /&gt;
 $uniqueID = explode(&amp;quot;\&amp;quot;&amp;quot;, $anchor);&lt;br /&gt;
 $filename = &amp;quot;./&amp;quot; . str_replace('.', '-', $uniqueID[1]) . &amp;quot;.txt&amp;quot;;&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color: green; font-weight: bold&amp;quot;&amp;gt;#filename of cache - generated from unique id in T4 content management system.&amp;lt;/span&amp;gt;&lt;br /&gt;
 $max_items = &amp;lt;t4 type=&amp;quot;content&amp;quot; name=&amp;quot;MaxNumberToShow&amp;quot; output=&amp;quot;normal&amp;quot; modifiers=&amp;quot;&amp;quot;  /&amp;gt;;&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color: green; font-weight: bold&amp;quot;&amp;gt;# $max_items = 30; // this is set in EPrints as well, will not exceed Eprints' own internal limit.&amp;lt;/span&amp;gt;&lt;br /&gt;
 $with_summaries = '&amp;lt;t4 type=&amp;quot;content&amp;quot; name=&amp;quot;ShowSummary&amp;quot; output=&amp;quot;normal&amp;quot; modifiers=&amp;quot;&amp;quot;  /&amp;gt;'; # could be 'yes' or 'no'&lt;br /&gt;
 $age = 0;&lt;br /&gt;
 if(file_exists($filename)){&lt;br /&gt;
 	$age = time() - filemtime($filename); &lt;br /&gt;
 }else{&lt;br /&gt;
 	$fh = fopen($filename, &amp;quot;w&amp;quot;);&lt;br /&gt;
 	fwrite($fh, $news_feed);&lt;br /&gt;
 	fclose($fh);&lt;br /&gt;
 	$age = $TTL;&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 function getFromCache($f){	&lt;br /&gt;
 	$fh = fopen($f, &amp;quot;r&amp;quot;);&lt;br /&gt;
 	$size = filesize($f);&lt;br /&gt;
 	$data = fread($fh, $size);&lt;br /&gt;
 	print $data;&lt;br /&gt;
 	fclose($fh);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 if($age &amp;gt;= $TTL){ &lt;br /&gt;
 	if($rss = fetch_rss($feed)){&lt;br /&gt;
 		$items = array_slice($rss-&amp;gt;items, 0);&lt;br /&gt;
 		$find = array(&amp;quot;/^\.?/&amp;quot;);&lt;br /&gt;
 		$replace = array(&amp;quot; &amp;quot;);&lt;br /&gt;
 		$news_feed = &amp;quot;&amp;amp;lt;ul class=\&amp;quot;rss_list\&amp;quot;&amp;gt;\n&amp;quot;;&lt;br /&gt;
 			foreach ($items as $item ){&lt;br /&gt;
 				if($count &amp;amp;lt; $max_items){&lt;br /&gt;
 					$news_feed .= &amp;quot;\t&amp;amp;lt;li class=\&amp;quot;rss_item\&amp;quot;&amp;gt;\n&amp;quot;;&lt;br /&gt;
 					$news_feed .= &amp;quot;\t\t&amp;amp;lt;span class=\&amp;quot;rss_title\&amp;quot;&amp;gt;&amp;amp;lt;a href=\&amp;quot;&amp;quot; . $item['link'] . &amp;quot;\&amp;quot; target=\&amp;quot;_blank\&amp;quot;&amp;gt;&amp;quot;;&lt;br /&gt;
 					$news_feed .= $item['title'] . &amp;quot;&amp;amp;lt;/a&amp;gt;&amp;amp;lt;/span&amp;gt;\n\t\t&amp;amp;lt;br /&amp;gt;\n&amp;quot;;&lt;br /&gt;
 					if($with_summaries == 'yes'){&lt;br /&gt;
 						$news_feed .= &amp;quot;\t\t&amp;amp;lt;span class=\&amp;quot;rss_summary\&amp;quot;&amp;gt;\n\t\t\t&amp;quot;;&lt;br /&gt;
 						$news_feed .= str_replace(($item['title'] . &amp;quot;.&amp;quot;), &amp;quot;&amp;quot;, htmlentities($item['summary'])) . &amp;quot;&amp;amp;lt;br/&amp;gt;\n\t\t&amp;amp;lt;/span&amp;gt;\n&amp;quot;;&lt;br /&gt;
 					}&lt;br /&gt;
 					$news_feed .= &amp;quot;\t\t&amp;amp;lt;br /&amp;gt;\n\t&amp;lt;/li&amp;gt;\n&amp;quot;;&lt;br /&gt;
 					$count += 1;&lt;br /&gt;
 				}&lt;br /&gt;
 			}&lt;br /&gt;
 		$news_feed .= &amp;quot;&amp;amp;lt;/ul&amp;gt;\n\n&amp;quot;;&lt;br /&gt;
 		echo $news_feed;&lt;br /&gt;
 		$fh = fopen($filename, &amp;quot;w&amp;quot;);&lt;br /&gt;
 		fwrite($fh, $news_feed);&lt;br /&gt;
 		fclose($fh);&lt;br /&gt;
 	}else{&lt;br /&gt;
 		getFromCache($filename);&lt;br /&gt;
 	}&lt;br /&gt;
 }else{&lt;br /&gt;
 	getFromCache($filename);&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color: green; font-weight: bold&amp;quot;&amp;gt;# David Kane, Waterford Institute of Technology&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==HOW TO: Add full text searching==&lt;br /&gt;
EPrints does not support this natively but there are several options.&lt;br /&gt;
&lt;br /&gt;
===htdig, or similar software===&lt;br /&gt;
There is plenty of software which will provide a full text search of a website. To add non-eprints cgi scripts to your site create a directory in the cgi dir:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 mkdir /opt/eprints2/cgi/local&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
and place your scripts in there, they will have URLs under &amp;lt;tt&amp;gt;http://yoursite.com/perl/&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Using an external search engine===&lt;br /&gt;
This is very easy, but will only index public documents. Any search engine will work, but Google is a good choice. Google provide a site-search service which allows you to register with them and then have a form which searches your site using google and adds your logo and colourscheme to the results.&lt;br /&gt;
&lt;br /&gt;
A really easy solution is to just make a form which links to our &amp;quot;google_site&amp;quot; script which just adds &amp;quot;site:yoursite.com&amp;quot; to the google request to limit the search results. The HTML for this would be something like:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;form action=&amp;quot;/perl/google_site&amp;quot;&amp;gt;&lt;br /&gt;
 Use Google to search this site:&lt;br /&gt;
 &amp;lt;input name=&amp;quot;q&amp;quot; value=&amp;quot;&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;input type=&amp;quot;submit&amp;quot; name=&amp;quot;go&amp;quot; value=&amp;quot;Search&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;/form&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For other search engines; see their documentation for how to make a form to search only your site.&lt;br /&gt;
&lt;br /&gt;
==HOW TO: Make the referencetext field link to the items referenced==&lt;br /&gt;
This should have been in the 2.2 docs but I didn't have time. Check the latest version of the documentation at software.eprints.org, if it's not there then bug me at support@eprints.org&lt;br /&gt;
&lt;br /&gt;
==HOW TO: Make the password controlled parts of the site use HTTPS==&lt;br /&gt;
This should have been in the 2.2 docs but I didn't have time. Check the latest version of the documentation at software.eprints.org, if it's not there then bug me at support@eprints.org&lt;br /&gt;
&lt;br /&gt;
==HOW TO: Customise the way the the search results are formatted==&lt;br /&gt;
This should have been in the 2.2 docs but I didn't have time. Check the latest version of the documentation at software.eprints.org, if it's not there then bug me at support@eprints.org&lt;br /&gt;
&lt;br /&gt;
==HOW TO: Reset your EPrints admin password [3.3]==&lt;br /&gt;
&lt;br /&gt;
To directly reset your password, log into phpMyAdmin and execute the following mySQL statement:&lt;br /&gt;
&lt;br /&gt;
 UPDATE user SET password = encrypt('newpassword') WHERE userid = 1;&lt;br /&gt;
This will effectively reset the EPrint admin password for user 1. Note that you can use this to reset the password of any user, although this is typically unnecessary as you should be able to simply log in as admin user (user 1), under which you have the ability to reset any user's password.&lt;/div&gt;</summary>
		<author><name>Libjlrs@leeds.ac.uk</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=Citation_Format&amp;diff=10646</id>
		<title>Citation Format</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Citation_Format&amp;diff=10646"/>
		<updated>2012-10-15T14:43:10Z</updated>

		<summary type="html">&lt;p&gt;Libjlrs@leeds.ac.uk: Added reference to epc:comments&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{formats}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The citation format files, located in the repository's [[EPrints_Directory_Structure/eprints3/archives/ARCHIVEID/cfg/citations|citations]] directory, describe how citations for documents, eprints, and users should be rendered. The name of the directories reflect the name of the dataset, with the filename within the directory (e.g. brief.xml) identifying the name of the citation style.&lt;br /&gt;
&lt;br /&gt;
   &amp;amp;lt;cite:citation xmlns=&amp;quot;http://www.w3.org/1999/xhtml&amp;quot; &lt;br /&gt;
       xmlns:cite=&amp;quot;http://eprints.org/ep3/citation&amp;quot; &lt;br /&gt;
       xmlns:epc=&amp;quot;http://eprints.org/ep3/control&amp;quot;&amp;amp;gt;&lt;br /&gt;
     &amp;amp;lt;cite:linkhere&amp;amp;gt;&amp;amp;lt;span class=&amp;quot;ep_document_citation&amp;quot;&amp;amp;gt;&amp;amp;lt;epc:print expr='format'/&amp;amp;gt;&amp;amp;lt;epc:if test=&amp;quot;formatdesc&amp;quot;&amp;amp;gt; &lt;br /&gt;
 &amp;amp;lt;epc:print expr=&amp;quot;formatdesc&amp;quot;/&amp;amp;gt;)&amp;amp;lt;/epc:if&amp;amp;gt;&amp;amp;lt;/span&amp;amp;gt;&amp;amp;lt;/cite:linkhere&amp;amp;gt;&lt;br /&gt;
   &amp;amp;lt;/cite:citation&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
Two tags are provided under the citation namespace: cite:citation and cite:linkhere. The former is the root element of the file, and contains the body of the citation as well as any required namespaces. The latter surrounds one or many elements, and renders the content as a link to the item.&lt;br /&gt;
&lt;br /&gt;
Other than &amp;lt;nowiki&amp;gt;&amp;lt;cite:citation&amp;gt;&amp;lt;/nowiki&amp;gt; and &amp;lt;nowiki&amp;gt;&amp;lt;cite:linkhere&amp;gt;&amp;lt;/nowiki&amp;gt;, you can also use the xhtml namespace, which is the default namespace (the one which doesn't need a foo: type prefix on tag names), and also the [[EPrints Control Format]] elements such as &amp;lt;epc:if&amp;gt; and &amp;lt;epc:print&amp;gt; and &amp;lt;epc:comment&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Normal XML comments (using &amp;lt;nowiki&amp;gt;&amp;lt;!-- --&amp;gt;&amp;lt;/nowiki&amp;gt;) within a citation are rendered in the output - comment out blocks of xml by wrapping with an &amp;lt;epc:comment&amp;gt; block instead of XML comments!&lt;/div&gt;</summary>
		<author><name>Libjlrs@leeds.ac.uk</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=EPrints_Control_Format&amp;diff=10645</id>
		<title>EPrints Control Format</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=EPrints_Control_Format&amp;diff=10645"/>
		<updated>2012-10-15T14:33:02Z</updated>

		<summary type="html">&lt;p&gt;Libjlrs@leeds.ac.uk: Added epc:comment; added source blocks around code sections&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{formats}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= EPrints Control =&lt;br /&gt;
&lt;br /&gt;
== Output Tags ==&lt;br /&gt;
&lt;br /&gt;
=== epc:print ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;epc:print expr='expression' opt='key=value;key2=value2'/&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;cite:citation xmlns=&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&lt;br /&gt;
           xmlns:cite=&amp;quot;http://eprints.org/ep3/citation&amp;quot;&lt;br /&gt;
           xmlns:epc=&amp;quot;http://eprints.org/ep3/control&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;epc:print expr=&amp;quot;$item.citation('default')&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;/cite:citation&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Outputs the result of the expression in the 'expr' attribute. &lt;br /&gt;
&lt;br /&gt;
Rendering options may be passed in the opt attribute using a key=value form, with semicolons separating multiple options.&lt;br /&gt;
&lt;br /&gt;
Any [[EPScript]] expression can be used. The most simple is just 'eprintid','title','creators' etc. You can also use values from the configuration files by using '$config{base_url}'.&lt;br /&gt;
&lt;br /&gt;
=== Print in attributes using {} ===&lt;br /&gt;
&lt;br /&gt;
Sometimes you may wish to insert a value into an XML attribute. eg. the &amp;quot;href&amp;quot; part of an anchor. Rather than a complicated system, but correct XML, we decide to go for something a bit more readable. Any {} pair in an XML attribute will be treated as a epc:print.&lt;br /&gt;
&lt;br /&gt;
So you can do something like &lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;a href=&amp;quot;http://eprints.badger.edu/cgi/myscript.pl?eprintid={eprintid}&amp;quot;&amp;gt;run myscript on this eprint&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== epc:phrase ===&lt;br /&gt;
&lt;br /&gt;
simple:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;epc:phrase ref='phraseid' /&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
with pins:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;epc:phrase ref='phraseid'&amp;gt;&lt;br /&gt;
   &amp;lt;epc:param name='somepin'&amp;gt;Content&amp;lt;/epc:param&amp;gt;&lt;br /&gt;
 &amp;lt;/epc:phrase&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Outputs the content of the phrase refered to by 'ref'. Any necessary parameters may be set using the &amp;lt;epc:param&amp;gt; tag, with the contents inserted into the pin with the name corresponding to the name attribute.&lt;br /&gt;
&lt;br /&gt;
== Conditional Tags ==&lt;br /&gt;
&lt;br /&gt;
=== epc:if ===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;epc:if test='expr'&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;/epc:if&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Outputs any XHTML content and evaluates any EPrints Control structures within the epc:if block if the expression in the test attribute is true.&lt;br /&gt;
&lt;br /&gt;
=== epc:choose, epc:when, epc:otherwise ===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;epc:choose&amp;gt;&lt;br /&gt;
   &amp;lt;epc:when test='expr'&amp;gt; &lt;br /&gt;
   ...&lt;br /&gt;
   &amp;lt;/epc:when&amp;gt;&lt;br /&gt;
   &amp;lt;epc:when test='expr2'&amp;gt; &lt;br /&gt;
   ...&lt;br /&gt;
   &amp;lt;/epc:when&amp;gt;&lt;br /&gt;
   &amp;lt;epc:otherwise&amp;gt;&lt;br /&gt;
   ...&lt;br /&gt;
   &amp;lt;/epc:otherwise&amp;gt;&lt;br /&gt;
 &amp;lt;/epc:choose&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
epc:choose allows for the construction of a complex conditional. Each epc:when block's 'test' attribute is evaluated, and the content of the block is returned if the result is true. If no expressions return true, the optional epc:otherwise block is returned. Note that no subsequent epc:when blocks are evaluated once the first block to return true is reached.&lt;br /&gt;
&lt;br /&gt;
=== epc:comment ===&lt;br /&gt;
XML comments are not removed from the output when they are encountered in a citation or other EPScript.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;epc:if test=&amp;quot;blah&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;!-- only print blah if it exists --&amp;gt;&lt;br /&gt;
  &amp;lt;epc:print expr=&amp;quot;blah&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/epc:if&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will result in the comment appearing in the html source:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!-- only print blah if it exists --&amp;gt;&lt;br /&gt;
This is Blah&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Using an epc:comment block allows you to include comments that aren't rendered in the output:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;epc:if test=&amp;quot;blah&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;epc:comment&amp;gt; only print blah if it exists &amp;lt;/epc:comment&amp;gt;&lt;br /&gt;
  &amp;lt;epc:print expr=&amp;quot;blah&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/epc:if&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Loops ==&lt;br /&gt;
&lt;br /&gt;
Multiple values can be iterated over. For example.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;epc:foreach expr=&amp;quot;creators_name&amp;quot; iterator=&amp;quot;name&amp;quot;&amp;gt;&lt;br /&gt;
    ( &amp;lt;epc:print expr=&amp;quot;$name&amp;quot; /&amp;gt; )&lt;br /&gt;
  &amp;lt;/epc:foreach&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
=== $index (3.2.0+) ===&lt;br /&gt;
&lt;br /&gt;
Within a foreach block you can use $index to find what iteration of the loop is on. The first value is zero.&lt;br /&gt;
&lt;br /&gt;
This can be used with the modulus &amp;quot;%&amp;quot; to add a strip effect, if wanted, eg.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
  &amp;lt;epc:foreach expr=&amp;quot;creators_name&amp;quot; iterator=&amp;quot;name&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;epc:if test=&amp;quot;$index % 2&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;tr class='odd'&amp;gt;&amp;lt;td&amp;gt;&amp;lt;epc:print expr=&amp;quot;$name&amp;quot; /&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;/epc:if&amp;gt;&lt;br /&gt;
    &amp;lt;epc:if test=&amp;quot;!($index % 2)&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;tr class='even'&amp;gt;&amp;lt;td&amp;gt;&amp;lt;epc:print expr=&amp;quot;$name&amp;quot; /&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
    &amp;lt;/epc:if&amp;gt;&lt;br /&gt;
  &amp;lt;/epc:foreach&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== limit (3.2.0+) ===&lt;br /&gt;
&lt;br /&gt;
You can set a limit of how many iterations to process using a &amp;quot;limit&amp;quot; attribute on the epc:foreach element. For example, &lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;epc:foreach expr=&amp;quot;creators_name&amp;quot; iterator=&amp;quot;name&amp;quot; limit=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
== epc:debug (3.2.0+) ==&lt;br /&gt;
&lt;br /&gt;
The epc:debug element has identical syntax to epc:print, but the result is sent to the error log -- either the command line, or to the apache error log.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;epc:debug expr='expression' opt='key=value;key2=value2'/&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== epc:set (3.2.0+) ==&lt;br /&gt;
&lt;br /&gt;
This allows a variable to be set for any print or if elements within the epc:set. This is useful if creating the value has a notable cost which you wish to minimise. &lt;br /&gt;
&lt;br /&gt;
$item.documents() requires some database access, and the results are not cached, so using this speeds things up.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;epc:set name='docs' expr='$item.documents()'&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Libjlrs@leeds.ac.uk</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=EPScript&amp;diff=10644</id>
		<title>EPScript</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=EPScript&amp;diff=10644"/>
		<updated>2012-10-04T10:24:58Z</updated>

		<summary type="html">&lt;p&gt;Libjlrs@leeds.ac.uk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{formats}}&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' There are many functions not documented on this page. Look in  ~/perl_lib/EPrints/Script/Compiled.pm for other functions.&lt;br /&gt;
&lt;br /&gt;
This is an introduction.&lt;br /&gt;
&lt;br /&gt;
= Language Synopsis =&lt;br /&gt;
&lt;br /&gt;
$var{xxx} - get the value of 'xxx' in $var&lt;br /&gt;
&lt;br /&gt;
$var{xxx}{yyy} - get the value of 'yyy' in 'xxx' in $var&lt;br /&gt;
&lt;br /&gt;
$var.xxx(yyy) - call method 'xxx' on $var with argument 'yyy'&lt;br /&gt;
&lt;br /&gt;
xxx(yyy) - call method 'xxx' with argument 'yyy'&lt;br /&gt;
&lt;br /&gt;
xxx - get the value of field 'xxx'&lt;br /&gt;
&lt;br /&gt;
xxx OP yyy - test whether 'xxx' is OP 'yyy' (=, !=, etc.)&lt;br /&gt;
&lt;br /&gt;
xxx LOGIC yyy - test whether 'xxx' LOGIC 'yyy' (and, or, not etc.)&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
$config{oai}{v2}{archive_id} - gets the current OAI repository identifier&lt;br /&gt;
&lt;br /&gt;
$current_user{department}.is_set() - returns true if the user's department field is set&lt;br /&gt;
&lt;br /&gt;
published.one_of('submitted','published') - returns true if published is 'unpub' or 'published'&lt;br /&gt;
&lt;br /&gt;
$item{type} = 'patent' - returns true if type from item is 'patent'&lt;br /&gt;
&lt;br /&gt;
join($item{userid}.as_item(){collection},',') - useful for extracting data in 'multiple' fields. For the owner of the eprint, return all 'collection's as a comma-separated string. See [[How to control eprint workflow based on a user field]]&lt;br /&gt;
&lt;br /&gt;
= Global Variables = &lt;br /&gt;
&lt;br /&gt;
$config{xxx} - a value from the configuration.&lt;br /&gt;
&lt;br /&gt;
$current_user - the current user, e.g., $current_user{username}&lt;br /&gt;
&lt;br /&gt;
$current_lang - the id of the current language (such as 'en')&lt;br /&gt;
&lt;br /&gt;
$item - the current item (usually an eprint, but not always, e.g., in citations or workflows for user objects), e.g., $item{eprintid}. If you just use '''eprintid''' it is a shortcut for '''$item{eprintid}'''&lt;br /&gt;
&lt;br /&gt;
= Data Types =&lt;br /&gt;
&lt;br /&gt;
EPScript allows for two primitive data types (string and integer) as well as providing the means to access properties of data objects such as EPrints or Users. &lt;br /&gt;
&lt;br /&gt;
== Primitive Types ==&lt;br /&gt;
&lt;br /&gt;
=== Strings and characters === &lt;br /&gt;
&lt;br /&gt;
These are contained within either double quotes (&amp;quot;&amp;quot;) or single quotes (&amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;). There is no difference between the two, but it may be easier to use one sort when inside an XML attribute. For example:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;when test=&amp;quot;type = 'patent'&amp;quot;&amp;gt;&lt;br /&gt;
 ...  &lt;br /&gt;
 &amp;lt;/when&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Integers ===&lt;br /&gt;
&lt;br /&gt;
Integers are defined as a string of numbers from 0-9, e.g. 300. Leading zeros do not have any effect, and decimal values are currently not supported. &lt;br /&gt;
&lt;br /&gt;
=== Booleans ===&lt;br /&gt;
&lt;br /&gt;
True or false values. Returned by = gt and lt and oneof and used in &amp;lt;if&amp;gt; etc.&lt;br /&gt;
&lt;br /&gt;
== Data Objects ==&lt;br /&gt;
&lt;br /&gt;
Data Objects include most of the key EPrints objects - whether an EPrint itself, documents related to the EPrint, or a user. EPScript treats all of these data objects the same, with a simple approach to retrieve properties. When an EPScript is executed, an 'item' object is supplied. In the case of a citation file, this will be the item for which the citation is being created. For a workflow, this will be the object on which the workflow acts (e.g. an EPrint or a user). Properties of main objects can be accessed using a shortened approach - the following example is from a user workflow, so the usertype property is available:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;if test=&amp;quot;usertype = 'editor'&amp;quot;&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;/if&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are cases, however, where two or more data objects may be provided - such as an EPrint and a user. Here the main item can still be accessed in the short form, but other objects use a dollar notation. In this example, the EPrint is available as $eprint:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;if test=&amp;quot;$eprint{ispublished}.one_of('unpub', 'submitted', 'inpress')&amp;quot;&amp;gt; (&amp;lt;print expr=&amp;quot;$eprint{ispublished}&amp;quot; /&amp;gt;)&amp;lt;/if&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Field Values ==&lt;br /&gt;
&lt;br /&gt;
Values associated with a data object field. The field which the value belongs to can effect how it is rendered, and compared to other values.&lt;br /&gt;
&lt;br /&gt;
== Hash ==&lt;br /&gt;
&lt;br /&gt;
This currently only used by the $config parameter to give access to configuration options. Get values out of it the same way you get values from a dataobejct, eg. $config{'base_url'}&lt;br /&gt;
&lt;br /&gt;
== XHTML ==&lt;br /&gt;
&lt;br /&gt;
The citation method returns a pre-rendered value. You can't do anything with XHTML other than print it.&lt;br /&gt;
&lt;br /&gt;
= Operators =&lt;br /&gt;
&lt;br /&gt;
==Logical Operators==&lt;br /&gt;
&lt;br /&gt;
===and===&lt;br /&gt;
&lt;br /&gt;
Returns true if both the left-hand and the right-hand expressions return true. &lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;if test=&amp;quot;type = 'book' and is_set( creators )&amp;quot;&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;/if&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===or===&lt;br /&gt;
Returns true if at least one of the expressions returns true.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;if test=&amp;quot;type = 'book' or type = 'patent'&amp;quot;&amp;gt; &lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;/if&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===not===&lt;br /&gt;
Returns true if the expression is false and false if the expression is true.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;if test=&amp;quot;!is_set( creators )&amp;quot;&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;/if&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Comparison Operators==&lt;br /&gt;
&lt;br /&gt;
===lt===&lt;br /&gt;
&lt;br /&gt;
Returns true if the left-hand expression is less than the right-hand expression. This is only applicable to expressions that return numeric values.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;if test=&amp;quot;length(editors) lt 6&amp;quot;&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;/if&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===gt===&lt;br /&gt;
&lt;br /&gt;
Returns true if the left-hand expression is greater than the right-hand expression. This is only applicable to expressions that return numeric values.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;if test=&amp;quot;length(editors) gt 1&amp;quot;&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;/if&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===equals===&lt;br /&gt;
&lt;br /&gt;
Returns true if the left-hand expression is equal to the right-hand expression. This applies to numeric, boolean, and string values. &lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;if test=&amp;quot;type = 'patent'&amp;quot;&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;/if&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
If the left OR the right value is a FIELDVALUE of a multiple field, then it returns true if the other value matches any of the values on the other side. eg. &amp;quot;subjects = 'group_foo'&amp;quot; will be true if any of the subjects are &amp;quot;group_foo&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===not equals===&lt;br /&gt;
&lt;br /&gt;
The inverse of the equals operator, this returns true if the expressions are not equal.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;if test=&amp;quot;type != 'book'&amp;quot;&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;/if&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Functions =&lt;br /&gt;
&lt;br /&gt;
== Calling Functions ==&lt;br /&gt;
&lt;br /&gt;
Functions can be called in two ways:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;when test=&amp;quot;is_set( creators )&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;print expr=&amp;quot;citation( eprint,title )&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
or&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;when test=&amp;quot;creators.is_set()&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;print expr=&amp;quot;eprint.citation( title )&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
These are interchangable, but it may be beneficial to use a specific form in some cases.&lt;br /&gt;
&lt;br /&gt;
== Function List ==&lt;br /&gt;
&lt;br /&gt;
=== is_set ===&lt;br /&gt;
&lt;br /&gt;
Returns true if the parameter is set, based on the following criteria:&lt;br /&gt;
* If the parameter is a string, it is set if it is not empty.&lt;br /&gt;
* If the parameter is a list or a complex structure, it is set if at least one value is set.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;when test=&amp;quot;is_set( creators )&amp;quot;&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;/when&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
parameters: is_set(ANYTHING) &lt;br /&gt;
&lt;br /&gt;
returns: BOOLEAN&lt;br /&gt;
&lt;br /&gt;
=== length ===&lt;br /&gt;
&lt;br /&gt;
Returns the number of items in the list.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;if test=&amp;quot;length(editors) gt 1&amp;quot;&amp;gt;s&amp;lt;/if&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
parameters: length(ANYTHING) .. although only Field Values make much sense&lt;br /&gt;
&lt;br /&gt;
returns: INTEGER&lt;br /&gt;
&lt;br /&gt;
=== one_of ===&lt;br /&gt;
&lt;br /&gt;
Returns true if the string is in the list of strings provided.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;when test=&amp;quot;type.one_of( 'book','book_section' )&amp;quot;&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;/when&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Can in theory use any type of value. Will use the &amp;quot;=&amp;quot; method to compare them.&lt;br /&gt;
&lt;br /&gt;
parameters: ANYTHING.one_of( LIST )&lt;br /&gt;
&lt;br /&gt;
returns: BOOLEAN&lt;br /&gt;
&lt;br /&gt;
=== reverse ===&lt;br /&gt;
&lt;br /&gt;
Returns the reverse of a string (i.e. 'abc' becomes 'cba').&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;when test=&amp;quot;type.reverse = 'tnetap'&amp;quot;&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;/when&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This function was largely used for debugging, it's not very useful...&lt;br /&gt;
&lt;br /&gt;
parameters: reverse(STRING)&lt;br /&gt;
&lt;br /&gt;
returns: STRING&lt;br /&gt;
&lt;br /&gt;
=== yesno ===&lt;br /&gt;
&lt;br /&gt;
Returns a string &amp;quot;yes&amp;quot; or &amp;quot;no&amp;quot; depending on the value of the boolean passed to it.&lt;br /&gt;
&lt;br /&gt;
parameters: yesno(BOOLEAN)&lt;br /&gt;
&lt;br /&gt;
returns: STRING&lt;br /&gt;
&lt;br /&gt;
=== citation ===&lt;br /&gt;
&lt;br /&gt;
Can only be called on a dataobject. eg. $item or $current_user. It returns the object rendered using the specified citation style.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;epc:print expr=&amp;quot;$item.citation('default')&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The results of citation are only really useful for rendering, not testing.&lt;br /&gt;
&lt;br /&gt;
parameters: DATAOBJ.citation(STRING)&lt;br /&gt;
&lt;br /&gt;
returns: XHTML data&lt;br /&gt;
&lt;br /&gt;
=== as_item ===&lt;br /&gt;
&lt;br /&gt;
A very useful little method. This can only be called on a field value of a field of type &amp;quot;itemref&amp;quot;. It returns the item itself.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;epc:print expr=&amp;quot;$item{userid}.as_item(){username}&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
parameters: FIELDVALUE.as_item()&lt;br /&gt;
&lt;br /&gt;
returns: DATAOBJECT&lt;br /&gt;
&lt;br /&gt;
= Examples =&lt;br /&gt;
&lt;br /&gt;
== Pluralising the editors of a book ==&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;if test=&amp;quot;type = 'book' and is_set(editors)&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;print expr=&amp;quot;editors&amp;quot; /&amp;gt;, (ed&amp;lt;if test=&amp;quot;length(editors) gt 1&amp;quot;&amp;gt;s&amp;lt;/if&amp;gt;&lt;br /&gt;
 &amp;lt;/if&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
== Rendering the URL of an EPrint ==&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;print expr=&amp;quot;$config{base_url}&amp;quot; /&amp;gt;/&amp;lt;print expr=&amp;quot;eprintid&amp;quot; /&amp;gt;/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Libjlrs@leeds.ac.uk</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=How_to_control_eprint_workflow_based_on_a_user_field&amp;diff=10643</id>
		<title>How to control eprint workflow based on a user field</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=How_to_control_eprint_workflow_based_on_a_user_field&amp;diff=10643"/>
		<updated>2012-10-04T10:17:06Z</updated>

		<summary type="html">&lt;p&gt;Libjlrs@leeds.ac.uk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;NOTE: This has been written based on my experience of an EPrints 3.3.10 install.&lt;br /&gt;
&lt;br /&gt;
== What I was trying to achieve ==&lt;br /&gt;
We have many 'collections'. Each EPrint belongs to one collection.&lt;br /&gt;
&lt;br /&gt;
Users can only deposit items into specific collections.&lt;br /&gt;
&lt;br /&gt;
How do I control the EPrint workflow to only show the collections that a user can deposit into?&lt;br /&gt;
&lt;br /&gt;
== How I did it ==&lt;br /&gt;
=== Configuration of metafields ===&lt;br /&gt;
*Create a namedset with the collections in it:&lt;br /&gt;
~/archives/ARCHIVEID/cfg/namedsets/collections&lt;br /&gt;
&amp;lt;source lang=&amp;quot;perl&amp;quot;&amp;gt;&lt;br /&gt;
# A list of collections - remember to add the relevant phrases!&lt;br /&gt;
library&lt;br /&gt;
art_gallery&lt;br /&gt;
lab_equipment&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Add the metafield to both the eprint and the user. This can be done in a few different ways, this is one:&lt;br /&gt;
Edit ~/archives/ARCHIVEID/cfg/cfg.d/eprint_fields.pl, adding:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;perl&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
        name =&amp;gt; 'collection',&lt;br /&gt;
        type =&amp;gt; 'namedset',&lt;br /&gt;
        set_name =&amp;gt; &amp;quot;collections&amp;quot;,&lt;br /&gt;
},&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit ~/archives/ARCHIVEID/cfg/cfg.d/user_fields.pl, adding:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;perl&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
        name =&amp;gt; 'collection',&lt;br /&gt;
        type =&amp;gt; 'namedset',&lt;br /&gt;
        set_name =&amp;gt; &amp;quot;collections&amp;quot;,&lt;br /&gt;
        multiple =&amp;gt; 1, #Allows a user to have rights to more than one collection&lt;br /&gt;
},&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add to user workflow ===&lt;br /&gt;
Edit ~/archives/ARCHIVEID/cfg/workflows/user/default.xml. We only want admin staff to be able to assign collections, so the field is added to the 'usertype' stage:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;stage name=&amp;quot;usertype&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;component&amp;gt;&amp;lt;field ref=&amp;quot;usertype&amp;quot;/&amp;gt;&amp;lt;/component&amp;gt;&lt;br /&gt;
      &amp;lt;component&amp;gt;&amp;lt;field ref=&amp;quot;username&amp;quot;/&amp;gt;&amp;lt;/component&amp;gt;&lt;br /&gt;
      &amp;lt;component&amp;gt;&amp;lt;field ref=&amp;quot;collection&amp;quot;/&amp;gt;&amp;lt;/component&amp;gt;&lt;br /&gt;
      &amp;lt;component&amp;gt;&amp;lt;field ref=&amp;quot;roles&amp;quot;/&amp;gt;&amp;lt;/component&amp;gt;&lt;br /&gt;
  &amp;lt;/stage&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
This allows one or more collections to be assigned to a user.&lt;br /&gt;
&lt;br /&gt;
=== Add to EPrint workflow ===&lt;br /&gt;
To render '''only''' the collections that have been assigned to a user, we need to get the 'collection's from the owning user, join them into a comma-separated string and use that as the 'options' for the eprint collection field.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;component&amp;gt;&amp;lt;field ref=&amp;quot;collection&amp;quot; options=&amp;quot;{join($item{userid}.as_item(){collection},',')}&amp;quot;/&amp;gt;&amp;lt;/component&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
We could also have used $current_user - which would be OK if the $current_user will have rights to more collections than the owning user.&lt;br /&gt;
&lt;br /&gt;
=== Update database and restart webserver ===&lt;br /&gt;
Update the database how you normally do it (web interface or commandline) and reload the server config.&lt;br /&gt;
Test it works :o)&lt;br /&gt;
&lt;br /&gt;
=== Adding a default ===&lt;br /&gt;
If a user has no collections assigned in their profile, what should happen?&lt;br /&gt;
We could either:&lt;br /&gt;
*always set a default collection in user_fields_default.pl&lt;br /&gt;
*use eprint_fields_default.pl to set a default collection for the eprint.&lt;br /&gt;
If a user only has access to one collection, the value should be set automatically and the field not shown in the workflow.&lt;br /&gt;
&lt;br /&gt;
[[Category:Howto]][[Category:Snippets]][[Category:Metadata Fields]][[Category:Contribute]]&lt;/div&gt;</summary>
		<author><name>Libjlrs@leeds.ac.uk</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=How_to_control_eprint_workflow_based_on_a_user_field&amp;diff=10642</id>
		<title>How to control eprint workflow based on a user field</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=How_to_control_eprint_workflow_based_on_a_user_field&amp;diff=10642"/>
		<updated>2012-10-04T10:16:07Z</updated>

		<summary type="html">&lt;p&gt;Libjlrs@leeds.ac.uk: Created page with 'NOTE: This has been written based on my experience of an EPrints 3.3.10 install.  == What I was trying to achieve == We have many 'collections'. Each EPrint belongs to one collec…'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;NOTE: This has been written based on my experience of an EPrints 3.3.10 install.&lt;br /&gt;
&lt;br /&gt;
== What I was trying to achieve ==&lt;br /&gt;
We have many 'collections'. Each EPrint belongs to one collection.&lt;br /&gt;
Users can only deposit items into specific collections.&lt;br /&gt;
How do I control the EPrint workflow to only show the collections that a user can deposit into?&lt;br /&gt;
&lt;br /&gt;
== How I did it ==&lt;br /&gt;
=== Configuration of metafields ===&lt;br /&gt;
#Create a namedset with the collections in it:&lt;br /&gt;
~/archives/ARCHIVEID/cfg/namedsets/collections&lt;br /&gt;
&amp;lt;source lang=&amp;quot;perl&amp;quot;&amp;gt;&lt;br /&gt;
# A list of collections - remember to add the relevant phrases!&lt;br /&gt;
library&lt;br /&gt;
art_gallery&lt;br /&gt;
lab_equipment&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#Add the metafield to both the eprint and the user. This can be done in a few different ways, this is one:&lt;br /&gt;
Edit ~/archives/ARCHIVEID/cfg/cfg.d/eprint_fields.pl, adding:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;perl&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
        name =&amp;gt; 'collection',&lt;br /&gt;
        type =&amp;gt; 'namedset',&lt;br /&gt;
        set_name =&amp;gt; &amp;quot;collections&amp;quot;,&lt;br /&gt;
},&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit ~/archives/ARCHIVEID/cfg/cfg.d/user_fields.pl, adding:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;perl&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
        name =&amp;gt; 'collection',&lt;br /&gt;
        type =&amp;gt; 'namedset',&lt;br /&gt;
        set_name =&amp;gt; &amp;quot;collections&amp;quot;,&lt;br /&gt;
        multiple =&amp;gt; 1, #Allows a user to have rights to more than one collection&lt;br /&gt;
},&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add to user workflow ===&lt;br /&gt;
Edit ~/archives/ARCHIVEID/cfg/workflows/user/default.xml. We only want admin staff to be able to assign collections, so the field is added to the 'usertype' stage:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;stage name=&amp;quot;usertype&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;component&amp;gt;&amp;lt;field ref=&amp;quot;usertype&amp;quot;/&amp;gt;&amp;lt;/component&amp;gt;&lt;br /&gt;
      &amp;lt;component&amp;gt;&amp;lt;field ref=&amp;quot;username&amp;quot;/&amp;gt;&amp;lt;/component&amp;gt;&lt;br /&gt;
      &amp;lt;component&amp;gt;&amp;lt;field ref=&amp;quot;collection&amp;quot;/&amp;gt;&amp;lt;/component&amp;gt;&lt;br /&gt;
      &amp;lt;component&amp;gt;&amp;lt;field ref=&amp;quot;roles&amp;quot;/&amp;gt;&amp;lt;/component&amp;gt;&lt;br /&gt;
  &amp;lt;/stage&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
This allows one or more collections to be assigned to a user.&lt;br /&gt;
&lt;br /&gt;
=== Add to EPrint workflow ===&lt;br /&gt;
To render '''only''' the collections that have been assigned to a user, we need to get the 'collection's from the owning user, join them into a comma-separated string and use that as the 'options' for the eprint collection field.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;component&amp;gt;&amp;lt;field ref=&amp;quot;collection&amp;quot; options=&amp;quot;{join($item{userid}.as_item(){collection},',')}&amp;quot;/&amp;gt;&amp;lt;/component&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
We could also have used $current_user - which would be OK if the $current_user will have rights to more collections than the owning user.&lt;br /&gt;
&lt;br /&gt;
=== Update database and restart webserver ===&lt;br /&gt;
Update the database how you normally do it (web interface or commandline) and reload the server config.&lt;br /&gt;
Test it works :o)&lt;br /&gt;
&lt;br /&gt;
=== Adding a default ===&lt;br /&gt;
If a user has no collections assigned in their profile, what should happen?&lt;br /&gt;
We could either:&lt;br /&gt;
*always set a default collection in user_fields_default.pl&lt;br /&gt;
*use eprint_fields_default.pl to set a default collection for the eprint.&lt;br /&gt;
If a user only has access to one collection, the value should be set automatically and the field not shown in the workflow.&lt;br /&gt;
&lt;br /&gt;
[[Category:Howto]][[Category:Snippets]][[Category:Metadata Fields]][[Category:Contribute]]&lt;/div&gt;</summary>
		<author><name>Libjlrs@leeds.ac.uk</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=EPScript&amp;diff=10641</id>
		<title>EPScript</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=EPScript&amp;diff=10641"/>
		<updated>2012-10-04T09:33:05Z</updated>

		<summary type="html">&lt;p&gt;Libjlrs@leeds.ac.uk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{formats}}&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' There are many functions not documented on this page. Look in  ~/perl_lib/EPrints/Script/Compiled.pm for other functions.&lt;br /&gt;
&lt;br /&gt;
This is an introduction.&lt;br /&gt;
&lt;br /&gt;
= Language Synopsis =&lt;br /&gt;
&lt;br /&gt;
$var{xxx} - get the value of 'xxx' in $var&lt;br /&gt;
&lt;br /&gt;
$var{xxx}{yyy} - get the value of 'yyy' in 'xxx' in $var&lt;br /&gt;
&lt;br /&gt;
$var.xxx(yyy) - call method 'xxx' on $var with argument 'yyy'&lt;br /&gt;
&lt;br /&gt;
xxx(yyy) - call method 'xxx' with argument 'yyy'&lt;br /&gt;
&lt;br /&gt;
xxx - get the value of field 'xxx'&lt;br /&gt;
&lt;br /&gt;
xxx OP yyy - test whether 'xxx' is OP 'yyy' (=, !=, etc.)&lt;br /&gt;
&lt;br /&gt;
xxx LOGIC yyy - test whether 'xxx' LOGIC 'yyy' (and, or, not etc.)&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
$config{oai}{v2}{archive_id} - gets the current OAI repository identifier&lt;br /&gt;
&lt;br /&gt;
$current_user{department}.is_set() - returns true if the user's department field is set&lt;br /&gt;
&lt;br /&gt;
published.one_of('submitted','published') - returns true if published is 'unpub' or 'published'&lt;br /&gt;
&lt;br /&gt;
$item{type} = 'patent' - returns true if type from item is 'patent'&lt;br /&gt;
&lt;br /&gt;
join($item{userid}.as_item(){collection},',') - useful for extracting data in 'multiple' fields. For the owner of the eprint, return all 'collection's as a comma-separated string.&lt;br /&gt;
&lt;br /&gt;
= Global Variables = &lt;br /&gt;
&lt;br /&gt;
$config{xxx} - a value from the configuration.&lt;br /&gt;
&lt;br /&gt;
$current_user - the current user, e.g., $current_user{username}&lt;br /&gt;
&lt;br /&gt;
$current_lang - the id of the current language (such as 'en')&lt;br /&gt;
&lt;br /&gt;
$item - the current item (usually an eprint, but not always, e.g., in citations or workflows for user objects), e.g., $item{eprintid}. If you just use '''eprintid''' it is a shortcut for '''$item{eprintid}'''&lt;br /&gt;
&lt;br /&gt;
= Data Types =&lt;br /&gt;
&lt;br /&gt;
EPScript allows for two primitive data types (string and integer) as well as providing the means to access properties of data objects such as EPrints or Users. &lt;br /&gt;
&lt;br /&gt;
== Primitive Types ==&lt;br /&gt;
&lt;br /&gt;
=== Strings and characters === &lt;br /&gt;
&lt;br /&gt;
These are contained within either double quotes (&amp;quot;&amp;quot;) or single quotes (&amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;). There is no difference between the two, but it may be easier to use one sort when inside an XML attribute. For example:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;when test=&amp;quot;type = 'patent'&amp;quot;&amp;gt;&lt;br /&gt;
 ...  &lt;br /&gt;
 &amp;lt;/when&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Integers ===&lt;br /&gt;
&lt;br /&gt;
Integers are defined as a string of numbers from 0-9, e.g. 300. Leading zeros do not have any effect, and decimal values are currently not supported. &lt;br /&gt;
&lt;br /&gt;
=== Booleans ===&lt;br /&gt;
&lt;br /&gt;
True or false values. Returned by = gt and lt and oneof and used in &amp;lt;if&amp;gt; etc.&lt;br /&gt;
&lt;br /&gt;
== Data Objects ==&lt;br /&gt;
&lt;br /&gt;
Data Objects include most of the key EPrints objects - whether an EPrint itself, documents related to the EPrint, or a user. EPScript treats all of these data objects the same, with a simple approach to retrieve properties. When an EPScript is executed, an 'item' object is supplied. In the case of a citation file, this will be the item for which the citation is being created. For a workflow, this will be the object on which the workflow acts (e.g. an EPrint or a user). Properties of main objects can be accessed using a shortened approach - the following example is from a user workflow, so the usertype property is available:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;if test=&amp;quot;usertype = 'editor'&amp;quot;&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;/if&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are cases, however, where two or more data objects may be provided - such as an EPrint and a user. Here the main item can still be accessed in the short form, but other objects use a dollar notation. In this example, the EPrint is available as $eprint:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;if test=&amp;quot;$eprint{ispublished}.one_of('unpub', 'submitted', 'inpress')&amp;quot;&amp;gt; (&amp;lt;print expr=&amp;quot;$eprint{ispublished}&amp;quot; /&amp;gt;)&amp;lt;/if&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Field Values ==&lt;br /&gt;
&lt;br /&gt;
Values associated with a data object field. The field which the value belongs to can effect how it is rendered, and compared to other values.&lt;br /&gt;
&lt;br /&gt;
== Hash ==&lt;br /&gt;
&lt;br /&gt;
This currently only used by the $config parameter to give access to configuration options. Get values out of it the same way you get values from a dataobejct, eg. $config{'base_url'}&lt;br /&gt;
&lt;br /&gt;
== XHTML ==&lt;br /&gt;
&lt;br /&gt;
The citation method returns a pre-rendered value. You can't do anything with XHTML other than print it.&lt;br /&gt;
&lt;br /&gt;
= Operators =&lt;br /&gt;
&lt;br /&gt;
==Logical Operators==&lt;br /&gt;
&lt;br /&gt;
===and===&lt;br /&gt;
&lt;br /&gt;
Returns true if both the left-hand and the right-hand expressions return true. &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;if test=&amp;quot;type = 'book' and is_set( creators )&amp;quot;&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;/if&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===or===&lt;br /&gt;
Returns true if at least one of the expressions returns true.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;if test=&amp;quot;type = 'book' or type = 'patent'&amp;quot;&amp;gt; &lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;/if&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===not===&lt;br /&gt;
Returns true if the expression is false and false if the expression is true.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;if test=&amp;quot;!is_set( creators )&amp;quot;&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;/if&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Comparison Operators==&lt;br /&gt;
&lt;br /&gt;
===lt===&lt;br /&gt;
&lt;br /&gt;
Returns true if the left-hand expression is less than the right-hand expression. This is only applicable to expressions that return numeric values.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;if test=&amp;quot;length(editors) lt 6&amp;quot;&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;/if&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===gt===&lt;br /&gt;
&lt;br /&gt;
Returns true if the left-hand expression is greater than the right-hand expression. This is only applicable to expressions that return numeric values.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;if test=&amp;quot;length(editors) gt 1&amp;quot;&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;/if&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===equals===&lt;br /&gt;
&lt;br /&gt;
Returns true if the left-hand expression is equal to the right-hand expression. This applies to numeric, boolean, and string values. &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;if test=&amp;quot;type = 'patent'&amp;quot;&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;/if&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the left OR the right value is a FIELDVALUE of a multiple field, then it returns true if the other value matches any of the values on the other side. eg. &amp;quot;subjects = 'group_foo'&amp;quot; will be true if any of the subjects are &amp;quot;group_foo&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===not equals===&lt;br /&gt;
&lt;br /&gt;
The inverse of the equals operator, this returns true if the expressions are not equal.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;if test=&amp;quot;type != 'book'&amp;quot;&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;/if&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Functions =&lt;br /&gt;
&lt;br /&gt;
== Calling Functions ==&lt;br /&gt;
&lt;br /&gt;
Functions can be called in two ways:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;when test=&amp;quot;is_set( creators )&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;print expr=&amp;quot;citation( eprint,title )&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;when test=&amp;quot;creators.is_set()&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;print expr=&amp;quot;eprint.citation( title )&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are interchangable, but it may be beneficial to use a specific form in some cases.&lt;br /&gt;
&lt;br /&gt;
== Function List ==&lt;br /&gt;
&lt;br /&gt;
=== is_set ===&lt;br /&gt;
&lt;br /&gt;
Returns true if the parameter is set, based on the following criteria:&lt;br /&gt;
* If the parameter is a string, it is set if it is not empty.&lt;br /&gt;
* If the parameter is a list or a complex structure, it is set if at least one value is set.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;when test=&amp;quot;is_set( creators )&amp;quot;&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;/when&amp;gt;&lt;br /&gt;
&lt;br /&gt;
parameters: is_set(ANYTHING) &lt;br /&gt;
&lt;br /&gt;
returns: BOOLEAN&lt;br /&gt;
&lt;br /&gt;
=== length ===&lt;br /&gt;
&lt;br /&gt;
Returns the number of items in the list.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;if test=&amp;quot;length(editors) gt 1&amp;quot;&amp;gt;s&amp;lt;/if&amp;gt;&lt;br /&gt;
&lt;br /&gt;
parameters: length(ANYTHING) .. although only Field Values make much sense&lt;br /&gt;
&lt;br /&gt;
returns: INTEGER&lt;br /&gt;
&lt;br /&gt;
=== one_of ===&lt;br /&gt;
&lt;br /&gt;
Returns true if the string is in the list of strings provided.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;when test=&amp;quot;type.one_of( 'book','book_section' )&amp;quot;&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;/when&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Can in theory use any type of value. Will use the &amp;quot;=&amp;quot; method to compare them.&lt;br /&gt;
&lt;br /&gt;
parameters: ANYTHING.one_of( LIST )&lt;br /&gt;
&lt;br /&gt;
returns: BOOLEAN&lt;br /&gt;
&lt;br /&gt;
=== reverse ===&lt;br /&gt;
&lt;br /&gt;
Returns the reverse of a string (i.e. 'abc' becomes 'cba').&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;when test=&amp;quot;type.reverse = 'tnetap'&amp;quot;&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;/when&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function was largely used for debugging, it's not very useful...&lt;br /&gt;
&lt;br /&gt;
parameters: reverse(STRING)&lt;br /&gt;
&lt;br /&gt;
returns: STRING&lt;br /&gt;
&lt;br /&gt;
=== yesno ===&lt;br /&gt;
&lt;br /&gt;
Returns a string &amp;quot;yes&amp;quot; or &amp;quot;no&amp;quot; depending on the value of the boolean passed to it.&lt;br /&gt;
&lt;br /&gt;
parameters: yesno(BOOLEAN)&lt;br /&gt;
&lt;br /&gt;
returns: STRING&lt;br /&gt;
&lt;br /&gt;
=== citation ===&lt;br /&gt;
&lt;br /&gt;
Can only be called on a dataobject. eg. $item or $current_user. It returns the object rendered using the specified citation style.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;epc:print expr=&amp;quot;$item.citation('default')&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The results of citation are only really useful for rendering, not testing.&lt;br /&gt;
&lt;br /&gt;
parameters: DATAOBJ.citation(STRING)&lt;br /&gt;
&lt;br /&gt;
returns: XHTML data&lt;br /&gt;
&lt;br /&gt;
=== as_item ===&lt;br /&gt;
&lt;br /&gt;
A very useful little method. This can only be called on a field value of a field of type &amp;quot;itemref&amp;quot;. It returns the item itself.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;epc:print expr=&amp;quot;$item{userid}.as_item(){username}&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
parameters: FIELDVALUE.as_item()&lt;br /&gt;
&lt;br /&gt;
returns: DATAOBJECT&lt;br /&gt;
&lt;br /&gt;
= Examples =&lt;br /&gt;
&lt;br /&gt;
== Pluralising the editors of a book ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;if test=&amp;quot;type = 'book' and is_set(editors)&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;print expr=&amp;quot;editors&amp;quot; /&amp;gt;, (ed&amp;lt;if test=&amp;quot;length(editors) gt 1&amp;quot;&amp;gt;s&amp;lt;/if&amp;gt;&lt;br /&gt;
 &amp;lt;/if&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Rendering the URL of an EPrint ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;print expr=&amp;quot;$config{base_url}&amp;quot; /&amp;gt;/&amp;lt;print expr=&amp;quot;eprintid&amp;quot; /&amp;gt;/&lt;/div&gt;</summary>
		<author><name>Libjlrs@leeds.ac.uk</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=Recaptcha&amp;diff=10640</id>
		<title>Recaptcha</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Recaptcha&amp;diff=10640"/>
		<updated>2012-10-02T14:27:43Z</updated>

		<summary type="html">&lt;p&gt;Libjlrs@leeds.ac.uk: Added categories&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;NOTE: This has been written based on my experience of an EPrints 3.3.10 install.&lt;br /&gt;
&lt;br /&gt;
== Configuring reCAPTCHA for user registration ==&lt;br /&gt;
Recent versions of EPrints (3.2+?) have configuration that allows reCAPTCHA to be used for user registration and/or document requests.&lt;br /&gt;
If your version of EPrints has the file: ~/perl_lib/EPrints/MetaField/Recaptcha.pm, these instructions *should* work...&lt;br /&gt;
&lt;br /&gt;
== What to do ==&lt;br /&gt;
# Register for a reCAPTCHA key at http://www.google.com/recaptcha (Click on the 'Use reCAPTCHA on your site' link).&lt;br /&gt;
# Add reCAPTCHA keys to config&lt;br /&gt;
# Configure a field to use reCAPTCHA&lt;br /&gt;
# Add field to workflow&lt;br /&gt;
&lt;br /&gt;
== Adding the config ==&lt;br /&gt;
Create a file: ~/archives/ARCHIVEID/cfg/cfg.d/recaptcha.pl&lt;br /&gt;
&amp;lt;source lang=&amp;quot;perl&amp;quot;&amp;gt;&lt;br /&gt;
# Used by recaptcha fields. See ~/perl_lib/EPrints/MetaField/Recaptcha.pm&lt;br /&gt;
# Captcha registered by you@your-institution&lt;br /&gt;
$c-&amp;gt;{recaptcha}-&amp;gt;{public_key} = &amp;quot;...&amp;quot;;&lt;br /&gt;
$c-&amp;gt;{recaptcha}-&amp;gt;{private_key} = &amp;quot;...&amp;quot;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Add the keys you got when registering for reCAPTCHA.&lt;br /&gt;
&lt;br /&gt;
''You can create either domain specific keys, or general purpose keys. If you run multiple archives you might want to create general keys and add the config file to ~/lib/cfg.d/ instead.''&lt;br /&gt;
&lt;br /&gt;
== Adding reCAPTCHA to User Registration ==&lt;br /&gt;
First we have to add the reCAPTCHA field to the user config.&lt;br /&gt;
I added the following code to the end of my recaptcha.pl file, but you could also add the field definition directly to the 'user_fields.pl' file.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;perl&amp;quot;&amp;gt;&lt;br /&gt;
#Add field to user dataset&lt;br /&gt;
$c-&amp;gt;add_dataset_field( &amp;quot;user&amp;quot;, {&lt;br /&gt;
        name =&amp;gt; &amp;quot;captcha&amp;quot;,&lt;br /&gt;
        type =&amp;gt; &amp;quot;recaptcha&amp;quot;,&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Now reload the configuration and update the database (through the web interface Admin-&amp;gt;Config. Tools -&amp;gt; Reload Config / Update Database) - or via the command line.&lt;br /&gt;
&lt;br /&gt;
Next, we have to add the field to the user registration workflow. If you haven't edited the registration workflow, look at ~/lib/workflows/user/register.xml. Add the following component after the existing Field::Multi component.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;component surround=&amp;quot;None&amp;quot;&amp;gt;&amp;lt;field ref=&amp;quot;captcha&amp;quot; /&amp;gt;&amp;lt;/component&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
''If you are running multiple archives and some need reCAPTCHA and others don't, copy the register.pl file into ~/archives/ARCHIVEID/workflows/user/ and edit it there.''&lt;br /&gt;
&lt;br /&gt;
Reload the configuration again, and then visit your 'Create Account' page - you should have a nice shiny reCAPTCHA added to the registration!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Adding reCAPTCHA to Document requests==&lt;br /&gt;
This is similar to the above, basically add a field to the request dataset, render it in the workflow (did you know that requests now have a workflow? I didn't!). &lt;br /&gt;
&lt;br /&gt;
Add the following to recaptcha.pl - or another suitable cfg.d/...pl file:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;perl&amp;quot;&amp;gt;&lt;br /&gt;
#Add field to requests&lt;br /&gt;
$c-&amp;gt;add_dataset_field( &amp;quot;request&amp;quot;, {&lt;br /&gt;
        name =&amp;gt; &amp;quot;captcha&amp;quot;,&lt;br /&gt;
        type =&amp;gt; &amp;quot;recaptcha&amp;quot;,&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add the field to the workflow for requests ~/lib/workflows/request/default.xml&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;component surround=&amp;quot;None&amp;quot;&amp;gt;&amp;lt;field ref=&amp;quot;captcha&amp;quot; /&amp;gt;&amp;lt;/component&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Reload config, update database etc. and test it works!&lt;br /&gt;
&lt;br /&gt;
Good work EPrints developers - it took about 10 minutes to get it working (and about 30 minutes to write this page :o)!&lt;br /&gt;
&lt;br /&gt;
[[Category:Howto]][[Category:Snippets]][[Category:Metadata Fields]][[Category:Contribute]]&lt;/div&gt;</summary>
		<author><name>Libjlrs@leeds.ac.uk</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=Recaptcha&amp;diff=10639</id>
		<title>Recaptcha</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Recaptcha&amp;diff=10639"/>
		<updated>2012-10-02T14:16:24Z</updated>

		<summary type="html">&lt;p&gt;Libjlrs@leeds.ac.uk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;NOTE: This has been written based on my experience of an EPrints 3.3.10 install.&lt;br /&gt;
&lt;br /&gt;
== Configuring reCAPTCHA for user registration ==&lt;br /&gt;
Recent versions of EPrints (3.2+?) have configuration that allows reCAPTCHA to be used for user registration and/or document requests.&lt;br /&gt;
If your version of EPrints has the file: ~/perl_lib/EPrints/MetaField/Recaptcha.pm, these instructions *should* work...&lt;br /&gt;
&lt;br /&gt;
== What to do ==&lt;br /&gt;
# Register for a reCAPTCHA key at http://www.google.com/recaptcha (Click on the 'Use reCAPTCHA on your site' link).&lt;br /&gt;
# Add reCAPTCHA keys to config&lt;br /&gt;
# Configure a field to use reCAPTCHA&lt;br /&gt;
# Add field to workflow&lt;br /&gt;
&lt;br /&gt;
== Adding the config ==&lt;br /&gt;
Create a file: ~/archives/ARCHIVEID/cfg/cfg.d/recaptcha.pl&lt;br /&gt;
&amp;lt;source lang=&amp;quot;perl&amp;quot;&amp;gt;&lt;br /&gt;
# Used by recaptcha fields. See ~/perl_lib/EPrints/MetaField/Recaptcha.pm&lt;br /&gt;
# Captcha registered by you@your-institution&lt;br /&gt;
$c-&amp;gt;{recaptcha}-&amp;gt;{public_key} = &amp;quot;...&amp;quot;;&lt;br /&gt;
$c-&amp;gt;{recaptcha}-&amp;gt;{private_key} = &amp;quot;...&amp;quot;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Add the keys you got when registering for reCAPTCHA.&lt;br /&gt;
&lt;br /&gt;
''You can create either domain specific keys, or general purpose keys. If you run multiple archives you might want to create general keys and add the config file to ~/lib/cfg.d/ instead.''&lt;br /&gt;
&lt;br /&gt;
== Adding reCAPTCHA to User Registration ==&lt;br /&gt;
First we have to add the reCAPTCHA field to the user config.&lt;br /&gt;
I added the following code to the end of my recaptcha.pl file, but you could also add the field definition directly to the 'user_fields.pl' file.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;perl&amp;quot;&amp;gt;&lt;br /&gt;
#Add field to user dataset&lt;br /&gt;
$c-&amp;gt;add_dataset_field( &amp;quot;user&amp;quot;, {&lt;br /&gt;
        name =&amp;gt; &amp;quot;captcha&amp;quot;,&lt;br /&gt;
        type =&amp;gt; &amp;quot;recaptcha&amp;quot;,&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Now reload the configuration and update the database (through the web interface Admin-&amp;gt;Config. Tools -&amp;gt; Reload Config / Update Database) - or via the command line.&lt;br /&gt;
&lt;br /&gt;
Next, we have to add the field to the user registration workflow. If you haven't edited the registration workflow, look at ~/lib/workflows/user/register.xml. Add the following component after the existing Field::Multi component.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;component surround=&amp;quot;None&amp;quot;&amp;gt;&amp;lt;field ref=&amp;quot;captcha&amp;quot; /&amp;gt;&amp;lt;/component&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
''If you are running multiple archives and some need reCAPTCHA and others don't, copy the register.pl file into ~/archives/ARCHIVEID/workflows/user/ and edit it there.''&lt;br /&gt;
&lt;br /&gt;
Reload the configuration again, and then visit your 'Create Account' page - you should have a nice shiny reCAPTCHA added to the registration!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Adding reCAPTCHA to Document requests==&lt;br /&gt;
This is similar to the above, basically add a field to the request dataset, render it in the workflow (did you know that requests now have a workflow? I didn't!). &lt;br /&gt;
&lt;br /&gt;
Add the following to recaptcha.pl - or another suitable cfg.d/...pl file:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;perl&amp;quot;&amp;gt;&lt;br /&gt;
#Add field to requests&lt;br /&gt;
$c-&amp;gt;add_dataset_field( &amp;quot;request&amp;quot;, {&lt;br /&gt;
        name =&amp;gt; &amp;quot;captcha&amp;quot;,&lt;br /&gt;
        type =&amp;gt; &amp;quot;recaptcha&amp;quot;,&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add the field to the workflow for requests ~/lib/workflows/request/default.xml&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;component surround=&amp;quot;None&amp;quot;&amp;gt;&amp;lt;field ref=&amp;quot;captcha&amp;quot; /&amp;gt;&amp;lt;/component&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Reload config, update database etc. and test it works!&lt;br /&gt;
&lt;br /&gt;
Good work EPrints developers - it took about 10 minutes to get it working (and about 30 minutes to write this page :o)!&lt;/div&gt;</summary>
		<author><name>Libjlrs@leeds.ac.uk</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=Recaptcha&amp;diff=10638</id>
		<title>Recaptcha</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Recaptcha&amp;diff=10638"/>
		<updated>2012-10-02T14:15:36Z</updated>

		<summary type="html">&lt;p&gt;Libjlrs@leeds.ac.uk: Create page about Captche / reCAPTCHA&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;NOTE: This has been written based on my experience of an EPrints 3.3.10 install.&lt;br /&gt;
&lt;br /&gt;
== Configuring reCAPTCHA for user registration ==&lt;br /&gt;
Recent versions of EPrints (3.2+?) have configuration that allows reCAPTCHA to be used for user registration and/or document requests.&lt;br /&gt;
If your version of EPrints has the file: ~/perl_lib/EPrints/MetaField/Recaptcha.pm, these instructions *should* work...&lt;br /&gt;
&lt;br /&gt;
== What to do ==&lt;br /&gt;
# Register for a reCAPTCHA key at [http://www.google.com/recaptcha] (Click on the 'Use reCAPTCHA on your site' link).&lt;br /&gt;
# Add reCAPTCHA keys to config&lt;br /&gt;
# Configure a field to use reCAPTCHA&lt;br /&gt;
# Add field to workflow&lt;br /&gt;
&lt;br /&gt;
== Adding the config ==&lt;br /&gt;
Create a file: ~/archives/ARCHIVEID/cfg/cfg.d/recaptcha.pl&lt;br /&gt;
&amp;lt;source lang=&amp;quot;perl&amp;quot;&amp;gt;&lt;br /&gt;
# Used by recaptcha fields. See ~/perl_lib/EPrints/MetaField/Recaptcha.pm&lt;br /&gt;
# Captcha registered by you@your-institution&lt;br /&gt;
$c-&amp;gt;{recaptcha}-&amp;gt;{public_key} = &amp;quot;...&amp;quot;;&lt;br /&gt;
$c-&amp;gt;{recaptcha}-&amp;gt;{private_key} = &amp;quot;...&amp;quot;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Add the keys you got when registering for reCAPTCHA.&lt;br /&gt;
&lt;br /&gt;
''You can create either domain specific keys, or general purpose keys. If you run multiple archives you might want to create general keys and add the config file to ~/lib/cfg.d/ instead.''&lt;br /&gt;
&lt;br /&gt;
== Adding reCAPTCHA to User Registration ==&lt;br /&gt;
First we have to add the reCAPTCHA field to the user config.&lt;br /&gt;
I added the following code to the end of my recaptcha.pl file, but you could also add the field definition directly to the 'user_fields.pl' file.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;perl&amp;quot;&amp;gt;&lt;br /&gt;
#Add field to user dataset&lt;br /&gt;
$c-&amp;gt;add_dataset_field( &amp;quot;user&amp;quot;, {&lt;br /&gt;
        name =&amp;gt; &amp;quot;captcha&amp;quot;,&lt;br /&gt;
        type =&amp;gt; &amp;quot;recaptcha&amp;quot;,&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Now reload the configuration and update the database (through the web interface Admin-&amp;gt;Config. Tools -&amp;gt; Reload Config / Update Database) - or via the command line.&lt;br /&gt;
&lt;br /&gt;
Next, we have to add the field to the user registration workflow. If you haven't edited the registration workflow, look at ~/lib/workflows/user/register.xml. Add the following component after the existing Field::Multi component.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;component surround=&amp;quot;None&amp;quot;&amp;gt;&amp;lt;field ref=&amp;quot;captcha&amp;quot; /&amp;gt;&amp;lt;/component&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
''If you are running multiple archives and some need reCAPTCHA and others don't, copy the register.pl file into ~/archives/ARCHIVEID/workflows/user/ and edit it there.''&lt;br /&gt;
&lt;br /&gt;
Reload the configuration again, and then visit your 'Create Account' page - you should have a nice shiny reCAPTCHA added to the registration!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Adding reCAPTCHA to Document requests==&lt;br /&gt;
This is similar to the above, basically add a field to the request dataset, render it in the workflow (did you know that requests now have a workflow? I didn't!). &lt;br /&gt;
&lt;br /&gt;
Add the following to recaptcha.pl - or another suitable cfg.d/...pl file:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;perl&amp;quot;&amp;gt;&lt;br /&gt;
#Add field to requests&lt;br /&gt;
$c-&amp;gt;add_dataset_field( &amp;quot;request&amp;quot;, {&lt;br /&gt;
        name =&amp;gt; &amp;quot;captcha&amp;quot;,&lt;br /&gt;
        type =&amp;gt; &amp;quot;recaptcha&amp;quot;,&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add the field to the workflow for requests ~/lib/workflows/request/default.xml&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;component surround=&amp;quot;None&amp;quot;&amp;gt;&amp;lt;field ref=&amp;quot;captcha&amp;quot; /&amp;gt;&amp;lt;/component&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Reload config, update database etc. and test it works!&lt;br /&gt;
&lt;br /&gt;
Good work EPrints developers - it took about 10 minutes to get it working (and about 30 minutes to write this page :o)!&lt;/div&gt;</summary>
		<author><name>Libjlrs@leeds.ac.uk</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=Files/EThOS_webservice_download_tool&amp;diff=10556</id>
		<title>Files/EThOS webservice download tool</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Files/EThOS_webservice_download_tool&amp;diff=10556"/>
		<updated>2012-07-04T10:11:05Z</updated>

		<summary type="html">&lt;p&gt;Libjlrs@leeds.ac.uk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The British Library EThOS service has a SOAP based webservice to allow institutions to pull digitized theses back from their collection.&lt;br /&gt;
&lt;br /&gt;
Some code is available [[http://files.eprints.org/778/ http://files.eprints.org/778/]] to pull the theses back from EThOS and to populate records that have been harvested by EThOS (via OAI-PMH) with their EThOS Ids.&lt;br /&gt;
&lt;br /&gt;
The eprints script uses:&lt;br /&gt;
* SOAP::Lite (to make the calls to the webservice)&lt;br /&gt;
* LWP (to download the Zip files)&lt;br /&gt;
* Archive::Zip (to extract the files)&lt;br /&gt;
* Time::Local (to generate timestamps for the webservice)&lt;br /&gt;
&lt;br /&gt;
The code consists of two parts:&lt;br /&gt;
* a bin script (goes in ~/bin/)&lt;br /&gt;
* a config file (goes in ~/archives/ARCHIVEID/cfg/cfg.d/)&lt;br /&gt;
&lt;br /&gt;
Run ~/bin/ethos to see usage&lt;br /&gt;
&lt;br /&gt;
The following rules are used:&lt;br /&gt;
1) If an incoming thesis contains an institutionalReference (therefore has been harvested):&lt;br /&gt;
* A search is done on the reference&lt;br /&gt;
** If the eprint doesn't exist, no import is done.&lt;br /&gt;
** If the eprint exists and doesn't have an id_number, the id_number is added.&lt;br /&gt;
** If the eprint exists and the id_number matches the ethosId no import is done.&lt;br /&gt;
** If the eprint exists and the id_number doesn't match the ethosId, an error is reported.&lt;br /&gt;
&lt;br /&gt;
2) If the incoming thesis does not have an institutionalReference, a search for the ethosId in the id_number field is conducted.&lt;br /&gt;
* If an eprint exists with that ethosId, no import is done.&lt;br /&gt;
* If the ethosId is not found, a new eprint is created. Files are downloaded, and added to the eprint. Any issues with the download are recorded in the 'suggestions' field.&lt;br /&gt;
&lt;br /&gt;
The following fields are set in the EPrint:&lt;br /&gt;
* userid&lt;br /&gt;
* title&lt;br /&gt;
* date&lt;br /&gt;
* abstract&lt;br /&gt;
* id_number&lt;br /&gt;
* keywords&lt;br /&gt;
* creators_name&lt;br /&gt;
* thesis_type&lt;br /&gt;
* suggestions&lt;br /&gt;
&lt;br /&gt;
The scripts were written based on the White Rose Etheses Online set up. This means the config file may seem a bit warped in it's structure - as it was designed to be able to cope with 3 institutions.&lt;br /&gt;
&lt;br /&gt;
== EThOS Identifiers ==&lt;br /&gt;
EThOS identifiers are of the form: '''uk.bl.ethos.''xxxxx'''''.&lt;br /&gt;
If you have ethos identifiers stored in your system in a different format, you will need to tweak the code to cope with your way of storing them.&lt;br /&gt;
Any question/problems with the script, email the tech-list!&lt;br /&gt;
&lt;br /&gt;
== Downloading EThOS records in practice ==&lt;br /&gt;
The process of dealing with etheses the three White Rose institutions is different at each site.&lt;br /&gt;
In general though, there is a different route and set of people dealing with theses coming from EThOS to those being deposited by students as part of teir studies.&lt;br /&gt;
We have created an 'EThOS import' user for each site, and provided a custom workflow for these users.&lt;br /&gt;
There are fewer 'required' metadata elements for EThOS theses - we don't have a record of any 'supervisor email address' for a 1956 thesis!&lt;/div&gt;</summary>
		<author><name>Libjlrs@leeds.ac.uk</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=Files/EThOS_webservice_download_tool&amp;diff=10555</id>
		<title>Files/EThOS webservice download tool</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Files/EThOS_webservice_download_tool&amp;diff=10555"/>
		<updated>2012-07-04T10:10:43Z</updated>

		<summary type="html">&lt;p&gt;Libjlrs@leeds.ac.uk: Added files.eprints link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The British Library EThOS service has a SOAP based webservice to allow institutions to pull digitized theses back from their collection.&lt;br /&gt;
&lt;br /&gt;
Some code is available [[http://files.eprints.org/778/]] to pull the theses back from EThOS and to populate records that have been harvested by EThOS (via OAI-PMH) with their EThOS Ids.&lt;br /&gt;
&lt;br /&gt;
The eprints script uses:&lt;br /&gt;
* SOAP::Lite (to make the calls to the webservice)&lt;br /&gt;
* LWP (to download the Zip files)&lt;br /&gt;
* Archive::Zip (to extract the files)&lt;br /&gt;
* Time::Local (to generate timestamps for the webservice)&lt;br /&gt;
&lt;br /&gt;
The code consists of two parts:&lt;br /&gt;
* a bin script (goes in ~/bin/)&lt;br /&gt;
* a config file (goes in ~/archives/ARCHIVEID/cfg/cfg.d/)&lt;br /&gt;
&lt;br /&gt;
Run ~/bin/ethos to see usage&lt;br /&gt;
&lt;br /&gt;
The following rules are used:&lt;br /&gt;
1) If an incoming thesis contains an institutionalReference (therefore has been harvested):&lt;br /&gt;
* A search is done on the reference&lt;br /&gt;
** If the eprint doesn't exist, no import is done.&lt;br /&gt;
** If the eprint exists and doesn't have an id_number, the id_number is added.&lt;br /&gt;
** If the eprint exists and the id_number matches the ethosId no import is done.&lt;br /&gt;
** If the eprint exists and the id_number doesn't match the ethosId, an error is reported.&lt;br /&gt;
&lt;br /&gt;
2) If the incoming thesis does not have an institutionalReference, a search for the ethosId in the id_number field is conducted.&lt;br /&gt;
* If an eprint exists with that ethosId, no import is done.&lt;br /&gt;
* If the ethosId is not found, a new eprint is created. Files are downloaded, and added to the eprint. Any issues with the download are recorded in the 'suggestions' field.&lt;br /&gt;
&lt;br /&gt;
The following fields are set in the EPrint:&lt;br /&gt;
* userid&lt;br /&gt;
* title&lt;br /&gt;
* date&lt;br /&gt;
* abstract&lt;br /&gt;
* id_number&lt;br /&gt;
* keywords&lt;br /&gt;
* creators_name&lt;br /&gt;
* thesis_type&lt;br /&gt;
* suggestions&lt;br /&gt;
&lt;br /&gt;
The scripts were written based on the White Rose Etheses Online set up. This means the config file may seem a bit warped in it's structure - as it was designed to be able to cope with 3 institutions.&lt;br /&gt;
&lt;br /&gt;
== EThOS Identifiers ==&lt;br /&gt;
EThOS identifiers are of the form: '''uk.bl.ethos.''xxxxx'''''.&lt;br /&gt;
If you have ethos identifiers stored in your system in a different format, you will need to tweak the code to cope with your way of storing them.&lt;br /&gt;
Any question/problems with the script, email the tech-list!&lt;br /&gt;
&lt;br /&gt;
== Downloading EThOS records in practice ==&lt;br /&gt;
The process of dealing with etheses the three White Rose institutions is different at each site.&lt;br /&gt;
In general though, there is a different route and set of people dealing with theses coming from EThOS to those being deposited by students as part of teir studies.&lt;br /&gt;
We have created an 'EThOS import' user for each site, and provided a custom workflow for these users.&lt;br /&gt;
There are fewer 'required' metadata elements for EThOS theses - we don't have a record of any 'supervisor email address' for a 1956 thesis!&lt;/div&gt;</summary>
		<author><name>Libjlrs@leeds.ac.uk</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=Ethos&amp;diff=10554</id>
		<title>Ethos</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Ethos&amp;diff=10554"/>
		<updated>2012-07-03T12:23:38Z</updated>

		<summary type="html">&lt;p&gt;Libjlrs@leeds.ac.uk: linked to download tool page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Management]]&lt;br /&gt;
[[Category:Howto]]&lt;br /&gt;
See also: [[Files/EThOS_webservice_download_tool]]&lt;br /&gt;
&amp;lt;blockquote&amp;gt;''Eprints 3 users - the OAI interface to expose UKETD_DC is already bundled with the Eprints 3 distribution. However, it is still necessary to configure your installation to allow entry of metadata conforming to EThOS requirements. To this end you may find the EPrints v3 Configuration Notes helpful.''&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
[http://ethostoolkit.cranfield.ac.uk/tiki-index.php?page_ref_id=28 Guide to using an existing repository]&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[http://ethostoolkit.cranfield.ac.uk/tiki-index.php?page=EPrints+v3+Configuration+Notes EPrints v3 Configuration Notes]&lt;br /&gt;
&lt;br /&gt;
[http://ethostoolkit.cranfield.ac.uk/tiki-index.php?page_ref_id=47 UKETD_DC: The metadata core set recommended by EThOS]&lt;br /&gt;
&lt;br /&gt;
=Mandatory Fields=&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
!Ethos Field name&lt;br /&gt;
!EPrints field used by Ethos plugin&lt;br /&gt;
!Comments&lt;br /&gt;
|-&lt;br /&gt;
|Title&lt;br /&gt;
|title&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Author&lt;br /&gt;
|creators_name&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Awarding Institution&lt;br /&gt;
|institution&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Type&lt;br /&gt;
|type&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Qualification level&lt;br /&gt;
|thesis_type&lt;br /&gt;
|Default thesis_type values mix qualification level (eg. Masters) and qualification name (eg. PhD). Suggest refining thesis_type values and optionally adding new thesis_name field.&lt;br /&gt;
|-&lt;br /&gt;
|Thesis Date&lt;br /&gt;
|date&lt;br /&gt;
|Implicitly assumed that this is date on title page of thesis.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Optional Fields=&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
!Ethos Field name&lt;br /&gt;
!EPrints field used by Ethos plugin&lt;br /&gt;
!Comments&lt;br /&gt;
|-&lt;br /&gt;
|Alternative Title&lt;br /&gt;
|alt_title&lt;br /&gt;
|Not in EPrints defaults.&lt;br /&gt;
|-&lt;br /&gt;
|Supervisor(s)/advisor&lt;br /&gt;
|advisor&lt;br /&gt;
|Not in EPrints defaults. Plugin expects single value text field. Suggest using default Contributors field instead (adjust plugin to look for contributors with Thesis advisor role).&lt;br /&gt;
|-&lt;br /&gt;
|Subject keywords&lt;br /&gt;
|subjects&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Abstract&lt;br /&gt;
|abstract&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|DDC&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|LCC&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|LCSH&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|MESH&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|UDC&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Author Affiliation&lt;br /&gt;
|department&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Publisher&lt;br /&gt;
|publisher&lt;br /&gt;
|Note publisher not in default thesis workflow.&lt;br /&gt;
|-&lt;br /&gt;
|Sponsors&lt;br /&gt;
|sponsors&lt;br /&gt;
|Not in EPrints defaults.&lt;br /&gt;
|-&lt;br /&gt;
|Grant number&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Qualification name&lt;br /&gt;
|thesis_name&lt;br /&gt;
|Not in EPrints defaults.&lt;br /&gt;
|-&lt;br /&gt;
|Language&lt;br /&gt;
|language&lt;br /&gt;
|Not in EPrints defaults.&lt;br /&gt;
|-&lt;br /&gt;
|Institution item page URL&lt;br /&gt;
|&lt;br /&gt;
|Note plugin uses both $eprint-&amp;gt;get_url and official_url for dc:isReferencedBy.&lt;br /&gt;
|-&lt;br /&gt;
|Citations&lt;br /&gt;
|citations&lt;br /&gt;
|Not in EPrints defaults.&lt;br /&gt;
|-&lt;br /&gt;
|Included/Quoted work&lt;br /&gt;
|referencetext&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Rights&lt;br /&gt;
|rights&lt;br /&gt;
|Not in EPrints defaults.&lt;br /&gt;
|-&lt;br /&gt;
|Embargo Type&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Embargo date&lt;br /&gt;
|date_embargo&lt;br /&gt;
|Not in EPrints defaults. Not to be confused with document.date_embargo.&lt;br /&gt;
|-&lt;br /&gt;
|Embargo reasons&lt;br /&gt;
|embargo_reason&lt;br /&gt;
|Not in EPrints defaults. Plugin expects single value text field.&lt;br /&gt;
|-&lt;br /&gt;
|Identifier&lt;br /&gt;
|&lt;br /&gt;
|Plugin uses $document-&amp;gt;get_url&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Deprecated Fields=&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
!Ethos Field name&lt;br /&gt;
!EPrints field used by Ethos plugin&lt;br /&gt;
!Comments&lt;br /&gt;
|-&lt;br /&gt;
|File Format&lt;br /&gt;
|document.format&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|File Size&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Checksum&lt;br /&gt;
|checksum&lt;br /&gt;
|Not in EPrints defaults&lt;br /&gt;
|-&lt;br /&gt;
|File Version&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Other (not in Ethos spec)=&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
!Ethos Field name&lt;br /&gt;
!EPrints field used by Ethos plugin&lt;br /&gt;
!Comments&lt;br /&gt;
|-&lt;br /&gt;
|Editor?/Contributor?&lt;br /&gt;
|editors_name&lt;br /&gt;
|dc:contributor&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Libjlrs@leeds.ac.uk</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=Files/EThOS_webservice_download_tool&amp;diff=10549</id>
		<title>Files/EThOS webservice download tool</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Files/EThOS_webservice_download_tool&amp;diff=10549"/>
		<updated>2012-06-28T15:40:13Z</updated>

		<summary type="html">&lt;p&gt;Libjlrs@leeds.ac.uk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The British Library EThOS service has a SOAP based webservice to allow institutions to pull digitized theses back from their collection.&lt;br /&gt;
&lt;br /&gt;
Soon, some code will be released on files.eprints.org (it will be linked from here when available) to pull the theses back from EThOS and to populate records that have been harvested by EThOS (via OAI-PMH) with their EThOS Ids.&lt;br /&gt;
&lt;br /&gt;
The eprints script uses:&lt;br /&gt;
* SOAP::Lite (to make the calls to the webservice)&lt;br /&gt;
* LWP (to download the Zip files)&lt;br /&gt;
* Archive::Zip (to extract the files)&lt;br /&gt;
* Time::Local (to generate timestamps for the webservice)&lt;br /&gt;
&lt;br /&gt;
The code consists of two parts:&lt;br /&gt;
* a bin script (goes in ~/bin/)&lt;br /&gt;
* a config file (goes in ~/archives/ARCHIVEID/cfg/cfg.d/)&lt;br /&gt;
&lt;br /&gt;
Run ~/bin/ethos to see usage&lt;br /&gt;
&lt;br /&gt;
The following rules are used:&lt;br /&gt;
1) If an incoming thesis contains an institutionalReference (therefore has been harvested):&lt;br /&gt;
* A search is done on the reference&lt;br /&gt;
** If the eprint doesn't exist, no import is done.&lt;br /&gt;
** If the eprint exists and doesn't have an id_number, the id_number is added.&lt;br /&gt;
** If the eprint exists and the id_number matches the ethosId no import is done.&lt;br /&gt;
** If the eprint exists and the id_number doesn't match the ethosId, an error is reported.&lt;br /&gt;
&lt;br /&gt;
2) If the incoming thesis does not have an institutionalReference, a search for the ethosId in the id_number field is conducted.&lt;br /&gt;
* If an eprint exists with that ethosId, no import is done.&lt;br /&gt;
* If the ethosId is not found, a new eprint is created. Files are downloaded, and added to the eprint. Any issues with the download are recorded in the 'suggestions' field.&lt;br /&gt;
&lt;br /&gt;
The following fields are set in the EPrint:&lt;br /&gt;
* userid&lt;br /&gt;
* title&lt;br /&gt;
* date&lt;br /&gt;
* abstract&lt;br /&gt;
* id_number&lt;br /&gt;
* keywords&lt;br /&gt;
* creators_name&lt;br /&gt;
* thesis_type&lt;br /&gt;
* suggestions&lt;br /&gt;
&lt;br /&gt;
The scripts were written based on the White Rose Etheses Online set up. This means the config file may seem a bit warped in it's structure - as it was designed to be able to cope with 3 institutions.&lt;br /&gt;
&lt;br /&gt;
== EThOS Identifiers ==&lt;br /&gt;
EThOS identifiers are of the form: '''uk.bl.ethos.''xxxxx'''''.&lt;br /&gt;
If you have ethos identifiers stored in your system in a different format, you will need to tweak the code to cope with your way of storing them.&lt;br /&gt;
Any question/problems with the script, email the tech-list!&lt;br /&gt;
&lt;br /&gt;
== Downloading EThOS records in practice ==&lt;br /&gt;
The process of dealing with etheses the three White Rose institutions is different at each site.&lt;br /&gt;
In general though, there is a different route and set of people dealing with theses coming from EThOS to those being deposited by students as part of teir studies.&lt;br /&gt;
We have created an 'EThOS import' user for each site, and provided a custom workflow for these users.&lt;br /&gt;
There are fewer 'required' metadata elements for EThOS theses - we don't have a record of any 'supervisor email address' for a 1956 thesis!&lt;/div&gt;</summary>
		<author><name>Libjlrs@leeds.ac.uk</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=Files/EThOS_webservice_download_tool&amp;diff=10548</id>
		<title>Files/EThOS webservice download tool</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Files/EThOS_webservice_download_tool&amp;diff=10548"/>
		<updated>2012-06-28T14:39:27Z</updated>

		<summary type="html">&lt;p&gt;Libjlrs@leeds.ac.uk: added 'in practice' section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The British Library EThOS service has a SOAP based webservice to allow institutions to pull digitized theses back from their collection.&lt;br /&gt;
The code uses:&lt;br /&gt;
* SOAP::Lite (to make the calls to the webservice)&lt;br /&gt;
* LWP (to download the Zip files)&lt;br /&gt;
* Archive::Zip (to extract the files)&lt;br /&gt;
* Time::Local (to generate timestamps for the webservice)&lt;br /&gt;
&lt;br /&gt;
The code consists of two parts:&lt;br /&gt;
* a bin script (goes in ~/bin/)&lt;br /&gt;
* a config file (goes in ~/archives/ARCHIVEID/cfg/cfg.d/)&lt;br /&gt;
&lt;br /&gt;
Run ~/bin/ethos to see usage&lt;br /&gt;
&lt;br /&gt;
The following rules are used:&lt;br /&gt;
1) If an incoming thesis contains an institutionalReference (therefore has been harvested):&lt;br /&gt;
* A search is done on the reference&lt;br /&gt;
** If the eprint doesn't exist, no import is done.&lt;br /&gt;
** If the eprint exists and doesn't have an id_number, the id_number is added.&lt;br /&gt;
** If the eprint exists and the id_number matches the ethosId no import is done.&lt;br /&gt;
** If the eprint exists and the id_number doesn't match the ethosId, an error is reported.&lt;br /&gt;
&lt;br /&gt;
2) If the incoming thesis does not have an institutionalReference, a search for the ethosId in the id_number field is conducted.&lt;br /&gt;
* If an eprint exists with that ethosId, no import is done.&lt;br /&gt;
* If the ethosId is not found, a new eprint is created. Files are downloaded, and added to the eprint. Any issues with the download are recorded in the 'suggestions' field.&lt;br /&gt;
&lt;br /&gt;
The following fields are set in the EPrint:&lt;br /&gt;
* userid&lt;br /&gt;
* title&lt;br /&gt;
* date&lt;br /&gt;
* abstract&lt;br /&gt;
* id_number&lt;br /&gt;
* keywords&lt;br /&gt;
* creators_name&lt;br /&gt;
* thesis_type&lt;br /&gt;
* suggestions&lt;br /&gt;
&lt;br /&gt;
The scripts were written based on the White Rose Etheses Online set up. This means the config file may seem a bit warped in it's structure - as it was designed to be able to cope with 3 institutions.&lt;br /&gt;
&lt;br /&gt;
== EThOS Identifiers ==&lt;br /&gt;
EThOS identifiers are of the form: '''uk.bl.ethos.''xxxxx'''''.&lt;br /&gt;
If you have ethos identifiers stored in your system in a different format, you will need to tweak the code to cope with your way of storing them.&lt;br /&gt;
Any question/problems with the script, email the tech-list!&lt;br /&gt;
&lt;br /&gt;
== Downloading EThOS records in practice ==&lt;br /&gt;
The process of dealing with etheses the three White Rose institutions is different at each site.&lt;br /&gt;
In general though, there is a different route and set of people dealing with theses coming from EThOS to those being deposited by students as part of teir studies.&lt;br /&gt;
We have created an 'EThOS import' user for each site, and provided a custom workflow for these users.&lt;br /&gt;
There are fewer 'required' metadata elements for EThOS theses - we don't have a record of any 'supervisor email address' for a 1956 thesis!&lt;/div&gt;</summary>
		<author><name>Libjlrs@leeds.ac.uk</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=Files/EThOS_webservice_download_tool&amp;diff=10547</id>
		<title>Files/EThOS webservice download tool</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Files/EThOS_webservice_download_tool&amp;diff=10547"/>
		<updated>2012-06-28T14:24:47Z</updated>

		<summary type="html">&lt;p&gt;Libjlrs@leeds.ac.uk: Added EThOS identifiers note&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The British Library EThOS service has a SOAP based webservice to allow institutions to pull digitized theses back from their collection.&lt;br /&gt;
The code uses:&lt;br /&gt;
* SOAP::Lite (to make the calls to the webservice)&lt;br /&gt;
* LWP (to download the Zip files)&lt;br /&gt;
* Archive::Zip (to extract the files)&lt;br /&gt;
* Time::Local (to generate timestamps for the webservice)&lt;br /&gt;
&lt;br /&gt;
The code consists of two parts:&lt;br /&gt;
* a bin script (goes in ~/bin/)&lt;br /&gt;
* a config file (goes in ~/archives/ARCHIVEID/cfg/cfg.d/)&lt;br /&gt;
&lt;br /&gt;
Run ~/bin/ethos to see usage&lt;br /&gt;
&lt;br /&gt;
The following rules are used:&lt;br /&gt;
1) If an incoming thesis contains an institutionalReference (therefore has been harvested):&lt;br /&gt;
* A search is done on the reference&lt;br /&gt;
** If the eprint doesn't exist, no import is done.&lt;br /&gt;
** If the eprint exists and doesn't have an id_number, the id_number is added.&lt;br /&gt;
** If the eprint exists and the id_number matches the ethosId no import is done.&lt;br /&gt;
** If the eprint exists and the id_number doesn't match the ethosId, an error is reported.&lt;br /&gt;
&lt;br /&gt;
2) If the incoming thesis does not have an institutionalReference, a search for the ethosId in the id_number field is conducted.&lt;br /&gt;
* If an eprint exists with that ethosId, no import is done.&lt;br /&gt;
* If the ethosId is not found, a new eprint is created. Files are downloaded, and added to the eprint. Any issues with the download are recorded in the 'suggestions' field.&lt;br /&gt;
&lt;br /&gt;
The following fields are set in the EPrint:&lt;br /&gt;
* userid&lt;br /&gt;
* title&lt;br /&gt;
* date&lt;br /&gt;
* abstract&lt;br /&gt;
* id_number&lt;br /&gt;
* keywords&lt;br /&gt;
* creators_name&lt;br /&gt;
* thesis_type&lt;br /&gt;
* suggestions&lt;br /&gt;
&lt;br /&gt;
The scripts were written based on the White Rose Etheses Online set up. This means the config file may seem a bit warped in it's structure - as it was designed to be able to cope with 3 institutions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== EThOS Identifiers ==&lt;br /&gt;
EThOS identifiers are of the form: '''uk.bl.ethos.''xxxxx'''''.&lt;br /&gt;
If you have ethos identifiers stored in your system in a different format, you will need to tweak the code to cope with your way of storing them.&lt;br /&gt;
Any question/problems with the script, email the tech-list!&lt;/div&gt;</summary>
		<author><name>Libjlrs@leeds.ac.uk</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=Files/EThOS_webservice_download_tool&amp;diff=10546</id>
		<title>Files/EThOS webservice download tool</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Files/EThOS_webservice_download_tool&amp;diff=10546"/>
		<updated>2012-06-28T14:18:47Z</updated>

		<summary type="html">&lt;p&gt;Libjlrs@leeds.ac.uk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The British Library EThOS service has a SOAP based webservice to allow institutions to pull digitized theses back from their collection.&lt;br /&gt;
The code uses:&lt;br /&gt;
* SOAP::Lite (to make the calls to the webservice)&lt;br /&gt;
* LWP (to download the Zip files)&lt;br /&gt;
* Archive::Zip (to extract the files)&lt;br /&gt;
* Time::Local (to generate timestamps for the webservice)&lt;br /&gt;
&lt;br /&gt;
The code consists of two parts:&lt;br /&gt;
* a bin script (goes in ~/bin/)&lt;br /&gt;
* a config file (goes in ~/archives/ARCHIVEID/cfg/cfg.d/)&lt;br /&gt;
&lt;br /&gt;
Run ~/bin/ethos to see usage&lt;br /&gt;
&lt;br /&gt;
The following rules are used:&lt;br /&gt;
1) If an incoming thesis contains an institutionalReference (therefore has been harvested):&lt;br /&gt;
* A search is done on the reference&lt;br /&gt;
** If the eprint doesn't exist, no import is done.&lt;br /&gt;
** If the eprint exists and doesn't have an id_number, the id_number is added.&lt;br /&gt;
** If the eprint exists and the id_number matches the ethosId no import is done.&lt;br /&gt;
** If the eprint exists and the id_number doesn't match the ethosId, an error is reported.&lt;br /&gt;
&lt;br /&gt;
2) If the incoming thesis does not have an institutionalReference, a search for the ethosId in the id_number field is conducted.&lt;br /&gt;
* If an eprint exists with that ethosId, no import is done.&lt;br /&gt;
* If the ethosId is not found, a new eprint is created. Files are downloaded, and added to the eprint. Any issues with the download are recorded in the 'suggestions' field.&lt;br /&gt;
&lt;br /&gt;
The following fields are set in the EPrint:&lt;br /&gt;
* userid&lt;br /&gt;
* title&lt;br /&gt;
* date&lt;br /&gt;
* abstract&lt;br /&gt;
* id_number&lt;br /&gt;
* keywords&lt;br /&gt;
* creators_name&lt;br /&gt;
* thesis_type&lt;br /&gt;
* suggestions&lt;br /&gt;
&lt;br /&gt;
The scripts were written based on the White Rose Etheses Online set up. This means the config file may seem a bit warped in it's structure - as it was designed to be able to cope with 3 institutions.&lt;br /&gt;
&lt;br /&gt;
Any question/problems with the script, email the tech-list!&lt;/div&gt;</summary>
		<author><name>Libjlrs@leeds.ac.uk</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=Files/EThOS_webservice_download_tool&amp;diff=10545</id>
		<title>Files/EThOS webservice download tool</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Files/EThOS_webservice_download_tool&amp;diff=10545"/>
		<updated>2012-06-28T13:59:36Z</updated>

		<summary type="html">&lt;p&gt;Libjlrs@leeds.ac.uk: Created page with 'The British Library EThOS service has a SOAP based webservice to allow institutions to pull digitized theses back from their collection. The code uses: * SOAP::Lite (to make the …'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The British Library EThOS service has a SOAP based webservice to allow institutions to pull digitized theses back from their collection.&lt;br /&gt;
The code uses:&lt;br /&gt;
* SOAP::Lite (to make the calls to the webservice)&lt;br /&gt;
* LWP (to download the Zip files)&lt;br /&gt;
* Archive::Zip (to extract the files)&lt;br /&gt;
* Time::Local (to generate timestamps for the webservice)&lt;br /&gt;
&lt;br /&gt;
The code consists of two parts:&lt;br /&gt;
* a bin script (goes in ~/bin/)&lt;br /&gt;
* a config file (goes in ~/archives/ARCHIVEID/cfg/cfg.d/)&lt;br /&gt;
&lt;br /&gt;
Run ~/bin/ethos to see usage&lt;br /&gt;
&lt;br /&gt;
The following rules are used:&lt;br /&gt;
1) If an incoming thesis contains an institutionalReference (therefore has been harvested):&lt;br /&gt;
* A search is done on the reference&lt;br /&gt;
** If the eprint doesn't exist, no import is done.&lt;br /&gt;
** If the eprint exists and doesn't have an id_number, the id_number is added.&lt;br /&gt;
** If the eprint exists and the id_number matches the ethosId no import is done.&lt;br /&gt;
** If the eprint exists and the id_number doesn't match the ethosId, an error is reported.&lt;br /&gt;
&lt;br /&gt;
2) If the incoming thesis does not have an institutionalReference, a search for the ethosId in the id_number field is conducted.&lt;br /&gt;
* If an eprint exists with that ethosId, no import is done.&lt;br /&gt;
* If the ethosId is not found, a new eprint is created. Files are downloaded, and added to the eprint. Any issues with the download are recorded in the 'suggestions' field.&lt;br /&gt;
&lt;br /&gt;
The following fields are set in the EPrint:&lt;br /&gt;
* userid&lt;br /&gt;
* title&lt;br /&gt;
* date&lt;br /&gt;
* abstract&lt;br /&gt;
* id_number&lt;br /&gt;
* keywords&lt;br /&gt;
* creators_name&lt;br /&gt;
* thesis_type&lt;br /&gt;
* suggestions&lt;/div&gt;</summary>
		<author><name>Libjlrs@leeds.ac.uk</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=Files/CoverPDF&amp;diff=9719</id>
		<title>Files/CoverPDF</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Files/CoverPDF&amp;diff=9719"/>
		<updated>2010-12-23T13:59:24Z</updated>

		<summary type="html">&lt;p&gt;Libjlrs@leeds.ac.uk: /* pdftk */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:EPrints 3 Plugins]]&lt;br /&gt;
An EPrints extension to automatically generate cover pages for PDF documents.&lt;br /&gt;
&lt;br /&gt;
==Prerequisites==&lt;br /&gt;
&lt;br /&gt;
===pdflatex===&lt;br /&gt;
&lt;br /&gt;
The LaTeX front end for the TeX text formatting system&lt;br /&gt;
http://www.tug.org/texlive/&lt;br /&gt;
&lt;br /&gt;
 yum install texlive-latex (Fedora 10)&lt;br /&gt;
&lt;br /&gt;
Note older distros may still be using tetex packages http://www.tug.org/tetex/&lt;br /&gt;
&lt;br /&gt;
===pdftk===&lt;br /&gt;
&lt;br /&gt;
The PDF Tool Kit&lt;br /&gt;
http://www.accesspdf.com/pdftk/&lt;br /&gt;
(2010-12-23 pdftk can now be found here: http://www.pdflabs.com/docs/install-pdftk/ )&lt;br /&gt;
 yum install pdftk (Fedora 10)&lt;br /&gt;
&lt;br /&gt;
==Installation (EPrints 3.1+)==&lt;br /&gt;
&lt;br /&gt;
Download the latest tarball to your local repository directory (eg. /opt/eprints3/archives/ARCHIVEID/)&lt;br /&gt;
&lt;br /&gt;
Extract files:&lt;br /&gt;
&lt;br /&gt;
 tar xzvf coverpdf_install_xx.tgz&lt;br /&gt;
&lt;br /&gt;
The following files should be extracted:&lt;br /&gt;
&lt;br /&gt;
===cfg/cfg.d/coverpage.pl===&lt;br /&gt;
&lt;br /&gt;
Allows you to configure which cover page gets applied to which document. For example you might like to use a single coverpage for all PDF documents, only apply the cover page to certain types of PDF document (eg. articles), or use different cover pages for different types of PDF document.&lt;br /&gt;
&lt;br /&gt;
The default is to apply a single coverpage (defined in coverpage.xml - see below) to all PDF documents.&lt;br /&gt;
&lt;br /&gt;
'''Note: check that the pdflatex and pdftk paths are correct for your system.&lt;br /&gt;
&lt;br /&gt;
===cfg/lang/en/phrases/coverpage.xml===&lt;br /&gt;
&lt;br /&gt;
Defines cover page template(s) which you can adjust to change the content and/or appearance of your cover page(s). Each cover page is defined as a LaTeX template which can include information about the repository (eg. repository name, admin email address) and metadata about the document (eg. citation, URL).&lt;br /&gt;
&lt;br /&gt;
The default cover page template displays the repository logo and lists the document citation and URL. A brief &amp;quot;Usage Guidelines&amp;quot; section is also included.&lt;br /&gt;
&lt;br /&gt;
'''Note: gif format logos are not supported by pdflatex - see Troubleshooting section below.&lt;br /&gt;
&lt;br /&gt;
===cfg/plugins/EPrints/Plugin/Convert/CoverPDF.pm===&lt;br /&gt;
&lt;br /&gt;
Conversion plugin which actually does the work of creating the cover page and prepending it to a PDF document.&lt;br /&gt;
&lt;br /&gt;
'''Note: the original PDF document is never overwritten - the conversion plugin makes a separate copy with a cover page.&lt;br /&gt;
&lt;br /&gt;
==Getting Started==&lt;br /&gt;
&lt;br /&gt;
To activate cover pages, you need to make a small change to the EPrints/Apache/Rewrite.pm module.&lt;br /&gt;
&lt;br /&gt;
 vim /opt/eprints3/perl_lib/EPrints/Apache/Rewrite.pm&lt;br /&gt;
&lt;br /&gt;
Around line 182 find the following code:&lt;br /&gt;
&lt;br /&gt;
 # let it fail if this isn't a real eprint       &lt;br /&gt;
 if( !defined $eprint )&lt;br /&gt;
 {&lt;br /&gt;
     $session-&amp;gt;terminate;&lt;br /&gt;
     return OK;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Add the following immediately after:&lt;br /&gt;
&lt;br /&gt;
 if( !$thumbnails &amp;amp;&amp;amp; $session-&amp;gt;get_repository-&amp;gt;can_call( &amp;quot;coverpage&amp;quot;, &amp;quot;process_request&amp;quot; ) )&lt;br /&gt;
 {&lt;br /&gt;
     my $ret = $session-&amp;gt;get_repository-&amp;gt;call( [ &amp;quot;coverpage&amp;quot;, &amp;quot;process_request&amp;quot; ], $session, $r, $eprint, $pos, $tail );&lt;br /&gt;
     return $ret if defined $ret;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
This gives the coverpage extension a chance to look at the request and decide whether a cover page needs to be generated.&lt;br /&gt;
&lt;br /&gt;
Save the file and restart Apache.&lt;br /&gt;
&lt;br /&gt;
You should now find that all PDF documents in your repository have a cover page. If you change the layout or content of the cover page (by editing coverpage.xml), all cover pages should automatically be updated to reflect the change. Also, if the metadata of the record changes the cover page should also automatically update to reflect the new metadata.&lt;br /&gt;
&lt;br /&gt;
==Troubleshooting==&lt;br /&gt;
&lt;br /&gt;
===GIF image not appearing on cover page===&lt;br /&gt;
&lt;br /&gt;
pdflatex does not support gif images - convert the gif image to a supported format such as png.&lt;br /&gt;
&lt;br /&gt;
The default cover page uses the site_logo setting defined in cfg.d/branding.pl. By default the logo is a gif image:&lt;br /&gt;
&lt;br /&gt;
 $c-&amp;gt;{site_logo} = &amp;quot;/images/sitelogo.gif&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
To create a png version of the logo:&lt;br /&gt;
&lt;br /&gt;
 cd /opt/eprints3/archives/ARCHIVEID/cfg/static/images/&lt;br /&gt;
 convert sitelogo.gif sitelogo.png&lt;br /&gt;
&lt;br /&gt;
Edit branding.pl and change sitelogo.gif to sitelogo.png.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Touch&amp;quot; coverpage.xml so that cover pages will be regenerated:&lt;br /&gt;
&lt;br /&gt;
 touch /opt/eprints3/archives/ARCHIVEID/cfg/lang/en/phrases/coverpage.xml&lt;br /&gt;
&lt;br /&gt;
The logo should now appear on the cover page.&lt;br /&gt;
&lt;br /&gt;
===&amp;quot;Check that coverpage content is valid LaTeX&amp;quot; error message in log===&lt;br /&gt;
&lt;br /&gt;
This can sometimes appear after touching/editing coverpage.xml even if the LaTeX code is correct. Restart Apache and try again.&lt;br /&gt;
&lt;br /&gt;
Check for any mktexfmt error messages in the log - see below.&lt;br /&gt;
&lt;br /&gt;
If the problem persists, try running pdflatex against the cover page template manually:&lt;br /&gt;
&lt;br /&gt;
 cd /tmp&lt;br /&gt;
 mkdir coverpage-test&lt;br /&gt;
 cd coverpage-test&lt;br /&gt;
 vi cover.tex&lt;br /&gt;
 (copy LaTeX code from coverpage.xml into cover.tex)&lt;br /&gt;
 pdflatex cover.tex&lt;br /&gt;
&lt;br /&gt;
Examine the pdflatex output for errors.&lt;br /&gt;
&lt;br /&gt;
This problem can also appear because of an intermittent bug in pdflatex. The symptom is that cover pages generally work, but occasionally (and transiently) either fail to appear or, more rarely, cause an internal server error. In this case, a workaround is to use latex and dvipdf instead of pdflatex. A (clumsy) way to do this is to modify CoverPDF.pm, replacing the line&lt;br /&gt;
&lt;br /&gt;
 system( $pdflatex, &amp;quot;-interaction=nonstopmode&amp;quot;, &amp;quot;-output-directory=$latex_dir&amp;quot;, $latex_file );&lt;br /&gt;
&lt;br /&gt;
with&lt;br /&gt;
&lt;br /&gt;
 system( &amp;quot;latex&amp;quot;, &amp;quot;-interaction=nonstopmode&amp;quot;, &amp;quot;-output-directory=$latex_dir&amp;quot;, $latex_file );&lt;br /&gt;
 system( &amp;quot;cd $latex_dir &amp;amp;&amp;amp; dvipdf cover.dvi&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
===&amp;quot;fmtutil: format directory does not exist&amp;quot; error message in log===&lt;br /&gt;
&lt;br /&gt;
Full error message:&lt;br /&gt;
&lt;br /&gt;
 kpathsea: Running mktexfmt pdflatex.fmt&lt;br /&gt;
 fmtutil: format directory `/.texlive2007/texmf-var/web2c' does not exist.&lt;br /&gt;
&lt;br /&gt;
Some texlive packages do not include all the necessary TeX format files to run. To generate the missing files, run the following as the &amp;quot;eprints&amp;quot; user (or the user you configured EPrints to run as):&lt;br /&gt;
&lt;br /&gt;
 fmtutil --missing&lt;br /&gt;
&lt;br /&gt;
Under Fedora 10, the home directory seen by the EPrints web server differs from that of the eprints user, so as root you may need to do&lt;br /&gt;
&lt;br /&gt;
 mkdir /.texlive2007&lt;br /&gt;
 chown eprints.eprints /.texlive2007&lt;br /&gt;
 chmod g+w /.texlive2007&lt;br /&gt;
&lt;br /&gt;
and then as the eprints user&lt;br /&gt;
&lt;br /&gt;
 HOME=/ fmtutil --missing&lt;br /&gt;
&lt;br /&gt;
===Encrypted PDFs / &amp;quot;Check the PDF is not password-protected&amp;quot; error message in log===&lt;br /&gt;
&lt;br /&gt;
If a PDF document is encrypted (password protected), a cover page cannot be added.&lt;br /&gt;
&lt;br /&gt;
To check for encrypted PDFs during the deposit process (and display a '''warning''' message) add the following to cfg.d/eprint_warnings.pl:&lt;br /&gt;
&lt;br /&gt;
 foreach my $doc ( @docs )&lt;br /&gt;
 {&lt;br /&gt;
     if( $doc-&amp;gt;get_type eq 'application/pdf' )&lt;br /&gt;
     {&lt;br /&gt;
         use PDF::API2;&lt;br /&gt;
         my $pdf = PDF::API2-&amp;gt;open( $doc-&amp;gt;local_path.'/'.$doc-&amp;gt;get_main );&lt;br /&gt;
         if( defined $pdf &amp;amp;&amp;amp; $pdf-&amp;gt;isEncrypted )&lt;br /&gt;
         {&lt;br /&gt;
             my $fieldname = $session-&amp;gt;make_element( &amp;quot;span&amp;quot;, class=&amp;gt;&amp;quot;ep_problem_field:documents&amp;quot; );&lt;br /&gt;
             push @problems, $session-&amp;gt;html_phrase( &amp;quot;validate:encrypted_pdf&amp;quot;, fieldname =&amp;gt; $fieldname );&lt;br /&gt;
         }&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
'''Note: You will need to install the PDF::API2 Perl module.&lt;br /&gt;
&lt;br /&gt;
'''Hint: If you want to prevent depositors from submitting encrypted PDFs, adapt the code to cfg.d/eprint_validate.pl instead.&lt;br /&gt;
&lt;br /&gt;
===Ampersands and other characters do not render correctly on cover sheet===&lt;br /&gt;
&lt;br /&gt;
Some characters, such as ampersands and copyright symbols, need to be quoted to render correctly in LaTeX. Try adding the following local subroutine to $coverpage-&amp;gt;{getcontent}:&lt;br /&gt;
&lt;br /&gt;
 $coverpage-&amp;gt;{get_content} = sub {&lt;br /&gt;
     [...]&lt;br /&gt;
     my $latex_encode = sub {&lt;br /&gt;
         my ($string) = @_;&lt;br /&gt;
         utf8::decode($string);&lt;br /&gt;
         return TeX::Encode::encode( &amp;quot;latex&amp;quot;, $string );&lt;br /&gt;
     };&lt;br /&gt;
     [...]&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
You can then use &amp;amp;$latex_encode() to wrapper the strings in %bits:&lt;br /&gt;
&lt;br /&gt;
 my %bits = (&lt;br /&gt;
     citation =&amp;gt; &amp;amp;$latex_encode( EPrints::Utils::tree_to_utf8( $eprint-&amp;gt;render_citation() ) ),&lt;br /&gt;
 [...]&lt;br /&gt;
 );&lt;br /&gt;
&lt;br /&gt;
===Older versions of pdflatex do not support -output-directory===&lt;br /&gt;
&lt;br /&gt;
Error messages in the log like:&lt;br /&gt;
&lt;br /&gt;
 /usr/bin/pdflatex: unrecognized option `-output-directory=/tmp/1cS5K8nVch'&lt;br /&gt;
&lt;br /&gt;
In CoverPDF.pm, try replacing:&lt;br /&gt;
&lt;br /&gt;
 system( $pdflatex, &amp;quot;-interaction=nonstopmode&amp;quot;, &amp;quot;-output-directory=$latex_dir&amp;quot;, $latex_file );&lt;br /&gt;
&lt;br /&gt;
with:&lt;br /&gt;
&lt;br /&gt;
 use Cwd;&lt;br /&gt;
 my $prev_dir = getcwd;&lt;br /&gt;
 chdir( $latex_dir );&lt;br /&gt;
 system( $pdflatex, &amp;quot;-interaction=nonstopmode&amp;quot;, $latex_file );&lt;br /&gt;
 chdir( $prev_dir );&lt;/div&gt;</summary>
		<author><name>Libjlrs@leeds.ac.uk</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=Files/CoverPDF&amp;diff=9718</id>
		<title>Files/CoverPDF</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Files/CoverPDF&amp;diff=9718"/>
		<updated>2010-12-23T13:57:40Z</updated>

		<summary type="html">&lt;p&gt;Libjlrs@leeds.ac.uk: /* pdftk */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:EPrints 3 Plugins]]&lt;br /&gt;
An EPrints extension to automatically generate cover pages for PDF documents.&lt;br /&gt;
&lt;br /&gt;
==Prerequisites==&lt;br /&gt;
&lt;br /&gt;
===pdflatex===&lt;br /&gt;
&lt;br /&gt;
The LaTeX front end for the TeX text formatting system&lt;br /&gt;
http://www.tug.org/texlive/&lt;br /&gt;
&lt;br /&gt;
 yum install texlive-latex (Fedora 10)&lt;br /&gt;
&lt;br /&gt;
Note older distros may still be using tetex packages http://www.tug.org/tetex/&lt;br /&gt;
&lt;br /&gt;
===pdftk===&lt;br /&gt;
&lt;br /&gt;
The PDF Tool Kit&lt;br /&gt;
http://www.accesspdf.com/pdftk/&lt;br /&gt;
(2010-12-23 pdftk can not be found here: http://www.pdflabs.com/docs/install-pdftk/ )&lt;br /&gt;
 yum install pdftk (Fedora 10)&lt;br /&gt;
&lt;br /&gt;
==Installation (EPrints 3.1+)==&lt;br /&gt;
&lt;br /&gt;
Download the latest tarball to your local repository directory (eg. /opt/eprints3/archives/ARCHIVEID/)&lt;br /&gt;
&lt;br /&gt;
Extract files:&lt;br /&gt;
&lt;br /&gt;
 tar xzvf coverpdf_install_xx.tgz&lt;br /&gt;
&lt;br /&gt;
The following files should be extracted:&lt;br /&gt;
&lt;br /&gt;
===cfg/cfg.d/coverpage.pl===&lt;br /&gt;
&lt;br /&gt;
Allows you to configure which cover page gets applied to which document. For example you might like to use a single coverpage for all PDF documents, only apply the cover page to certain types of PDF document (eg. articles), or use different cover pages for different types of PDF document.&lt;br /&gt;
&lt;br /&gt;
The default is to apply a single coverpage (defined in coverpage.xml - see below) to all PDF documents.&lt;br /&gt;
&lt;br /&gt;
'''Note: check that the pdflatex and pdftk paths are correct for your system.&lt;br /&gt;
&lt;br /&gt;
===cfg/lang/en/phrases/coverpage.xml===&lt;br /&gt;
&lt;br /&gt;
Defines cover page template(s) which you can adjust to change the content and/or appearance of your cover page(s). Each cover page is defined as a LaTeX template which can include information about the repository (eg. repository name, admin email address) and metadata about the document (eg. citation, URL).&lt;br /&gt;
&lt;br /&gt;
The default cover page template displays the repository logo and lists the document citation and URL. A brief &amp;quot;Usage Guidelines&amp;quot; section is also included.&lt;br /&gt;
&lt;br /&gt;
'''Note: gif format logos are not supported by pdflatex - see Troubleshooting section below.&lt;br /&gt;
&lt;br /&gt;
===cfg/plugins/EPrints/Plugin/Convert/CoverPDF.pm===&lt;br /&gt;
&lt;br /&gt;
Conversion plugin which actually does the work of creating the cover page and prepending it to a PDF document.&lt;br /&gt;
&lt;br /&gt;
'''Note: the original PDF document is never overwritten - the conversion plugin makes a separate copy with a cover page.&lt;br /&gt;
&lt;br /&gt;
==Getting Started==&lt;br /&gt;
&lt;br /&gt;
To activate cover pages, you need to make a small change to the EPrints/Apache/Rewrite.pm module.&lt;br /&gt;
&lt;br /&gt;
 vim /opt/eprints3/perl_lib/EPrints/Apache/Rewrite.pm&lt;br /&gt;
&lt;br /&gt;
Around line 182 find the following code:&lt;br /&gt;
&lt;br /&gt;
 # let it fail if this isn't a real eprint       &lt;br /&gt;
 if( !defined $eprint )&lt;br /&gt;
 {&lt;br /&gt;
     $session-&amp;gt;terminate;&lt;br /&gt;
     return OK;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Add the following immediately after:&lt;br /&gt;
&lt;br /&gt;
 if( !$thumbnails &amp;amp;&amp;amp; $session-&amp;gt;get_repository-&amp;gt;can_call( &amp;quot;coverpage&amp;quot;, &amp;quot;process_request&amp;quot; ) )&lt;br /&gt;
 {&lt;br /&gt;
     my $ret = $session-&amp;gt;get_repository-&amp;gt;call( [ &amp;quot;coverpage&amp;quot;, &amp;quot;process_request&amp;quot; ], $session, $r, $eprint, $pos, $tail );&lt;br /&gt;
     return $ret if defined $ret;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
This gives the coverpage extension a chance to look at the request and decide whether a cover page needs to be generated.&lt;br /&gt;
&lt;br /&gt;
Save the file and restart Apache.&lt;br /&gt;
&lt;br /&gt;
You should now find that all PDF documents in your repository have a cover page. If you change the layout or content of the cover page (by editing coverpage.xml), all cover pages should automatically be updated to reflect the change. Also, if the metadata of the record changes the cover page should also automatically update to reflect the new metadata.&lt;br /&gt;
&lt;br /&gt;
==Troubleshooting==&lt;br /&gt;
&lt;br /&gt;
===GIF image not appearing on cover page===&lt;br /&gt;
&lt;br /&gt;
pdflatex does not support gif images - convert the gif image to a supported format such as png.&lt;br /&gt;
&lt;br /&gt;
The default cover page uses the site_logo setting defined in cfg.d/branding.pl. By default the logo is a gif image:&lt;br /&gt;
&lt;br /&gt;
 $c-&amp;gt;{site_logo} = &amp;quot;/images/sitelogo.gif&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
To create a png version of the logo:&lt;br /&gt;
&lt;br /&gt;
 cd /opt/eprints3/archives/ARCHIVEID/cfg/static/images/&lt;br /&gt;
 convert sitelogo.gif sitelogo.png&lt;br /&gt;
&lt;br /&gt;
Edit branding.pl and change sitelogo.gif to sitelogo.png.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Touch&amp;quot; coverpage.xml so that cover pages will be regenerated:&lt;br /&gt;
&lt;br /&gt;
 touch /opt/eprints3/archives/ARCHIVEID/cfg/lang/en/phrases/coverpage.xml&lt;br /&gt;
&lt;br /&gt;
The logo should now appear on the cover page.&lt;br /&gt;
&lt;br /&gt;
===&amp;quot;Check that coverpage content is valid LaTeX&amp;quot; error message in log===&lt;br /&gt;
&lt;br /&gt;
This can sometimes appear after touching/editing coverpage.xml even if the LaTeX code is correct. Restart Apache and try again.&lt;br /&gt;
&lt;br /&gt;
Check for any mktexfmt error messages in the log - see below.&lt;br /&gt;
&lt;br /&gt;
If the problem persists, try running pdflatex against the cover page template manually:&lt;br /&gt;
&lt;br /&gt;
 cd /tmp&lt;br /&gt;
 mkdir coverpage-test&lt;br /&gt;
 cd coverpage-test&lt;br /&gt;
 vi cover.tex&lt;br /&gt;
 (copy LaTeX code from coverpage.xml into cover.tex)&lt;br /&gt;
 pdflatex cover.tex&lt;br /&gt;
&lt;br /&gt;
Examine the pdflatex output for errors.&lt;br /&gt;
&lt;br /&gt;
This problem can also appear because of an intermittent bug in pdflatex. The symptom is that cover pages generally work, but occasionally (and transiently) either fail to appear or, more rarely, cause an internal server error. In this case, a workaround is to use latex and dvipdf instead of pdflatex. A (clumsy) way to do this is to modify CoverPDF.pm, replacing the line&lt;br /&gt;
&lt;br /&gt;
 system( $pdflatex, &amp;quot;-interaction=nonstopmode&amp;quot;, &amp;quot;-output-directory=$latex_dir&amp;quot;, $latex_file );&lt;br /&gt;
&lt;br /&gt;
with&lt;br /&gt;
&lt;br /&gt;
 system( &amp;quot;latex&amp;quot;, &amp;quot;-interaction=nonstopmode&amp;quot;, &amp;quot;-output-directory=$latex_dir&amp;quot;, $latex_file );&lt;br /&gt;
 system( &amp;quot;cd $latex_dir &amp;amp;&amp;amp; dvipdf cover.dvi&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
===&amp;quot;fmtutil: format directory does not exist&amp;quot; error message in log===&lt;br /&gt;
&lt;br /&gt;
Full error message:&lt;br /&gt;
&lt;br /&gt;
 kpathsea: Running mktexfmt pdflatex.fmt&lt;br /&gt;
 fmtutil: format directory `/.texlive2007/texmf-var/web2c' does not exist.&lt;br /&gt;
&lt;br /&gt;
Some texlive packages do not include all the necessary TeX format files to run. To generate the missing files, run the following as the &amp;quot;eprints&amp;quot; user (or the user you configured EPrints to run as):&lt;br /&gt;
&lt;br /&gt;
 fmtutil --missing&lt;br /&gt;
&lt;br /&gt;
Under Fedora 10, the home directory seen by the EPrints web server differs from that of the eprints user, so as root you may need to do&lt;br /&gt;
&lt;br /&gt;
 mkdir /.texlive2007&lt;br /&gt;
 chown eprints.eprints /.texlive2007&lt;br /&gt;
 chmod g+w /.texlive2007&lt;br /&gt;
&lt;br /&gt;
and then as the eprints user&lt;br /&gt;
&lt;br /&gt;
 HOME=/ fmtutil --missing&lt;br /&gt;
&lt;br /&gt;
===Encrypted PDFs / &amp;quot;Check the PDF is not password-protected&amp;quot; error message in log===&lt;br /&gt;
&lt;br /&gt;
If a PDF document is encrypted (password protected), a cover page cannot be added.&lt;br /&gt;
&lt;br /&gt;
To check for encrypted PDFs during the deposit process (and display a '''warning''' message) add the following to cfg.d/eprint_warnings.pl:&lt;br /&gt;
&lt;br /&gt;
 foreach my $doc ( @docs )&lt;br /&gt;
 {&lt;br /&gt;
     if( $doc-&amp;gt;get_type eq 'application/pdf' )&lt;br /&gt;
     {&lt;br /&gt;
         use PDF::API2;&lt;br /&gt;
         my $pdf = PDF::API2-&amp;gt;open( $doc-&amp;gt;local_path.'/'.$doc-&amp;gt;get_main );&lt;br /&gt;
         if( defined $pdf &amp;amp;&amp;amp; $pdf-&amp;gt;isEncrypted )&lt;br /&gt;
         {&lt;br /&gt;
             my $fieldname = $session-&amp;gt;make_element( &amp;quot;span&amp;quot;, class=&amp;gt;&amp;quot;ep_problem_field:documents&amp;quot; );&lt;br /&gt;
             push @problems, $session-&amp;gt;html_phrase( &amp;quot;validate:encrypted_pdf&amp;quot;, fieldname =&amp;gt; $fieldname );&lt;br /&gt;
         }&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
'''Note: You will need to install the PDF::API2 Perl module.&lt;br /&gt;
&lt;br /&gt;
'''Hint: If you want to prevent depositors from submitting encrypted PDFs, adapt the code to cfg.d/eprint_validate.pl instead.&lt;br /&gt;
&lt;br /&gt;
===Ampersands and other characters do not render correctly on cover sheet===&lt;br /&gt;
&lt;br /&gt;
Some characters, such as ampersands and copyright symbols, need to be quoted to render correctly in LaTeX. Try adding the following local subroutine to $coverpage-&amp;gt;{getcontent}:&lt;br /&gt;
&lt;br /&gt;
 $coverpage-&amp;gt;{get_content} = sub {&lt;br /&gt;
     [...]&lt;br /&gt;
     my $latex_encode = sub {&lt;br /&gt;
         my ($string) = @_;&lt;br /&gt;
         utf8::decode($string);&lt;br /&gt;
         return TeX::Encode::encode( &amp;quot;latex&amp;quot;, $string );&lt;br /&gt;
     };&lt;br /&gt;
     [...]&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
You can then use &amp;amp;$latex_encode() to wrapper the strings in %bits:&lt;br /&gt;
&lt;br /&gt;
 my %bits = (&lt;br /&gt;
     citation =&amp;gt; &amp;amp;$latex_encode( EPrints::Utils::tree_to_utf8( $eprint-&amp;gt;render_citation() ) ),&lt;br /&gt;
 [...]&lt;br /&gt;
 );&lt;br /&gt;
&lt;br /&gt;
===Older versions of pdflatex do not support -output-directory===&lt;br /&gt;
&lt;br /&gt;
Error messages in the log like:&lt;br /&gt;
&lt;br /&gt;
 /usr/bin/pdflatex: unrecognized option `-output-directory=/tmp/1cS5K8nVch'&lt;br /&gt;
&lt;br /&gt;
In CoverPDF.pm, try replacing:&lt;br /&gt;
&lt;br /&gt;
 system( $pdflatex, &amp;quot;-interaction=nonstopmode&amp;quot;, &amp;quot;-output-directory=$latex_dir&amp;quot;, $latex_file );&lt;br /&gt;
&lt;br /&gt;
with:&lt;br /&gt;
&lt;br /&gt;
 use Cwd;&lt;br /&gt;
 my $prev_dir = getcwd;&lt;br /&gt;
 chdir( $latex_dir );&lt;br /&gt;
 system( $pdflatex, &amp;quot;-interaction=nonstopmode&amp;quot;, $latex_file );&lt;br /&gt;
 chdir( $prev_dir );&lt;/div&gt;</summary>
		<author><name>Libjlrs@leeds.ac.uk</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=Find_creation_date_of_cache_tables&amp;diff=9717</id>
		<title>Find creation date of cache tables</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Find_creation_date_of_cache_tables&amp;diff=9717"/>
		<updated>2010-12-22T12:16:04Z</updated>

		<summary type="html">&lt;p&gt;Libjlrs@leeds.ac.uk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;To see the date that your cache tables were created, use the following MySQL comment (run as a 'powerful' mysql user):&lt;br /&gt;
&lt;br /&gt;
mysql&amp;gt; select TABLE_SCHEMA, TABLE_NAME, CREATE_TIME from information_schema.tables WHERE TABLE_NAME RLIKE 'cache[0-9]';&lt;br /&gt;
[[Category:Snippets]]&lt;/div&gt;</summary>
		<author><name>Libjlrs@leeds.ac.uk</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=Find_creation_date_of_cache_tables&amp;diff=9716</id>
		<title>Find creation date of cache tables</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Find_creation_date_of_cache_tables&amp;diff=9716"/>
		<updated>2010-12-22T12:12:35Z</updated>

		<summary type="html">&lt;p&gt;Libjlrs@leeds.ac.uk: Created page with 'To see the date that your cache tables were created, use the following MySQL comment (run as a 'powerful' mysql user):  mysql&amp;gt; select TABLE_SCHEMA, TABLE_NAME, CREATE_TIME from i…'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;To see the date that your cache tables were created, use the following MySQL comment (run as a 'powerful' mysql user):&lt;br /&gt;
&lt;br /&gt;
mysql&amp;gt; select TABLE_SCHEMA, TABLE_NAME, CREATE_TIME from information_schema.tables WHERE TABLE_NAME RLIKE 'cache[0-9]';&lt;/div&gt;</summary>
		<author><name>Libjlrs@leeds.ac.uk</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=Category:Snippets&amp;diff=9715</id>
		<title>Category:Snippets</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Category:Snippets&amp;diff=9715"/>
		<updated>2010-12-22T12:06:23Z</updated>

		<summary type="html">&lt;p&gt;Libjlrs@leeds.ac.uk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Howto]]&lt;br /&gt;
Snippets are intended to be quick to write notes or  bare bones. You should be able to put one together in about 5 minutes. Just stick any code you wrote and a few sentences explaining what it does in a wiki page and add it to the snippets category. It means that in future you will be able to find the snippet if you ever need to repeat the task. Other users might also be able to repeat what you have done. They may choose to extend it, improve it, make it into a plugin or it may even get picked up by EPrints core. &lt;br /&gt;
&lt;br /&gt;
Hopefully snippets will help the EPrints development team get a idea of what it is you guys are trying to do with EPrints.&lt;br /&gt;
&lt;br /&gt;
When adding a snippet please try to include the version of EPrints you wrote it for. This will greatly help future users.&lt;/div&gt;</summary>
		<author><name>Libjlrs@leeds.ac.uk</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=Instructions_for_local_plugins&amp;diff=9539</id>
		<title>Instructions for local plugins</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Instructions_for_local_plugins&amp;diff=9539"/>
		<updated>2010-10-19T09:50:47Z</updated>

		<summary type="html">&lt;p&gt;Libjlrs@leeds.ac.uk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Plugins]]&lt;br /&gt;
See also: [[Tips_to_write_plugins]]&lt;br /&gt;
&lt;br /&gt;
To change the functionality of a core plugin within a specific archive, you can make a subclass of the original package.&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' If you are on 3.2.0-3.2.3 there is a bug in plugin factory that may cause local customisation to plugins to bleed between archives. Ticket is here: [http://trac.eprints.org/eprints/ticket/3867 http://trac.eprints.org/eprints/ticket/3867]&lt;br /&gt;
&lt;br /&gt;
Make a directory (in this example I'm subclassing a Screen plugin):&lt;br /&gt;
 ~/archives/ARCHIVEID/cfg/plugins/EPrints/Plugins/Screen&lt;br /&gt;
&lt;br /&gt;
copy the original plugin to this location, with a new name:&lt;br /&gt;
 cp ~/perl_lib/EPrints/Plugin/Screen/Items.pm ~/archives/ARCHIVEID/cfg/plugins/EPrints/Plugins/Screen/MyItems.pm&lt;br /&gt;
&lt;br /&gt;
From the file, remove any subs that you don't want to redefine, and rename the package according to the name of the new file (in this example, I'm only redefining the 'render' sub).&lt;br /&gt;
The file should look a bit like this:&lt;br /&gt;
 package EPrints::Plugin::Screen::MyItems;&lt;br /&gt;
 @ISA = ( 'EPrints::Plugin::Screen::Items' );&lt;br /&gt;
 &lt;br /&gt;
 use strict;&lt;br /&gt;
 &lt;br /&gt;
 sub render&lt;br /&gt;
 {&lt;br /&gt;
     my( $self ) = @_;&lt;br /&gt;
     my $session = $self-&amp;gt;{session};&lt;br /&gt;
 ...&lt;br /&gt;
 ...&lt;br /&gt;
 } #end of sub render&lt;br /&gt;
&lt;br /&gt;
Then, add the following lines to the ~/archives/ARCHIVEID/cfg/cfg.d/plugins.pl file:&lt;br /&gt;
 $c-&amp;gt;{plugin_alias_map}-&amp;gt;{&amp;quot;Screen::Items&amp;quot;} = &amp;quot;Screen::MyItems&amp;quot;;&lt;br /&gt;
 $c-&amp;gt;{plugin_alias_map}-&amp;gt;{&amp;quot;Screen::MyItems&amp;quot;} = undef;&lt;br /&gt;
This makes calls to Screens::Items go via your new version - which has the locally defined sub (render in this case), and also makes sure that your new version doesn't appear alongside the original version.&lt;br /&gt;
I have found that running ~/bin/epadmin reload ARCHIVEID doesn't always pick these changes up - you might need to restart Apache to see what you've done!&lt;/div&gt;</summary>
		<author><name>Libjlrs@leeds.ac.uk</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=Instructions_for_local_plugins&amp;diff=9538</id>
		<title>Instructions for local plugins</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Instructions_for_local_plugins&amp;diff=9538"/>
		<updated>2010-10-19T09:50:28Z</updated>

		<summary type="html">&lt;p&gt;Libjlrs@leeds.ac.uk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Plugins]]&lt;br /&gt;
See also: [[Tips_to_write_plugins]]&lt;br /&gt;
&lt;br /&gt;
To change the functionality of a core plugin within a specific archive, you can make a subclass of the original package.&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' If you are on 3.2.0-3.2.3 there is a bug in plugin factory that may cause local customisation to plugins to bleed between archives. Ticket is here: [http://trac.eprints.org/eprints/ticket/3867]&lt;br /&gt;
&lt;br /&gt;
Make a directory (in this example I'm subclassing a Screen plugin):&lt;br /&gt;
 ~/archives/ARCHIVEID/cfg/plugins/EPrints/Plugins/Screen&lt;br /&gt;
&lt;br /&gt;
copy the original plugin to this location, with a new name:&lt;br /&gt;
 cp ~/perl_lib/EPrints/Plugin/Screen/Items.pm ~/archives/ARCHIVEID/cfg/plugins/EPrints/Plugins/Screen/MyItems.pm&lt;br /&gt;
&lt;br /&gt;
From the file, remove any subs that you don't want to redefine, and rename the package according to the name of the new file (in this example, I'm only redefining the 'render' sub).&lt;br /&gt;
The file should look a bit like this:&lt;br /&gt;
 package EPrints::Plugin::Screen::MyItems;&lt;br /&gt;
 @ISA = ( 'EPrints::Plugin::Screen::Items' );&lt;br /&gt;
 &lt;br /&gt;
 use strict;&lt;br /&gt;
 &lt;br /&gt;
 sub render&lt;br /&gt;
 {&lt;br /&gt;
     my( $self ) = @_;&lt;br /&gt;
     my $session = $self-&amp;gt;{session};&lt;br /&gt;
 ...&lt;br /&gt;
 ...&lt;br /&gt;
 } #end of sub render&lt;br /&gt;
&lt;br /&gt;
Then, add the following lines to the ~/archives/ARCHIVEID/cfg/cfg.d/plugins.pl file:&lt;br /&gt;
 $c-&amp;gt;{plugin_alias_map}-&amp;gt;{&amp;quot;Screen::Items&amp;quot;} = &amp;quot;Screen::MyItems&amp;quot;;&lt;br /&gt;
 $c-&amp;gt;{plugin_alias_map}-&amp;gt;{&amp;quot;Screen::MyItems&amp;quot;} = undef;&lt;br /&gt;
This makes calls to Screens::Items go via your new version - which has the locally defined sub (render in this case), and also makes sure that your new version doesn't appear alongside the original version.&lt;br /&gt;
I have found that running ~/bin/epadmin reload ARCHIVEID doesn't always pick these changes up - you might need to restart Apache to see what you've done!&lt;/div&gt;</summary>
		<author><name>Libjlrs@leeds.ac.uk</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=Instructions_for_local_plugins&amp;diff=9537</id>
		<title>Instructions for local plugins</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Instructions_for_local_plugins&amp;diff=9537"/>
		<updated>2010-10-19T09:50:12Z</updated>

		<summary type="html">&lt;p&gt;Libjlrs@leeds.ac.uk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Plugins]]&lt;br /&gt;
See also: [[Tips_to_write_plugins]]&lt;br /&gt;
&lt;br /&gt;
To change the functionality of a core plugin within a specific archive, you can make a subclass of the original package.&lt;br /&gt;
'''NOTE:''' If you are on 3.2.0-3.2.3 there is a bug in plugin factory that may cause local customisation to plugins to bleed between archives. Ticket is here: [http://trac.eprints.org/eprints/ticket/3867]&lt;br /&gt;
&lt;br /&gt;
Make a directory (in this example I'm subclassing a Screen plugin):&lt;br /&gt;
 ~/archives/ARCHIVEID/cfg/plugins/EPrints/Plugins/Screen&lt;br /&gt;
&lt;br /&gt;
copy the original plugin to this location, with a new name:&lt;br /&gt;
 cp ~/perl_lib/EPrints/Plugin/Screen/Items.pm ~/archives/ARCHIVEID/cfg/plugins/EPrints/Plugins/Screen/MyItems.pm&lt;br /&gt;
&lt;br /&gt;
From the file, remove any subs that you don't want to redefine, and rename the package according to the name of the new file (in this example, I'm only redefining the 'render' sub).&lt;br /&gt;
The file should look a bit like this:&lt;br /&gt;
 package EPrints::Plugin::Screen::MyItems;&lt;br /&gt;
 @ISA = ( 'EPrints::Plugin::Screen::Items' );&lt;br /&gt;
 &lt;br /&gt;
 use strict;&lt;br /&gt;
 &lt;br /&gt;
 sub render&lt;br /&gt;
 {&lt;br /&gt;
     my( $self ) = @_;&lt;br /&gt;
     my $session = $self-&amp;gt;{session};&lt;br /&gt;
 ...&lt;br /&gt;
 ...&lt;br /&gt;
 } #end of sub render&lt;br /&gt;
&lt;br /&gt;
Then, add the following lines to the ~/archives/ARCHIVEID/cfg/cfg.d/plugins.pl file:&lt;br /&gt;
 $c-&amp;gt;{plugin_alias_map}-&amp;gt;{&amp;quot;Screen::Items&amp;quot;} = &amp;quot;Screen::MyItems&amp;quot;;&lt;br /&gt;
 $c-&amp;gt;{plugin_alias_map}-&amp;gt;{&amp;quot;Screen::MyItems&amp;quot;} = undef;&lt;br /&gt;
This makes calls to Screens::Items go via your new version - which has the locally defined sub (render in this case), and also makes sure that your new version doesn't appear alongside the original version.&lt;br /&gt;
I have found that running ~/bin/epadmin reload ARCHIVEID doesn't always pick these changes up - you might need to restart Apache to see what you've done!&lt;/div&gt;</summary>
		<author><name>Libjlrs@leeds.ac.uk</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=Instructions_for_local_plugins&amp;diff=9535</id>
		<title>Instructions for local plugins</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Instructions_for_local_plugins&amp;diff=9535"/>
		<updated>2010-10-18T15:00:42Z</updated>

		<summary type="html">&lt;p&gt;Libjlrs@leeds.ac.uk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Plugins]]&lt;br /&gt;
See also: [[Tips_to_write_plugins]]&lt;br /&gt;
&lt;br /&gt;
To change the functionality of a core plugin within a specific archive, you can make a subclass of the original package.&lt;br /&gt;
&lt;br /&gt;
Make a directory (in this example I'm subclassing a Screen plugin):&lt;br /&gt;
 ~/archives/ARCHIVEID/cfg/plugins/EPrints/Plugins/Screen&lt;br /&gt;
&lt;br /&gt;
copy the original plugin to this location, with a new name:&lt;br /&gt;
 cp ~/perl_lib/EPrints/Plugin/Screen/Items.pm ~/archives/ARCHIVEID/cfg/plugins/EPrints/Plugins/Screen/MyItems.pm&lt;br /&gt;
&lt;br /&gt;
From the file, remove any subs that you don't want to redefine, and rename the package according to the name of the new file (in this example, I'm only redefining the 'render' sub).&lt;br /&gt;
The file should look a bit like this:&lt;br /&gt;
 package EPrints::Plugin::Screen::MyItems;&lt;br /&gt;
 @ISA = ( 'EPrints::Plugin::Screen::Items' );&lt;br /&gt;
 &lt;br /&gt;
 use strict;&lt;br /&gt;
 &lt;br /&gt;
 sub render&lt;br /&gt;
 {&lt;br /&gt;
     my( $self ) = @_;&lt;br /&gt;
     my $session = $self-&amp;gt;{session};&lt;br /&gt;
 ...&lt;br /&gt;
 ...&lt;br /&gt;
 } #end of sub render&lt;br /&gt;
&lt;br /&gt;
Then, add the following lines to the ~/archives/ARCHIVEID/cfg/cfg.d/plugins.pl file:&lt;br /&gt;
 $c-&amp;gt;{plugin_alias_map}-&amp;gt;{&amp;quot;Screen::Items&amp;quot;} = &amp;quot;Screen::MyItems&amp;quot;;&lt;br /&gt;
 $c-&amp;gt;{plugin_alias_map}-&amp;gt;{&amp;quot;Screen::MyItems&amp;quot;} = undef;&lt;br /&gt;
This makes calls to Screens::Items go via your new version - which has the locally defined sub (render in this case), and also makes sure that your new version doesn't appear alongside the original version.&lt;br /&gt;
I have found that running ~/bin/epadmin reload ARCHIVEID doesn't always pick these changes up - you might need to restart Apache to see what you've done!&lt;/div&gt;</summary>
		<author><name>Libjlrs@leeds.ac.uk</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=Instructions_for_local_plugins&amp;diff=9534</id>
		<title>Instructions for local plugins</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Instructions_for_local_plugins&amp;diff=9534"/>
		<updated>2010-10-18T11:15:59Z</updated>

		<summary type="html">&lt;p&gt;Libjlrs@leeds.ac.uk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Plugins]]&lt;br /&gt;
See also: [[Tips_to_write_plugins]]&lt;br /&gt;
&lt;br /&gt;
To change the functionality of a core plugin within a specific archive, you can make a subclass of the original package.&lt;br /&gt;
&lt;br /&gt;
Make a directory (in this example I'm subclassing a Screen plugin):&lt;br /&gt;
 ~/archives/ARCHIVEID/cfg/plugins/EPrints/Plugins/Screen&lt;br /&gt;
&lt;br /&gt;
copy the original plugin to this location, with a new name:&lt;br /&gt;
 cp ~/perl_lib/EPrints/Plugin/Screen/Items.pm ~/archives/ARCHIVEID/cfg/plugins/EPrints/Plugins/Screen/MyItems.pm&lt;br /&gt;
&lt;br /&gt;
From the file, remove any subs that you don't need, and rename the package according to the name of the new file (in this example, I'm only redefining the 'render' sub).&lt;br /&gt;
The file should look a bit like this:&lt;br /&gt;
 package EPrints::Plugin::Screen::MyItems;&lt;br /&gt;
 @ISA = ( 'EPrints::Plugin::Screen::Items' );&lt;br /&gt;
 &lt;br /&gt;
 use strict;&lt;br /&gt;
 &lt;br /&gt;
 sub render&lt;br /&gt;
 {&lt;br /&gt;
     my( $self ) = @_;&lt;br /&gt;
     my $session = $self-&amp;gt;{session};&lt;br /&gt;
 ...&lt;br /&gt;
 ...&lt;br /&gt;
 } #end of sub render&lt;/div&gt;</summary>
		<author><name>Libjlrs@leeds.ac.uk</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=Instructions_for_local_plugins&amp;diff=9533</id>
		<title>Instructions for local plugins</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Instructions_for_local_plugins&amp;diff=9533"/>
		<updated>2010-10-18T11:15:43Z</updated>

		<summary type="html">&lt;p&gt;Libjlrs@leeds.ac.uk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Plugins]]&lt;br /&gt;
See also: [[Tips_to_write_plugins]]&lt;br /&gt;
To change the functionality of a core plugin within a specific archive, you can make a subclass of the original package.&lt;br /&gt;
&lt;br /&gt;
Make a directory (in this example I'm subclassing a Screen plugin):&lt;br /&gt;
 ~/archives/ARCHIVEID/cfg/plugins/EPrints/Plugins/Screen&lt;br /&gt;
&lt;br /&gt;
copy the original plugin to this location, with a new name:&lt;br /&gt;
 cp ~/perl_lib/EPrints/Plugin/Screen/Items.pm ~/archives/ARCHIVEID/cfg/plugins/EPrints/Plugins/Screen/MyItems.pm&lt;br /&gt;
&lt;br /&gt;
From the file, remove any subs that you don't need, and rename the package according to the name of the new file (in this example, I'm only redefining the 'render' sub).&lt;br /&gt;
The file should look a bit like this:&lt;br /&gt;
 package EPrints::Plugin::Screen::MyItems;&lt;br /&gt;
 @ISA = ( 'EPrints::Plugin::Screen::Items' );&lt;br /&gt;
 &lt;br /&gt;
 use strict;&lt;br /&gt;
 &lt;br /&gt;
 sub render&lt;br /&gt;
 {&lt;br /&gt;
     my( $self ) = @_;&lt;br /&gt;
     my $session = $self-&amp;gt;{session};&lt;br /&gt;
 ...&lt;br /&gt;
 ...&lt;br /&gt;
 } #end of sub render&lt;/div&gt;</summary>
		<author><name>Libjlrs@leeds.ac.uk</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=Instructions_for_local_plugins&amp;diff=9532</id>
		<title>Instructions for local plugins</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Instructions_for_local_plugins&amp;diff=9532"/>
		<updated>2010-10-18T11:03:48Z</updated>

		<summary type="html">&lt;p&gt;Libjlrs@leeds.ac.uk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Plugins]]&lt;br /&gt;
To change the functionality of a core plugin within a specific archive, you can make a subclass of the original package.&lt;br /&gt;
&lt;br /&gt;
Make a directory (in this example I'm subclassing a Screen plugin):&lt;br /&gt;
 ~/archives/ARCHIVEID/cfg/plugins/EPrints/Plugins/Screen&lt;br /&gt;
&lt;br /&gt;
copy the original plugin to this location, with a new name:&lt;br /&gt;
 cp ~/perl_lib/EPrints/Plugin/Screen/Items.pm ~/archives/ARCHIVEID/cfg/plugins/EPrints/Plugins/Screen/MyItems.pm&lt;br /&gt;
&lt;br /&gt;
From the file, remove any subs that you don't need, and rename the package according to the name of the new file (in this example, I'm only redefining the 'render' sub).&lt;br /&gt;
The file should look a bit like this:&lt;br /&gt;
 package EPrints::Plugin::Screen::MyItems;&lt;br /&gt;
 @ISA = ( 'EPrints::Plugin::Screen::Items' );&lt;br /&gt;
 &lt;br /&gt;
 use strict;&lt;br /&gt;
 &lt;br /&gt;
 sub render&lt;br /&gt;
 {&lt;br /&gt;
     my( $self ) = @_;&lt;br /&gt;
     my $session = $self-&amp;gt;{session};&lt;br /&gt;
 ...&lt;br /&gt;
 ...&lt;br /&gt;
 } #end of sub render&lt;/div&gt;</summary>
		<author><name>Libjlrs@leeds.ac.uk</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=Instructions_for_local_plugins&amp;diff=9531</id>
		<title>Instructions for local plugins</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Instructions_for_local_plugins&amp;diff=9531"/>
		<updated>2010-10-18T11:01:51Z</updated>

		<summary type="html">&lt;p&gt;Libjlrs@leeds.ac.uk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Plugins]]&lt;br /&gt;
To change the functionality of a core plugin within a specific archive, you can make a subclass of the original package.&lt;br /&gt;
&lt;br /&gt;
Make a directory (in this example I'm subclassing a Screen plugin):&lt;br /&gt;
 ~/archives/ARCHIVEID/cfg/plugins/EPrints/Plugins/Screen&lt;br /&gt;
&lt;br /&gt;
copy the original plugin to this location, with a new name:&lt;br /&gt;
 cp ~/perl_lib/EPrints/Plugin/Screen/Items.pm ~/archives/ARCHIVEID/cfg/plugins/EPrints/Plugins/Screen/MyItems.pm&lt;br /&gt;
&lt;br /&gt;
From the file, remove any subs that you don't need, and rename the package according to the name of the new file (in this example, I'm only redefining the 'render' sub).&lt;br /&gt;
The file should look a bit like this:&lt;br /&gt;
 package EPrints::Plugin::Screen::MyItems;&lt;br /&gt;
 @ISA = qw/ EPrints::Plugin::Screen::Items /;&lt;br /&gt;
 &lt;br /&gt;
 use strict;&lt;br /&gt;
 &lt;br /&gt;
 sub render&lt;br /&gt;
 {&lt;br /&gt;
     my( $self ) = @_;&lt;br /&gt;
     my $session = $self-&amp;gt;{session};&lt;br /&gt;
 ...&lt;br /&gt;
 ...&lt;br /&gt;
 } #end of sub render&lt;/div&gt;</summary>
		<author><name>Libjlrs@leeds.ac.uk</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=Instructions_for_local_plugins&amp;diff=9530</id>
		<title>Instructions for local plugins</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Instructions_for_local_plugins&amp;diff=9530"/>
		<updated>2010-10-18T11:01:23Z</updated>

		<summary type="html">&lt;p&gt;Libjlrs@leeds.ac.uk: new page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Plugins]]&lt;br /&gt;
To change the functionality of a core plugin within a specific archive, you can make a subclass of the original package.&lt;br /&gt;
&lt;br /&gt;
Make a directory (in this example I'm subclassing a Screen plugin):&lt;br /&gt;
 ~/archives/ARCHIVEID/cfg/plugins/EPrints/Plugins/Screen&lt;br /&gt;
&lt;br /&gt;
copy the original plugin to this location, with a new name:&lt;br /&gt;
 cp ~/perl_lib/EPrints/Plugin/Screen/Items.pm ~/archives/ARCHIVEID/cfg/plugins/EPrints/Plugins/Screen/MyItems.pm&lt;br /&gt;
&lt;br /&gt;
From the file, remove any subs that you don't need, and rename the package according to the name of the new file (in this example, I'm only redefining the 'render' sub).&lt;br /&gt;
The file should look a bit like this:&lt;br /&gt;
 package EPrints::Plugin::Screen::MyItems;&lt;br /&gt;
 @ISA = qw/ EPrints::Plugin::Screen::Items /;&lt;br /&gt;
&lt;br /&gt;
 use strict;&lt;br /&gt;
 &lt;br /&gt;
 sub render&lt;br /&gt;
 {&lt;br /&gt;
     my( $self ) = @_;&lt;br /&gt;
     my $session = $self-&amp;gt;{session};&lt;br /&gt;
 ...&lt;br /&gt;
 ...&lt;br /&gt;
 } #end of sub render&lt;/div&gt;</summary>
		<author><name>Libjlrs@leeds.ac.uk</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=Tips_to_write_plugins&amp;diff=9529</id>
		<title>Tips to write plugins</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Tips_to_write_plugins&amp;diff=9529"/>
		<updated>2010-10-18T10:49:25Z</updated>

		<summary type="html">&lt;p&gt;Libjlrs@leeds.ac.uk: added link to new instructrions page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Plugins]]&lt;br /&gt;
I've written a lot of plugins for EPrints 3+ now and so i think its time to share the knowledge. If you care you can read about the mess I got into in the early days [http://blogs.ecs.soton.ac.uk/oneshare/2009/09/25/taking-stock-and-mopping-up-the-mess-i-made-of-eprints/ here].&lt;br /&gt;
&lt;br /&gt;
So without further ado let me give you the top 10 ways to avoid making a hash of your EPrints install when doing a large customization:&lt;br /&gt;
&lt;br /&gt;
* Rule 1: NEVER edit Session.pm if there is one file that you will absolutely not recover from it’s this. also there is an easy way to avoid editing it see rule 6.&lt;br /&gt;
&lt;br /&gt;
* Rule 2: Don’t edit anything in perl_lib/EPrints. Make copies with a new name and new package. That way these files wont be over written when you upgrade.&lt;br /&gt;
&lt;br /&gt;
* Rule 3: Everything in the Plugin/ directory which you do should be kept in the appropiate place in archives/YOUR_REPOSITORY/cfg/plugins/EPrints/Plugin etc. This is a really good way to keep track of what you’ve actually done.&lt;br /&gt;
&lt;br /&gt;
* Rule 4: Everything you do should be a plugin. EPrints has plugins for almost everything which means you should be able to do almost all funtionality in plugins. See [[Instructions for local plugins]]&lt;br /&gt;
&lt;br /&gt;
* Rule 5: For everything you want to do which doesn't seem to be a plugin think really hard. Are you SURE it’s not a plugin? Really SURE? Are you SURE you need this functionality? Really SURE?&lt;br /&gt;
&lt;br /&gt;
* Rule 6: If you have followed rule 5 and you are still really sure then kludge a plugin, a kuldgin as I like to call them, using namespace over writing. This is feature/artifact of perl, from one package you can write in another package. Add methods to the DataObj::EPrint good example of where you might want to do this. To do it :&lt;br /&gt;
&lt;br /&gt;
make a Plugin (yes  a plugin) in your local cfg (see rule 3). start the plugin file in the normal way:&lt;br /&gt;
 package EPrints::Plugin::MyPlugin;&lt;br /&gt;
 use strict;&lt;br /&gt;
 our @ISA = qw/ EPrints::Plugin /;&lt;br /&gt;
 #now for the clever bit&lt;br /&gt;
 package EPrints::DataObj::EPrint;&lt;br /&gt;
 sub mysubroutine{&lt;br /&gt;
  return(”foo”);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
That has added mysubroutine to DataObj::EPrint so you can now&lt;br /&gt;
&lt;br /&gt;
 my $eprint = EPrint::DataObj::EPrint-&amp;gt;new($session, 23); #get eprint 23&lt;br /&gt;
 print $eprint-&amp;gt;mysubroutine(); #prints “foo”&lt;br /&gt;
&lt;br /&gt;
* Rule 7: learn about cfg/cfg.d/plugins.pl. This file lets you disable plugins you dont want to use or map you modified plugins over other plugins. For example use MyReview.pm everywhere you would usually use Review.pm – very powerful. It also lets you define where plugins apear around about the place.&lt;br /&gt;
&lt;br /&gt;
* Rule 8: for plugins which use a cgi script for whatever reason (usually ajax) make a directory in cgi which has the same name as the plugin for example cgi/myfirstplugin where all the cgi used by MyFirstPlugin.pm can be found. It makes it much easier to see what youve done and if you want to deploy the plugin somewhere else you grab the plugin file and the directory and you well on the way.&lt;br /&gt;
&lt;br /&gt;
* Rule 9: Give each plugin its own phrase file. I got into a hidious mess where my zz_local.xml phrase file was about a 4000 lines long and it wasnt clear what phrases belonged to what plugin.&lt;br /&gt;
&lt;br /&gt;
* Rule 10: If your plugin needs configuring put all the config options in a cfg/cfg.d/my_plugins_config_options.pl that way the user only has to go to one place edit the options and different repositories using the same plugin can have different options.&lt;br /&gt;
&lt;br /&gt;
In conclusion obey rules 1-10. If I’d known this stuff when I’d started we probably wouldnt have needed the first 6 months of the OneShare project.&lt;/div&gt;</summary>
		<author><name>Libjlrs@leeds.ac.uk</name></author>
		
	</entry>
</feed>