<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.apple-tab-span
        {mso-style-name:apple-tab-span;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-GB" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">&gt;</span> I would suggest disabling the plugin in its 'new' function<o:p></o:p></p>
<p class="MsoNormal">This isn’t a good option. When installing extensions from the Bazaar, people often forget to do this – which means installing anything on a multiple-archive setup is *<b>dangerous</b>*...<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">I’ve tried to trace the ‘disable’ param through EPrints::PluginFactory – but nothing looks out of place.<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">I’d suggest that this is a priority to get fixed in EPrints core.<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">Cheers,<o:p></o:p></p>
<p class="MsoNormal">John<o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"> eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk]
<b>On Behalf Of </b>Adam Field<br>
<b>Sent:</b> 02 November 2015 13:22<br>
<b>To:</b> eprints-tech@ecs.soton.ac.uk<br>
<b>Subject:</b> [EP-tech] Re: Plugins: enabled by default?<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">Hi<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal"><span class="apple-tab-span">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>Yes, I've noticed this too, recently. &nbsp;It used to be the case but doesn't seem to be any more. &nbsp;I would suggest disabling the plugin in its 'new' function, and enabling it in the local configuration.
 &nbsp;See&nbsp;<a href="http://bazaar.eprints.org/393/1/plugins/EPrints/Plugin/Export/Hello.pm">http://bazaar.eprints.org/393/1/plugins/EPrints/Plugin/Export/Hello.pm</a>&nbsp;and&nbsp;<span class="apple-tab-span">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><a href="http://bazaar.eprints.org/393/1/epm/hello_test/cfg/cfg.d/z_hello.pl">http://bazaar.eprints.org/393/1/epm/hello_test/cfg/cfg.d/z_hello.pl</a>&nbsp;(the bazaar package I wrote for a training video).<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<div>
<div>
<div>
<div>
<p class="MsoNormal"><span style="color:black">--<br>
Adam Field<br>
Business Relationship Manager and Community Lead<br>
EPrints Services<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="color:black"><o:p>&nbsp;</o:p></span></p>
</div>
</div>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<div>
<div>
<p class="MsoNormal">On 2 Nov 2015, at 12:39, John Salter &lt;<a href="mailto:J.Salter@leeds.ac.uk">J.Salter@leeds.ac.uk</a>&gt; wrote:<o:p></o:p></p>
</div>
<p class="MsoNormal"><br>
<br>
<o:p></o:p></p>
<p class="MsoNormal">Hi,<br>
Just trying to verify (or otherwise) my understanding of plugins and disabling/enabling them.<br>
From: <a href="http://wiki.eprints.org/w/New_Features_in_EPrints_3.3#EPrints_Bazaar">
http://wiki.eprints.org/w/New_Features_in_EPrints_3.3#EPrints_Bazaar</a><br>
&quot;By default plugins installed in lib/plugins will be disabled and hence can be enabled on a per-repository basis.&quot;<br>
<br>
On our test repository (3.3.10), we're not seeing this - things in ~/lib/plugins/... seem to be enabled for all archives.<br>
This causes a problem when a plugin references a field that doesn't exist for a dataobj.<br>
<br>
Can anyone verify that their install works as expected:<br>
Is a plugin in ~/lib/plugins/... available without being specifically enabled in the archive's cfg.d?<br>
<br>
<br>
<o:p></o:p></p>
<p class="MsoNormal">From the code below, you can create two screen plugins:<o:p></o:p></p>
<p class="MsoNormal">PluginTestA: &nbsp;should be disabled by default, but appears to be active when visiting:
<a href="http://your_repo/cgi/users/home?screen=PluginTestA">http://your_repo/cgi/users/home?screen=PluginTestA</a><br>
PluginTestB: should also be disabled - and seems to work correctly: <a href="http://your_repo/cgi/users/home?screen=PluginTestB">
http://your_repo/cgi/users/home?screen=PluginTestB</a> gives an error.<br>
<br>
PluginTestA can be disabled by adding archive-level config (e.g. to ~/archives/ARCHIVEID/cfg/cfg.d/z_plugin_test.pl):<br>
$c-&gt;{plugins}-&gt;{&quot;Screen::PluginTestA&quot;}-&gt;{params}-&gt;{disable} = 1;<br>
but my understanding is that it should be disabled by default, and explicitly enabled when needed.<br>
<br>
If you can test this, I'd appreciate it. Might be worth including the version of EPrints you're running too.<br>
Cheers,<br>
John<br>
<br>
<br>
~/lib/plugins/EPrints/Plugin/Screen/PluginTestA.pm<br>
####################################################################<br>
package EPrints::Plugin::Screen::PluginTestA;<br>
<br>
our @ISA = ( 'EPrints::Plugin::Screen' );<br>
<br>
use strict;<br>
<br>
sub new<br>
{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;my( $class, %params ) = @_;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;my $self = $class-&gt;SUPER::new(%params);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return $self;<br>
}<br>
<br>
sub render<br>
{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;my( $self ) = @_;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;my $repo = $self-&gt;{repository};<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;my $page = $repo-&gt;xml-&gt;create_element( &quot;div&quot; );<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$page-&gt;appendChild( $repo-&gt;xml-&gt;create_text_node( &quot;This should be disabled by default&quot; ) );<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return $page;<br>
}<br>
<br>
sub render_title<br>
{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;my( $self ) = @_;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;my $f = $self-&gt;{repository}-&gt;make_doc_fragment;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$f-&gt;appendChild( $self-&gt;{repository}-&gt;xml-&gt;create_text_node( &quot;This is: PluginTestA&quot; ) );<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return $f;<br>
}<br>
1;<br>
####################################################################<br>
<br>
~/lib/plugins/EPrints/Plugin/Screen/PluginTestB.pm<br>
####################################################################<br>
package EPrints::Plugin::Screen::PluginTestB;<br>
<br>
our @ISA = ( 'EPrints::Plugin::Screen' );<br>
<br>
use strict;<br>
<br>
sub new<br>
{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;my( $class, %params ) = @_;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;my $self = $class-&gt;SUPER::new(%params);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$self-&gt;{disable} = 1;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return $self;<br>
}<br>
<br>
sub render<br>
{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;my( $self ) = @_;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;my $repo = $self-&gt;{repository};<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;my $page = $repo-&gt;xml-&gt;create_element( &quot;div&quot; );<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$page-&gt;appendChild( $repo-&gt;xml-&gt;create_text_node( &quot;This is explicitly disabled&quot; ) );<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return $page;<br>
}<br>
<br>
sub render_title<br>
{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;my( $self ) = @_;<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;my $f = $self-&gt;{repository}-&gt;make_doc_fragment;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$f-&gt;appendChild( $self-&gt;{repository}-&gt;xml-&gt;create_text_node( &quot;This is: PluginTestB&quot; ) );<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return $f;<br>
}<br>
1;<br>
####################################################################<br>
<br>
<br>
*** Options: <a href="http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech">
http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech</a><br>
*** Archive: <a href="http://www.eprints.org/tech.php/">http://www.eprints.org/tech.php/</a><br>
*** EPrints community wiki: <a href="http://wiki.eprints.org/">http://wiki.eprints.org/</a><br>
*** EPrints developers Forum: <a href="http://forum.eprints.org/">http://forum.eprints.org/</a><o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
</div>
</body>
</html>