Difference between revisions of "API:EPrints/URL"

From EPrints Documentation
Jump to: navigation, search
(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. -...)
 
 
(5 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/URL.pm|package_name=EPrints::URL}}[[Category:API|URL]]<!-- End of Pod2Wiki -->
+
  -->{{API}}{{Pod2Wiki}}{{API:Source|file=perl_lib/EPrints/URL.pm|package_name=EPrints::URL}}[[Category:API|URL]][[Category:API:EPrints/URL|URL]]<div><!-- Edit below this comment -->
<!-- Pod2Wiki=head_name -->=NAME=
+
 
 +
 
 +
<!-- Pod2Wiki=_private_ --><!-- Pod2Wiki=head_name -->
 +
==NAME==
 
'''EPrints::URL''' - URL utility methods
 
'''EPrints::URL''' - URL utility methods
  
<!-- End of Pod2Wiki -->
+
<!-- Edit below this comment -->
<!-- Pod2Wiki=head_description -->=DESCRIPTION=
+
 
 +
 
 +
<!-- Pod2Wiki= -->
 +
<!-- Pod2Wiki=head_description -->
 +
==DESCRIPTION==
 
This module contains utility methods for generating and getting URLs, relative paths etc.
 
This module contains utility methods for generating and getting URLs, relative paths etc.
  
<!-- End of Pod2Wiki -->
+
<!-- Edit below this comment -->
<!-- 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,
 
  );
 
 
 
<!-- End of Pod2Wiki -->
 
<!-- Pod2Wiki=head_methods -->=METHODS=
 
<!-- End of Pod2Wiki -->
 
<!-- 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.
+
<!-- Pod2Wiki= -->
 +
<!-- Pod2Wiki=head_synopsis -->
 +
==SYNOPSIS==
 +
<source lang="perl">use EPrints;
  
<!-- End of Pod2Wiki -->
+
my $base_url = $session->get_url->get(
<!-- Pod2Wiki=item_scheme_auto -->==scheme_auto==
+
scheme => "auto",
 +
host => 1,
 +
path => "cgi",
 +
query => 0,
 +
);</source>
  
  scheme =&gt; "auto"
+
<!-- Edit below this comment -->
  
Link to same protocol as is active now (N/A to shell scripts).
 
  
<!-- End of Pod2Wiki -->
+
<!-- Pod2Wiki= -->
<!-- Pod2Wiki=item_scheme_http -->==scheme_http==
+
<!-- Pod2Wiki=head_methods -->
 +
==METHODS==
 +
<!-- Pod2Wiki=head_get -->
 +
===get===
  
  scheme =&gt; "http"
+
<source lang="perl">$url = $url->get( %opts [, $page ] )
  
Link to the non-secure location.
+
</source>
 
+
Constructs a $url based on the current configuration and %opts. If $page is specified will return a URL to that page.
<!-- End of Pod2Wiki -->
 
<!-- Pod2Wiki=item_scheme_https -->==scheme_https==
 
  
  scheme =&gt; "https"
+
* scheme =&gt; "auto"
 +
: Link to same protocol as is active now (N/A to shell scripts).
  
Link to the secure location.
+
* scheme =&gt; "http"
 +
: Link to the non-secure location.
  
<!-- End of Pod2Wiki -->
+
* scheme =&gt; "https"
<!-- Pod2Wiki=item_host_1 -->==host_1==
+
: Link to the secure location (or http if <code>securehost</code> isn't defined).
  
  host =&gt; 1
+
* host =&gt; 1
 +
: Create an absolute link (including host and port).
  
Create an absolute link (including host and port).
+
* path =&gt; "auto"
 +
: Use the current path (N/A to shell scripts).
  
<!-- End of Pod2Wiki -->
+
* path =&gt; "static", path =&gt; "cgi", path =&gt; "images"
<!-- Pod2Wiki=item_path_auto -->==path_auto==
+
: Link to the root of the static, cgi and images respectively.
  
  path =&gt; "auto"
+
* query =&gt; 1
 +
: Create a self-referential link (i.e. include all parameters in the query part).
  
Use the current path (N/A to shell scripts).
+
<!-- Edit below this comment -->
  
<!-- End of Pod2Wiki -->
 
<!-- Pod2Wiki=item_path_static_path_cgi_path_images -->==path_static_path_cgi_path_images==
 
  
  path =&gt; "static", path =&gt; "cgi", path =&gt; "images"
+
<!-- Pod2Wiki= -->
 +
<!-- Pod2Wiki=head_copyright -->
 +
==COPYRIGHT==
 +
Copyright 2000-2011 University of Southampton.
  
Link to the root of the static, cgi and images respectively.
+
This file is part of EPrints http://www.eprints.org/.
  
<!-- 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_query_1 -->==query_1==
 
  
  query =&gt; 1
+
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.
  
Create a self-referential link (i.e. include all parameters in the query part).
+
You should have received a copy of the GNU Lesser General Public License along with EPrints. If not, see http://www.gnu.org/licenses/.
  
<!-- End of Pod2Wiki -->
+
<!-- Edit below this comment -->
<!-- Pod2Wiki=head_undocumented_methods -->=UNDOCUMENTED METHODS=
 
{{API:Undocumented Methods}}<!-- End of Pod2Wiki -->
 
<!-- Pod2Wiki=item_new -->==new==
 
  
<!-- End of Pod2Wiki -->
 
<!-- Pod2Wiki=item_to_string -->==to_string==
 
  
<!-- End of Pod2Wiki -->
+
<!-- Pod2Wiki= -->
<!-- Pod2Wiki=_postamble_ --><!-- End of Pod2Wiki -->
+
<!-- Pod2Wiki=_postamble_ -->
 +
<!-- Edit below this comment -->

Latest revision as of 09:56, 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

EPrints::URL - URL utility methods


DESCRIPTION

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


SYNOPSIS

use EPrints;

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


METHODS

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.

  • scheme => "auto"
Link to same protocol as is active now (N/A to shell scripts).
  • scheme => "http"
Link to the non-secure location.
  • scheme => "https"
Link to the secure location (or http if securehost isn't defined).
  • host => 1
Create an absolute link (including host and port).
  • path => "auto"
Use the current path (N/A to shell scripts).
  • path => "static", path => "cgi", path => "images"
Link to the root of the static, cgi and images respectively.
  • query => 1
Create a self-referential link (i.e. include all parameters in the query part).


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/.