- of_clearlog function
- of_getappeonusername function
- of_getbrowserversion function
- of_getcachedir function
- of_getclientid function
- of_getclientip function
- of_getclienttype function
- of_gethttpinfo function
- of_getiehandle function
- of_getieurl function
- of_getostype function
- of_getrunmode function
- of_getservertype function
- of_getsessioncount function
- of_is64browser function
- of_ldaplogon function
- of_log function
- of_networktest function
- of_popmenu function
- of_popmenuon function
- of_print2file function
- of_Print2PDF function (Obsolete)
- of_switchRealTimeCalc function
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 PowerServer NVO components. Then, in the PowerServer 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.
Function of AppeonExtFuncs object |
Appeon client functions |
Description |
---|---|---|
Gets the user name that you type into the Appeon Login dialog box. |
||
Gets the Internet Explorer version of the client. |
||
Gets the Cache directory that is used by the current application. |
||
Gets the unique session identifier for the Web client. |
||
Gets the IP address of the Web client. |
||
Gets the type of an application. |
||
Gets the HTTP header information from a particular request. |
||
Gets the Internet Explorer handle for the current application. |
||
Gets the URL of the application. |
||
Gets the type of OS that runs your application (the PowerServer Web application, the PowerServer mobile application, or the PowerBuilder client application). |
||
NA |
Gets the remaining day(s) of license or technical support. |
|
Gets the PowerServer type where the application runs. |
||
of_getsessioncount function (Obsolete) |
AppeonGetSessionCount function (Obsolete) |
This function is obsolete since Appeon PowerServer 2013. Replace it with the getSessionCount function in PowerServer open interfaces. |
Detects if the IE browser where the application runs is 64-bit. |
||
Logs in to the LDAP server with the specified user name and password. |
||
Calculates the elapsed time for the client to call the server over the network. |
||
Pops up Appeon DataWindow menu at a specified position in a specified DataWindow control. |
||
Pops up Appeon DataWindow menu in a specified window when you right click the mouse button. |
||
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. |
NA |
Sets the HintText property of the SingleLineEdit control. The HintText property is not available in PowerBuilder SingleLineEdit control. It is specially designed for the PowerServer mobile application. |
|
Performs the DataWindow real-time expression calculation in time or performs the calculation for only one time in the whole life-cycle. |
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 |
|
A reference to an AppeonExtFuncs object. |
Return value
integer
1 - Success.
-1 - It is called in PowerBuilder, or there is an error.
Description
Gets the user name that you type into the Appeon Login dialog box.
Syntax
appeonextfuncs
.of_getappeonusername
( )
Argument |
Description |
|
A reference to an AppeonExtFuncs object. |
Return value
String.
Usage
This function takes effect in the deployed PowerServer application, not in the PowerBuilder application.
Description
Gets the Internet Explorer version of the Web client.
Supported in the browser-based Web application only.
Syntax
appeonextfuncs
.of_getbrowserversion
( )
Argument |
Description |
|
A reference to an AppeonExtFuncs object. |
Return value
String.
Usage
This function takes effect in the deployed PowerServer application, not in the PowerBuilder application.
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 PowerServer Configuration Guide for .NET or in PowerServer 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 |
|
A reference to an AppeonExtFuncs object. |
Return value
String.
Usage
This function takes effect in the deployed PowerServer application, not in the PowerBuilder application.
Description
Gets the unique session identifier for the Web or mobile client.
Syntax
appeonextfuncs
.of_getclientid
( )
Argument |
Description |
|
A reference to an AppeonExtFuncs object. |
Return value
String.
Description
Gets the IP address of the Web or mobile client.
Syntax
appeonextfuncs
.of_getclientip
( )
Argument |
Description |
|
A reference to an AppeonExtFuncs object. |
Return value
String.
Description
Gets the type of an application.
Syntax
appeonextfuncs
.of_getclienttype
( )
Argument |
Description |
|
A reference to an AppeonExtFuncs object. |
Return value
String. |
Returns "WEB" if the application runs in the Web browser or on the desktop as an IWA (installable Web app). Returns "PB" if the application runs in PowerBuilder. Returns "MOBILE" if the application runs on a mobile device. |
Description
Gets the HTTP header information from a particular request.
Syntax
appeonextfuncs
.of_gethttpinfo
( string attribute
)
Argument |
Description |
|
A reference to an AppeonExtFuncs object. |
|
The required HTTP information. For example, "Host", "Cookie", etc. |
Return value
String.
Usage
This function takes effect in the deployed PowerServer application, not in the original PowerBuilder application.
Description
Gets the Internet Explorer handle for the Web application.
Supported in the browser-based Web application only.
Syntax
appeonextfuncs
.of_getiehandle
( )
Argument |
Description |
|
A reference to an AppeonExtFuncs object. |
Return value
Long.
Usage
This function takes effect in the deployed PowerServer application, not in the PowerBuilder application.
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 |
|
A reference to an AppeonExtFuncs object. |
Return value
String.
Usage
This function takes effect in the deployed PowerServer application, not in the PowerBuilder application.
Description
Gets the type of OS that runs your application (the PowerServer Web application, the PowerServer mobile application, or the PowerBuilder client application).
Syntax
appeonextfuncs
.of_getostype
( )
Argument |
Description |
|
A reference to an AppeonExtFuncs object. |
Return value
String. |
Returns the type of OS that runs the PowerServer Web application, the PowerServer mobile application, or the PowerBuilder client application. |
Description
Gets the running mode of an application.
Syntax
appeonextfunc
.of_getrunmode
( )
Argument |
Description |
|
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 PowerServer Toolkit, see the section called “Basic Settings” in PowerServer Toolkit User Guide) if the application runs on the Web or a mobile device. |
Description
Gets the PowerServer type where the application runs.
Syntax
appeonextfuncs
.of_getservertype
( )
Argument |
Description |
|
A reference to an AppeonExtFuncs object. |
Return value
Integer |
Returns 1 if the PowerServer applications runs on a PowerServer that is installed to a Java Server (such as JBoss). Returns 2 if the PowerServer applications runs on a PowerServer that is installed to a .NET IIS server. |
Usage
This function takes effect in the deployed PowerServer application, not in the PowerBuilder application.
This function is obsolete since Appeon PowerServer 2013. Replace it with the getSessionCount function in PowerServer open interfaces.
Description
Detects if the IE browser where the Web application runs is 64-bit.
Supported in the browser-based Web application only.
Syntax
appeonextfuncs
.of_is64browser
( )
Argument |
Description |
|
A reference to an AppeonExtFuncs object. |
Return value
Boolean |
Returns "true" if the PowerServer application runs on a 64-bit IE browser. Returns "false" if the PowerServer application runs on a 32-bit IE browser. |
Usage
This function takes effect in the deployed PowerServer application, not in the PowerBuilder application.
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 |
|
A reference to an AppeonExtFuncs object. |
|
User name for logging into the LDAP server. |
|
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 PowerServer application, not in the PowerBuilder application. To make this function work in the PowerServer 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 PowerServer Configuration Guide for .NET or PowerServer Configuration Guide for J2EE.
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.
appeonextfuncs
.of_log
( integer ai_level
, string
as_info
)
Argument |
Description |
|
A reference to an AppeonExtFuncs object. |
|
1 - FATAL level. 2 - ERROR level. 3 - WARNING level. 4 - INFO level. (Default value) 5 - DEBUG level. |
|
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 PowerServer Configuration Guide for .NET or PowerServer Configuration Guide for J2EE.
Description
Calculates the elapsed time for the client to call the server over the network. The returned value can help the developer find out the network state, and then determine whether to do data retrieval or update, especially for a large amount of data. This improves the end user experience, to avoid hanging up the application for a long time when data retrieval or update is performed on a poor network connection.
This function is supported on both the Web and mobile clients.
This function works with the .NET IIS server only, not with the J2EE application server.
Syntax
appeonextfuncs
.of_networktest
( long lcount
)
Argument |
Description |
|
A reference to an AppeonExtFuncs object. |
|
The times to call the server. It should be a number between 1 and 9999. |
Return value
Returns the elapsed time (in milliseconds) for the call when the function succeeds, and returns -1 when failing to connect to PowerServer, and -2 for timeout (timeout is 1 second and is not configurable).
Description
Pops up Appeon DataWindow menu at a specified position in a specified DataWindow control.
Appeon DataWindow Menu is available in PowerServer Web only. For more information about the menu items, refer to the section called “Appeon DataWindow menu” in PowerServer Toolkit User Guide.
Supported on the Web client only.
Syntax
appeonextfuncs
.of_popmenu
( datawindow adw_dw
, integer
nx
, Integer ny
)
Argument |
Description |
|
A reference to an AppeonExtFuncs object. |
|
The DataWindow control on which you want to pop up the Appeon DataWindow menu. |
|
The distance from the left edge of the popup menu. |
|
The distance from the top edge of the popup menu. |
Return value
None.
Usage
-
The user customized RMB menu has a higher priority than the Appeon customized menu.
-
The AppeonPopMenu function has a higher priority than the AppeonPopMenuOn function.
-
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.
Description
Pops up Appeon DataWindow menu in a specified window when you right click the mouse button.
Appeon DataWindow Menu is available in PowerServer Web only. For more information about the menu items, refer to the section called “Appeon DataWindow menu” in PowerServer Toolkit User Guide.
Supported on the Web client only.
Syntax
appeonextfuncs
.of_popmenuon
( datawindow adw_dw
, Boolean
ab_show
)
Argument |
Description |
|
A reference to an AppeonExtFuncs object. |
|
The DataWindow control on which you want to show the Appeon DataWindow menu. |
|
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
-
The user customized RMB menu has a higher priority than the Appeon customized menu.
-
The AppeonPopMenu function has a higher priority than the AppeonPopMenuOn function.
-
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.
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 |
|
A reference to an AppeonExtFuncs object. |
|
The DataWindow object to be saved as image files. |
|
The path of image files. |
|
The specified name of image files. |
|
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
-
This function is used to execute saving DataWindow as image files.
-
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.
-
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.
-
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.
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 PowerServer Web or Supported PB Features for PowerServer Mobile.
Supported on the Web client only.
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 |
|
A reference to an AppeonExtFuncs object. |
|
The DataWindow/DataStore/DataWindowChild object. |
|
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. |