Jump to content

generic method to follow the user activity


delagoutte

Recommended Posts

is there a simple method that can be used to follow the user activity in my unigui app.

a thing like that exist ?

proecdure TUniMainModule.onReceiveMessage(ComponentClicked : tuni....)
begin
  if ComponentClicked.classname = tunibutton then
    log(ComponentClicked.ownerForm+ComponentClicked.name+self.usr_name);
end

 

Link to comment
Share on other sites

21 hours ago, Hayri ASLAN said:

Do you want to track all clicks,  etc?

yes and no,

i would like a generic method exposed by unigui that catch all click,etc and in this function i could apply a "filter " for log like that : if event = click on the unibutton and if this name is BtnSave in form MyOwnForm then log(....)

  • Upvote 1
Link to comment
Share on other sites

Hi,

You can use UniGUIMainModuleHandleRequest, You can see eventname, objectname etc.

procedure TUniMainModule.UniGUIMainModuleHandleRequest(ASession: TObject;
  var Handled: Boolean);
begin
  if TUniGUISession(ASession).IsAjax then
  begin
//    TUniGUISession(ASession).ARequest.Params
  end;
end;

 

Link to comment
Share on other sites

  • 4 weeks later...
  • 3 weeks later...
  • 2 months later...

so i use this code :

procedure TUniMainModule.UniGUIMainModuleHandleRequest(ASession: TObject;
var
  aObject :TObject;
  OurComponent :TComponent;
  OurForm :TComponent;
  Event : string;
begin
  if (ASession<>nil)  then
  begin
    if (TUniGUISession(ASession).IsAjax) then
    begin
      try
        aObject:= TUniGUISession(ASession).FindObject(TUniGUISession(ASession).ARequest.Params.Values['obj']);
        Event := TUniGUISession(ASession).ARequest.Params.Values['evt'];
        if (aObject <> nil) then
        begin
          OurComponent:= TExtObject(aObject).AttachedComponent;
          // form name, control name, event name, classname of component
          addActivityLog(OurComponent.Owner.Name,OurComponent.Name,Event,OurComponent.ClassName);
        end;
      except

      end;
    end;
  end;
end;

i have a problem with UnimenuItem.

with this code, for itemmenu, i have a OurComponent.name that is empty and classname = TUniMenuControl.

how can i do for having the name of the items on the menu ?

Link to comment
Share on other sites

6 hours ago, delagoutte said:

so i use this code :


procedure TUniMainModule.UniGUIMainModuleHandleRequest(ASession: TObject;
var
  aObject :TObject;
  OurComponent :TComponent;
  OurForm :TComponent;
  Event : string;
begin
  if (ASession<>nil)  then
  begin
    if (TUniGUISession(ASession).IsAjax) then
    begin
      try
        aObject:= TUniGUISession(ASession).FindObject(TUniGUISession(ASession).ARequest.Params.Values['obj']);
        Event := TUniGUISession(ASession).ARequest.Params.Values['evt'];
        if (aObject <> nil) then
        begin
          OurComponent:= TExtObject(aObject).AttachedComponent;
          // form name, control name, event name, classname of component
          addActivityLog(OurComponent.Owner.Name,OurComponent.Name,Event,OurComponent.ClassName);
        end;
      except

      end;
    end;
  end;
end;

i have a problem with UnimenuItem.

with this code, for itemmenu, i have a OurComponent.name that is empty and classname = TUniMenuControl.

how can i do for having the name of the items on the menu ?

Hi,

Can you please create a test case that we can work on it?

  • Like 1
Link to comment
Share on other sites

49 minutes ago, delagoutte said:

Hello,

Could you check the test case ? could you find the problem ?

Hi,

Yes, we checked and we are not assigning attachedcomponent on the core side. We will add it in the next build so your code will continue to work.

Link to comment
Share on other sites

oui on a mis en place cette méthode couplé avec loggerpro + un appender pour écrire dans une base de données.

En rajoutant le numéro de session et autres infos sur le navigateur, l'OS... ca permet d'avoir de la data qui devrait être exploitable pour déterminer les fonctions utilisées dans notre logiciel.

y a juste ce "bug" sur les popupmenu mais sinon pour le reste(bouton, grille, panel....) ca marche bien

Link to comment
Share on other sites

  • 1 month later...
On 5/4/2020 at 3:13 PM, Hayri ASLAN said:

Hi,

Yes, we checked and we are not assigning attachedcomponent on the core side. We will add it in the next build so your code will continue to work.

Hello Hayri ASLAN,

Could you confirm me that this bug will be fixe in the next release ?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...