Re: [Zope-dev] How to use UserTrack product?

2008-09-10 Thread Rupesh P Raj
Thanks a lot Dieter for the guidance. It worked well.

Thanks,
Roopesh
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] How to use UserTrack product?

2008-09-09 Thread Dieter Maurer
Rupesh P Raj wrote at 2008-9-9 13:41 +0530:
I am very newbee to Zope. In my Zope application I want to integrate
UserTrack product (we dont use plone). I placed the UserTrack folder inside
the Products directory, and created an instance of UserTrack inside some of
the other zope products, as follows:

u = UserTrack()
logger(str(u.listUserActivities()))

But the list is coming as empty. I think the place where I have initialised
the UserTrack instance is wrong.

In the Readme file which comes along with UserTrack says that, UserTrack
lists the currently active authenticated users that are logged into zope and
accesses an object below the folder where the UserTrack instance resides. So
I guess I need to write initialize in some of the ZMI folder object, but
which one?. Can anyone please help me.

I do not know UserTrack and how it works.

However, the README tells you, that UserTrack must reside
in a folder. This means that it must be integrated into the Zope
site hierarchy.


Usually, you put objects into a folder in the ZMI via the so
called add list. This is the selection field to the left
of the Add button in the Contents tab of folder like objects.


You can also do this programmatically.
The idiom is

destination.manage_addProduct[defining_product].constructor(args)

Here defining_product is the product that defines the new object's
class, constructor is the function that create the object
and args are the arguments the constructor needs (usually
the id of the object to be created, optionally a title).


An example would be:

   destination.manage_addProduct['OFSP'].manage_addFile(id, content)


-- 
Dieter
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )