<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7651.14">
<TITLE>Re: [Seaside] How to get the number of user connected</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<P><FONT SIZE=2>Or you could create your own session subclass and store your user there, which should make other things easier as well.<BR>
<BR>
Cheers!<BR>
<BR>
-Boris<BR>
(Sent from a BlackBerry)<BR>
<BR>
----- Original Message -----<BR>
From: seaside-bounces@lists.squeakfoundation.org <seaside-bounces@lists.squeakfoundation.org><BR>
To: William Harford <seaside@harford.org><BR>
Cc: The Squeak Enterprise Aubergines Server - general discussion. <seaside@lists.squeakfoundation.org><BR>
Sent: Wed Dec 13 02:36:50 2006<BR>
Subject: Re: [Seaside] How to get the number of user connected<BR>
<BR>
Thanks again for your answer.<BR>
It works fine and answer me the number of active sessions for a given<BR>
application.<BR>
The problem is that I'd like to count the active users logged in. And<BR>
there could be several sessions by user. So I'll need to get to the<BR>
WAComponent of my application and test the name of the user.<BR>
I just manage to do that quickly with the session like this :<BR>
<BR>
self state objects keysDo: [:k | (k class == MyComponent) ifTrue: [^ k<BR>
user]]<BR>
<BR>
But this is ugly because I needed to define WASession>>state and<BR>
WAStateRegistry>>object to access the state. Is there any 'clean' way<BR>
to get to the application state from its session ?<BR>
<BR>
Florian Minjat<BR>
<BR>
William Harford wrote:<BR>
> Florian,<BR>
><BR>
> (WASession allSubInstances select:[ :ea | ea isActive]) size<BR>
><BR>
> Will get you the total number of active sessions for all session. I<BR>
> think something like ...<BR>
><BR>
> (WASession allSubInstances select:<BR>
> [ :ea | ea isActive & (ea application name = "whatever" ) ]) size<BR>
><BR>
> Will get you what you want.<BR>
><BR>
> I have not tried the above but it should be close enough to get you<BR>
> started.<BR>
><BR>
> Will<BR>
><BR>
> On Dec 12, 2006, at 10:31 AM, Florian Minjat wrote:<BR>
><BR>
>> Hi,<BR>
>> I'd like to display on my seaside application the number of users<BR>
>> currently connected to a particular application. I know I have to get<BR>
>> some info from the sessions. But with a quick look into the code I<BR>
>> could'nt manage to see how I could do that.<BR>
>> Any hint ?<BR>
>><BR>
>> Florian<BR>
>> _______________________________________________<BR>
>> Seaside mailing list<BR>
>> Seaside@lists.squeakfoundation.org<BR>
>> <A HREF="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</A><BR>
><BR>
><BR>
_______________________________________________<BR>
Seaside mailing list<BR>
Seaside@lists.squeakfoundation.org<BR>
<A HREF="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</A><BR>
</FONT>
</P>
</BODY>
</HTML>