Difference between revisions of "Training Video:Virtual Fields"
(→Introduction) |
m (→Video: converted https to http) |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 6: | Line 6: | ||
Walkthrough of adding a metadata field to a repository. | Walkthrough of adding a metadata field to a repository. | ||
− | Virtual Meta Fields are fields that are not stored in the database, instead their input and output is programmed. They can be used whenever a default display-value is not suitable. Since their value is calculated their uses are limited by one's imagination. Despite their obvious | + | Virtual Meta Fields are fields that are not stored in the database, instead their input and output is programmed. They can be used whenever a default display-value is not suitable. Since their value is calculated their uses are limited by one's imagination. Despite their obvious usefulness with respect to rendering and displaying content, it should be stressed out that they can be used for storing values as well. |
Except from Virtual Fields, this video touches other useful areas of EPrints, like how to write an EPrints script using the API, how fields are rendered, etc. | Except from Virtual Fields, this video touches other useful areas of EPrints, like how to write an EPrints script using the API, how fields are rendered, etc. | ||
Line 32: | Line 32: | ||
==Video== | ==Video== | ||
+ | The Video can be found at [http://www.youtube.com/watch?v=GjeWcewJA5o http://www.youtube.com/watch?v=qu92uyXzHEA]. | ||
+ | ===Index=== | ||
+ | *[http://www.youtube.com/watch?v=qu92uyXzHEA&t=0m00s 0:00 introduction] | ||
+ | *[http://www.youtube.com/watch?v=qu92uyXzHEA&t=1m00s 1:00 create virtual field definition] | ||
+ | *[http://www.youtube.com/watch?v=qu92uyXzHEA&t=2m45s 2:45 create render function for virtual field] | ||
+ | *[http://www.youtube.com/watch?v=qu92uyXzHEA&t=4m15s 4:15 rename render function parameters] | ||
+ | *[http://www.youtube.com/watch?v=qu92uyXzHEA&t=6m00s 6:00 $session / $repo naming style] | ||
+ | *[http://www.youtube.com/watch?v=qu92uyXzHEA&t=6m45s 6:45 check function names in eprints wiki] | ||
+ | *[http://www.youtube.com/watch?v=qu92uyXzHEA&t=8m00s 8:00 edit eprint_render.pl to show new field] | ||
+ | *[http://www.youtube.com/watch?v=qu92uyXzHEA&t=8m45s 8:45 restart web server and regenerate abstract to show field] | ||
+ | *[http://www.youtube.com/watch?v=qu92uyXzHEA&t=10m15s 10:15 debug why field not showing] | ||
+ | *[http://www.youtube.com/watch?v=qu92uyXzHEA&t=11m00s 11:00 force field display in citation file] | ||
+ | *[http://www.youtube.com/watch?v=qu92uyXzHEA&t=12m00s 12:00 create demo script to demonstrate is_set test failures] | ||
+ | *[http://www.youtube.com/watch?v=qu92uyXzHEA&t=16m00s 16:00 run test script] | ||
+ | *[http://www.youtube.com/watch?v=qu92uyXzHEA&t=19m00s 19:00 trace function calls in base EPrints to show why failures happen] | ||
+ | *[http://www.youtube.com/watch?v=qu92uyXzHEA&t=22m00s 22:00 create new metadata field type to fix the failures ] | ||
+ | *[http://www.youtube.com/watch?v=qu92uyXzHEA&t=26m45s 26:45 create new get_value function as field property] | ||
+ | *[http://www.youtube.com/watch?v=qu92uyXzHEA&t=28m00s 28:00 debugging new script changes] | ||
+ | *[http://www.youtube.com/watch?v=qu92uyXzHEA&t=29m00s 29:00 tracing warnings from epadmin test] | ||
+ | *[http://www.youtube.com/watch?v=qu92uyXzHEA&t=30m00s 30:00 adding field defaults functionality] | ||
+ | *[http://www.youtube.com/watch?v=qu92uyXzHEA&t=34m30s 34:30 testing new changes] | ||
+ | *[http://www.youtube.com/watch?v=qu92uyXzHEA&t=34m45s 34:45 debugging no uppercase appearance] | ||
+ | *[http://www.youtube.com/watch?v=qu92uyXzHEA&t=36m00s 36:00 test script success and summary] | ||
+ | *[http://www.youtube.com/watch?v=qu92uyXzHEA&t=38m40s 38:40 fix wide character in utf8 warning message] | ||
+ | *[http://www.youtube.com/watch?v=qu92uyXzHEA&t=39m40s 39:40 regenerate abstract page to show is_set test now returns true] | ||
+ | |||
+ | ===Video=== | ||
<youtube>qu92uyXzHEA</youtube> | <youtube>qu92uyXzHEA</youtube> | ||
+ | |||
+ | ===Notes, Errata and Additional Information=== | ||
+ | The content of the video has been tested in Ubuntu and Debian, using EPrints versions 3.3.13 and 3.3.14. | ||
==More Reading== | ==More Reading== | ||
* Metatada fields (http://wiki.eprints.org/w/Category:EPrints_Metadata_Fields) | * Metatada fields (http://wiki.eprints.org/w/Category:EPrints_Metadata_Fields) | ||
− | |||
− | |||
− |
Latest revision as of 09:27, 19 November 2015
Contents
Introduction
Walkthrough of adding a metadata field to a repository.
Virtual Meta Fields are fields that are not stored in the database, instead their input and output is programmed. They can be used whenever a default display-value is not suitable. Since their value is calculated their uses are limited by one's imagination. Despite their obvious usefulness with respect to rendering and displaying content, it should be stressed out that they can be used for storing values as well.
Except from Virtual Fields, this video touches other useful areas of EPrints, like how to write an EPrints script using the API, how fields are rendered, etc.
What you will learn
Watching this video will teach you:
- How and when to use Virtual Fields
- How to add a new field (Virtual Field in this example)
- How a Virtual Field's value is rendered
- How to correctly override an EPrints' function (render_value in this example)
- How to use the Core API Wiki
- How abstracts are refreshed and re-generated
- How the citation's summary page is edited
- How to create and run a simple script using EPrints' API
- How to return a value from a Virtual Field
- How to inherit MetaField.pm class to create a new field type and override some of its functions
- How to create a virtual field based on a newly generated field type
What you should already know
- basic understanding of EPrints tree structure (http://wiki.eprints.org/w/EPrints_Directory_Structure_Tree)
- basic understanding of EPrints configuration files (http://wiki.eprints.org/w/EPrints_Directory_Structure/eprints3/archives/ARCHIVEID/cfg/cfg.d)
- basic understanding of Eprints administrative commands (http://wiki.eprints.org/w/API:bin/epadmin)
Video
The Video can be found at http://www.youtube.com/watch?v=qu92uyXzHEA.
Index
- 0:00 introduction
- 1:00 create virtual field definition
- 2:45 create render function for virtual field
- 4:15 rename render function parameters
- 6:00 $session / $repo naming style
- 6:45 check function names in eprints wiki
- 8:00 edit eprint_render.pl to show new field
- 8:45 restart web server and regenerate abstract to show field
- 10:15 debug why field not showing
- 11:00 force field display in citation file
- 12:00 create demo script to demonstrate is_set test failures
- 16:00 run test script
- 19:00 trace function calls in base EPrints to show why failures happen
- 22:00 create new metadata field type to fix the failures
- 26:45 create new get_value function as field property
- 28:00 debugging new script changes
- 29:00 tracing warnings from epadmin test
- 30:00 adding field defaults functionality
- 34:30 testing new changes
- 34:45 debugging no uppercase appearance
- 36:00 test script success and summary
- 38:40 fix wide character in utf8 warning message
- 39:40 regenerate abstract page to show is_set test now returns true
Video
Notes, Errata and Additional Information
The content of the video has been tested in Ubuntu and Debian, using EPrints versions 3.3.13 and 3.3.14.
More Reading
- Metatada fields (http://wiki.eprints.org/w/Category:EPrints_Metadata_Fields)