14 Mapping URLs
This chapter includes the following topics:
14.1 WebUrlMapPlugin Component
WebCenter Content uses an Oracle WebLogic Server, which has a built-in web server, to filter pages through a web browser. User requests are authenticated with the Oracle WebLogic Server user store, or other configured user store, and communicated with the Content Server instance.
The WebUrlMapPlugin component enables you to map shortened URLs to other URLs using a substitution script for the mapping, which also enables you to map long URLs to abbreviated versions. The WebUrlMapPlugin component is installed (enabled) by default with the Content Server instance.
14.2 Script Construction
The shortened URLs that you can create generally use the following format:
http://myhostexample.com/prefix/suffix
The actual mapping process is based on the part of the URL that follows the host name portion. To resolve the shortened URL, the Content Server instance compares the prefix to those in the list of defined WebUrlMapPlugin entries. If a match exists, the Content Server instance uses the map script that corresponds to the matching prefix to display the applicable document or Content Server page. For more information about the suffix, see Supported Variables for Referencing.
To construct a URL mapping entry using the WebUrlMaps page, you must establish a prefix and define the corresponding map.
Prefix
The prefix portion of the mapping entry is any abbreviation you want to use to identify URLs of a certain form. For example, if you want your short URL to return the dynamic conversions of documents, you can use idc
as your prefix (for example, the abbreviated form of dynamic converter).
When you create your prefix, do not enter a slash (/) character at the beginning of it because the Content Server instance removes the first slash from the incoming URL before the prefix test is performed.
Caution:
Include a slash (/) at the end of your URL map prefix. Otherwise, your mappings can apply to many more URLs and interfere with standard Content Server operations.
Map
The map portion of the mapping entry is the Idoc Script code that the Content Server instance uses to resolve the shortened URL. You can use substitution tags (<!--$variable-->
) in the map portion. Examples include:
<!--$cgipath--> <!--$internetuser--> <!--$suffix-->
These substitution tags are variables that refer to the applicable parameters of a URL.
Simple 'if' constructions are also supported. For example, the following script segment performs a test to determine whether a value exists and is not empty:
<!--$if myconfigvar-->something<!--$endif-->
14.3 Supported Variables for Referencing
The map portion of the URL mapping entry uses the following standard variables for referencing:
-
The CGI path
This is the current CGI path of the Oracle WebLogic Server web server filter's configured Content Server instance. The web server filter is configured to provide both communication and security for this Content Server instance. A typical example is
/idcm1/idcplg
. -
The 'suffix' parameter
The value of the suffix variable (
<!--$suffix-->
) is derived from the part of the URL that follows the preliminary mapping 'prefix' and before the question mark (?). Any slashes (/) at the beginning of the suffix are removed before being substituted into this variable. For example, in the following URL, 'dc
' is the mapping prefix followed by the suffix.http://myhostexample.com/dc/mydocumentname
After removing the slash,
mydocumentname
is used as the value for the suffix variable that is used as a substitution tag in the map portion of the mapping entry. Also, the suffix variable does not include any CGI parameters. Therefore, in the following URL,mydocumentname
is still used as the suffix variable's value.http://myhostexample.com/dc/mydocumentname?a=1
To enforce the slash separation between the prefix and suffix, add the slash at the end of your prefix abbreviation.
-
Any plugin variable
For example, you could use the construct
<!--$internetuser-->
to substitute for the user ID of the currently logged-in user. -
Any CGI parameter
14.5 Mapping Examples
The following examples demonstrate mapping scripts and techniques.
14.5.1 Info Update Form
You can define a web URL mapping script that enables you to create a shortened URL to generate the Info Update Form for existing content items. You can write the mapping script to allow users to enter any identification variable for a particular document. For example, all URLs with the following format:
http://myhostexample.com/u/mydoc_parameter
can be mapped to the URL:
http://myhostexample.com/idcm1//idcplg?IdcService=GET_UPDATE_FORM&dDocName=mydocumentname
To map URLs, define the following web URL map entry using the WebUrlMaps page:
-
Prefix:
u/
-
Map:
<!--$cgipath-->?IdcService=GET_UPDATE_FORM<!--$suffix-->&myparam=<!--$myparam-->
14.5.2 Dynamic Conversion
Dynamic Converter must be installed for this URL mapping example to work. See Dynamic Converter in Managing Oracle WebCenter Content.
You can define a web URL mapping script that enables you to create shortened URLs to various dynamic conversions of documents. For example, all URLs with the following format:
http://myexamplename.com/dc/mydocumentname
can be mapped to the URL:
http://myhostexample.com/idcm1/idcplg?IdcService=GET_DYNAMIC_CONVERSION&dDocName=mydocumentname&RevisionSelectionMethod=LatestReleased
To map URLs, define the following web URL map entry using the WebUrlMaps page:
-
Prefix:
dc/
-
Map:
<!--$cgipath-->?IdcService=GET_DYNAMIC_CONVERSION&dDocName=<!--$suffix-->&RevisionSelectionMethod=LatestReleased
14.5.3 CGI parameters
You can also directly reference CGI parameters. For example, URLs with the following format:
http://myhostexample.com/dcp/mydocumentname?myparam=myvalue
can be mapped to the URL:
http://myhostexample.com/idcm1/idcplg?IdcService=GET_DYNAMIC_CONVERSION&dDocName=mydocumentname&RevisionSelectionMethod=LatestReleased&myparam=myvalue
To map URLs, define the following web URL map entry using the WebUrlMaps page:
-
Prefix:
dcp/
-
Map:
<!--$cgipath-->?IdcService=GET_DYNAMIC_CONVERSION&dDocName=<!--$suffix-->&RevisionSelectionMethod=LatestReleased&myparam=<!--$myparam-->