ASKUI

Summary


Askui is used to execute a pre-determined action on the client workstation. The list of actions is shown below.  

Syntax

   Askui return = "" with action, list_param

Parameters

Element

Description

Restrictions

return

return the information in the form of a string of characters

action

code action : character string in the form :
"UIAsk="+chr$(1)+"action_value"

list_param

List of id_param separated by the character ','.

The expressions must be alphanumeric and are limited to 255.

id_param

parameter : character string in the form :
"cd_param="+chr$(1)+"param_value"

The expressions must be alphanumeric and are limited to 255.

Examples

# Example 1 : copy an Excel file
# from the client workstation to the TMP folder on the server
# pre-position the current folder in the file selection window
# by the "my documents" folder on the client workstation   
Local char RETOUR(250)
Askui RETURN="" With "UIAsk="+chr$(1) + "AskPutFile",
& "UIRemotePath="+ chr$(1) + "TMP",
& "UILocalFileExts="+ chr$(1) + "xls",
& "UILocalPath="+chr$(1) + "#myDocuments"

# Example 2 : Create a Word
# pre-position the current folder in the file selection window
# by the "my documents" folder on the client workstation   
Local char RETURN (250)
Askui RETURN="" With "UIAsk="+chr$(1) + "AskSelFile",
& "UILocalFileExts="+ chr$(1) + "doc",
& "UILocalPath="+chr$(1) + "#myDocuments"

# Example 3 : Read a text file on the client workstation   
Local Clbfile RETURN(10)
Setlob RETURN With ""

Askui RETURN With "UIAsk="+chr$(1) + "AskReadTextFile",
& "UILocalFileExts="+ chr$(1) + "txt"

# Example 4 : launch a shell command on the client workstation   
Local Clbfile RETURN(10)
Setlob RETURN With ""

Askui RETURN With "UIAsk="+chr$(1) + "AskExecShell",
& "UILocalShell="+ chr$(1) + "AdxOfficemodule.hta -cmd xlsinsert -input 'TMP/data.csv'"

# Example 5 : copy a file"200406.etebac" 
# from the folder BANQ of the current folder to the client workstation 
# pre-position the current folder in the file selection window
# by the "my documents" folder on the client workstation  
Local char RETURN(250)
Askui RETURN="" With "UIAsk="+chr$(1) + "AskGetFile",
& "UIRemotePath="+ chr$(1) + "BANQ,200406,etebac",
& "UIRemoteBinary="+ chr$(1) + "0",

& "UILocalFileName="+ chr$(1) + "200406.etebac",
& "UILocalPath="+chr$(1) + "#myDocuments"

Description and comments

Askui is used to pilot the client. The client receives (via the engine) the order to execute an Askui. It interprets the associated parameters and it takes charge of the transfer or opening of the file.

Askui is used to launch one of the following actions :

A single action can be specified at a time.

On completion, a code specifies that the action has been correctly carried out or not. In the case of transfer or selection of a file, on completion the name and path for the destination file is returned. In the case of a text file read, on completion a clob with the contents of the text file is returned. In the case of the launch of a shell command, on completion a clob containing the the standard exit of the process (stdout) and the errors (stderr).

action :

This parameter is used to identify the action to be launched on the client.

The available actions are as follows :

Action

Description

AskPutFile

Transfer a file from the client workstation to the server.
A selection window opens to specify the file from the client workstation to be transferred.

AskGetFile

Transfer a file from the server to the client workstation, by user request a selection window opens to specify the name of the file to be written on the client workstation as well as the directory.

AskSelFile

Selection of a file on the client workstation

AskReadTextFile

Read of a text file on the client workstation.

AskExecShell

Launch of a Shell command on the client workstation and return of the stdout and stderr in a character string of more than 250 chaaracters.

id_param

The parameters available by action are as follows :

Action

Parameters

Mand.

AskPutFile

UILocalFileName

Name of the file on the client workstation
UILocalFileExts Extension(s) to filter the files to be displayed
UILocalPath Directory on the client workstation
UIRemoteFileName Name of the file on the server
UIRemotePath yes Directory on the server
UIRemoteOverWrite   Flag authorising the re-writing of the file on the server

AskGetFile

UIRemotePathFile

yes Directory and Name of the file on the server
UIRemoteBinary Flag indicating that the contents of the file are binary
UILocalFileName Name of the file on the client workstation
UILocalPath Directory on the client workstation

AskSelFile

 

UILocalFileName

Name of the file on the client workstation
UILocalFileExts Extension(s) to filter the files to be displayed
UILocalPath Directory on the client workstation

AskExecShell

UILocalShell

Explanation of each parameter : 

Parameters

Description

UILocalFileName

Optional parameter 
Name and extension of the file to be read to explicitly describe the file on the client
This name serves to pre-load the selection window on this file.
The user is free to choose another file.

UILocalFileExts

Optional parameter
List of the accepted extensions separated by the character";"
Is used to carryout a filter of the files to be displayed in the selection window

This parameter is taken into account, if the UILocalFileName parameter is not eneterd. 

UILocalPath

Optional parameter
Complete or partial path for the folder or the file on the client.
This path serves to pre-set the selection window in a folder.
The user is free to change this.
This path is expressed is either explicitly, or by making reference to an environment variable, or by making reference to an identifier in one of the standard folders (Special Folders) on the client workstation.

·        
 "TMP" describe the sub-folder "TMP" from the installation folder
·        
"D:\temp\Adonix " describes a folder on disk D of the workstation
·        
« $HOMEPATH » describes the folder whose path is contained in the environment variable HOMEPATH
·        « #myDocuments » describes the folder "my document"

UIRemoteFileName

Optional parameter 
Name and extension of the file to be written to the server.
If this parameter is absent, a file is written to the server with the same name as that of the client. 

UIRemotePath

Complete or partial path for the folder on the server where the file should be stored. Accept the canonical form Adonix : 
"directory, file_name, extens [, appli [, vol [ , mach ] ] ] »
· "TMP " describes the sub-folder "TMP" on the current Adonix folder
· « /var/adonix/import » describes a folder existing in the filesystem of a UNIX server
· "c:\temp\import" describes a folder existing in the filesystem of a Windows server
· "\\groupserver\pub\impot" describes a folder existing in a shared volume on a Windows server
"TMP,,, X3" canonical form of the sub-folder TMP of the Adonix X3 folder

UIRemoteOverWrite  

Optional parameter
yes/no, 0/1
Indicator that is used to authorise or not the deletion of a file on the server.

UIRemotePathFile

Complete or partial path for the file to be transferred : 
· "TMP/toto.txt" describes the file"toto.txt" present in the sub-folder "TMP" of the current Adonix folder.
· « /var/adonix/export/zzz.csv » describes the file "zzz.csv" present in the folder "/var/adonix/export/" of the filesystem on a UNIX server
. "directory, file_name, extens [, appli [, vol [ , mach ] ] ]" canonical Adonix form describing the file "file_name.extens" in the sub-directory "directory" of the current folder. 

UIRemoteBinary

Optional parameter
yes/no, 0/1
Indicates that the contents of the file are binary. 
the windows client does not take into account this argument.

UILocalshell

The command to be launched


Possible identifiers for the standard folders (Special Folders) on the client workstation: 

#AllUsersDesktop
The file system directory that contains files and folders that appear on the desktop for all users. 
A typical path is C:\Documents and Settings\All Users\Desktop.

#AllUsersStartMenu
The file system directory that contains the programs and folders that appear on the Start menu for all users. 
A typical path is C:\Documents and Settings\All Users\Start Menu.

#AllUsersPrograms
The file system directory that contains the directories for the common program groups that appear on the Start menu for all users. 
A typical path is C:\Documents and Settings\All Users\Start Menu\Programs.

#AllUsersStartup
The file system directory that contains the programs that appear in the Start-up folder for all users. 
A typical path is C:\Documents and Settings\All Users\Start Menu\Programs\Startup.

#Desktop
The file system directory used to physically store file OBJects on the desktop (not to be confused with the desktop folder itself). 
A typical path is C:\Documents and Settings\username\Desktop.

#Favourites :
The file system directory that serves as a common repository for the user's favourite items. 
A typical path is C:\Documents and Settings\username\Favourites.

#Fonts
A virtual folder containing fonts. 
A typical path is C:\Windows\Fonts.

#MyDocuments
The file system directory used to physically store a user's common repository of documents. 
A typical path is C:\Documents and Settings\username\My Documents.

#NetHood
A file system directory containing the link OBJects that may exist in the My Network Places virtual folder. It is not the same as CSIDL_NETWORK, which represents the network namespace root. 
A typical path is C:\Documents and Settings\username\NetHood.

#PrintHood
The file system directory that contains the link OBJects that can exist in the Printers virtual folder. 
A typical path is C:\Documents and Settings\username\PrintHood.

#Programs
The file system directory that contains the user's program groups (which are themselves file system directories). 
A typical path is C:\Documents and Settings\username\Start Menu\Programs.

#Recent
The file system directory that contains shortcuts to the user's most recently used documents. 
A typical path is C:\Documents and Settings\username\My Recent Documents.

#SendTo
The file system directory that contains Send To menu items. 
A typical path is C:\Documents and Settings\username\SendTo.

#StartMenu :
 
The file system directory containing Start menu items. 
A typical path is C:\Documents and Settings\username\Start Menu.

#Startup
The file system directory that corresponds to the user's Startup program group. The system starts these programs whenever any user logs onto Windows NT or starts Windows 95. 
A typical path is C:\Documents and Settings\username\Start Menu\Programs\Startup.

#Template
The file system directory that serves as a common repository for document templates. 
A typical path is C:\Documents and Settings\username\Templates. 

return :

This parameter is used to identify the variable that will contain the information on the return of the instruction.

On return, the instruction returns the following information :

Action

Value

Meaning

AskPutFile

0

No transfer

1,directory,file_name,extens[,appli]

a file has been transferred
+ name of the transferred file on the server in the canonical form (see Filpath )

-1

unexpected error

-91

the indicated directory does not exist

-92

access to the indicated directory is not authorised

-93

the designated file already exists, operation prohibited

-94 the indicated file does not exist

-99

service request not supported

AskGetFile

0

No transfer

1, local path of the written file

a file has been transferred
+ name of the transferred file on the client in the canonical form (see Filpath )

-1

error during the transfer or on writing the file to the client workstation

-91

the indicated directory does not exist

-92

access to the indicated directory is not authorised

-94 the indicated file does not exist
-99 service request not supported


AskSelFile

0

No file selected

1, designated file path

1 file has been selected
+ name of the selected file on the client in the canonical form (see. Filpath )
-99 service request not supported

AskReadTextFile

Text

UTF-8 text contained in the selected file

-99

service request not supported

AskExecShell

Text

the stdout and the stderr in UTF-8

-99

service request not supported

New to version 142

This is a new instruction.

Associated errors

Error

Description

 

 

Associated keywords

  GETUI - CALLUI


SUMMARY


Copyright © Sage 1999 - 2007