EPrints Technical Mailing List Archive

See the EPrints wiki for instructions on how to join this mailing list and related information.

Message: #09284


< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First

Re: [EP-tech] core recommender on the "preview"


CAUTION: This e-mail originated outside the University of Southampton.

A quick update on this, the can_be_viewed function below created issues for when I ran generate_abstracts from the cron/CMD.

The reason was that get_request is undefined when it runs into this function from the generate_abstracts.

I fixed it like this:

 

sub can_be_viewed {

          my( $self ) = @_;

    my $repository = $self->{repository};

          if (defined $repository->get_request){

                   return 0 if $repository->get_request->uri =~ "/cgi/users/home";

          }

          return 1;

          }

 

Tomasz

 

 

 

 

From: Tomasz Neugebauer
Sent: March 17, 2023 4:12 PM
To: eprints-tech@ecs.soton.ac.uk
Subject: RE: [EP-tech] core recommender on the "preview"

 

Thank you, that worked nicely.

I ended up having to change the CoreRecommender.pm file that’s part of the bazaar package, so I’ll have to deal with it if ever the CoreRecommender bazaar is updated, but so be it.

I added this to remove it from the “preview” screen:

 

sub can_be_viewed {

          my( $self ) = @_;

    my $repository = $self->{repository};

          return 0 if $repository->get_request->uri =~ "/cgi/users/home";

          return 1;

          }

         

Tomasz

 

 

From: David R Newman <drn@ecs.soton.ac.uk>
Sent: March 16, 2023 8:35 PM
To: eprints-tech@ecs.soton.ac.uk; Tomasz Neugebauer <Tomasz.Neugebauer@concordia.ca>
Subject: Re: [EP-tech] core recommender on the "preview"

 

Attention This email originates from outside the concordia.ca domain. // Ce courriel provient de l'extérieur du domaine de concordia.ca

 

 

Hi Tomasz,

Originally no box plugins would not appear in the preview tab but this was done in a rather hacky way which checked to see whether the request was over HTTPS or not.  Since people have moved to predominantly using HTTPS, this caused issues with box plugins not appearing on abstract pages if when they were cached they were requested over HTTPS.

Due to this and that probably the main reason box plugins were set not shown in the preview tab was because of the historic lack of width in this tab making the previews with box plugins not a reflective of what the abstract page would ultimately look like.  It was decided that previews in recent versions of 3.4 should include box plugins.

If you wanted to disable a particular plugin from appearing in a preview you would need to edit the box plugin's can_be_viewed function.  I have found that the following line works if put above the "return 1;" line:

return 0 if $self->{repository}->{request}->uri =~ "/cgi/users/home";

Regards

David Newman

On 16/03/2023 11:13 pm, Tomasz Neugebauer via Eprints-tech wrote:

CAUTION: This e-mail originated outside the University of Southampton.

Does anyone know how to disappear the core recommender from the “preview” panels?

The core recommender is great on the abstract pages, but they can be confusing to depositors when it appears on the “preview” while the item is being deposited/edited.

 

Tomasz

 

 

 

*** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
*** Archive: http://www.eprints.org/tech.php/
*** EPrints community wiki: http://wiki.eprints.org/