# 22. Virtuoso Functions Guide - http_map_get

Chapter Contents | Prev | Next
Keyword Search:
www.openlinksw.com
docs.openlinksw.com
Book Home
Contents
Preface
Virtuoso Functions Guide
Administration
Aggregate Functions
Array Manipulation
BPEL APIs
Backup
Compression
Cursor
Date & Time Manipulation
Debug
Dictionary Manipulation
Encoding & Decoding
File Manipulation
Free Text
Hashing / Cryptographic
LDAP
Locale
Mail
Miscellaneous
Number
Remote SQL Data Source
Replication
SOAP
SQL
String
Transaction
Type Mapping
UDDI
User Defined Types & The CLR
Virtuoso Java PL API
Virtuoso Server Extension Interface (VSEI)
Web Server & Internet
dav add & update fun...
dav manipulation fun...
dav search functions
dav_exp
lfs_exp
serv_queue_top
vhost_define
vhost_remove
webdav users & group...
client_attr
connection_get
connection_id
connection_is_dirty
connection_set
connection_vars
connection_vars_set
dbname
ftp_get
ftp_ls
ftp_put
get_certificate_info
get_keyword
get_keyword_ucase
http
http_acl_get
http_body_read
http_client
http_client_ip
http_debug_log
http_enable_gz
http_file
http_flush
http_get
http_header
http_header_get
http_kill
http_listen_host
http_map_get
http_map_table
http_param
http_path
http_pending_req
http_physical_path
http_proxy
http_request_get
http_request_header
http_request_status
http_rewrite
http_root
http_url
http_value
http_xslt
ses_connect
ses_disconnect
ses_read_line
ses_write
tcpip_gethostbyaddr
tcpip_gethostbyname
vsp_calculate_digest
wsdl_import_udt
XML
XPATH & XQUERY
Functions Index

## http_map_get

get values from HTTP virtual host path mapping table
http_map_get (in element_name varchar);
Parameters
element_name – The possible values for element_name are: 'vsp_uid', 'soap_uid', 'persist_ses_vars', 'default_page', 'browseable', 'security_level' , 'auth_opts', 'soap_opts', 'domain', 'mounted'.
Description

Retrieves information associated with the virtual host / HTTP path mapping in effect for the VSP page being processed. Values valid in current connection or URL context may be retrieved by element_name.

Calling http_map_get has no use outside of http context. In this case an error will be signalled.

Return Types

Value returned depends of element_name:

element_name | Datatype | Return value
--- | --- | ---
vsp_uid | VARCHAR | Which SQL user active content will execute as
soap_uid | VARCHAR | Which SQL user SOAP calls will be executed as
persist_ses_vars | INTEGER | Is persisting of session variables enabled?
default_page | VARCHAR | Default page for current mapping
browseable | INTEGER | Is directory browsing enabled?
security_level | VARCHAR | Security level ('DIGEST', 'SSL', 'BASIC')
auth_opts | ANY | Application-specific authentication options
soap_opts | ANY | Application-specific SOAP options
domain | VARCHAR | Directory path that is the logical start point of current mapping.
mounted | VARCHAR | Physical path that is the physical start point of current mapping

Examples
Retrieving Mapping Details

    <?vsp
    declare def_page varchar;
    def_page := http_map_get ('default_page');
    http (sprintf ('<p>The default page for this path is: %s </p>', def_page));
    ?>

Warn users if non-SSL connection

    <HTML>
      <HEAD>
        <TITLE>TEST</TITLE>
      </HEAD>
      <BODY>
        <P>We're executing as <?= http_map_get ('vsp_uid') ?></P>
    <?vsp
        if (http_map_get ('security_level') <> 'SSL')
          {
    ?>
        Warning: This page is not protected by transport level encryption
        and may be viewable by anybody in the middle with a network
        sniffer.
    <?vsp
          }
    ?>
      </BODY>
    </HTML>