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

[EP-tech] Re: Multiple Compound Views



Thanks for taking the time to investigate and reply.  If I produce a solution I'll feed it back.

Alan

-----Original Message-----
From: Field A.N. [mailto:af05v at ecs.soton.ac.uk]
Sent: 27 February 2015 16:54
To: eprints-tech at ecs.soton.ac.uk
Subject: [EP-tech] Re: Multiple Compound Views

Hi Alan

        Hmmm...  I do remember there being a subtle issue with this kind of browsing because there is no explicit link between the two sub fields when you're browsing.  EPrints will create the first menu by finding any item with Funder A in it, then all items with Funder B in it.  Of those two sets of items, it will then look for projects, but it doesn't know that projects belong to funders.  Essentially, when you access the subfields directly, both the funder and the project are simple properties of EPrints, with no connection between them.

        That's why we have subject trees, but I understand that that's not an appropriate solution (unless you know all the projects and funders in advance).  There is a projects and funders extension, which is here: https://github.com/eprints/funders , but I don't believe it's complete and I'm not sure how (or if) it handles browsing.


--
Adam Field
Business Relationship Manager and Community Lead EPrints Services




On 27 Feb 2015, at 09:15, Alan.Stiles wrote:

> Hi Adam,
>
> Field definition:
> $c->add_dataset_field( 'eprint',
>         { name => 'project_details',
>           type => 'compound',
>           multiple => 1,
>           fields => [
>                         {
>                         'sub_name' => 'project_name',
>                         'type' => 'text',
>                         'input_cols' => 60,
>                         'allow_null' => 1,
>                         },
>                         {
>                         'sub_name' => 'project_id',
>                         'type' => 'text',
>                         'input_cols' => 20,
>                         'allow_null' => 1,
>                         },
>                         {
>                         'sub_name' => 'funder',
>                         'type' => 'text',
>                         'input_cols' => 30,
>                         'allow_null' => 1,
>                         }
>                     ],
>           input_boxes => 2,
>           input_add_boxes => 1,
>         }
> );
>
>
> Current view configuration:
> {
>                 id => "projects",
>                 allow_null => 0,
>                 hideempty => 1,
>                 menus => [
>                         {
>                                 fields => [ "project_details_funder" ],
>                                 allow_null => 0,
>                                 hideempty => 1,
>                                 new_column_at => [1, 1],
>                                 mode => "sections",
>                                 open_first_section => 1,
>                                 group_range_function => "EPrints::Update::Views::cluster_ranges_30",
>                                 group_sorting_function => "alpha_first",
>                         },
>                         {
>                                 fields => [ "project_details_project_id" ],
>                                 allow_null => 0,
>                                 hideempty => 1,
>                                 new_column_at => [1, 1],
>                                 mode => "sections",
>                                 open_first_section => 1,
>                                 grouping_function => "EPrints::Update::Views::group_by_first_character",
>                                 group_sorting_function => "alpha_first",
>                         }
>                 ],
>                 citation => "neat",
>                 order => "-date",
>                 variations => [
>                         "date;truncate=4,reverse",
>                         "type",
>                         "creators_name;first_letter",
>                         "DEFAULT",
>                 ],
> },
>
> From: Adam Field [mailto:af05v at ecs.soton.ac.uk]
> Sent: 26 February 2015 19:20
> To: eprints-tech at ecs.soton.ac.uk
> Subject: [EP-tech] Re: Multiple Compound Views
>
> Hi Alan
>
>             Can you paste in your metadata field definition and your browse view configuration for that view?
>
> --
> Adam
>
> On 26 Feb 2015, at 17:33, Alan.Stiles <alan.stiles at open.ac.uk> wrote:
>
>
> Anybody done anything with creating a view from a multiple compound field? I?ve got a main view of project funder, with sub views of project ids, with lists of eprints related to the project id below that.
> At the moment however, I get all the project ids for the eprint below each funder, rather than just the value for the funder  Example to better explain this below.
> Any clues how to get the desired outcome?
>
> e.g.  eprint xxx has a multi-value compound field
>
> funder A: projectid 1
> funder B: projectid 2
> funder C: projectid 3
>
> and my generated views are
>
> funder A
>                 projectid 1
>                                 eprint xxx
>                 projectid 2
>                                 eprint xxx
>                 projectid 3
>                                 eprint xxx funder B
>                 projectid 1
>                                 eprint xxx
>                 projectid 2
>                                 eprint xxx
>                 projectid 3
>                                 eprint xxx etc? when what I want is
> funder A
>                 projectid 1
>                                 eprint xxx funder B
>                 projectid 2
>                                 eprint xxx funder C
>                 projectid 3
>                                 eprint xxx
>
>
> cheers,
> Alan Stiles
> Digital Repository Developer
> Library Services, The Open University
> oro.open.ac.uk
>
>
> -- 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. ***
> 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/
> *** EPrints developers Forum: http://forum.eprints.org/
>
> *** 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/
> *** EPrints developers Forum: http://forum.eprints.org/


*** 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/
*** EPrints developers Forum: http://forum.eprints.org/
-- 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.