|
|
|||||
|
GpGadGets Are you tired to do a program in desktop mode and do it again for web use. So why not do it only one time, and use it in the two ways ? The objetive is to make a simple system ( 1 component) to create delphi programs which run both in desktop or in web mode. As it is the same program running in desktop and www forms, it can interactive the both modes. So you you can literally see what is the user doing, response some on-line question, and much more... Our solution is an automatic runtime translation tool between the desktop form to web form, and do the web form responses to be process by the Destop form. This 'Central' component have the basics functions, and there are serveral childs components wich identify each desktop component and specifically handle the render and responses functions. The user can "extend" the set of childs components by adding the own "translations" for specify components not supported. The component is thinked as a "general tool" and it is winsock connection independent, so it is posible to use it in several environments (Indy, Synapse...) and it is possible to use it in other "majors" tools as IntraWeb, so you can add interactive services to the IntraWeb application. Gp is indicated for little web application, with simple forms and controls.
Use case of GpGadGet It has the following posible modes: 1- Run a unique form to be shared for all the users (including the desktop program user). It can be usefull for vote opicions counters (see Sample2) , little multi-chat system 2- Run differents forms for different users in hiden forms. ( each user session create the new forms, but they are hiden. see Sample3 ). 3- Run different forms for different users in normal showed forms ( So the the desktop user, can see the form changes in all the open user forms, even interactue with its: chat, help, close the connection by closing the form) The component can use both 'traditional' or 'ajax' mode to exchange the info posts, but of course JavaScript must be activated.
Limitations Of course, GpGadGet is not magic, so its is not aceptable for any kind of desktop applications to have a www translation. The main use can be in forms with standart controls , and simple graphics. But it is not possible to translate all kinds of controls than you have in a desktop program, some of them because no translation is posible or others because they are not done at the moment. It haven't support for MDI application and have not primary support for dialog boxs. For not supported components is possible to treat it as an Image ( so you can at least to see the component image) Not all kind of web services have a desktop version solution, so you can not think in any kind of web program ( because it must be possible to run it in desktop too). But you can use external templates to render the html page ( so you can mix other things in your program), and it is possible to intercent the www calls to spefify some www features than have not relevance in desktop. Is not possible in ISAPI dlls, because a ISAPI dll have not desktop access ( it run as a non interactive service). Really it is a old problem than persecutes to me lot of time, because I tried to have desktop access for remote control, but it is not possible. The only solution than I have (at the moment) is a ISAPI program than bridge the calls to other "interactive service" running the Gp application. (I have some prototype done)
sample1 : Convert it Download the example program in sample1.zip, and run the sample1.exe program, which is very simple and no need any installation or settings. About the example1, the main form application is shared in the web access for all the users, but you can configure the component to have different hiden forms to each user session.(so each user can have the own app session). I take the convert.pas sample unit, I just inherited a new form taking the TFormCovert parent. And do some little changes (include a Tpicture component with the logo and a label with the project name), and include the TGpGadget and TGpSocket components to the form and set the property of the port to 82, and in the oncreate method active the socket and run the browser where you can see the web mode of the program. The result is than I can run the app, in the traditional form, but the app is "shared" in internet. So somebody can use the same app form and I can see what are they doing because the actions are processed by my forms. Sample 2: Voteme Download sample2.zip for sample binary. The sample2 is a little on-line vote system. Is a simple form with 3 bottons and a input, than refresh the pie chart showing the vote result. The result is not so fiable because one user can vote several times. 1) We need the way to check the user session to test if the vote is repited. It intrudes new concepts: User session, check http params request... When a web user contact with the GpServer a user session (TgpUser) is generated to remember some information from the user. Each user session have a key which identify this session. You have the TResponRequest class which is the context of the call (Information about the request and about the response). And when a desktop event is generated, the sender object of the call is the TResponRequest instance which generate the call. We can know lot of things of the call with this object, for example the user session id which makes the request. 2) Illustrate the use of custom controls. The Tchart component, than is not primary supported by GGG, can be easy adopted by the WWW form. 3) It uses a little template to custom the web page result.
Sample 3: firstfact Its a DB aware sample witch translate the Delphi DbStandart components to www The sample run the www in not interactive mode, so each www user session has the own form. It illustrated the way to do have the application running in desktop mode for the desktop user. The name of GpGadGets is because it is perfect to do little gadgets for google directorys, you can include the following link http://www.multite.es/hello.xml in the google ig directory . GpGadGets is a beta product, it In following samples I will try to explain other aspects of the components... GpGadGets its a part of granprimo project.
TSpyceSpice = Class (Tspyce)
TSpyceSpice have several purposes: The first: A quick and easy way to extend the remote controls capabilities of Gp by using standart delphi forms which run in WWW forms. The second: You can make hybrid programms, which run both in desktop and Web formats. Even you can interactue between the web access and desktop access ( for example to make a chat between the server and the clients) The third: You can make more or less simple programs to run in web format. It can work in Ajax mode to refresh only the changed controls.
spice Classes
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Teléfono: 978-610539 - Fax: 978-610861 -Trav.Agustina Aragón 1,1e 44002 Teruel ( España ).webmaster Copyright © 1997-2004 , [Multi-Informatica Teruel, S.L].La información contenida en este documento está sujeta a modificaciones sin previo aviso. Otros productos u organizaciones mencionadas aquí son marcas comerciales o marcas registradas propiedad de sus respectivas organizaciones o propietarios. |