Difference between revisions of "API:EPrints/Update/Views"

From EPrints Documentation
Jump to: navigation, search
(Removing all content from page)
Line 1: Line 1:
 +
<!-- Pod2Wiki=_preamble_
 +
This page has been automatically generated from the EPrints 3.2 source. Any wiki changes made between the 'Pod2Wiki=*' and 'Edit below this comment' comments will be lost.
 +
-->{{API}}{{Pod2Wiki}}{{API:Source|file=EPrints/Update/Views.pm|package_name=EPrints::Update::Views}}[[Category:API|VIEWS]][[Category:API:EPrints/Update|VIEWS]][[Category:API:EPrints/Update/Views|VIEWS]]<div><!-- Edit below this comment -->
  
 +
 +
<!-- Pod2Wiki=_private_ --><!-- Pod2Wiki=head_name -->
 +
==NAME==
 +
'''EPrints::Update::Views''' - Update view pages
 +
 +
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 +
<span style='display:none'>User Comments</span>
 +
<!-- Edit below this comment -->
 +
 +
 +
<!-- Pod2Wiki= -->
 +
</div>
 +
<!-- Pod2Wiki=head_synopsis -->
 +
==SYNOPSIS==
 +
  $c-&gt;{browse_views} = [
 +
    {
 +
      id =&gt; "year",
 +
      order =&gt; "creators_name/title",
 +
      menus =&gt; [
 +
        {
 +
          fields =&gt; [qw( date;res=year )],
 +
          reverse_order =&gt; 1,
 +
          allow_null =&gt; 1,
 +
          new_column_at =&gt; [10, 10]
 +
        },
 +
      ],
 +
      variations =&gt; [qw(
 +
        creators_name;first_letter
 +
        type
 +
        DEFAULT
 +
      )],
 +
    },
 +
  ];
 +
 
 +
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 +
<span style='display:none'>User Comments</span>
 +
<!-- Edit below this comment -->
 +
 +
 +
<!-- Pod2Wiki= -->
 +
</div>
 +
<!-- Pod2Wiki=head_description -->
 +
==DESCRIPTION==
 +
Update the browse-by X web pages on demand.
 +
 +
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 +
<span style='display:none'>User Comments</span>
 +
<!-- Edit below this comment -->
 +
 +
 +
<!-- Pod2Wiki= -->
 +
</div>
 +
<!-- Pod2Wiki=head_options -->
 +
==OPTIONS==
 +
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 +
<span style='display:none'>User Comments</span>
 +
<!-- Edit below this comment -->
 +
 +
 +
<!-- Pod2Wiki= -->
 +
</div>
 +
<!-- Pod2Wiki=item_id -->
 +
===id===
 +
 +
Set the unique id for the view, which in the URL will be /view/[id]/...
 +
 +
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 +
<span style='display:none'>User Comments</span>
 +
<!-- Edit below this comment -->
 +
 +
 +
<!-- Pod2Wiki= -->
 +
</div>
 +
<!-- Pod2Wiki=item_dataset_archive -->
 +
===dataset = "archive"===
 +
 +
Set the dataset id to retrieve records from.
 +
 +
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 +
<span style='display:none'>User Comments</span>
 +
<!-- Edit below this comment -->
 +
 +
 +
<!-- Pod2Wiki= -->
 +
</div>
 +
<!-- Pod2Wiki=item_menus -->
 +
===menus = [ ... ]===
 +
 +
An array of hierarchical menu choices.
 +
 +
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 +
<span style='display:none'>User Comments</span>
 +
<!-- Edit below this comment -->
 +
 +
 +
<!-- Pod2Wiki= -->
 +
</div>
 +
<!-- Pod2Wiki=item_order -->
 +
===order = ""===
 +
 +
Order matching records by the given field structure.
 +
 +
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 +
<span style='display:none'>User Comments</span>
 +
<!-- Edit below this comment -->
 +
 +
 +
<!-- Pod2Wiki= -->
 +
</div>
 +
<!-- Pod2Wiki=item_qw -->
 +
===variations = [qw( DEFAULT )]===
 +
 +
Add group-bys on additional pages. "DEFAULT" shows all of the records in a list.
 +
 +
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 +
<span style='display:none'>User Comments</span>
 +
<!-- Edit below this comment -->
 +
 +
 +
<!-- Pod2Wiki= -->
 +
</div>
 +
<!-- Pod2Wiki=item_nolink_0 -->
 +
===nolink = 0===
 +
 +
Don't show a link to this view from the /view/ page.
 +
 +
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 +
<span style='display:none'>User Comments</span>
 +
<!-- Edit below this comment -->
 +
 +
 +
<!-- Pod2Wiki= -->
 +
</div>
 +
<!-- Pod2Wiki=head_menus -->
 +
===Menus===
 +
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 +
<span style='display:none'>User Comments</span>
 +
<!-- Edit below this comment -->
 +
 +
 +
<!-- Pod2Wiki= -->
 +
</div>
 +
<!-- Pod2Wiki=item_allow_null_0 -->
 +
====allow_null = 0====
 +
 +
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 +
<span style='display:none'>User Comments</span>
 +
<!-- Edit below this comment -->
 +
 +
 +
<!-- Pod2Wiki= -->
 +
</div>
 +
<!-- Pod2Wiki=item_qw -->
 +
====fields = [qw( ... )]====
 +
 +
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 +
<span style='display:none'>User Comments</span>
 +
<!-- Edit below this comment -->
 +
 +
 +
<!-- Pod2Wiki= -->
 +
</div>
 +
<!-- Pod2Wiki=item_new_column_at_x_y -->
 +
====new_column_at = [x, y]====
 +
 +
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 +
<span style='display:none'>User Comments</span>
 +
<!-- Edit below this comment -->
 +
 +
 +
<!-- Pod2Wiki= -->
 +
</div>
 +
<!-- Pod2Wiki=item_reverse_order_0 -->
 +
====reverse_order = 0====
 +
 +
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 +
<span style='display:none'>User Comments</span>
 +
<!-- Edit below this comment -->
 +
 +
 +
<!-- Pod2Wiki= -->
 +
</div>
 +
<!-- Pod2Wiki=item_mode_default -->
 +
====mode = "default"====
 +
 +
Use "sections" to cause the menu to be broken into sections.
 +
 +
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 +
<span style='display:none'>User Comments</span>
 +
<!-- Edit below this comment -->
 +
 +
 +
<!-- Pod2Wiki= -->
 +
</div>
 +
<!-- Pod2Wiki=item_open_first_section_1 -->
 +
====open_first_section = 1====
 +
 +
Open the first section of the browse menu.
 +
 +
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 +
<span style='display:none'>User Comments</span>
 +
<!-- Edit below this comment -->
 +
 +
 +
<!-- Pod2Wiki= -->
 +
</div>
 +
<!-- Pod2Wiki=head_methods -->
 +
==METHODS==
 +
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 +
<span style='display:none'>User Comments</span>
 +
<!-- Edit below this comment -->
 +
 +
 +
<!-- Pod2Wiki= -->
 +
</div>
 +
<!-- Pod2Wiki=item_update_view_file -->
 +
===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.
 +
 +
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 +
<span style='display:none'>User Comments</span>
 +
<!-- Edit below this comment -->
 +
 +
 +
<!-- Pod2Wiki= -->
 +
</div>
 +
<!-- Pod2Wiki=head_pseudo_views_class -->
 +
===Pseudo-Views Class===
 +
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 +
<span style='display:none'>User Comments</span>
 +
<!-- Edit below this comment -->
 +
 +
 +
<!-- Pod2Wiki= -->
 +
</div>
 +
<!-- Pod2Wiki=item_name -->
 +
====name====
 +
 +
$desc = $view-&gt;name
 +
Returns a human-readable name of this view (for debugging).
 +
 +
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 +
<span style='display:none'>User Comments</span>
 +
<!-- Edit below this comment -->
 +
 +
 +
<!-- Pod2Wiki= -->
 +
</div>
 +
<!-- Pod2Wiki=item_update_view_by_path -->
 +
====update_view_by_path====
 +
 +
$view-&gt;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
 +
 
 +
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 +
<span style='display:none'>User Comments</span>
 +
<!-- Edit below this comment -->
 +
 +
 +
<!-- Pod2Wiki= -->
 +
</div>
 +
<!-- Pod2Wiki=head_copyright -->
 +
==COPYRIGHT==
 +
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 +
<span style='display:none'>User Comments</span>
 +
<!-- Edit below this comment -->
 +
 +
 +
<!-- Pod2Wiki= -->
 +
</div>
 +
<!-- Pod2Wiki=_postamble_ --><!-- Edit below this comment -->

Revision as of 10:47, 25 August 2011

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.4, 3.3) | Revision Log | Before editing this page please read Pod2Wiki


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


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