19
GO-GLOBAL Session Manager API Samples Version 4.8.2

GO-GLOBAL · 1 GGA PLUG-IN 1. Install the GO-Global Host on a test machine where Microsoft Visual Studio 2008 is available. 2. Review the GO-Global Authentication (GGA) Interface

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: GO-GLOBAL · 1 GGA PLUG-IN 1. Install the GO-Global Host on a test machine where Microsoft Visual Studio 2008 is available. 2. Review the GO-Global Authentication (GGA) Interface

GO-GLOBAL

Session Manager API Samples

Version 4.8.2

Page 2: GO-GLOBAL · 1 GGA PLUG-IN 1. Install the GO-Global Host on a test machine where Microsoft Visual Studio 2008 is available. 2. Review the GO-Global Authentication (GGA) Interface

1 | P a g e

COPYRIGHT AND TRADEMARK NOTICE

Copyright 1997-2015 GraphOn Corporation. All Rights Reserved.

This document, as well as the software described in it, is a proprietary product of GraphOn, protected by the copyright laws of

the United States and international copyright treaties. Any reproduction of this publication in whole or in part is strictly

prohibited without the written consent of GraphOn. Except as otherwise expressly provided, GraphOn grants no express or

implied right under any GraphOn patents, copyrights, trademarks or other intellectual property rights. Information in this

document is subject to change without notice.

GraphOn, the GraphOn logo, and GO-Global and the GO logo are trademarks or registered trademarks of GraphOn Corporation

in the US and other countries. Microsoft, Windows, Windows NT, Internet Explorer, and Terminal Server are trademarks of

Microsoft Corporation in the United States and/or other countries. Linux is a registered trademark of Linus Torvalds. UNIX is a

registered trademark of The Open Group. Red Hat is a trademark or registered trademark of Red Hat, Inc. in the United States

and other countries. Adobe, Acrobat, AIR, Flash, and Reader are either registered trademarks or trademarks of Adobe Systems

Incorporated in the United States and/or other countries. Firefox is a registered trademark of the Mozilla Foundation. Mac, Mac

OS, and Safari are trademarks of Apple Inc., registered in the U.S. and other countries.

Portions copyright © 1998-2000 The OpenSSL Project. All rights reserved. This product includes software developed by the

OpenSSL Project for use in the OpenSSL Toolkit (www.openssl.org). Portions copyright © 1995-1998 Eric Young

([email protected]). All rights reserved. This product includes software written by Eric Young ([email protected]). This

product includes software written by Tim Hudson ([email protected]).

All other brand and product names are trademarks of their respective companies or organizations.

Printed in the United States of America.

Page 3: GO-GLOBAL · 1 GGA PLUG-IN 1. Install the GO-Global Host on a test machine where Microsoft Visual Studio 2008 is available. 2. Review the GO-Global Authentication (GGA) Interface

1 | P a g e

CONTENTS

1 GGA Plug-in ........................................................................................................................................................... 2

2 SM Sample ............................................................................................................................................................ 4

3 ActiveX Control Sample....................................................................................................................................... 14

Page 4: GO-GLOBAL · 1 GGA PLUG-IN 1. Install the GO-Global Host on a test machine where Microsoft Visual Studio 2008 is available. 2. Review the GO-Global Authentication (GGA) Interface

Session Manager API Samples

2 | P a g e

1 GGA PLUG-IN

1. Install the GO-Global Host on a test machine where Microsoft Visual Studio 2008 is available.

2. Review the GO-Global Authentication (GGA) Interface section of file Session Manager API.doc.

3. Open and build the project listed in this archive’s Win32\Components\SessionManager\tests

folder. A binary file, ggaTestPlugin.dll, will be generated in the project’s Release or Debug folder, accord-

ing to your choice of configuration.

4. Copy the newly built ggaTestPlugin.dll to the \Program

Files\GraphOn\GO-Global\Programs\ folder.

5. Modify the system registry on each of your independent-application and relayed GO-Global hosts by

adding a string value named GGAPluginPath under the following key on each:

HKEY_LOCAL_MACHINE\SOFTWARE\GraphOn\GO-Global\AppServer

6. Assign to the new registry variable the fully qualified path you established to the GGA plug-in in the

preceding step.

7. The GGA plug-in sample expects its parameter to be a Unicode string of the form

UserName@domain:password. That value is illustrated below in the Create new session dialog that

our SM_Sample.exe program can launch:

Page 5: GO-GLOBAL · 1 GGA PLUG-IN 1. Install the GO-Global Host on a test machine where Microsoft Visual Studio 2008 is available. 2. Review the GO-Global Authentication (GGA) Interface

Session Manager API Samples

3 | P a g e

To support developers who must create a plug-in for handling customized authentication data, the

replacement text for UserName@domain:password may be anything. As demonstrated in the API’s

samples, the text is forwarded as a Unicode string to the installed GGA plug-in.

Page 6: GO-GLOBAL · 1 GGA PLUG-IN 1. Install the GO-Global Host on a test machine where Microsoft Visual Studio 2008 is available. 2. Review the GO-Global Authentication (GGA) Interface

Session Manager API Samples

4 | P a g e

2 SM SAMPLE

1. Install the GO-Global Host.

2. On a test machine where Microsoft Visual Studio 2008 is available, open and build the project listed in this archive’s samples\SM_Sample folder. Binary file SM_Sample.exe will be generated in the project’s

Release, Debug, or Opt folder, according to your choice of configuration.

3. Start application SM_Sample.exe from within the Microsoft Development Environment. The Session

Manager Sample dialog box will appear:

Page 7: GO-GLOBAL · 1 GGA PLUG-IN 1. Install the GO-Global Host on a test machine where Microsoft Visual Studio 2008 is available. 2. Review the GO-Global Authentication (GGA) Interface

Session Manager API Samples

5 | P a g e

4. In the Relay Server group’s Address box, enter the name of the machine on which you installed the GO-Global Host. Click the Connect button. A successful connection will be indicated by the disablement of the Address and Port edit controls and of the Connect button, by text being written into the Servers and History boxes, and by enablement of the Refresh, Inspect…, Disconnect, Save…, and Clear buttons and the Connect clients to session toggle box and edit control:

Page 8: GO-GLOBAL · 1 GGA PLUG-IN 1. Install the GO-Global Host on a test machine where Microsoft Visual Studio 2008 is available. 2. Review the GO-Global Authentication (GGA) Interface

Session Manager API Samples

6 | P a g e

You may view a log file of what’s happening on the server side at any time you want (even before exiting the application) by opening the HTML log file that is created and maintained by the Application Publishing Service (APS). The name and the contents of that file will be similar to those shown in this archive’s

samples\Log folder:

aps_2002-11-14_15-52-34-718.html

The numbers will vary for you. They represent year-month-day_hours-minutes-seconds-milliseconds.

A log file is created on your server each time you start the APS and it is closed whenever the APS is stopped.

Log files are stored in a directory called Log that appears at the same level of the server’s file hierarchy as

the folder you specified during installation as the home for GraphOn programs such as aps.exe.

If you decide to view your log file while running SM_Sample.exe, please remember that you must make your HTML browser perform its “refresh” operation in order to see entries added since its last update. In other words, GO-Global may write diagnostic and progress messages relevant to the commands you enter in Session Manager Sample, but those messages will not be visible in an active browser until you tell it to update its view.

5. Select an entry from among those available in the Session Manager Sample dialog’s Servers list box, and then click the Inspect… button to the right of that box. The application’s Server dialog will appear, as shown below. The association of API functions to dialog controls is in the table that follows it:

Page 9: GO-GLOBAL · 1 GGA PLUG-IN 1. Install the GO-Global Host on a test machine where Microsoft Visual Studio 2008 is available. 2. Review the GO-Global Authentication (GGA) Interface

Session Manager API Samples

7 | P a g e

Control Session Manager API Function

Add (Applications) SMI_AddPublishedApplication ()

Create (Sessions) SMI_CreateSession ()

Delete (Applications) SMI_RemovePublishedApplication ()

Refresh (Applications) SMI_EnumeratePublishedApplications ()

Refresh (Server) SMI_GetServerInfo ()

Refresh (Sessions) SMI_EnumerateSessions ()

Terminate (Sessions) SMI_DestroySession ()

6. In the simplest scenario that we might imagine, your server will not have any clients connected, nor will it have any applications available. Those conditions are reflected by empty Sessions and Applications list boxes in the Server dialog. By clicking the dialog’s Add button you will bring up an empty version of the Publish new application dialog. In the sample of that dialog captured below, we have entered values that illustrate how Notepad may be added. Please note that certain limitations apply to your choice of application. One is that you must have administrative privileges on the server. A second limitation is that your chosen application must exist on the server. If the application is installed on multiple servers (i.e., when a relay server is used), the application’s path must be the same on each server. After entering whatever values are meaningful for the application you want on your system, click the dialog’s OK button:

Page 10: GO-GLOBAL · 1 GGA PLUG-IN 1. Install the GO-Global Host on a test machine where Microsoft Visual Studio 2008 is available. 2. Review the GO-Global Authentication (GGA) Interface

Session Manager API Samples

8 | P a g e

Control Session Manager API Function

OK SMI_AddPublishedApplication ()

7. Following the closure of the Publish new application dialog, you will again be seeing the Server dialog shown in step #5, above. If the application you chose to add has been published successfully, its name will now be visible in the Server dialog’s Applications list box. Select that entry (Notepad in our example) and click the Inspect… button to the right of the box. The sample program’s Published Application dialog will appear, as shown below:

The data written to the window at the top of this dialog are the contents of structure

SMI_PUBLISHED_APPLICATION. That relationship becomes clear if you click the adjacent Edit

button to bring up a separate Edit published application dialog (which is not illustrated in this document).

The original application information was obtained by a call in the Server dialog’s implementation to

SMI_EnumeratePublishedApplications ().

If your application has user and group settings in effect, they are obtained by a call to SMI_EnumerateApplicationUserSettings () and written to the Users/Groups window. By

selecting an entry from that list and then clicking on the Details button beside it, you will cause additional information to be written to the window at the bottom of the dialog box as illustrated above.

Page 11: GO-GLOBAL · 1 GGA PLUG-IN 1. Install the GO-Global Host on a test machine where Microsoft Visual Studio 2008 is available. 2. Review the GO-Global Authentication (GGA) Interface

Session Manager API Samples

9 | P a g e

8. Click the Published Application dialog’s Close button to return to the Server dialog. From there a click on the Create… button will bring up our Create new session dialog, illustrated below. By making valid assignments to this dialog’s controls you may establish a session in which a particular published application (such as Notepad) is running. The Display dimensions represent the size of the session’s display surface; ideally, the Horizontal and Vertical values you enter should match those of the client’s window, as measured in pixels. Check () the Specify authentication data box to enable the passing of a custom authentication buffer to the APS. The installed custom authentication plug-in will verify the contents of that buffer as documented in file Sample - GGA plugin.doc from this archive. Click the dialog’s OK button to approve your settings. A session will be created, but will not be started until a client has connected to it.

Control Session Manager API Function

OK SMI_CreateSession ()

Page 12: GO-GLOBAL · 1 GGA PLUG-IN 1. Install the GO-Global Host on a test machine where Microsoft Visual Studio 2008 is available. 2. Review the GO-Global Authentication (GGA) Interface

Session Manager API Samples

10 | P a g e

9. Program control will return to the Server dialog shown in step #5, where a number identifying the new session will be added to the Sessions list box. Make a note of that number. Reactivate the Session Manager Sample dialog on your desktop. Check () its Connect clients to session box and, in the associated edit control, enter the session identification number that you just noted:

10. Launch Internet Explorer from your desktop. In the Address bar, type the following URL, replacing server

with the address of the GO-Global Host and sid with the session identifier (4, in the above example): http:// server/goglobal/logon.html?sessionid=sid. The goal of this step is to connect to the server, having it download and install the ActiveX Client. The GraphOn Program Window will then appear.

Page 13: GO-GLOBAL · 1 GGA PLUG-IN 1. Install the GO-Global Host on a test machine where Microsoft Visual Studio 2008 is available. 2. Review the GO-Global Authentication (GGA) Interface

Session Manager API Samples

11 | P a g e

11. After you have created a session, the Server dialog will have the session’s identifier listed in its Sessions list box. Select that ID and then click the Inspect button beside the box. Our sample application’s Session dialog will appear, as shown below. The association of API functions to dialog controls is in the table that follows it:

Control Session Manager API Function

Details (Clients) SMI_GetClientInfo ()

Details (Processes) SMI_GetApplicationInfo ()

Disconnect (Clients) SMI_DisconnectClient ()

Give Control (Clients) SMI_SetEventClient ()

Launch (Processes) SMI_LaunchApplication ()

Refresh (Clients) SMI_EnumerateClients ()

Refresh (Processes) SMI_EnumerateApplications ()

Refresh (Session) SMI_GetSessionInfo ()

Terminate (Processes) SMI_TerminateApplication ()

Page 14: GO-GLOBAL · 1 GGA PLUG-IN 1. Install the GO-Global Host on a test machine where Microsoft Visual Studio 2008 is available. 2. Review the GO-Global Authentication (GGA) Interface

Session Manager API Samples

12 | P a g e

12. Select an entry from among those available in the Session dialog’s Clients list box and then click the Details button beside that box. Data will be written to the window at the bottom of the dialog box as illustrated below:

To give control of the session to the selected client, click the Give control button.

Page 15: GO-GLOBAL · 1 GGA PLUG-IN 1. Install the GO-Global Host on a test machine where Microsoft Visual Studio 2008 is available. 2. Review the GO-Global Authentication (GGA) Interface

Session Manager API Samples

13 | P a g e

13. If you select an entry from among those available in the Session dialog’s Processes list box and then click the Details button to the right of it, the resulting behavior is essentially the same as that shown above when obtaining client information. Because of that similarity, the behavior for a process is not pictured in this document. Another control to the right of the Session dialog’s Processes list box is the Launch… button. By clicking on it you will bring up the Launch application dialog:

Assign the display name of a published application to the dialog’s Display name control and click the OK button to launch a new application. Such attempts will not succeed if the session is inactive, i.e., if no clients have been connected.

14. When you have finished your experiments with the Session and Server dialogs and closed both, you will again be seeing the application’s Session Manager Sample dialog (as shown in step #4, above). You have the option whenever you wish of saving the contents of its History window to a text file whose name you

can specify after clicking the Save… button.

Click the Exit button of the Session Manager Sample dialog to end the application.

Page 16: GO-GLOBAL · 1 GGA PLUG-IN 1. Install the GO-Global Host on a test machine where Microsoft Visual Studio 2008 is available. 2. Review the GO-Global Authentication (GGA) Interface

Session Manager API Samples

14 | P a g e

3 ACTIVEX CONTROL SAMPLE

1. Read file ReadMe.doc from this archive. Complete the instructions for setting up GO-Global hosts

and test platform(s).

2. On a test machine where Microsoft Visual C++ version 7.0 is available, open and build the project listed in this archive’s samples\ActiveX folder. Binary file ActiveX Control Demon-

stration.exe will be generated in either the project’s Release or Debug folder, according to your choice of configuration. We have provided complete sources for this sample. They are for an application based on Microsoft Foundation Classes (MFC). You may modify project settings or even the sources themselves in any way you wish.

3. Launch Internet Explorer on a test machine. Enter a pattern of the form http://ServerName/logon.html in the Explorer’s Address control, where ServerName is replaced by the name of your host computer.

Click one of the Microsoft ActiveX Control options, e.g., Embedded windows.

4. Depending on the security settings in effect for you browser, the following dialog box may appear:

Click the dialog’s Yes button.

Page 17: GO-GLOBAL · 1 GGA PLUG-IN 1. Install the GO-Global Host on a test machine where Microsoft Visual Studio 2008 is available. 2. Review the GO-Global Authentication (GGA) Interface

Session Manager API Samples

15 | P a g e

5. A GO-Global Logon dialog box will appear. Cancel it. Close Internet Explorer.

6. Start the Windows NT Command Processor (DOS Command Prompt). Perform a directory listing to confirm that the Downloaded Program Files folder now contains a file called ieg.dll:

cd C:\winnt\Downloaded Program Files

dir

7. Start application ActiveX Control Demonstration.exe from within the Microsoft Development Environment. A full-sized version of the following window will appear:

8. Select menu item Demonstrations | ActiveX Control.

9. By clicking the dialog’s Connect button you will start the connection process to your GO-Global server. The next thing you will see in this sequence is the GO-Global Connection dialog box:

Type in the address of your GO-Global host (TS-W2K-JPN, in our example) and click the Connect button.

Page 18: GO-GLOBAL · 1 GGA PLUG-IN 1. Install the GO-Global Host on a test machine where Microsoft Visual Studio 2008 is available. 2. Review the GO-Global Authentication (GGA) Interface

Session Manager API Samples

16 | P a g e

10. The GO-Global splash-screen will appear, followed by the Logon dialog:

Fill in the dialog box’s User name and Password fields with the settings for a valid account on your server. Click the Logon button.

11. The Program Window will appear. It will contain entries for those applications that have been installed on the server for the logged-on user:

To terminate the session, you may either close the demonstration dialog box (the one illustrated in step #8) or click on its Disconnect button. If you select the Disconnect button, you may start a new session immediately by next clicking on the Connect button.

12. The preceding steps detail the default behavior of the ActiveX Control Demonstra-

tion.exe program. Because we have included all sources for that program with this distribution kit, you may change the behavior to anything you like.

The files that will probably be of greatest interest to you are the following:

ggDlgDemo.cpp

ggDlgDemo.h

ggDlgDemo.inl

In these files you will see how the ActiveX control can be used, from memory allocation to the setting (and retrieval) of properties to the creation and destruction of the control as a CWnd-derivative. An easy way to begin your experimentation with it is to change its default

Page 19: GO-GLOBAL · 1 GGA PLUG-IN 1. Install the GO-Global Host on a test machine where Microsoft Visual Studio 2008 is available. 2. Review the GO-Global Authentication (GGA) Interface

Session Manager API Samples

17 | P a g e

settings in file ggDlgDemo.h. Please refer to the documentation and the assignment statements in that file under the section labeled as follows:

//== MANIFEST CONSTANTS:

We used a Microsoft Wizard to generate the following two files automatically after we had registered ieg.dll on our development machine:

iegctrl1.cpp

iegctrl1.h

It was also the Wizard that named our control class CIegctrl1. In our ggDlgDemo class declaration you will see that the ActiveX control is represented by member variable m_ActiveX_Control, a pointer to class type CIegctrl1.