Start of Content Area

Syntax documentation System API  Locate the document in its SAP Library structure

With the EPCF system API you have access to the settings of the EPCF service.

 

EPCM.getVersion()

This method returns the current framework version as type number.

Usage

<script language="JavaScript">

    var version = EPCM.getVersion();

</script>

 

EPCM.getLevel()

This method  returns the current EPCF level as type number.

The EPCF level defines which EPCF services are available. The portal application has to take care, that it uses services which are available at the current EPCF level.

Usage

<script language ="JavaScript">

   if (EPCM.getLevel() >= 2) {

       EPCM.storeClientData( "urn:com.sap:myObjects",

                             "person", "Albert Borland" );

   }

 </script>

 

EPCM.getUAType()

This method returns the client type as type number.

Usually this method will be used together with the method getUAVersion() and getUAPlatform(). The return value can be compared to predefined EPCM-constants:

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

Usage

<SCRIPT language ="JavaScript">

     if(EPCM.getUAType() == EPCM.MSIE){/*codingfor       IE*/ }

     if(EPCM.getUAType() == EPCM.MOZILLA){/*codingfor   Mozilla*/ }

 </SCRIPT>    

 

EPCM. getUAVersion()

This method returns version of the client as type number.

Usage

<SCRIPT language ="JavaScript">

    if(EPCM.getUAType() == EPCM.MSIE){

      if(EPCM.getUAVersion() ==       5.0){/*codingfor MSIE 5.0 */ }

      if(EPCM.getUAVersion() > 5.5){/*codingfor MSIE 5.0+*/ }

    }

 </SCRIPT>

 

 

EPCM.getUAPlatform()

This method returns the platform on which the client is running as type number.

The return value can be compared to predefined EPCM constants:

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

Usage

<SCRIPT language ="JavaScript">

   if(EPCM.getUAPlatform() == EPCM.LINUX_PLATFORM){

   /* coding that will only be processed if the client runs LINUX */

   }

</SCRIPT>

 

getInstanceId() Method

This method returns an unique EPCF instance as type String.

The method is used by the EPCF core to distinguish the pages after a page refresh.

Usage

<SCRIPT language ="JavaScript">

   document.write("EPCMInstanceId = " + EPCM.getInstanceId() );

</SCRIPT>

 

EPCM.getUniqueWindowId()

This method returns an unique identifier of the IFrame as type 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

The method returns null when the object returned by window.top is not accessible because of security reasons (JavaScript origin policy).

Usage

<SCRIPT language ="JavaScript">

     document.write("WindowId = " + EPCM.getUniqueWindowId() );

     ...    

     ECPM.storeClientData(

     "com.sap.portal:test",EPCM.getUniqueWindowId()+"Item",myItem);

     ...

 </SCRIPT>

 

End of Content Area