Jump to content

dalpiaze

Members
  • Posts

    29
  • Joined

  • Last visited

Everything posted by dalpiaze

  1. Hi Farshad, It's possible to not show the Tay Icon when using Stand Alone EXE ? I have created an application with a Main Form thats monitors the Web Application and I use my own Tray Icon with another options... so when I run the application, It's shows two Tray Icons .... Thanks.
  2. Hey Farshad, Any chance to change the name of SynEdit package/units or another way to use uniGUI having other version of SynEdit ? Thanks..
  3. Hi, I already use SynEdit for other things, with the last version (updated via SVN - SynEdit sourceforge). This version conflicts with the SynEdit version that comes with uniGUI... And then I can't install uniGUI... I suggest to rename SynEdit units used in uniGUI to not confict with original SynEdit package... Thanks.
  4. Hi Farshad, Could you rename the SynEdit package and units to not conflit with other version of SynEdit that we may be using for some other proposes ? Like you do with Indy package... Thank you.
  5. OK, it works! Thanks.
  6. Hi, Any way to catch commands like: "http://localhost:8077/do_something" Thanks.
  7. Hi, I have a problem using TUniDBGrid with Master/Detail structure. I put two TUniDBGrid's in a TUniForm, linked to two Tables (configured with Master/Detail) Until here ok. Then, I want detail grid starts with the "last" record selected when Master grid changes record. In my Delphi projects (non uniGUI), I usually set the event of Master component TDataSource>OnDataChange > TbDetail.Last; and works fine! But in uniGUI (WebMode), it seems when the grid detais recharge records (master record changed), after display refresh, the DataSet jumps the record to the focused on the grid component, losing my required position on DataSet. Some workaround for this ?? Thanks.
  8. Hello, It seems to be a problem with the function "SendStream" to download files when I want use extensions not usefull, like ".cfg". I use the following code: S := TStringStream.Create('abcdefg'); try UniSession.SendStream(S, 'file.cfg'); finally S.Free; end; If I use the extension default ".txt", then the download sucessfull ocurrs, but when I use an extension like ".cfg", the download doesen't starts. I have tested with Chrome, Internet Explore and FireFox and the same in all. Someone have this problem? Thanks.
  9. Yes, I want to catch the HTTP call before a uniGui session starts, because in specific commands I don't want to start a new uniGui session, but just do some procedure and return a HTTP response to the client.
  10. Hi, uniGUI uses Indy to controls http requests and manage the sessions. Is there a way to catch the Request event of Indy when the http request fired (before the section starts) ?? I would used this to catch when client starts page like "http://localhost:8888/specific_command" when client starts "specific_command" should NOT starts a session, but only do something in server (like write a record on a database) and closes de HTTP connection. Thanks.
  11. I'm using a TUniDBGrid linked to a TDataSource, and the TDataSource linked to a TTable. When I do: Table1.Append; Table1.FieldByName('campo').AsString := value; Table1.Post; The record in DataSet automatically moves to the new record (ok!) But in TUniDBGrid the selection is currently in the previous record. When DataSet fires update to the linked components (including DBGrid), the record change to the new position, But TUniDBGrid fires some Refresh event after that and set the previous position to the DataSet according with the original selection, losing the new record position. This occurs only in WebMode. ---- I try to do that: UniDBGrid1.DataSource := nil; Table1.Append; Table1.FieldByName('campo').AsString := value; Table1.Post; UniDBGrid1.DataSource := DataSource1; And then works perfect (when the Grid refreshs, the new record comes selected). ----- Is this a bug or how to workaround ?
  12. I already use the SynEdit package in Delphi 2010, updated via SVN (I have the last version SVN 81). But uniGUI uses an older version of SynEdit. When I try to Install uniGUI I receive the error that an unit of uniGUI was compiled with a different version of SynEdit. An idea: change the unit's name of SynEdit in UniGUI package, like made with "uIndy". Thanks.
  13. dalpiaze

    Download File

    Hi there, I want to place a Button on a form that fires a Download of a File located at Server side (considering Web Mode, of course). It's possible?
  14. dalpiaze

    TUniDBGrid

    It seems to be a problem with the component "TUniDBGrid", when using with DataSet "filtered". When the DataSet it's non-filtered (full records), navigating around the records works well. But when the dataset is filtered, the navigation loses control, selecting a prior record or jumping three records than the selecioned record. This ocurrs when using UniDBGrid in "paged" mode and in normal mode too. Any suggestions? Thanks.
  15. Cristiano, This is strange, because when OnDestroy of MainModule is fired, the children components has to be still full avaliable, moment that you can free some "on the fly" component and do other things with they. Can you post your relevant code?
  16. Right. In my case, I'm doing this in a TForm that comes visible for the user too. But also works in ServerModule. In your case, you can do the same in ServerModule, reading the events of MainModule's. I suggest create two procedures in Public scope of ServerModule: public procedure NewSession(Session: TUniMainModule); procedure EndSession(Session: TUniMainModule); And then you call this events in OnCreate and OnDestroy of MainModule, filling the "Session" var with the called MainModule: uses uniGUIApplication; type TUniMainModule = class(TUniGUIMainModule) procedure UniGUIMainModuleCreate(Sender: TObject); procedure UniGUIMainModuleDestroy(Sender: TObject); public InTime: TDateTime; Session: TUniGUISession; end; (...) implementation (...) uses ServerModule; procedure TUniMainModule.UniGUIMainModuleCreate(Sender: TObject); begin InTime := Now; //write the timestamp when the session starts Session := UniSession; //write the address of session ServerModule.NewSession(Self); end; procedure TUniMainModule.UniGUIMainModuleDestroy(Sender: TObject); begin ServerModule.EndSession(Self); end; I hope that is what you looking for. If not, please reply. Thanks.
  17. You can do the following: 1. Put a variable "InTime: TDateTime" in TUniMainModule (that represents the session) 2. In "OnCreate" of the MainModule write "InTime := Now;" Then you can catch the OnDestroy of MainModule (that are fired when the session ends), and check if the Session.LastTimeStamp-Session.InTime > DefaultTimeOut. If true, then the session is terminated by timeout. It's an idea that I'm using here.
  18. You can do the following: UniSession.Logout Remember that UniSession it's a function of "uniGUIApplication" unit that retrieves the current session. But if you are managing the sessions in "global" scope, first you have to get the TUniGUISession. So, you can do the following: uses ServerModule; procedure KillSession; var Sessions: TList; Session: TUniGUISession; I: Integer; begin Sessions := UniServerModule.SessionManager.Sessions.SessionList.LockList; try for I := 0 to Sessions.Count - 1 do begin Session := Sessions[i]; Secao.Lock; try if Session.(SessionID/IP/Address) = (????) then Session.Logout; finally Secao.Unlock; end; end; finally UniServerModule.SessionManager.Sessions.SessionList.UnlockList; end; end;
  19. Sorry, here goes the explanation in English: I'm testing the UniGUI "sessions" features too, because I actualy use IntraWeb, that have a very similar way to handle sessions. In my tests, the use of the "MainModule" as session control is working properly, so that I use "OnCreate" and "OnDestroy", they are correctly fired when the session starts and ends. To ilustrate this feature, I will post here a piece of code that well represents the use of sessions in UniGUI: type TUniMainModule = class(TUniGUIMainModule) procedure UniGUIMainModuleCreate(Sender: TObject); procedure UniGUIMainModuleDestroy(Sender: TObject); public IDSession: String; TimeStart: TDateTime; Session: TUniGUISession; end; (...) implementation (...) var Count: Integer = 0; procedure TUniMainModule.UniGUIMainModuleCreate(Sender: TObject); begin Inc(Count); // increments the Count IDSession := 'sec' + IntToStr(Count); // write IDSession with the session number TimeStart := Now; Session := UniSession; FrmMon.Add(Self); // function of another form that add the session to a list end; procedure TUniMainModule.UniGUIMainModuleDestroy(Sender: TObject); begin FrmMon.Del(Self); // function of another form that removes the session from a list end; In addition there are many other routines that can be made ​​in the control session, which I'm doing some testing here. And just remember: I am considering the use of UniGUI in StandAloneServer mode, where the session control is most needed. Remembering also that the session ends only when ocurrs the timeout (default 10 minutes), or if the session is terminated manualy. So the event "OnDestroy" of "MainModule" is only fired in this cases. All this was concluded from tests. Please, correct me if I'm wrong. Thanks.
  20. Importante lembrar também o seguinte: Você está falando de sessões iniciadas pelo Browser certo? (ou sessão da VCL ?) Se for sessão do Browser, lembre-se de que a sessão só termina no TimeOut (padrão 10 minutos) ou se tiver um botão nos forms da aplicação que force o término da sessão.
  21. Leandro, Também estou testando as funcionalidades de sessão do UniGUI, pois utilizo atualmente o IntraWeb, que possui bastante semelhança com este. Aqui nos meus testes, o uso do "MainModule" como controlador da sessão está funcionando corretamente, de modo que se eu coloco uma variável (por exemplo) nele e atribuo algo no OnCreate do MainModule, funciona correto e se fizer algo no OnDestroy também está funcionando. Vou postar aqui um exemplo do que estou utilizando no MainModule que pode te ajudar: Nesse exemplo estou usando os eventos "Create" e "Destroy" para atribuir um número para a sessão e também para saber quando inicia a sessão e termina podendo exibir num outro form da aplicação uma lista das sessões. (Estou considerando o uso de modo StandAloneServer). type TUniMainModule = class(TUniGUIMainModule) procedure UniGUIMainModuleCreate(Sender: TObject); procedure UniGUIMainModuleDestroy(Sender: TObject); public IDSecao: String; TimeStart: TDateTime; Session: TUniGUISession; end; (...) implementation (...) var Count: Integer = 0; procedure TUniMainModule.UniGUIMainModuleCreate(Sender: TObject); begin Inc(Count); // incrementa o Count IDSecao := 'sec' + IntToStr(Count); // grava em IDSecao o numero da sessao TimeStart := Now; Session := UniSession; FrmMon.Add(Self); // funcao de outro form para adicionar a Sessao numa Lista end; procedure TUniMainModule.UniGUIMainModuleDestroy(Sender: TObject); begin FrmMon.Del(Self); // funcao de outro form para deletar a Sessao numa Lista end;
  22. dalpiaze

    Suggestions

    Suggestions to UniGUI: - A component "TUniLine" / "TUniBevel" - A component "TUniShape" - A property in ServerModule "AllowVCL" that controls if session auto-started in VCL using stand alone server.
  23. dalpiaze

    Sessions

    OK, thanks. The code works fine. Now I need to catch the Event when the Session starts and stops. I assigned the events: UniServerModule.SessionManager.Sessions.OnSessionStart := OnSessionStart; UniServerModule.SessionManager.Sessions.OnSessionEnd := OnSessionEnd; and created the following events: procedure TFrmMon.OnSessionStart(Sender: TIdHTTPSession); begin ListAdd( TUniGUISession(Sender) ); end; procedure TFrmMon.OnSessionEnd(Sender: TIdHTTPSession); begin ListDel( TUniGUISession(Sender) ); end; procedure TFrmMon.Add(Secao: TUniGUISession); begin List.Items.Add( Secao.RemoteHost + ' - ' + BrowserToStr(Secao.Browser) ); end; (...) This code works fine! The problem with this code is that property "Browser" comes "brUnknown" when the session starts If I read the session again after a few seconds, the property is correctly defined. Is there a way (or another event) to catch the properties of the section when they are loaded ? PS: I tried to do this in another way: adding the properties of the section to my list when the TUniMainModule is created (OnCreate) (that represents a Session). Works exactly like the prior mode (using SessionManager events)
  24. dalpiaze

    Sessions

    I'm developing an applicataion using uniGUI in StandAloneServer mode. I created a Form that shows the sessions of the Web Server clients, using a TListBox. When the MainModule.OnCreate ocurrs, I add a line "Session xyx started" ... OK If I read the properties of the Sender (TIdHTTPSession), I see only "SessionID" and "RemoteIP".. In current session, I can use the UniSession variable that returns a lot of information.. How can I read a TUniGUISession type using an Event or similar, but not in the aspect of the current session, but getting the list of sessions or know the handle of the session that was open?
×
×
  • Create New...