Show TOC

Syntax documentationSystem API Locate this document in the navigation structure

System API provides a set of methods to discover the underlying client environment and current EPCM object. For background information, see System and Environment.

EPCM.getVersion()

Returns the current framework version as a number.

Example Example

  1. <script language="JavaScript">
        var version = EPCM.getVersion();
    </script>
    
End of the code.
EPCM.getLevel()

Returns the current EPCF level as a number.

The EPCF level defines which EPCF services are available. Make sure that your portal application only uses services that are available at the current EPCF level.

Example Example

  1. <script language ="JavaScript">
    if (EPCM.getLevel() >= 2) 
    		{
       EPCM.storeClientData( "urn:com.sap:myObjects","person", "John Doe" );
    		}
     </script>
    
End of the code.
EPCM.getUAType()

Returns the client (user agent) type as a number.

The return value is equal to one of the predefined EPCM constants:

EPCM.MSIE, EPCM.NETSCAPE, EPCM.MOZILLA, EPCM.OPERA, EPCM.NOKIA, EPCM_UP, EPCM_ERICSSON, EPCM_MSPIE, EPCM_PALM, EPCM.OTHER.

Example Example

  1. <SCRIPT language ="JavaScript">
         if(EPCM.getUAType() == EPCM.MSIE){/*for IE*/ }
         if(EPCM.getUAType() == EPCM.MOZILLA){/*for Mozilla*/ }
     </SCRIPT>
    
End of the code.
EPCM. getUAVersion()

Returns the version of the client as a number.

Example Example

  1. <SCRIPT language ="JavaScript">
        if(EPCM.getUAType() == EPCM.MSIE){
          if(EPCM.getUAVersion() == 6.0){/*for MSIE 6.0 */ }
          if(EPCM.getUAVersion() > 6.0){/*for MSIE 7.0*/ }
        }
     </SCRIPT>
    
End of the code.
EPCM.getUAPlatform()

Returns the platform on which the client is running as a number.

The return value can be compared to the predefined EPCM constants:

EPCM.NT_PLATFORM, EPCM.WIN_PLATFORM, EPCM.MAC_PLATFORM, EPCM.LINUX_PLATFORM, EPCM.WAP_PLATFORM, EPCM.PDA_PLATFORM, EPCM.OTHER_PLATFORM.

Example Example

  1. <SCRIPT language ="JavaScript">
       if(EPCM.getUAPlatform() == EPCM.LINUX_PLATFORM){
       /* code that is processed if the client runs on LINUX */
       }
    </SCRIPT>
    
End of the code.
EPCM.getInstanceId()

Returns a unique EPCM instance ID as a string.

When a page is refreshed, the previous instance of the EPCM object is discarded and a new instance is created. To check whether the EPCM instance has changed, compare the value returned by this method with a previously stored value.

Example Example

  1. <SCRIPT language ="JavaScript">
       document.write("EPCMInstanceId = " + EPCM.getInstanceId() );
    </SCRIPT>
    
End of the code.
EPCM.getUniqueWindowId()

Returns an unique identifier of the IFrame as a string.

You can use this method to append the returned IFrame identifier string to the name you use to define a client data bag. This creates a client data bag that can only be accessed by a specific IFrame.

Caution Caution

The method returns null when the window.top object (reference of the topmost frame of the current window) cannot be accessed because of the Same Origin Policy. For more information, see Relaxing of the Same Origin Policy.

End of the caution.

Example Example

  1. <SCRIPT language ="JavaScript">
         document.write("WindowId = " + EPCM.getUniqueWindowId() ); 
         ...     
         ECPM.storeClientData(
         "com.sap.portal:test",EPCM.getUniqueWindowId()+"Item",myItem);
         ...
     </SCRIPT>
    
End of the code.
EPCM.getSAPTop ()

Returns the reference to the topmost frame that belongs to the SAP portal.

Example Example

  1. <SCRIPT language ="JavaScript">
    if( EPCM.getSAPTop() == window){
      /* the current frame/window is the topmost one */
    }
    </SCRIPT>
    
End of the code.