<!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 &lt;seaside-bounces@lists.squeakfoundation.org&gt;<BR>
To: William Harford &lt;seaside@harford.org&gt;<BR>
Cc: The Squeak Enterprise Aubergines Server - general discussion. &lt;seaside@lists.squeakfoundation.org&gt;<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&gt;&gt;state and<BR>
WAStateRegistry&gt;&gt;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>
&gt; Florian,<BR>
&gt;<BR>
&gt; (WASession allSubInstances select:[ :ea | ea isActive]) size<BR>
&gt;<BR>
&gt; Will get you the total number of active sessions for all session. I<BR>
&gt; think something like ...<BR>
&gt;<BR>
&gt; (WASession allSubInstances select:<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; [ :ea | ea isActive &amp; (ea application name = &quot;whatever&quot; ) ]) size<BR>
&gt;<BR>
&gt; Will get you what you want.<BR>
&gt;<BR>
&gt; I have not tried the above but it should be close enough to get you<BR>
&gt; started.<BR>
&gt;<BR>
&gt; Will<BR>
&gt;<BR>
&gt; On Dec 12, 2006, at 10:31 AM, Florian Minjat wrote:<BR>
&gt;<BR>
&gt;&gt; Hi,<BR>
&gt;&gt;&nbsp;&nbsp; I'd like to display on my seaside application the number of users<BR>
&gt;&gt; currently connected to a particular application. I know I have to get<BR>
&gt;&gt; some info from the sessions. But with a quick look into the code I<BR>
&gt;&gt; could'nt manage to see how I could do that.<BR>
&gt;&gt;&nbsp;&nbsp; Any hint ?<BR>
&gt;&gt;<BR>
&gt;&gt; Florian<BR>
&gt;&gt; _______________________________________________<BR>
&gt;&gt; Seaside mailing list<BR>
&gt;&gt; Seaside@lists.squeakfoundation.org<BR>
&gt;&gt; <A HREF="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</A><BR>
&gt;<BR>
&gt;<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>