Difference between revisions of "API:EPrints/URL"

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/URL.pm|package_name=EPrints::URL}}[[Category:API|URL]]<div><!-- Edit below this comment -->
  
 +
 +
<!-- Pod2Wiki=_private_ --><!-- Pod2Wiki=head_name -->
 +
==NAME==
 +
'''EPrints::URL''' - URL utility 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=head_description -->
 +
==DESCRIPTION==
 +
This module contains utility methods for generating and getting URLs, relative paths etc.
 +
 +
<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==
 +
  use EPrints;
 +
 
 +
  my $base_url = $session-&gt;get_url-&gt;get(
 +
    scheme =&gt; "auto",
 +
    host =&gt; 1,
 +
    path =&gt; "cgi",
 +
    query =&gt; 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=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_get -->
 +
===get===
 +
 +
$url = $url-&gt;get( %opts [, $page ] )
 +
Constructs a $url based on the current configuration and %opts. If $page is specified will return a URL to that 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=item_scheme_auto -->
 +
===scheme_auto===
 +
 +
scheme =&gt; "auto"
 +
Link to same protocol as is active now (N/A to shell scripts).
 +
 +
<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_scheme_http -->
 +
===scheme_http===
 +
 +
scheme =&gt; "http"
 +
Link to the non-secure location.
 +
 +
<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_scheme_https -->
 +
===scheme_https===
 +
 +
scheme =&gt; "https"
 +
Link to the secure location.
 +
 +
<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_host_1 -->
 +
===host_1===
 +
 +
host =&gt; 1
 +
Create an absolute link (including host and port).
 +
 +
<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_auto -->
 +
===path_auto===
 +
 +
path =&gt; "auto"
 +
Use the current path (N/A to shell scripts).
 +
 +
<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_static_path_cgi_path_images -->
 +
===path_static_path_cgi_path_images===
 +
 +
path =&gt; "static", path =&gt; "cgi", path =&gt; "images"
 +
Link to the root of the static, cgi and images respectively.
 +
 +
<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_query_1 -->
 +
===query_1===
 +
 +
query =&gt; 1
 +
Create a self-referential link (i.e. include all parameters in the query part).
 +
 +
<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 13:21, 25 February 2010

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::URL - URL utility methods

User Comments


DESCRIPTION

This module contains utility methods for generating and getting URLs, relative paths etc.

User Comments


SYNOPSIS

 use EPrints;
 
 my $base_url = $session->get_url->get(
   scheme => "auto",
   host => 1,
   path => "cgi",
   query => 0,
 );
 

User Comments


METHODS

User Comments


get

$url = $url->get( %opts [, $page ] )

Constructs a $url based on the current configuration and %opts. If $page is specified will return a URL to that page.

User Comments


scheme_auto

scheme => "auto"

Link to same protocol as is active now (N/A to shell scripts).

User Comments


scheme_http

scheme => "http"

Link to the non-secure location.

User Comments


scheme_https

scheme => "https"

Link to the secure location.

User Comments


host_1

host => 1

Create an absolute link (including host and port).

User Comments


path_auto

path => "auto"

Use the current path (N/A to shell scripts).

User Comments


path_static_path_cgi_path_images

path => "static", path => "cgi", path => "images"

Link to the root of the static, cgi and images respectively.

User Comments


query_1

query => 1

Create a self-referential link (i.e. include all parameters in the query part).

User Comments