<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://wiki.ext-9.eprints-hosting.org/w/index.php?action=history&amp;feed=atom&amp;title=Doc_rewrite.pl</id>
	<title>Doc rewrite.pl - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.ext-9.eprints-hosting.org/w/index.php?action=history&amp;feed=atom&amp;title=Doc_rewrite.pl"/>
	<link rel="alternate" type="text/html" href="https://wiki.ext-9.eprints-hosting.org/w/index.php?title=Doc_rewrite.pl&amp;action=history"/>
	<updated>2026-05-10T09:38:48Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.6</generator>
	<entry>
		<id>https://wiki.ext-9.eprints-hosting.org/w/index.php?title=Doc_rewrite.pl&amp;diff=14482&amp;oldid=prev</id>
		<title>Drn@ecs.soton.ac.uk: Added page about config file</title>
		<link rel="alternate" type="text/html" href="https://wiki.ext-9.eprints-hosting.org/w/index.php?title=Doc_rewrite.pl&amp;diff=14482&amp;oldid=prev"/>
		<updated>2022-02-04T10:20:40Z</updated>

		<summary type="html">&lt;p&gt;Added page about config file&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{dirs}}&lt;br /&gt;
{{cfgd}}&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;doc_rewrite.pl&amp;#039;&amp;#039;&amp;#039; contains an &amp;#039;&amp;#039;&amp;#039;EP_TRIGGER_DOC_URL_REWRITE&amp;#039;&amp;#039;&amp;#039; trigger to take the request document URL and ensure the right version is returned based on the relationship (to the original document) supplied in the call.  E.g. Returning the thumbnail preview of the document.&lt;br /&gt;
== Example ==&lt;br /&gt;
 $c-&amp;gt;add_trigger( EP_TRIGGER_DOC_URL_REWRITE, sub {&lt;br /&gt;
   my( %args ) = @_;&lt;br /&gt;
 &lt;br /&gt;
   my( $request, $doc, $relations, $filename ) = @args{qw( request document relations filename )};&lt;br /&gt;
 &lt;br /&gt;
   foreach my $r (@$relations)&lt;br /&gt;
   {&lt;br /&gt;
     $r =~ s/^has(.+)$/is$1Of/;&lt;br /&gt;
     $doc = $doc-&amp;gt;search_related( $r )-&amp;gt;item( 0 );&lt;br /&gt;
     if( !defined $doc )&lt;br /&gt;
     {&lt;br /&gt;
       $request-&amp;gt;status( 404 );&lt;br /&gt;
       return EP_TRIGGER_DONE;&lt;br /&gt;
     }&lt;br /&gt;
     $filename = $doc-&amp;gt;get_main;&lt;br /&gt;
   }&lt;br /&gt;
 &lt;br /&gt;
   $request-&amp;gt;pnotes( dataobj =&amp;gt; $doc );&lt;br /&gt;
   $request-&amp;gt;pnotes( filename =&amp;gt; $filename );&lt;br /&gt;
 }, priority =&amp;gt; 100 );&lt;/div&gt;</summary>
		<author><name>Drn@ecs.soton.ac.uk</name></author>
	</entry>
</feed>