ePages 7.21.0 - DE_EPAGES/Shop/API/Url.pm

Package DE_EPAGES::Shop::API::Url

Some functions to build shop urls.

@EXPORT_OK
BuildShopUrl
BuildDefaultShopUrl

Functions

BuildDefaultShopUrl
BuildShopUrl

BuildDefaultShopUrl

Builds an epages url for a given shop object with the given get parameters

Syntax
$url = BuildDefaultShopUrl($Object, $hParams, $hOptions, $Shop);
Input
$Object (object)
any object that belongs to a shop
$hParams (ref.hash)
url get parameters; values may be strings or arrays of strings
$hOptions (ref.hash)
with following keys:
  • Type - one of 'sf', 'admin', 'mobile', 'sf/mobile',
    if type is 'sf/mobile' a .mobile will be generated if the servlet is defined and the client
    is a mobile device, otherwise a .sf url is generated; defaults to 'sf' - string
  • UseSSL - use https as protocol if SSL enabled for shop / database (optional, defaults to 0) - boolean
  • UseObjectPath - use object path rather than objectid (optional, defaults to 0) - boolean
  • AddToken - add security token or not (optional, defaults to 0) - boolean
  • Token - the security token (required AddToken is true) - String
  • AddCookies - add cookies to url or not (optional, defaults to 0) - boolean
  • Cookies - cookie values (required if AddCookies is true) - hash.ref
  • NoUTF8 - do not use utf-8 for encoding get parameters (optional, defaults to 0) - boolean
  • IsMobileServlet - is the client a mobile device or not - boolean
$Shop (object)
the current shop
Return
$url (string)
the url

BuildShopUrl

Builds an epages url for a given shop object with the given get parameters

Syntax
$url = BuildShopUrl($Object, $hParams, $hOptions, $Servlet);
Example
$url = BuildShopUrl($PaymentMethod, {'ChangeAction' => 'Callback', 'ViewAction' => 'ViewResult'});
$url = BuildShopUrl($Shop, {'ChangeAction' => 'SaveDate', 'ViewAction' => 'ViewResult'});
$url = BuildShopUrl($PaymentMethod, {'ChangeAction' => ['BlockMonitor', 'Callback'], 'ViewAction' => 'ViewResult'});
Input
$Object (object)
any object that belongs to a shop
$hParams (ref.hash)
url get parameters; values may be strings or arrays of strings
$hOptions (ref.hash)
with following keys:
  • Type - one of 'sf', 'admin', 'mobile', 'sf/mobile',
    if type is 'sf/mobile' a .mobile will be generated if the servlet is defined and the client
    is a mobile device, otherwise a .sf url is generated; defaults to 'sf' - string
  • UseSSL - use https as protocol if SSL enabled for shop / database (optional, defaults to 0) - boolean
  • UseObjectPath - use object path rather than objectid (optional, defaults to 0) - boolean
  • AddToken - add security token or not (optional, defaults to 0) - boolean
  • AddCookies - add cookies to url or not (optional, defaults to 0) - boolean
  • NoUTF8 - do not use utf-8 for encoding get parameters (optional, defaults to 0) - boolean
$Servlet (object)
the current servlet (optional, but required if either AddToken or AddCookies is true)
Return
$url (string)
the url