Difference between revisions of "API:bin/generate views"

From EPrints Documentation
Jump to: navigation, search
 
(2 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 3.2 source. Any wiki changes made between the 'Pod2Wiki=*' and 'Edit below this comment' 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.
  -->{{API}}{{Pod2Wiki}}{{API:Source|file=bin/generate_views.pm|package_name=bin/generate_views}}[[Category:API|BIN/GENERATE_VIEWS]][[Category:API:bin/generate_views|BIN/GENERATE_VIEWS]][[Category:API:bin/generate_views|BIN/GENERATE_VIEWS]]<div><!-- Edit below this comment -->
+
  -->{{API}}{{Pod2Wiki}}{{API:Source|file=bin/generate_views|package_name=bin/generate_views}}[[Category:API|BIN/GENERATE_VIEWS]][[Category:API:bin/generate_views|BIN/GENERATE_VIEWS]][[Category:API:bin/generate_views|BIN/GENERATE_VIEWS]]<div><!-- Edit below this comment -->
  
  
Line 8: Line 8:
 
'''generate_views''' - Generate static browse pages for an EPrint repository
 
'''generate_views''' - Generate static browse pages for an EPrint repository
  
<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 -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
 
 
<!-- Pod2Wiki=head_synopsis -->
 
<!-- Pod2Wiki=head_synopsis -->
 
==SYNOPSIS==
 
==SYNOPSIS==
 
'''generate_views''' <em>repository_id</em> ['''options''']  
 
'''generate_views''' <em>repository_id</em> ['''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 -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
 
 
<!-- Pod2Wiki=head_description -->
 
<!-- Pod2Wiki=head_description -->
 
==DESCRIPTION==
 
==DESCRIPTION==
Line 42: Line 36:
 
If viewid is specified then only that view is updated. This can be useful if some views need updating more often then others. The top /view/ page which links to each view is always updated.
 
If viewid is specified then only that view is updated. This can be useful if some views need updating more often then others. The top /view/ page which links to each view is always updated.
  
<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 -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
 
 
<!-- Pod2Wiki=head_arguments -->
 
<!-- Pod2Wiki=head_arguments -->
 
==ARGUMENTS==
 
==ARGUMENTS==
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
+
* '''repository_id'''  
<span style='display:none'>User Comments</span>
+
: The ID of the eprint repository to use.
<!-- Edit below this comment -->
 
 
 
 
 
<!-- Pod2Wiki= -->
 
</div>
 
<!-- Pod2Wiki=item_b_repository_id -->
 
==='''repository_id''' ===
 
 
 
The ID of the eprint repository to use.
 
  
<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 -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
 
 
<!-- Pod2Wiki=head_options -->
 
<!-- Pod2Wiki=head_options -->
 
==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%; '>
+
* '''--generate menus'''  
<span style='display:none'>User Comments</span>
+
: Only generate the menu pages, not the pages with links to records.
<!-- Edit below this comment -->
 
  
 +
* '''--generate lists'''
 +
: Only generate the pages with lists of records, not the menu pages.
  
<!-- Pod2Wiki= -->
+
* '''--view''' <em>view_id</em>
</div>
+
: Generate only the view with this ID.
<!-- Pod2Wiki=item_b_generate_menus -->
 
==='''--generate menus''' ===
 
 
 
Only generate the menu pages, not the pages with links to records.
 
 
 
<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 -->
 
  
 +
* '''--lang''' <em>lang_id</em>
 +
: Generate only pages for the language with this ID.
  
<!-- Pod2Wiki= -->
+
* '''--help'''
</div>
+
: Print a brief help message and exit.
<!-- Pod2Wiki=item_b_generate_lists -->
 
==='''--generate lists''' ===
 
  
Only generate the pages with lists of records, not the menu pages.
+
* '''--man'''
 +
: Print the full manual page and then exit.
  
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
+
* '''--quiet'''
<span style='display:none'>User Comments</span>
+
: Be vewwy vewwy quiet. This option will supress all output unless an error occurs.
<!-- Edit below this comment -->
 
  
 +
* '''--verbose'''
 +
: Explain in detail what is going on. May be repeated for greater effect.
  
<!-- Pod2Wiki= -->
+
* '''--version'''
</div>
+
: Output version information and exit.
<!-- Pod2Wiki=item_b_view_i_view_id -->
 
==='''--view''' <em>view_id</em>===
 
  
Generate only the view with this ID.
+
<pre></pre>
  
<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 -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
+
<!-- Pod2Wiki=head_copyright -->
<!-- Pod2Wiki=item_b_lang_i_lang_id -->
+
==COPYRIGHT==
==='''--lang''' <em>lang_id</em>===
+
Copyright 2000-2011 University of Southampton.
  
Generate only pages for the language with this ID.  
+
This file is part of EPrints http://www.eprints.org/.
 
 
<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 -->
 
  
 +
EPrints is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
  
<!-- 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 General Public License for more details.
</div>
 
<!-- Pod2Wiki=item_b_help -->
 
==='''--help'''===
 
  
Print a brief help message and exit.
+
You should have received a copy of the GNU General Public License along with EPrints.  If not, see http://www.gnu.org/licenses/.
  
<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 -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
+
<!-- Pod2Wiki=_postamble_ -->
<!-- Pod2Wiki=item_b_man -->
 
==='''--man'''===
 
 
 
Print the full manual page and then exit.
 
 
 
<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 -->
 
<!-- Edit below this comment -->
 
 
<!-- Pod2Wiki= -->
 
</div>
 
<!-- Pod2Wiki=item_b_quiet -->
 
==='''--quiet'''===
 
 
Be vewwy vewwy quiet. This option will supress all output unless an error occurs.
 
 
<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_b_verbose -->
 
==='''--verbose'''===
 
 
Explain in detail what is going on. May be repeated for greater effect.
 
 
<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_b_version -->
 
==='''--version'''===
 
 
Output version information and exit.
 
 
<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 -->
 

Latest revision as of 09:57, 22 January 2013

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

generate_views - Generate static browse pages for an EPrint repository


SYNOPSIS

generate_views repository_id [options]


DESCRIPTION

This script creates some or all of the pages used in the /view/ section of the website. Since 3.1 these pages update themselves if they get only than a certain age, but this can cause delays for the viewer, so this script is still provided to pre-prepare them to provide a smoother experience.

Note: Since EPrints 3.1 it is not essential to run generate_views periodically, but it is still recommended.

What this does is generate browse pages for each field configured as browsable in ArchiveConfig.pm. It creates a static web page for each value of that field, and index pages to navigate to them.

For example, if we make "year" browseable then this script will generate one page for each unique value of the year field. So a user can then view the 1995 page and see links to all the 1995 eprints.

Advantages of this are that this puts less load on the database than user searches. Assuming you pick two or three sensible fields to make browsable.

This script should be run every hour or so, but that should once a day or even once a week on large repositories, as the more eprints the longer it will take to run. The rough length of time to run this is of the order of O( languages * eprints * browsable fields ). You can automate running this with the cron system.

If viewid is specified then only that view is updated. This can be useful if some views need updating more often then others. The top /view/ page which links to each view is always updated.


ARGUMENTS

  • repository_id
The ID of the eprint repository to use.


OPTIONS

  • --generate menus
Only generate the menu pages, not the pages with links to records.
  • --generate lists
Only generate the pages with lists of records, not the menu pages.
  • --view view_id
Generate only the view with this ID.
  • --lang lang_id
Generate only pages for the language with this ID.
  • --help
Print a brief help message and exit.
  • --man
Print the full manual page and then exit.
  • --quiet
Be vewwy vewwy quiet. This option will supress all output unless an error occurs.
  • --verbose
Explain in detail what is going on. May be repeated for greater effect.
  • --version
Output version information and exit.


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 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 General Public License for more details.

You should have received a copy of the GNU General Public License along with EPrints. If not, see http://www.gnu.org/licenses/.