EPrints Technical Mailing List Archive

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

Message: #04001


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

[EP-tech] Re: Multiple Compound Views


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@ecs.soton.ac.uk]
Sent: 26 February 2015 19:20
To: eprints-tech@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@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

 

 

-- 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/