Jump to content
Wiki Home
EPrints Home
Bazaar
Files
Main menu
Main menu
move to sidebar
hide
Navigation
Front Page
EPrints 3 Manual
EPrints Training Course
EPrints Glossary
Installing EPrints
How-to Configure EPrints
EPrints 3.2+ API
EPrints 3 Reference
EPrints Plugins
Wiki
All categories
Recent changes
Main Page
Help
EPrints Documentation
Search
Search
Appearance
Log in
Request account
Personal tools
Log in
Request account
Pages for logged out editors
learn more
Contributions
Talk
Editing
API:EPrints/DataObj/Document
(section)
Page
Discussion
British English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Object 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_clone --> ====clone==== $newdoc = $doc->clone( $eprint ) Attempt to clone this document. Both the document metadata and the actual files. The clone will be associated with the given <tt>$eprint</tt>. Returns to the newly colument document. <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_remove --> ====remove==== $success = $doc->remove Attempt to completely delete this document. Including derived documents such as thumbnails. Returns boolean dependent on success of deleting document. <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_get_eprint --> ====get_eprint==== $eprint = $doc->get_eprint Returns the eprint this document is associated with. Alias for: $doc->get_parent <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_get_baseurl --> ====get_baseurl==== $url = $doc->get_baseurl Returns the base URL of the document. <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_is_public --> ====is_public==== $boolean = $doc->is_public Returnes <tt>true</tt> if this document has no security set and is in the live archive. Otherwise, returns <tt>false</tt>. <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_path --> ====path==== $path = $doc->path Returns the relative path to the document without specifying any file. <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_file_path --> ====file_path==== $path = $doc->file_path( [ $file ] ) Returns the relative path to <tt>$file</tt> stored in this document. If <tt>$file</tt> is undefined returns the path to the main file. This is an efficient shortcut to this: my $file = $doc->stored_file( $filename ); my $path = $file->path; <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_get_url --> ====get_url==== $url = $doc->get_url( [ $file ] ) Returns the full URL of the document. If <tt>$file</tt> is not specified then the main file is used. <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_local_path --> ====local_path==== $path = $doc->local_path DEPRECATED. Returns the full path of the directory where this document is stored in the filesystem. <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_files --> ====files==== %files = $doc->files Returns a hash, the keys of which are all the files belonging to this document (relative to [[API:EPrints/DataObj/Document#local_path|local_path]]). The values are the sizes of the files in bytes. <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_remove_file --> ====remove_file==== $success = $doc->remove_file( $filename ) Attempts to remove the file with <tt>$filename</tt>. <tt>$filename</tt> must be specified in the format that can be retrieved by [[API:EPrints/DataObj/Document#get_stored_file|get_stored_file]]. <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_set_main --> ====set_main==== $doc->set_main( $main_file ) Sets <tt>main</tt> for the document to the named <tt>$main_file</tt> and adjusts <tt>format</tt> and <tt>mime_type</tt> as necessary. Will not affect the database until the document is committed. Unsets <tt>main</tt> if <tt>$main_file</tt> is undefined. <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_get_main --> ====get_main==== $filename = $doc->get_main Returns the filename of the file set as <tt>main</tt> in this document. <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_set_format --> ====set_format==== $doc->set_format( $format ) Set format for document to <tt>$format</tt>. Will not affect the database until document is committed. Alias for: $doc->set_value( "format" , $format ); <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_set_format_desc --> ====set_format_desc==== $doc->set_format_desc( $format_desc ) Set format description for document to <tt>$format_desc</tt>. Will not affect the database until document is committed. Alias for: $doc->set_value( "format_desc" , $format_desc ); <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_upload --> ====upload==== $success = $doc->upload( $filehandle, $filename, [ $preserve_path, $filesize ] ) DEPRECATED - Use [[API:EPrints/DataObj/Document#add_file|add_file]], which will automatically identify the file type. Upload the contents of the given <tt>$filehandle</tt> into this document as the given <tt>$filename</tt>. If <tt>$preserve_path</tt> then make any subdirectories needed, otherwise place this in the top level directory. <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_add_file --> ====add_file==== $fileobj = $doc->add_file( $file, $filename, [ $preserve_path ] ) <tt>$file</tt> is the full path to a file to be added to the document, with name <tt>$filename</tt>. <tt>$filename</tt> is passed through [[API:EPrints/System#sanitise|EPrints::System#sanitise]] before being written. If <tt>$preserve_path</tt> is <tt>tru</tt>e then include path components in <tt>$filename</tt>. Returns the file object if successfully created or <tt>undef</tt> on failure. <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_upload_archive --> ====upload_archive==== $success = $doc->upload_archive( $filehandle, $filename, $archive_format ) DEPRECATED - use [[API:EPrints/DataObj/Document#add_archive|add_archive]]. Upload the file contents provided through <tt>$filehandle</tt> using the filename from <tt>$filename</tt>. How to deal with the specified <tt>$archive_format</tt> (e.g. <tt>.zip</tt>, <tt>.tar.gz</tt>) is configured in [[API:EPrints/SystemSettings|EPrints::SystemSettings]]. <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_add_archive --> ====add_archive==== $success = $doc->add_archive( $file, $archive_format ) Adds the contents of that archive <tt>$file</tt> to the document, where <tt>$archive_format</tt> is the format of the archive file (e.g. <tt>.zip</tt>, <tt>.tar.gz</tt>, etc.) Returns a boolean dependent on whether the contents of the archive file is added to the document's subdirectory on the filesystem. <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_add_directory --> ====add_directory==== $success = $doc->add_directory( $directory ) Upload the contents of <tt>$directory</tt> to this document. This will not set the document's <tt>main</tt> field. This method expects <tt>$directory</tt> to have a trailing slash <tt>/</tt>. Returns boolean depending on success of adding directory to document. <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_upload_url --> ====upload_url==== $success = $doc->upload_url( $url ) Attempts to grab files from the given <tt>$url</tt> over HTTP. Grabbing files this way is always problematic. Therefore, by default, only relative links will be followed and only links to files in the same directory or subdirectory will be followed. This method by default uses {{API:PodLink|file=https:|package_name=https:|section=|text=wget}}. However, you can modify this in [[API:EPrints/SystemSettings|EPrints::SystemSettings]]. Returns a boolean dependent of whether file(s) were successfully uploaded. <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_commit --> ====commit==== $success = $doc->commit( [ $force ] ) Commit any changes that have been made to this data object to the database. Calls <tt>set_document_automatic_fields</tt> in the archive's configuration first to set any automatic fields that may be needed. If <tt>$force</tt> is defined and <tt>true</tt> then still commit even if there are no non-volatile changes. Returns boolean depending on whether commit of document data object is successful. <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_get_derived_versions --> ====get_derived_versions==== @derived_docs = $doc->get_derived_versions Returns an array of documents that are derived from the current document through the <tt>isVersionOf</tt> relation. <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_validate --> ====validate==== $problems = $doc->validate( [ $for_archive ] ) Validates the document data object. If <tt>$for_archive</tt> is defined this will be passed through to the archive configured <tt>validate_document</tt> method, in case it is required for bespoke changes to this method. Returns a reference to an array of XHTML DOM objects describing validation problems with the entire document, including the metadata and repository config specific requirements. A returned reference to an empty array indicates no problems. <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_user_can_view --> ====user_can_view==== $boolean = $doc->user_can_view( $user ) Returns <tt>true</tt> if this document's security settings allow the given <tt>$user</tt> access to view it. <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_get_type --> ====get_type==== $type = $doc->get_type Returns the type of this document. Alias for: $doc->value( "format" ); <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_queue_files_modified --> ====queue_files_modified==== $doc->queue_files_modified Adds a <tt>files_modified</tt> task (e.g. for creating/updating thumbnails) to the event queue. <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_files_modified --> ====files_modified==== $doc->files_modified This method does all the things that need doing when a file has been modified. <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_rehash --> ====rehash==== $doc->rehash Recalculate the hash value of the document. Uses MD5 of the files (in alphabetic order), but can use user-specified hashing function instead. <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_make_indexcodes --> ====make_indexcodes==== $indexcodes_doc = $doc->make_indexcodes Make the index codes document for this document. Returns the generated index codes document on success or <tt>undef</tt> on failure. <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_remove_indexcodes --> ====remove_indexcodes==== $doc = $doc->remove_indexcodes Remove any documents containing index codes for this document. Returns the number of documents removed. <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_cache_file --> ====cache_file==== $filename = $doc->cache_file( $suffix ); DEPRECATED Returns a cache filename for this document with the given <tt>$suffix</tt>. <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_register_parent --> ====register_parent==== $doc->register_parent( $parent ) Registers the <tt>$parent</tt> [[API:EPrints/DataObj/EPrint|EPrints::DataObj::EPrint]] object for this document. This may cause reference loops, but it does avoid two identical eprint data objects existing at once. <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_thumbnail_url --> ====thumbnail_url==== $doc->thumbnail_url( $size ) Returns the URL for the thumbnail of the document for a specified <tt>$size</tt>. If <tt>$size</tt> is unspecified defaults to <tt>small</tt>. Other values for <tt>$size</tt> include <tt>medium</tt> and <tt>preview</tt>. Returns <tt>undef</tt> if file for particular type of thumbnail does not exist. This method is called bt [[API:EPrints/DataObj/Document#icon_url|icon_url]]. It is best to use that method to reliably retrieve the required URL. <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_icon_url --> ====icon_url==== $doc->icon_url( $size ) Returns the URL for the icon of the document for a specified <tt>$size</tt>. If <tt>$size</tt> is unspecified defaults to <tt>small</tt>. Other values for <tt>$size</tt> include <tt>medium</tt> and <tt>preview</tt>. <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_render_icon_link --> ====render_icon_link==== $frag = $doc->render_icon_link( %opts ) Render a link to the icon for this document. Options: new_window => 1 - Make link go to <tt>_blank</tt> not current window. preview => 1 - If possible, provide a preview pop-up. public => 0 - Show thumbnail/preview only on public documents. public => 1 - Show thumbnail/preview on all documents if possible. with_link => 0 - Do not link. <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_render_preview_link --> ====render_preview_link==== $frag = $doc->render_preview_link( %opts ) Render a link to the preview for this document (if available) using a lightbox. 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_caption_frag --> ====caption_frag==== caption => $frag XHTML fragment to use as the caption, defaults to empty. <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_set_name --> ====set_name==== set => "name" The name of the set this document belongs to, defaults to none (preview won't be shown as part of a set). <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_thumbnail_plugin --> ====thumbnail_plugin==== $plugin = $doc->thumbnail_plugin( $size ) Returns the plugin used to generatee thumbnails of the specified <tt>$size</tt>. <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_thumbnail_path --> ====thumbnail_path==== $path = $doc->thumbnail_path DEPRECATED Returns the filesystem path to location of thumbnails for the document. <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_thumbnail_types --> ====thumbnail_types==== $doc->thumbnail_types Returns array containing names of all the thumbnail types available for this document. <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_remove_thumbnails --> ====remove_thumbnails==== $doc->remove_thumbnails Removes all thumbnail files associated with this document. <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_make_thumbnails --> ====make_thumbnails==== $doc->make_thumbnails Make all the thumbnail files required for this document. <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_mime_type --> ====mime_type==== $mime_type = $doc->mime_type DEPRECATED - use <tt>$doc->value( "mime_type" )</tt> Returns the MIME type of this document. <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_get_parent_id --> ====get_parent_id==== $eprintid = $doc->get_parent_id Returns the ID of the parent for this document, (i.e. the eprint 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_add_relation --> ====add_relation==== $doc->add_relation( $tgt, @types ) Add one or more relations with type(s) specified by <tt>@types</tt> to the document data object and pointing to the <tt>$tgt</tt> data object. This will not update the <tt>$tgt</tt> data object even if reflexive relations exist. <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_remove_relation --> ====remove_relation==== $doc->remove_relation( $tgt, [ @types ] ) Removes the relations for the document data object to the <tt>$tgt</tt> data object. If <tt>@types</tt> is not defined, remove all relations to <tt>$tgt</tt>. If <tt>$tgt</tt> is also undefined removes all relations given in <tt>@types</tt>. If both <tt>$tgt</tt>, and <tt>@types</tt> are both undefined no relations will be removed. If you want to remove all relations do: $doc->set_value( "relation", [] ); <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_has_relation --> ====has_relation==== $bool = $doc->has_relation( $tgt, [ @types ] ) Returns <tt>true</tt> if document data object has relations to <tt>$tgt</tt>. If <tt>@types</tt> is also given, check these relations satisfy all of the given types. If <tt>$tgt</tt> is undefined, relations that satisfy the given types may be to any data object. <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_search_related --> ====search_related==== $list = $doc->search_related( [ $type ] ) Returns an [[API:EPrints/List|EPrints::List]] that contains all document data objects related to this document data object. If <tt>$type</tt> is defined return only those document data object related by that type. <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_render_citation_link --> ====render_citation_link==== $citation = $doc->render_citation_link( $style, %params ) Returns a XHTML DOM citation rendering of the document data object. Using citation <tt>$style</tt> and <tt>%params</tt> provided and setting class for DOM parent element to <tt>ep_document_link</tt>. <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_render_video_preview --> ====render_video_preview==== $frag = $doc->render_video_preview( $css_class ) Returns a XHTML DOM fragment rendering of a HTML5 video preview with optional subtitles. Assigning the <tt>$css_class</tt> to the parent element if the XHTML DOM fragment, if provided. Access / security concerns should be addressed at a higher level. <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_permit --> ====permit==== $boolean = $doc->permit( $priv, $user ) Returns boolean depending on whether the <tt>$user</tt> has the privilege <tt>$priv</tt> to carry out a particular action on this document data object. See [[API:EPrints/DataObj#permit|EPrints::DataObj#permit]]. <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_utility_methods -->
Summary:
Please note that all contributions to EPrints Documentation may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
EPrints Documentation:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)