[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[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 at 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 at ecs.soton.ac.uk<mailto:drn at ecs.soton.ac.uk>>
Sent: March 16, 2023 8:35 PM
To: eprints-tech at ecs.soton.ac.uk<mailto:eprints-tech at ecs.soton.ac.uk>; Tomasz Neugebauer <Tomasz.Neugebauer at concordia.ca<mailto:Tomasz.Neugebauer at 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: https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.eprints.org%2Ftech.php%2F&data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Ccd8bd4ef2b18424643fb08db410b18de%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638175288274419536%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000%7C%7C%7C&sdata=d5Xz1UCQE6ivL7epKC4mKApWRwyNTV%2FP03%2B3kUPKl1k%3D&reserved=0
*** EPrints community wiki: https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwiki.eprints.org%2F&data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Ccd8bd4ef2b18424643fb08db410b18de%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638175288274419536%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000%7C%7C%7C&sdata=LU8aIEG2gsOyZGsg72xUWfd3UceNUIHxhxzlFKEkzwI%3D&reserved=0
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20230419/0d47a3a0/attachment-0001.html