Professional Documents
Culture Documents
Sapconsole Io Enginge
Sapconsole Io Enginge
6$3&RQVROH,2(QJLQH
6$3$*
1HXURWWVWU
':DOOGRUI
&20,QWHUIDFH'RFXPHQWDWLRQ
SAPConsole I/O Engine
&RS\ULJKW
Copyright 1999 SAP AG. All rights reserved.
No part of this document may be reproduced or transmitted in any form or for
any purpose without the express permission of SAP AG.
The information contained herein reflects current planning and may be changed
without prior notice.
$XWKRUV ?
5HVSRQVLEOH3URGXFW0DQDJHU"
(GLWRU ?
7DUJHWJURXS ?
&RPSRQHQW ?
FRUUHVSRQGV WR VWUXFWXUH LQ
6$31HW
1DPLQJFRQYHQWLRQ
&RQWHQWV
,6DS7HUP&RQILJXUDEOH
,6DS7HUP8VHV3URILOHV
&XUUHQW3URILOH6HW ................................................................................... 9
,6DS7HUP,2(QJLQH
,QLW ........................................................................................................ 10
7HUP7H[W6HW.......................................................................................... 11
7HUP&XUVRU3RV6HW ............................................................................... 11
7HUP&XUVRU9LV6HW ................................................................................ 12
7HUP&OHDU ............................................................................................ 12
7HUP8SGDWH.......................................................................................... 12
7\SHG.H\*HW ........................................................................................ 12
,6DS7HUP&RQILJXUDEOH
An I/O Engine may offer several modes of work. It might also require the
gathering of some information from the user. To encourage the design of
flexible engines and facilitate their use by the end user, SAP has defined the
ISapTermConfigurable interface.
This interface enables the user to configure the engine in the correct way
through administrative utilities such as the ‘SAPConsole Administrator’.
The ISapTermConfigurable interface has one member function:
ShowCfgDialog
5HPDUNV:
Not only can an I/O Engine be configurable, it can also support multiple sets of
configurations. To provide such an advanced behavior engines implement the
interface ISapTermUsesProfiles. Before each call to show their
configuration dialog, engines that use profiles are notified by the SAPConsole
Administrator for which profile the call is made. For more information, please
see ISapTermUsesProfiles and the sample code provided there.
6KRZ&IJ'LDORJ
+5(68/76KRZ&IJ'LDORJ
,6DS7HUP8VHV3URILOHV
An I/O Engine may offer several modes of work and multiple sets of
configurations. Such behavior is implemented in the SAPConsole framework
through profiles. A profile is one uniquely named set of configuration. It
defines the mode of work and supplies all information this mode requires.
SAPConsole uses profiles for its own configuration and I/O Engines can
smoothly integrate into this configuration mechanism by implementing the
ISapTermUsesProfiles interface.
It has one member function:
CurrentProfileSet
That way such delegation is performed in the configuration phase and as part
of the initialization phase.
/**
* The main dialog box showed by the application
*/
Class CAdministratorDialog : public CDialog
{
...
ISapTermConfigurable * m_pConfigurable;
CString m_strSelectedEng;
CString m_strProfileName;
CButton m_btnConfigEngine;
...
void OnSelChangeEngine ();
void OnClickConfigEngine ();
...
};
/**
* Wherever the user changes the engine selected for
* the profile, the framework delegates the window
* notification message to this member function. The
* name of the newly selected I/O engine is loaded
* into the m_strProfileName member variable. The
* function checks if the new engine is configurable
* and updates the data members and the display
* accordingly.
*/
void CAdministratorDialog::OnSelChangeEngine ()
{
// Release previous configurable object
if(m_pConfigurable != NULL)
m_pConfigurable->Release();
/**
.* Triggers whenever a user clicks on the ‘Configure
.* I/O Engine’ button. The function calls the engine
.* to bring up its configuration dialog.
*/
void CAdministratorDialog::OnClickConfigEngine ()
{
// The button is enabled only when the engine
// is configurable thus on a click we are
Later, when SAPConsole is started and identifies in its profile that it needs to
use that engine, it loads it through COM. However, before initializing the
engine, SAPConsole queries to see whether the I/O Engine supports the use of
profiles (implements ISapTermUsesProfiles). If such support exists, the engine
is notified which profile to use. Only then does SAPConsole initializes it. That
way, the I/O Engine can load the data it saved under this profile name and
initialize the right working mode.
The following C++ code might illustrate the concept of how SAPConsole
delegates the profile name to its engine and only then initializes it. Again this
code is simplified and stripped out of error handling:
/**
/**
* Loads the I/O engine into the m_pIOEngine member
* variable and initializes it. Returns TRUE on
* success, FALSE on error.
*/
BOOL CSAPconsole::InitEngine()
{
// Find and instantiate the right io engine. The
// work is done by an IOEngineLoader object
// which encapsulates both how to find the
// engine to load under the profile name, and
// how to load it.
m_pIOEngine =
IOEngineLoader().GetIOEngineForProfile(m_bs
trProfileName);
if(m_pIOEngine == NULL)
return FALSE;
pProfileUser->CurrentProfileSet(
m_bstrProfileName);
&XUUHQW3URILOH6HW
+5(68/7&XUUHQW3URILOH6HW%675EVWU3URILOH1DPH
,6DS7HUP,2(QJLQH
This interface encapsulates the core services expected from any I/O Engine
used by SAPConsole. All operation specified by this interface must be
completely supported by any engine implementation. It has these member
functions:
Init
TermTextSet
TermCursorPosSet
TypedKeyGet
TermCursorVisSet
TermClear
TermUpdate
,QLW
+5(68/7,QLW
This method will be called once, and only once. This method is guaranteed to
be the first to be called on the ISapTermIOEngine interface, and the I/O
Engine is expected to be fully operational after it returns.
the engine have all the necessary information it needs for its initialization.
Also, only when being called toInit may it assume that its client intends to
actually use its I/O Engine, and not just query it for interface support.
7HUP7H[W6HW
+5(68/77HUP7H[W6HW%675EVWU7H[W8,17Q6WDUW;8,17
Q6WDUW<8,17Q$WWULE0DVN
Displays a text string starting at the character cell position given by Q6WDUW;
and Q6WDUW<. The text display attributes are given by the bits of
Q$WWULE0DVN.
Parameters:
Remarks: The cell in upper left corner of the display is defined by (0,0).
7HUP&XUVRU3RV6HW
+5(68/77HUP&XUVRU3RV6HW8,17Q/RF;8,17Q/RF<
Parameters:
Remarks: The cell in upper left corner of the display is defined by (0,0).
7HUP&XUVRU9LV6HW
+5(68/77HUP&XUVRU9LV6HW%22/E6KRZ
Parameters:
7HUP&OHDU
+5(68/77HUP&OHDU
Clear the display of all text and non-default attributes. This is somewhat
similar to CLS command under DOS.
7HUP8SGDWH
+5(68/77HUP8SGDWH
Flush all output. If an engine implements a caching mechanism, there are times
that the physical display differs from the logical one. It is used to override
caching and notify the engine that it should synchronize the logical and
physical view.
7\SHG.H\*HW
+5(68/77\SHG.H\*HW:&+$5
S8QLFRGH&KDU:25'
SZ9LUWXDO.H\&RGH':25'
GZ&RQWURO.H\6WDWH:25'
SZ5HSHDW&RXQW
Retrieve one key typed by the user. User typing is retrieved key at a time, in
the order in which the typing is performed.
The parameters to the function encapsulate information about the key typed.
The caller allocates them and the engine always fills all of them.
Parameters: