Honestly I have not used the Admin pages since about Webware 5
I think that the biggest problem facing webware is that everyone is
reinventing the wheel each time. It is just easier to write the code
over rather then develop an abstract tool. Take the session viewer, it
would be very easy to add any type of session editing that you need and
you could probably do it a lot faster then learning a new tool. Also
your own code will then be a part of your application.
I am a big fan of generic frameworks, but unless they are mature its
easier to roll our own.
Ask 10 webware developers how they manage users and you will get 11 answers
Ask 10 zope developers how they manage users and you will get 2 answers
(there is always the one oddball)
-Aaron
Huy Do wrote:
> Thanks Aaron.........sorry if I offended anyone ;-) but it was my
> mistake for using such a vague term to just mean "any good old
> program" (like your example there).
>
> So I will presume there is nothing in the default webware package in
> the Admin area to do the following:
>
> 1. View/inspect/manipulate existing sessions
> 2. Expire existing sessions
>
> I just didn't want to reinvent the wheel is all.
>
> Thanks again.
>
> Huy
>
> Aaron Held wrote:
>
>> Tools, we don't need no tools, Python developers barely even need a
>> framework. If I wanted tools to make life easier I would program in
>> Java or .NET Then I could just draw a picture of my website and it
>> would all work..... hmmmm where is that .net CD I got in the mail.....
>>
>> Here is my servlet: Status.py
>>
>>
>> from SecurePage import SecurePage
>> from time import strftime,gmtime
>>
>> class Status(SecurePage):
>> def __init__(self):
>> SecurePage.__init__(self)
>>
>> def writeDataRow(self,one,two):
>> self.writeln('<tr><td>%s:</td><td>%s</td></tr>' % (one,two))
>>
>> def writeContent(self):
>> self.writeln('<table><tr><td>')
>> user=self.session().value('user')
>> self.writeln('There are currently %s active sessions' %
>> len(self.application().sessions().keys()))
>> for sess in self.application().sessions().keys():
>> self.writeln('<br><br>Session Key: %s' % sess)
>> thisSession = self.application().session(sess)
>> self.writeln('<br>Active Since: %s' % strftime("%a, %d
>> %b %Y %H:%M:%S %Z", gmtime(thisSession.creationTime())))
>> self.writeln('<br>Last Access: %s' % strftime("%a, %d
>> %b %Y %H:%M:%S %Z", gmtime(thisSession.lastAccessTime())))
>> self.writeln('<table>')
>> if thisSession.hasValue('user'):
>> self.writeDataRow('UserName','<b>' +
>> str(thisSession.value('user')) + '</b>')
>> if thisSession.hasValue('CurrentSQL'):
>> self.writeDataRow('Current SQL
>> Statement',thisSession.value('CurrentSQL').genSQL())
>> if thisSession.hasValue('rsSize'):
>> self.writeDataRow('Current Result Set
>> Size',str(thisSession.value('rsSize')) + ' Records')
>> self.writeln('</table>')
>> else:
>> thisSession = self.session()
>> self.writeln('<br>Active Since: %s' % strftime("%a, %d %b
>> %Y %H:%M:%S %Z", gmtime(thisSession.creationTime())))
>> self.writeln('<br>Last Access: %s' % strftime("%a, %d %b
>> %Y %H:%M:%S %Z", gmtime(thisSession.lastAccessTime())))
>> #self.writeln(thisSession.values().keys())
>> self.writeln('<table>')
>> if thisSession.hasValue('user'):
>> self.writeDataRow('UserName','<b>' +
>> str(thisSession.value('user')) + '</b>')
>> if thisSession.hasValue('CurrentSQL'):
>> self.writeDataRow('Current SQL
>> Statement',thisSession.value('CurrentSQL').genSQL())
>> if thisSession.hasValue('rsSize'):
>> self.writeDataRow('Current Result Set
>> Size',str(thisSession.value('rsSize')) + ' Records')
>> self.writeln('</table>')
>>
>>
>> self.writeln('</td></tr></table>')
>>
>> The action is:
>>
>> 1) get a list of session keys:
>> for sess in self.application().sessions().keys():
>> self.writeln('<br><br>Session Key: %s' % sess)
>> 2) get each session
>> thisSession = self.application().session(sess)
>> 3) dump whatever info you need:
>> if thisSession.hasValue('user'):
>> self.writeDataRow('UserName','<b>' +
>> str(thisSession.value('user')) + '</b>')
>>
>> -Aaron
>>
>> Huy Do wrote:
>>
>>> Hi,
>>>
>>> Just wondering if there was an existing tool in webware to view and
>>> manually expire sessions.
>>>
>>> Basic details like when the session was created, last accessed etc.
>>>
>>> Thanks
>>>
>>> Huy
>>>
>>>
>>>
>>> -------------------------------------------------------
>>> This SF.net email is sponsored by: If flattening out C++ or Java
>>> code to make your application fit in a relational database is
>>> painful, don't do it! Check out ObjectStore. Now part of Progress
>>> Software.
>>> http://www.objectstore.net/sourceforge
>>> _______________________________________________
>>> Webware-discuss mailing list
>>> Webware-discuss@...
>>> https://lists.sourceforge.net/lists/listinfo/webware-discuss
>>
>>
>>
>>
>>
>>
>>
>> -------------------------------------------------------
>> This SF.net email is sponsored by: If flattening out C++ or Java
>> code to make your application fit in a relational database is
>> painful, don't do it! Check out ObjectStore. Now part of Progress
>> Software.
>> http://www.objectstore.net/sourceforge
>> _______________________________________________
>> Webware-discuss mailing list
>> Webware-discuss@...
>> https://lists.sourceforge.net/lists/listinfo/webware-discuss
>
>
>
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: ObjectStore.
> If flattening out C++ or Java code to make your application fit in a
> relational database is painful, don't do it! Check out ObjectStore.
> Now part of Progress Software. http://www.objectstore.net/sourceforge
> _______________________________________________
> Webware-discuss mailing list
> Webware-discuss@...
> https://lists.sourceforge.net/lists/listinfo/webware-discuss
|