⧼vector-jumptocontent⧽

API:EPrints/Update/Views: Difference between revisions

From EPrints Documentation
New page: <!-- Pod2Wiki=_preamble_ This page has been automatically generated from the EPrints source. Any wiki changes made between the 'Pod2Wiki=*' and 'End of Pod2Wiki' comments will be lost. -...
 
No edit summary
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
<!-- Pod2Wiki=_preamble_  
<!-- Pod2Wiki=_preamble_  
This page has been automatically generated from the EPrints source. Any wiki changes made between the 'Pod2Wiki=*' and 'End of Pod2Wiki' comments will be lost.
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.
  -->{{Pod2Wiki}}{{API:Source|file=EPrints/Update/Views.pm|package_name=EPrints::Update::Views}}[[Category:API|Views]]<!-- End of Pod2Wiki -->
  -->{{API}}{{Pod2Wiki}}{{API:Source|file=perl_lib/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=head_name -->=NAME=
'''EPrints::Update::Views


'''<!-- End of Pod2Wiki -->
 
<!-- Pod2Wiki=head_description -->=DESCRIPTION=
<!-- Pod2Wiki=_private_ --><!-- Pod2Wiki=head_name -->
==NAME==
'''EPrints::Update::Views''' - Update view pages
 
<!-- Edit below this comment -->
 
 
<!-- Pod2Wiki= -->
<!-- Pod2Wiki=head_synopsis -->
==SYNOPSIS==
<source lang="perl">$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
)],
},
];</source>
 
<!-- Edit below this comment -->
 
 
<!-- Pod2Wiki= -->
<!-- Pod2Wiki=head_description -->
==DESCRIPTION==
Update the browse-by X web pages on demand.
Update the browse-by X web pages on demand.


<!-- End of Pod2Wiki -->
<!-- Edit below this comment -->
<!-- Pod2Wiki=head_undocumented_methods -->=UNDOCUMENTED METHODS=
 
{{API:Undocumented Methods}}<!-- End of Pod2Wiki -->
 
<!-- Pod2Wiki=item_call -->==call==
<!-- Pod2Wiki= -->
<!-- Pod2Wiki=head_options -->
==OPTIONS==
* id
: Set the unique id for the view, which in the URL will be /view/[id]/...
 
* dataset = "archive"
: Set the dataset id to retrieve records from.
 
* menus = [ ... ]
: An array of hierarchical menu choices.
 
* order = ""
: Order matching records by the given field structure.
 
* variations = [qw( DEFAULT )]
: Add group-bys on additional pages. "DEFAULT" shows all of the records in a list.
 
* nolink = 0
: Don't show a link to this view from the /view/ page.
 
<!-- Edit below this comment -->
 
 
<!-- Pod2Wiki= -->
<!-- Pod2Wiki=head_menus -->
===Menus===
* allow_null = 0
* fields = [qw( ... )]
* new_column_at = [x, y]
* reverse_order = 0
* mode = "default"
: Use "sections" to cause the menu to be broken into sections.
 
* open_first_section = 1
: Open the first section of the browse menu.
 
<!-- Edit below this comment -->
 
 
<!-- Pod2Wiki= -->
<!-- Pod2Wiki=head_variations -->
===Variations===
Format is:


<!-- End of Pod2Wiki -->
<pre> [fieldname];[options]</pre>
<!-- Pod2Wiki=item_cluster_ranges_10 -->==cluster_ranges_10==


<!-- End of Pod2Wiki -->
Where options is:
<!-- Pod2Wiki=item_cluster_ranges_100 -->==cluster_ranges_100==


<!-- End of Pod2Wiki -->
<pre> [option1],[option2],[option3]=[value]</pre>
<!-- Pod2Wiki=item_cluster_ranges_20 -->==cluster_ranges_20==


<!-- End of Pod2Wiki -->
If no value is given the option is implicitly 1 (enable).
<!-- Pod2Wiki=item_cluster_ranges_200 -->==cluster_ranges_200==


<!-- End of Pod2Wiki -->
<pre> creators_name;first_letter,allow_null=1</pre>
<!-- Pod2Wiki=item_cluster_ranges_30 -->==cluster_ranges_30==


<!-- End of Pod2Wiki -->
* allow_null = 0
<!-- Pod2Wiki=item_cluster_ranges_40 -->==cluster_ranges_40==
: Show items that have no value(s) for the selected field.


<!-- End of Pod2Wiki -->
* cloud
<!-- Pod2Wiki=item_cluster_ranges_50 -->==cluster_ranges_50==
: Render a "Tag Cloud" of links, where the individual links are scaled by their frequency of occurence.


<!-- End of Pod2Wiki -->
* cloudmin = 80, cloudmax = 200
<!-- Pod2Wiki=item_cluster_ranges_60 -->==cluster_ranges_60==
: Scale cloud tag links by between cloudmin and cloudmax percent from normal text size.


<!-- End of Pod2Wiki -->
* first_letter
<!-- Pod2Wiki=item_cluster_ranges_70 -->==cluster_ranges_70==
: Implies truncate=1 and first_value.


<!-- End of Pod2Wiki -->
* first_value
<!-- Pod2Wiki=item_cluster_ranges_80 -->==cluster_ranges_80==
: Only group-by on the first value in a multiple field.


<!-- End of Pod2Wiki -->
* jump = none|plain|default
<!-- Pod2Wiki=item_cluster_ranges_90 -->==cluster_ranges_90==
: Hide the jump-to links, render just the links or render as a phrase ('Update/Views:jump_to').


<!-- End of Pod2Wiki -->
* tags
<!-- Pod2Wiki=item_cluster_ranges_n -->==cluster_ranges_n==
: Treat the field value as a comma or semi-colon separated list of values.


<!-- End of Pod2Wiki -->
* truncate = n
<!-- Pod2Wiki=item_create_sections_menu -->==create_sections_menu==
: Truncate the value to at most n characters.


<!-- End of Pod2Wiki -->
<!-- Edit below this comment -->
<!-- Pod2Wiki=item_create_single_page_menu -->==create_single_page_menu==


<!-- End of Pod2Wiki -->
<!-- Pod2Wiki=item_default_sort -->==default_sort==


<!-- End of Pod2Wiki -->
<!-- Pod2Wiki= -->
<!-- Pod2Wiki=item_get_cols_for_menu -->==get_cols_for_menu==
<!-- Pod2Wiki=head_methods -->
==METHODS==
<!-- Pod2Wiki=head_update_view_file -->
===update_view_file===


<!-- End of Pod2Wiki -->
<source lang="perl">$filename = update_view_file( $repo, $langid, $localpath, $uri )
<!-- Pod2Wiki=item_get_fieldlist_sizes -->==get_fieldlist_sizes==


<!-- End of Pod2Wiki -->
</source>
<!-- Pod2Wiki=item_get_fieldlist_sizes_subject -->==get_fieldlist_sizes_subject==
This is the function which decides which type of view it is:


<!-- End of Pod2Wiki -->
<pre>  * the main menu of views
<!-- Pod2Wiki=item_get_fieldlist_values -->==get_fieldlist_values==
  * the top level menu of a view
  * the sub menu of a view
  * a page within a single value of a view</pre>


<!-- End of Pod2Wiki -->
Does not update the file if it's not needed.
<!-- Pod2Wiki=item_get_fields_from_view -->==get_fields_from_view==


<!-- End of Pod2Wiki -->
<!-- Edit below this comment -->
<!-- Pod2Wiki=item_get_filters -->==get_filters==


<!-- End of Pod2Wiki -->
<!-- Pod2Wiki=item_get_showvalues_for_menu -->==get_showvalues_for_menu==


<!-- End of Pod2Wiki -->
<!-- Pod2Wiki= -->
<!-- Pod2Wiki=item_get_sizes -->==get_sizes==
<!-- Pod2Wiki=head_pseudo_views_class -->
===Pseudo-Views Class===
<!-- Edit below this comment -->


<!-- End of Pod2Wiki -->
<!-- Pod2Wiki=item_get_view_opts -->==get_view_opts==


<!-- End of Pod2Wiki -->
<!-- Pod2Wiki= -->
<!-- Pod2Wiki=item_group_by_2_characters -->==group_by_2_characters==
<!-- Pod2Wiki=head_name -->
===name===


<!-- End of Pod2Wiki -->
<source lang="perl">$desc = $view->name
<!-- Pod2Wiki=item_group_by_3_characters -->==group_by_3_characters==


<!-- End of Pod2Wiki -->
</source>
<!-- Pod2Wiki=item_group_by_4_characters -->==group_by_4_characters==
Returns a human-readable name of this view (for debugging).


<!-- End of Pod2Wiki -->
<!-- Edit below this comment -->
<!-- Pod2Wiki=item_group_by_5_characters -->==group_by_5_characters==


<!-- End of Pod2Wiki -->
<!-- Pod2Wiki=item_group_by_a_to_z -->==group_by_a_to_z==


<!-- End of Pod2Wiki -->
<!-- Pod2Wiki= -->
<!-- Pod2Wiki=item_group_by_first_character -->==group_by_first_character==
<!-- Pod2Wiki=head_update_view_by_path -->
===update_view_by_path===


<!-- End of Pod2Wiki -->
<source lang="perl">$view->update_view_by_path( %opts )
<!-- Pod2Wiki=item_group_by_n_chars -->==group_by_n_chars==


<!-- End of Pod2Wiki -->
</source>
<!-- Pod2Wiki=item_group_items -->==group_items==
Updates the view source files.


<!-- End of Pod2Wiki -->
Options:
<!-- Pod2Wiki=item_modernise_view -->==modernise_view==


<!-- End of Pod2Wiki -->
<pre>  on_write - callback called with the filename written
<!-- Pod2Wiki=item_no_ranges -->==no_ranges==
  langid - language to write
  do_menus - suppress generation of menus
  do_lists - suppress generation of lists</pre>


<!-- End of Pod2Wiki -->
<!-- Edit below this comment -->
<!-- Pod2Wiki=item_render_array_of_eprints -->==render_array_of_eprints==


<!-- End of Pod2Wiki -->
<!-- Pod2Wiki=item_render_export_bar -->==render_export_bar==


<!-- End of Pod2Wiki -->
<!-- Pod2Wiki= -->
<!-- Pod2Wiki=item_render_menu -->==render_menu==
<!-- Pod2Wiki=head_copyright -->
==COPYRIGHT==
: Copyright 2000-2011 University of Southampton.


<!-- End of Pod2Wiki -->
: This file is part of EPrints http://www.eprints.org/.
<!-- Pod2Wiki=item_render_navigation_aids -->==render_navigation_aids==


<!-- End of Pod2Wiki -->
: EPrints is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
<!-- Pod2Wiki=item_render_subj_menu -->==render_subj_menu==


<!-- End of Pod2Wiki -->
: EPrints is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
<!-- Pod2Wiki=item_update_browse_view_list -->==update_browse_view_list==


<!-- End of Pod2Wiki -->
: You should have received a copy of the GNU Lesser General Public License along with EPrints.  If not, see http://www.gnu.org/licenses/.
<!-- Pod2Wiki=item_update_view_file -->==update_view_file==


<!-- End of Pod2Wiki -->
<!-- Edit below this comment -->
<!-- Pod2Wiki=item_update_view_list -->==update_view_list==


<!-- End of Pod2Wiki -->
<!-- Pod2Wiki=item_update_view_menu -->==update_view_menu==


<!-- End of Pod2Wiki -->
<!-- Pod2Wiki= -->
<!-- Pod2Wiki=_postamble_ --><!-- End of Pod2Wiki -->
<!-- Pod2Wiki=_postamble_ -->
<!-- Edit below this comment -->

Latest revision as of 09:57, 22 January 2013

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


NAME

EPrints::Update::Views - Update view pages


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
		)],
	},
];


DESCRIPTION

Update the browse-by X web pages on demand.


OPTIONS

  • id
Set the unique id for the view, which in the URL will be /view/[id]/...
  • dataset = "archive"
Set the dataset id to retrieve records from.
  • menus = [ ... ]
An array of hierarchical menu choices.
  • order = ""
Order matching records by the given field structure.
  • variations = [qw( DEFAULT )]
Add group-bys on additional pages. "DEFAULT" shows all of the records in a list.
  • nolink = 0
Don't show a link to this view from the /view/ page.


Menus

  • allow_null = 0
  • fields = [qw( ... )]
  • new_column_at = [x, y]
  • reverse_order = 0
  • mode = "default"
Use "sections" to cause the menu to be broken into sections.
  • open_first_section = 1
Open the first section of the browse menu.


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
  • allow_null = 0
Show items that have no value(s) for the selected field.
  • cloud
Render a "Tag Cloud" of links, where the individual links are scaled by their frequency of occurence.
  • cloudmin = 80, cloudmax = 200
Scale cloud tag links by between cloudmin and cloudmax percent from normal text size.
  • first_letter
Implies truncate=1 and first_value.
  • first_value
Only group-by on the first value in a multiple field.
  • jump = none|plain|default
Hide the jump-to links, render just the links or render as a phrase ('Update/Views:jump_to').
  • tags
Treat the field value as a comma or semi-colon separated list of values.
  • truncate = n
Truncate the value to at most n characters.


METHODS

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.


Pseudo-Views Class

name

$desc = $view->name

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


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


COPYRIGHT

Copyright 2000-2011 University of Southampton.
This file is part of EPrints http://www.eprints.org/.
EPrints is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
EPrints is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with EPrints. If not, see http://www.gnu.org/licenses/.