EPrints Technical Mailing List Archive

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

Message: #06511


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

Re: [EP-tech] Altering Creator Browse


Okay,

So, if you look at https://github.com/eprints/eprints/blob/3.3/lib/defaultcfg/cfg.d/views.pl you can see that it has

$c->{browse_views} = [

on line 21 which opens an array of view definitions, each of which is bounded by {} (e.g. line 22 and 37, don’t forget about the comma separating the view definitions either).

Now on line 94 the last definition closes ( with }, ) and then on line 95 the array which was set up at line 21 closes ( with ]; )

If you put the new view definition between lines 94 and 95 on what is otherwise a default install, restart apache and regenerate the views (from the admin system tools screen) it should create the new person browse view, and as John says they should be at http://domain.name/view/person

 

If it’s still throwing the process distinctby error check if your creators_id and editors_id fields are defined as the same data type – in eprints cfg.d and on the mysql server.

 

Alan

 

 

 

From: eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk] On Behalf Of Andrew Beeken
Sent: 16 May 2017 15:11
To: eprints-tech@ecs.soton.ac.uk
Subject: Re: [EP-tech] Altering Creator Browse

 

Yes, however I know there were some fiddles made within the database to include a “non-users” table which I think this particular change references. This has led to some issues updating things as bespoke functions and non-standard database tables have been wiped out. It’s complicated!

 

I will check the views.pl, though, and see if there’s anything I can salvage. I was hoping to tackle it from scratch though to avoid repeating past mistakes.

 

From: eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk] On Behalf Of Alan.Stiles
Sent: 16 May 2017 14:49
To:
eprints-tech@ecs.soton.ac.uk
Subject: Re: [EP-tech] Altering Creator Browse

 

Sorry – slight mis-type on my part – I meant views.pl throughout.

 

You appear to have a working creators view on your live system : http://eprints.lincoln.ac.uk/view/creators/  which includes a view of possibly your stuff under the id 3762 ?

http://eprints.lincoln.ac.uk/view/creators/3762.html

 

Is this not what you are trying to do now?

Alan

 

 

From: eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk] On Behalf Of Andrew Beeken
Sent: 16 May 2017 14:24
To:
eprints-tech@ecs.soton.ac.uk
Subject: Re: [EP-tech] Altering Creator Browse

 

Say all of the big words slowly so that thickie understands ;)

 

Okay, so I’ve added that to views.pl and it’s giving me the error when I try to view /person; I get that I’m probably not supposed to do that then? I tried creating view.pl in the /cfg.d folder but it results in a 404 presumably because it’s not generating the view?

 

From: eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk] On Behalf Of Alan.Stiles
Sent: 16 May 2017 13:46
To:
eprints-tech@ecs.soton.ac.uk
Subject: Re: [EP-tech] Altering Creator Browse

 

Step 1 is can you successfully create and build  a view based on the creators_id field, so you get a view set which lists justs the ids (and counts of publications?) – this should be an addition to views.pl in [EPRINTS_ROOT]/archives/[ARCHIVE_ID]/cfg/cfg.d/ along the lines of this from the comments near the end of view.pl

        {

                id => "person",

                menus => [

                       {

                               fields => [ "creators_id","editors_id" ],

                               allow_null => 0,

                       }

               ],

                order => "-date/title",

                noindex => 1,

                nolink => 1,

               nocount => 0,

                include => 1,

        },

 

 

 

From: eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk] On Behalf Of Andrew Beeken
Sent: 16 May 2017 12:08
To:
eprints-tech@ecs.soton.ac.uk
Subject: Re: [EP-tech] Altering Creator Browse

 

I get what this is trying to do and we’re certainly tagging with user ID. I’ve tried to implement the code as shown, both generating the view as “creators” and “people”, however I’m getting an error:

 

Can only perform process_distinctby on multiple fields with the same field type

 

I’m putting this largely down to this: https://cdn-images-1.medium.com/max/455/1*snTXFElFuQLSFDnvZKJ6IA.png

 

I really don’t fully know how to interpret the code in EPrints so anything like this is above me without a proper step by step explaining why specific things are being written in specific places and what they’re supposed to do.

 

Sorry if I seem inept!

 

From: eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk] On Behalf Of Alan.Stiles
Sent: 15 May 2017 17:03
To:
eprints-tech@ecs.soton.ac.uk
Subject: Re: [EP-tech] Altering Creator Browse

 

My predecessor did something of that nature on our repository (see http://threader.ecs.soton.ac.uk/lists/eprints_tech/15598.html).

Essentially, you need to have tagged each creator (from your institution) on each publication record with their unique id, so the system can build a view based on the unique id, but when rendering the view, it uses their name (from the user record) rather than the id field.

Does that help, or still leave you with (more) questions?

Alan

 

From: eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk] On Behalf Of Andrew Beeken
Sent: 15 May 2017 16:41
To:
eprints-tech@ecs.soton.ac.uk
Subject: [EP-tech] Altering Creator Browse

 

Hello all!

 

So, I’m progressing with my migration – one of the things I want to do, which is something we get with our current repository, is to generate the creator browse based on a users ID number, rather than their name; so instead of eprints.lincoln.ac.uk/creator/john+smith or what have you, we get …/creator/1234. At present the name method is generating multiple pages for users who publish under different names, such as John Smith or J. Smith or John D. Smith. Also we may have different John Smith’s in our system and will want to identify them as such. So, the creator browse needs to be generated based on the user table.

 

Any ideas on how to go about doing this? The current method is not portable as the code will not work with the current version of EPrints, and I want to explore some non intrusive (plugin) ways of doing it rather than altering core functions.

 

Andrew


The University of Lincoln, located in the heart of the city of Lincoln, has established an international reputation based on high student satisfaction, excellent graduate employment and world-class research.


The information in this e-mail and any attachments may be confidential. If you have received this email in error please notify the sender immediately and remove it from your system. Do not disclose the contents to another person or take copies.

Email is not secure and may contain viruses. The University of Lincoln makes every effort to ensure email is sent without viruses, but cannot guarantee this and recommends recipients take appropriate precautions.

The University may monitor email traffic data and content in accordance with its policies and English law. Further information can be found at:
http://www.lincoln.ac.uk/legal.

-- The Open University is incorporated by Royal Charter (RC 000391), an exempt charity in England & Wales and a charity registered in Scotland (SC 038302). The Open University is authorised and regulated by the Financial Conduct Authority.