AppeonExtFuncs object

AppeonExtfuncs object provides functions to help users manipulate the deployed application. The function of the AppeonExtfuncs object usually returns different values in the PowerBuilder application and in the deployed application. The values returned in the PowerBuilder application are defined in the AppeonExtfuncs object; while the values returned in the deployed application are defined in the Appeon client library.

The function of AppeonExtfuncs object performs almost identical to the global function of the Appeon client functions. Typically, the function of AppeonExtfuncs object is recommended over the Appeon client functions for the following two reasons:

  • The function of the AppeonExtfuncs object delivers a better extensibility and is much easier to manage.

  • Calling too much global functions of Appeon client functions may affect the performance.

Calling functions of AppeonExtFuncs object

The best way to use these functions is to pass their return values into Appeon Server NVO components. Then, in the Appeon Server NVO components, the information (such as browser version, user name etc.) can be utilized to code more application features such as security authentication, auditing, logging, file operation, etc. This means you can write more scripts in NVO components for implementing more application features.

Below lists the function of AppeonExtfuncs object and their corresponding Appeon client functions.

Table 1. Functions of AppeonExtFuncs object

Function of AppeonExtFuncs object

Appeon client functions

Description

of_getappeonusername function

AppeonGetAppeonUserName function

Gets the user name that you type into the Appeon Login dialog box.

of_getbrowserversion function

AppeonGetBrowserVersion function

Gets the Internet Explorer version of the client.

of_getcachedir function

AppeonGetCacheDir function

Gets the Cache directory that is used by the current application.

of_getclientid function

AppeonGetClientID function

Gets the unique session identifier for the Web client.

of_getclientip function

AppeonGetClientIP function

Gets the IP address of the Web client.

of_getclienttype function

AppeonGetClientType function

Gets the type of an application.

of_gethttpinfo function

AppeonGetHttpInfo function

Gets the HTTP header information from a particular request.

of_getiehandle function

AppeonGetIEHandle function

Gets the Internet Explorer handle for the current application.

of_getieurl function

AppeonGetIEURL function

Gets the URL of the application.

of_getostype function

AppeonGetOSType function

Gets the type of OS that runs your application (the Appeon Web application, the Appeon mobile application, or the PowerBuilder client application).

NA

AppeonGetRemainingdays function

Gets the remaining day(s) of license or technical support.

of_getservertype function

AppeonGetServerType function

Gets the Appeon Server type where the application runs.

of_getsessioncount function (Obsolete)

AppeonGetSessionCount function (Obsolete)

This function is obsolete since Appeon for PowerBuilder 2013.

Replace it with the getSessionCount function in Appeon Server open interfaces.

of_is64browser function

appeonisin64browser function

Detects if the IE browser where the application runs is 64-bit.

of_ldaplogon function

AppeonLDAPLogon Function

Logs in to the LDAP server with the specified user name and password.

of_popmenu function

AppeonPopMenu function

Pops up Appeon DataWindow menu at a specified position in a specified DataWindow control.

of_popmenuon function

AppeonPopMenuOn function

Pops up Appeon DataWindow menu in a specified window when you right click the mouse button.

of_print2file function

AppeonPrint2File function

Saves the specified DataWindow as image files of BMP, JPG or GIF format.

of_Print2PDF function (Obsolete)

AppeonPrint2PDF function (Obsolete)

of_Print2PDF is an obsolete function and will be discontinued in a future release. Please replace it with the SaveAs function of the DataWindow or Child DataWindow and set the saveas file type to PDF format.

of_SetHintText function

AppeonSetHintText function

Sets the HintText property of the SingleLineEdit control. The HintText property is not available in PowerBuilder SingleLineEdit control. It is specially designed for the Appeon Mobile application.

of_switchRealTimeCalc function

AppeonSwitchRealTimeCalc function

Performs the DataWindow real-time expression calculation in time or performs the calculation for only one time in the whole life-cycle.


of_getappeonusername function

Description

Gets the user name that you type into the Appeon Login dialog box.

Syntax

appeonextfuncs.of_getappeonusername ( )

Argument

Description

appeonextfuncs

A reference to an AppeonExtFuncs object.

Return value

String.

Usage

This function takes effect in the deployed Appeon application, not in the PowerBuilder application.

of_getbrowserversion function

Description

Gets the Internet Explorer version of the Web client.

Supported on the Web client only.

Syntax

appeonextfuncs.of_getbrowserversion ( )

Argument

Description

appeonextfuncs

A reference to an AppeonExtFuncs object.

Return value

String.

Usage

This function takes effect in the deployed Appeon application, not in the PowerBuilder application.

of_getcachedir function

Description

Gets the cache directory that is used by the current application.

For the Web application, the cache directory can be customized in AEM. For details, refer to the section called “Client Storage Location” in Appeon Server Configuration Guide for .NET in Appeon Server Configuration Guide for J2EE.

For the iOS mobile application, the cache directory is /$Appeon_Mobile_folder$/Documents/$your_application_folder$, for example, /var/mobile/Applications/144F5F33-A33F-480D-A3D9-01BBA5410EB2/Documents/4c001b05.

For the Android mobile application, the cache directory is /data/data/$Appeon_Mobile_folder$/files/$your_application_folder$, for example, /data/data/com.appeon.mobile/files/21746870.

Syntax

appeonextfuncs.of_getcachedir ( )

Argument

Description

appeonextfuncs

A reference to an AppeonExtFuncs object.

Return value

String.

Usage

This function takes effect in the deployed Appeon application, not in the PowerBuilder application.

of_getclientid function

Description

Gets the unique session identifier for the Web or mobile client.

Syntax

appeonextfuncs.of_getclientid ( )

Argument

Description

appeonextfuncs

A reference to an AppeonExtFuncs object.

Return value

String.

of_getclientip function

Description

Gets the IP address of the Web or mobile client.

Syntax

appeonextfuncs.of_getclientip ( )

Argument

Description

appeonextfuncs

A reference to an AppeonExtFuncs object.

Return value

String.

of_getclienttype function

Description

Gets the type of an application.

Syntax

appeonextfuncs.of_getclienttype ( )

Argument

Description

appeonextfuncs

A reference to an AppeonExtFuncs object.

Return value

String.

Returns "WEB" if the application runs on the Web.

Returns "PB" if the application runs in PowerBuilder.

Returns "MOBILE" if the application runs on a mobile device.

of_gethttpinfo function

Description

Gets the HTTP header information from a particular request.

Syntax

appeonextfuncs.of_gethttpinfo ( string attribute )

Argument

Description

appeonextfuncs

A reference to an AppeonExtFuncs object.

attribute

The required HTTP information. For example, "Host", "Cookie", etc.

Return value

String.

Usage

This function takes effect in the deployed Appeon application, not in the original PowerBuilder application.

of_getiehandle function

Description

Gets the Internet Explorer handle for the Web application.

Supported on the Web client only.

Syntax

appeonextfuncs.of_getiehandle ( )

Argument

Description

appeonextfuncs

A reference to an AppeonExtFuncs object.

Return value

Long.

Usage

This function takes effect in the deployed Appeon application, not in the PowerBuilder application.

of_getieurl function

Description

Gets the URL of the Web application.

For the mobile application, use of_getappinfo to get the URL of the mobile application.

Syntax

appeonextfuncs.of_getieurl ( )

Argument

Description

appeonextfuncs

A reference to an AppeonExtFuncs object.

Return value

String.

Usage

This function takes effect in the deployed Appeon application, not in the PowerBuilder application.

of_getostype function

Description

Gets the type of OS that runs your application (the Appeon Web application, the Appeon mobile application, or the PowerBuilder client application).

Syntax

appeonextfuncs.of_getostype ( )

Argument

Description

appeonextfuncs

A reference to an AppeonExtFuncs object.

Return value

String.

Returns the type of OS that runs the Appeon Web application, the Appeon mobile application, or the PowerBuilder client application.

of_getrunmode function

Description

Gets the running mode of an application.

Syntax

appeonextfunc.of_getrunmode ( )

Argument

Description

appeonextfuncs

A reference to an AppeonExtFuncs object.

Return value

String

Returns "" an empty string if the application runs in PowerBuilder.

Returns "RELEASE" or "DEBUG" (Debug JS, or debug JS/PS) (according to the generation mode setting in Appeon Developer, see the section called “Selecting an application file generation mode” in Appeon Developer User Guide) if the application runs on the Web or a mobile device.

of_getservertype function

Description

Gets the Appeon Server type where the application runs.

Syntax

appeonextfuncs.of_getservertype ( )

Argument

Description

appeonextfuncs

A reference to an AppeonExtFuncs object.

Return value

Integer

Returns 1 if the Appeon applications runs on an Appeon Server that is installed to a Java Server (such as EAServer).

Returns 2 if the Appeon applications runs on an Appeon Server that is installed to a .NET IIS server.

Usage

This function takes effect in the deployed Appeon application, not in the PowerBuilder application.

of_getsessioncount function

This function is obsolete since Appeon for PowerBuilder 2013. Replace it with the getSessionCount function in Appeon Server open interfaces.

of_getwebservicerespxml function

This function is used by Appeon for internal purpose.

of_is64browser function

Description

Detects if the IE browser where the Web application runs is 64-bit.

Supported on the Web client only.

Syntax

appeonextfuncs.of_is64browser ( )

Argument

Description

appeonextfuncs

A reference to an AppeonExtFuncs object.

Return value

Boolean

Returns "true" if the Appeon application runs on a 64-bit IE browser.

Returns "false" if the Appeon application runs on a 32-bit IE browser.

Usage

This function takes effect in the deployed Appeon application, not in the PowerBuilder application.

of_ldaplogon function

Description

Logs in to the LDAP server with the specified user name and password.

Syntax

appeonextfuncs.of_ldaplogon ( string as_username, string as_password )

Argument

Description

appeonextfuncs

A reference to an AppeonExtFuncs object.

as_username

User name for logging into the LDAP server.

as_password

Password for logging into the LDAP server.

Return value

String.

Returns "" an empty string if the login succeeds.

Returns the error information.

Usage

This function takes effect in the deployed Appeon application, not in the PowerBuilder application. To make this function work in the Appeon application, you should set the System Security to ON in AEM, and make sure the LDAP server is correctly set up. For detailed instructions, refer to the section called “System Security” in Appeon Server Configuration Guide for .NET or Appeon Server Configuration Guide for J2EE.

of_log function

Description

Generates the Web/mobile client log information, and the default log level is INFO.

This function is supported on both the Web and mobile clients.

Syntax

appeonextfuncs.of_log ( integer ai_level, string as_info )

Argument

Description

appeonextfuncs

A reference to an AppeonExtFuncs object.

ai_level

1 - FATAL level.

2 - ERROR level.

3 - WARNING level.

4 - INFO level. (Default value)

5 - DEBUG level.

as_info

The log information.

Return value

integer

1 - Success.

-1 - It is called in PowerBuilder, or there is an error.

Usage

For the log path of Web applications, mobile applications (that run in Appeon Workspace), and native mobile applications, please refer to the section called “Client Logs” in Appeon Server Configuration Guide for .NET or Appeon Server Configuration Guide for J2EE.

of_clearlog function

Description

Clears the Web/mobile client log information.

This function is supported on both the Web and mobile clients.

Syntax

appeonextfuncs.of_clearlog ( )

Argument

Description

appeonextfuncs

A reference to an AppeonExtFuncs object.

Return value

integer

1 - Success.

-1 - It is called in PowerBuilder, or there is an error.

of_popmenu function

Description

Pops up Appeon DataWindow menu at a specified position in a specified DataWindow control.

Appeon DataWindow Menu is available in Appeon Web only. For more information about the menu items, refer to the section called “Appeon DataWindow menu” in Appeon Developer User Guide.

Supported on the Web client only.

Syntax

appeonextfuncs.of_popmenu ( datawindow adw_dw , integer nx , Integer ny )

Argument

Description

appeonextfuncs

A reference to an AppeonExtFuncs object.

adw_dw

The DataWindow control on which you want to pop up the Appeon DataWindow menu.

nx

The distance from the left edge of the popup menu.

ny

The distance from the top edge of the popup menu.

Return value

None.

Usage

  1. The user customized RMB menu has a higher priority than the Appeon customized menu.

  2. The AppeonPopMenu function has a higher priority than the AppeonPopMenuOn function.

  3. Defining your RMB menu in RButtonDown event is not recommended because this will cause confusion in the system. To work around this, define your RMB menu in the RButtonUp event.

of_popmenuon function

Description

Pops up Appeon DataWindow menu in a specified window when you right click the mouse button.

Appeon DataWindow Menu is available in Appeon Web only. For more information about the menu items, refer to the section called “Appeon DataWindow menu” in Appeon Developer User Guide.

Supported on the Web client only.

Syntax

appeonextfuncs.of_popmenuon ( datawindow adw_dw, Boolean ab_show )

Argument

Description

appeonextfuncs

A reference to an AppeonExtFuncs object.

adw_dw

The DataWindow control on which you want to show the Appeon DataWindow menu.

ab_show

Gives an option whether to display the Appeon DataWindow menu.

True - Display the Appeon DataWindow menu.

False - Not to display the Appeon DataWindow menu.

Return value

None.

Usage

  1. The user customized RMB menu has a higher priority than the Appeon customized menu.

  2. The AppeonPopMenu function has a higher priority than the AppeonPopMenuOn function.

  3. Defining your RMB menu in RButtonDown event is not recommended because this will cause the confusion of the system. To work around this, define your RMB menu in the RButtonUp event.

of_print2file function

Description

Saves the specified DataWindow as image files of BMP, JPG or GIF format.

Supported on the Web client only.

Syntax

appeonextfuncs.of_print2file ( datawindow adw, string asoutpath, string asoutname, long alouttype )

Argument

Description

appeonextfuncs

A reference to an AppeonExtFuncs object.

adw

The DataWindow object to be saved as image files.

asoutpath

The path of image files.

asoutname

The specified name of image files.

alouttype

The format type of files: 1-BMP; 2-JPG; 3-GIF

Return value

Integer

Returns 1 if it succeeds in saving the specified DataWindow as image files.

Returns -1 if an unknown error occurs.

Returns -2 if alouttype is an unsupported format.

Returns -3 if adw is an invalid DataWindow object, DataStore object or DataWindowChild object.

Returns -4 if it fails in creating a file, e.g., the specified path does not exist or without access rights.

Returns -5 if it fails in creating device context, e.g., user sets a large size when customizing page property.

Returns -6~-12 if an internal error occurs.

Usage

  1. This function is used to execute saving DataWindow as image files.

  2. If the page size is large enough, a DataWindow is saved as one file; if the size of a DataWindow surpasses the page size, the DataWindow is saved as several files.

  3. The asoutname is the file name specified by user, for example, the function is appeonprint2file(adw, "c:\", "appeon", 1), if a DataWindow is saved as one file, the file is like C:\appeon.bmp; if a DataWindow is saved as several files, the files are like C:\appeon1.bmp, C:\appeon2.bmp, ..., C:\appeonN.bmp. Another example, the function is appeonprint2file(adw, "c:\", "test.bmp", 1), if a DataWindow is saved as one file, the file is like C:\ test.bmp.bmp; if a DataWindow is saved as several files, the files are like C:\test.bmp1.bmp, C:\test.bmp2.bmp, ..., C:\test.bmpN.bmp.

  4. The upper limit of page size is restrained by the type of operating system. For instance, in Windows Vista, the upper limit of customized page size is 5500*5500 around. However, the page size can also be 1024*10000 by reducing page width and increasing page height.

of_Print2PDF function (Obsolete)

Obsolete function

of_Print2PDF is an obsolete function and will be discontinued in a future release. Please replace it with the SaveAs function of the DataWindow or Child DataWindow and set the saveas file type to PDF format. For details, refer to the section called “Functions of DataWindow control” in Supported PB Features for Appeon Web (Web only) or Supported PB Features for Appeon Mobile.

Supported on the Web client only.

of_SetHintText function

Description

Sets the HintText property of the SingleLineEdit control. The HintText property is not available in PowerBuilder SingleLineEdit control. It is specially designed for the Appeon Mobile application.

Syntax

appeonextfuncs.of_sethinttext ( singlelineedit sle_target, string as_hinttext )

Argument

Description

appeonextfuncs

A reference to an AppeonExtFuncs object.

sle_target

The SingleLineEdit control.

as_hinttext

The text that will be displayed as hint text in the SingleLineEdit control.

Return value

Integer.

1 - Success.

-1 - It is called in PowerBuilder or Appeon Web, or there is an error.

-2 - The sle_target argument is invalid.

-3 - The as_hinttext argument is null.

of_switchRealTimeCalc function

Description

Performs the DataWindow real-time expression calculation in time or performs the calculation for only one time in the whole life-cycle.

Syntax

appeonextfuncs.of_switchRealTimeCalc ( powerobject adw, integer para )

Argument

Description

appeonextfuncs

A reference to an AppeonExtFuncs object.

adw

The DataWindow/DataStore/DataWindowChild object.

para

0 - Default value, performs the real-time calculation;

1 - No need to perform the real-time calculation, and performs the calculation for only one time in the whole life-cycle.

Return value

Integer.

0 - Success.

-1 - Failure.