[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[EP-tech] Re: migrating customised code when upgrading 3.1.0 -> 3.3.10



On Tue, 2013-01-22 at 13:05 +1100, Matthew Brady wrote:

> In previous versions (3.1.x),  there used to be a line in the
> file /opt/eprints3/archives/<repoid>/cfg/cfg.d/eprint_render.pl
> 
>  
> 
>        my @documents = $eprint->get_all_documents();
> 
>  
> 
> Which could be replaced to allow supporting documents etc., related to
> the eprint item, to be stored but not made visible on abstract pages
> etc..  
> 
>        my @documents = ();
>        foreach my $doc ( $eprint->get_all_documents() )
>        {
>              next if $doc->get_value( "security" ) eq "nonvisible";
>              push @documents, $doc;
>        }
> 
>  
> 
> Does anyone know of a way to do this in 3.3.10?

Hi,

get_all_documents() has never changed but rendering has been moved into
the XML, which allows you to customise the abstract page without having
to hack in Perl. NB that doesn't mean you have to use XML, you can still
do your rendering in Perl and pass it as a fragment to the XML.

So from this (in citations/eprint/summary_page.xml):

            <epc:foreach expr="$docs" iterator="doc">
                <epc:print expr="$doc.citation('eprint_page', 'eprint',
$item)" />
            </epc:foreach>

To this:

            <epc:foreach expr="$docs" iterator="doc">
<epc:if test="$doc.security != 'nonvisible'">
                <epc:print expr="$doc.citation('eprint_page', 'eprint',
$item)" />
</epc:if>
            </epc:foreach>

?

-- 
All the best,
Tim
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: This is a digitally signed message part
Url : http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20130122/5cdfb7e7/attachment.bin