Map Class Methods
In this section, the Map class methods are presented in alphabetical order.
Syntax
AddAttribute(name, value)
Description
Use the AddAttribute method to add an attribute stored as a name/value pair in the psmap browser cookie. For example, the psmap cookie can be used to store URL history for the Back button, the state of the MAP application between pages, or other application-specific information.
Note: The contents of the psmap cookie are entirely under the control of the application developer. You can add attributes, delete attributes, delete all attributes, or retrieve attributes on any server trip.
Parameters
Field or Control |
Definition |
---|---|
name |
Specifies the attribute name as a String value. |
value |
Specifies the attribute value as a String value. |
Returns
A Boolean value.
Example
&b_Ret = &Map.AddAttribute("URL_1", "http://example.com");
Syntax
AddMetaTag(name, value)
Description
Use this method to add an HTML <meta> tag to the HTML document.
Parameters
Field or Control |
Definition |
---|---|
name |
Specifies the name of the <meta> tag as a String. |
value |
Specifies the value of the <meta> tag as a String. |
Returns
A Boolean value: True if the method executes successfully, False otherwise.
Example
The following example adds an HTML <meta> tag:
&bret = &Map.AddMetaTag("apple-mobile-web-app-capable", "yes");
The resulting HTML code would include the tag as follows:
<meta apple-mobile-web-app-capable="yes">
Syntax
ClearAttributes()
Description
Use the ClearAttributes method to delete all attributes from the psmap cookie.
Parameters
None.
Returns
None.
Example
&Map.ClearAttributes();
Syntax
DeleteAttribute(name)
Description
Use the DeleteAttribute method to delete an attribute from the psmap cookie by specifying the attribute's name.
Parameters
Field or Control |
Definition |
---|---|
name |
Specifies the attribute name as a String value. |
Returns
A Boolean value.
Example
&bRet = &Map.DeleteAttribute("URL_1");
Syntax
DeleteMetaTag(name)
Description
Use this method to delete an HTML <meta> tag from the HTML document.
Parameters
Field or Control |
Definition |
---|---|
name |
Specifies the name of the <meta> tag as a String. |
Returns
A Boolean value: True if the method executes successfully, False otherwise.
Syntax
GetAJAXName(index)
Description
Use this method to return the name of an AJAX parameter that has been parsed by the MAP framework.
Parameters
Field or Control |
Definition |
---|---|
index |
Specifies which AJAX parameter as a Integer. |
Returns
A String value.
Syntax
GetAJAXNonSerializedData()
Description
Use this method to return the input to an AJAX event as non-serialized data (that is, as a data blob).
Parameters
None.
Returns
A String value.
Syntax
GetAJAXValue(index)
Description
Use this method to return the value of an AJAX parameter that has been parsed by the MAP framework.
Parameters
Field or Control |
Definition |
---|---|
index |
Specifies which AJAX parameter as an Integer. |
Returns
A String value.
Syntax
GetAJAXValueByName(name)
Description
Use this method to return the value of an AJAX parameter that has been parsed by the MAP framework.
Parameters
Field or Control |
Definition |
---|---|
name |
Specifies the name of the AJAX parameter as a String. |
Returns
A String value.
Example
&A_Value = &Map.GetAJAXValueByName("SearchGroupName");
Syntax
GetAttributeName(n_index)
Description
Use the GetAttributeName method to return the attribute name for the nth attribute of the psmap cookie as a String.
Parameters
Field or Control |
Definition |
---|---|
n_index |
Specifies the index for the attribute as a Integer value. |
Returns
A String value.
Example
&name = &Map.GetAttributeName(&i);
Syntax
GetAttributeValue(n_index)
Description
Use the GetAttributeValuemethod to return the attribute value for the nth attribute of the psmap cookie as a String.
Parameters
Field or Control |
Definition |
---|---|
n_index |
Specifies the index for the attribute as a Integer value. |
Returns
A String value.
Example
&value = &Map.GetAttributeValue(&i);
Syntax
GetAuthToken()
Description
Use this method to get the authentication token for the user signed into this MAP application.
Parameters
None.
Returns
A String value.
Syntax
GetAuthTokenDomain()
Description
Use the GetAuthTokenDomain method to return as String value representing the authentication domain for the active web profile as defined on the Web Profile Configuration page.
Parameters
None.
Returns
A String value.
Example
&domain = &Map.GetAuthTokenDomain();
Syntax
GetCSS()
Description
Use this method to return the in-line CSS that has been set for the MAP layout.
Parameters
None.
Returns
A String value.
Syntax
GetCustDocument()
Description
Use the GetCustDocument method to return the custom document defined for this MAP layout.
Parameters
None.
Returns
A Document object.
Syntax
GetDocument()
Description
Use this method to return the Document object associated with this MAP layout.
Parameters
None.
Returns
A Document object.
Syntax
GetElement(element_ID)
Description
Use this method to return a MapElement object from this MAP layout.
Parameters
Field or Control |
Definition |
---|---|
element_ID |
Specifies the element ID as a String. Note: The element_ID must be valid for this MAP layout. |
Returns
A MapElement object.
Example
In the following example, the label text for the back button in the application is set to the value of the PSBackLabel property:
&Map.GetElement("map_back_button").LabelText = &Map.PSBackLabel;
Syntax
GetExceptionDocument()
Description
When an exception is thrown, use the GetExceptionDocument method to return the exception document defined for this MAP layout.
Parameters
None.
Returns
A Document object.
Syntax
GetExceptionURIDocument()
Description
When an exception is thrown, use the GetExceptionURIDocument method to return the exception URI document defined for this MAP layout.
Parameters
None.
Returns
A Document object.
Syntax
GetJavaScript()
Description
Use this method to return the in-line JavaScript that has been set for the MAP layout.
Parameters
None.
Returns
A String value.
Syntax
GetMetaTagName(index)
Description
Use this method to get the name of an HTML <meta> tag.
Parameters
Field or Control |
Definition |
---|---|
index |
Specifies which <meta> tag as an Integer. |
Returns
A String value.
Syntax
GetNumberofAJAXParms()
Description
Use this method to return the number of parsed AJAX parameters.
Parameters
None.
Returns
An Integer value.
Example
The following example loops through the parsed AJAX parameters:
For &i = 1 To &Map.GetNumberofAJAXParms()
&A_Name = &Map.GetAJAXName(&i);
&A_Value = &Map.GetAJAXValue(&i);
...
End-For;
Syntax
GetNumberOfAttributes()
Description
Use the GetNumberOfAttributes method to return the number of attributes stored in the psmap cookie as an Integer.
Parameters
None.
Returns
An Integer value.
Example
For &i = 1 To &Map.GetNumberOfAttributes()
&name = &Map.GetAttributeName(&i);
&value = &Map.GetAttributeValue(&i);
/* Additional processing */
End-For;
Syntax
GetNumberOfMetaTags()
Description
Use this method to return the number of HTML <meta> tags in the HTML document.
Parameters
None.
Returns
An Integer value.
Syntax
GetPage(page_number)
Description
Use this method to return one of the MapPage objects associated with this MAP layout.
Parameters
Field or Control |
Definition |
---|---|
page_number |
Specifies the which MapPage as an Integer. |
Returns
A MapPage object.
Example
The following example gets the first page of the MAP application:
&Page = &Map.GetPage(1);
Syntax
GetPortaName()
Description
Use the GetPortaName method to return the name of the current portal as a String value.
Parameters
None.
Returns
A String value.
Example
&PortalName = &Map.GetPortaName();
Syntax
GetPortalNodeName()
Description
Use the GetPortalNodeName method to return the name of the node from the current portal as a String value. If the portal host node name cannot be determined for the current portal, then the default local node name for the current system is returned.
Parameters
None.
Returns
A String value.
Example
Within a MAP application, you could use an invocation similar to the following to generate a URL for an absolute reference to a PeopleSoft component:
&URL = GenerateComponentPortalURL(&Map.GetPortaName(), &Map.GetPortalNodeName(), MenuName.PORTAL_ADMIN, %MAP_Market, Component.PTSF_GBLSRCH_FLUID, Page.PTS_NUI_GBLSRCH, "U");
Syntax
GetURIDocument()
Description
Use this method to return the URI document associated with the MAP layout.
Parameters
None.
Returns
A Document object.
Syntax
GetWebServerInfo()
Description
Use the GetWebServerInfo method to return information about the web server as a String value with the following format:
SERVERTYPE:WS_type OSNAME:OS_name HOSTNAME:host_name/IP_address
For example:
SERVERTYPE:Weblogic OSNAME:Windows Server 2008 R2 HOSTNAME:MYSERVER/192.0.2.100
Parameters
None.
Returns
A String value.
Example
&WS_info = &Map.GetWebServerInfo();
Syntax
LoadState(state_ID)
Description
Use this method to re-load the Document object based on the state ID generated by the MAP framework.
The MAP framework automatically generates and saves the state ID for a layout when the “Retain State” check box has been selected in the Layout Details group box of the Layout page.
Parameters
Field or Control |
Definition |
---|---|
state_ID |
Specifies the automatically generated state ID as a String. |
Returns
A Boolean value: True if the method executes successfully, False otherwise.
Syntax
SetCSS(CSS_data)
Description
Use this method to set in-line CSS data for this MAP layout.
Parameters
Field or Control |
Definition |
---|---|
CSS_data |
Specifies the in-line CSS as a String. |
Returns
A Boolean value: True if the method executes successfully, False otherwise.
Syntax
SetJavaScript(JS_code)
Description
Use this method to set in-line JavaScript for this MAP layout.
Parameters
Field or Control |
Definition |
---|---|
JS_code |
Specifies the in-line JavaScript as a String. |
Returns
A Boolean value: True if the method executes successfully, False otherwise.
Syntax
SetOvrdAJAXDocument(&doc)
Description
Use this method to specify an override Document object to be the non-serialized output for an AJAX event.
Parameters
Field or Control |
Definition |
---|---|
&doc |
Specifies the override as a Document object. |
Returns
A Boolean value: True if the method executes successfully, False otherwise.
Example
&bSuccess = &Map.SetOvrdAJAXDocument(&responseDoc);
Syntax
StateExists(state_ID)
Description
Use this method to determine whether the specified state ID exists for this MAP application.
The MAP framework automatically generates and saves the state ID for a layout when the “Retain State” check box has been selected in the Layout Details group box of the Layout page.
Parameters
Field or Control |
Definition |
---|---|
state_ID |
Specifies the state ID as a String. |
Returns
A Boolean value: True if the method executes successfully, False otherwise.
Syntax
ValidateSessionID(session_ID)
Description
Use this method to validate a session ID, which has been passed into the MAP framework from the client using a name/value pair. Use this method with events when the MAP framework does not perform input serialization—for example, with AJAX events. The method can be used to prevent cross-site request forgery attacks.
Parameters
Field or Control |
Definition |
---|---|
session_ID |
Specifies the session ID as a String. |
Returns
A Boolean value: True if the method executes successfully, False otherwise.
Example
&b_ret = &Map.ValidateSessionID("Z9X16v2zja37ZUSTEwmp3PejmU");