API:EPrints/Update/Views

From Eprints Documentation

Revision as of 16:25, 17 February 2012 by Tdb01r (Talk | contribs)
Jump to: navigation, search

EPrints 3 Reference: Directory Structure - Metadata Fields - Repository Configuration - XML Config Files - XML Export Format - EPrints data structure - Core API - Data Objects


API: Core API

Latest Source Code (3.3, 3.2) | Revision Log | Before editing this page please read Pod2Wiki


Contents

NAME

EPrints::Update::Views - Update view pages

User Comments


SYNOPSIS

 $c->{browse_views} = [
   {
     id => "year",
     order => "creators_name/title",
     menus => [
       {
         fields => [qw( date;res=year )],
         reverse_order => 1,
         allow_null => 1,
         new_column_at => [10, 10]
       },
     ],
     variations => [qw(
       creators_name;first_letter
       type
       DEFAULT
     )],
   },
 ];
 

User Comments


DESCRIPTION

Update the browse-by X web pages on demand.

User Comments


OPTIONS

User Comments


id

Set the unique id for the view, which in the URL will be /view/[id]/...

User Comments


dataset = "archive"

Set the dataset id to retrieve records from.

User Comments


menus = [ ... ]

An array of hierarchical menu choices.

User Comments


order = ""

Order matching records by the given field structure.

User Comments


variations = [qw( DEFAULT )]

Add group-bys on additional pages. "DEFAULT" shows all of the records in a list.

User Comments


nolink = 0

Don't show a link to this view from the /view/ page.

User Comments


Menus

User Comments


allow_null = 0

User Comments


fields = [qw( ... )]

User Comments


new_column_at = [x, y]

User Comments


reverse_order = 0

User Comments


mode = "default"

Use "sections" to cause the menu to be broken into sections.

User Comments


open_first_section = 1

Open the first section of the browse menu.

User Comments


Variations

Format is:

 [fieldname];[options]
 

Where options is:

 [option1],[option2],[option3]=[value]
 

If no value is given the option is implicitly 1 (enable).

 creators_name;first_letter,allow_null=1
 

User Comments


allow_null = 0

Show items that have no value(s) for the selected field.

User Comments


cloud

Render a "Tag Cloud" of links, where the individual links are scaled by their frequency of occurence.

User Comments


cloudmin = 80, cloudmax = 200

Scale cloud tag links by between cloudmin and cloudmax percent from normal text size.

User Comments


first_letter

Implies truncate=1 and first_value.

User Comments


first_value

Only group-by on the first value in a multiple field.

User Comments


jump = none|plain|default

Hide the jump-to links, render just the links or render as a phrase ('Update/Views:jump_to').

User Comments


tags

Treat the field value as a comma or semi-colon separated list of values.

User Comments


truncate = n

Truncate the value to at most n characters.

User Comments


METHODS

User Comments


update_view_file

$filename = update_view_file( $repo, $langid, $localpath, $uri )

This is the function which decides which type of view it is:

 * the main menu of views
 * the top level menu of a view
 * the sub menu of a view
 * a page within a single value of a view
 

Does not update the file if it's not needed.

User Comments


Pseudo-Views Class

User Comments


name

$desc = $view->name

Returns a human-readable name of this view (for debugging).

User Comments


update_view_by_path

$view->update_view_by_path( %opts )

Updates the view source files.

Options:

 on_write - callback called with the filename written
 langid - language to write
 do_menus - suppress generation of menus
 do_lists - suppress generation of lists
 

User Comments


COPYRIGHT

User Comments


Personal tools