Re: [Zope-dev] RedstrictedCreation proposal

2002-04-09 Thread Itamar Shtull-Trauring

Toby Dickenson wrote:

 (Ive CCed everyone who has commented on the proposal; I hope thats OK)

Could everyone stick to zope-dev only? One copy of each email is enough ;)



___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] OpenSSH configuration between ZEO clients storageserver

2002-03-27 Thread Itamar Shtull-Trauring

Shane Hathaway wrote:

 But you don't need reliability compensation to multiplex.  SSH assumes 
 the transport layer is reliable.  So an SSH tunnel and an SSL tunnel are 
 virtually synonymous.

They're not really, but yeah, I was wrong :)

A SSL forwarder takes a packet, and then sends over another TCP 
connection that happens to be encrypted. It's basically a TCP port 
forwarder. Multiple client connections through the local SSL forwarder 
(e.g. stunnel) will run over *multiple* outgoing streams:

client -- stunnel on localhost --- stunnel on www.foo.com  server 
on www.foo.com

SSH OTOH uses a multiplexing protocol, where multiple streams of data 
run over the same connection, and each have their own flow control. 
Multiple client connections over a SSH port forwarder will run over the 
same *single* stream.

A third thing is TCP over TCP, i.e. PPP over SSH or SSL, which functions 
as a full network connection.

 The Python standard library has good support for an SSL client but not 
 for an SSL server.

pyOpenSSL is good for both servers and clients. Could be better, but 
it's easy
to start using it, especially for select() based servers (its thread-safety
is iffy). Twisted's SSL stuff uses it, and latest version of pyOpenSSL 
may have asyncore example.


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] OpenSSH configuration between ZEO clients storage server

2002-03-26 Thread Itamar Shtull-Trauring

Adam Manock wrote:

  For a look at why TCP over TCP is a bad idea, (e.g. ssh port forwarding)
 
  see: http://sites.inka.de/sites/bigred/devel/tcp-tcp.html
 
  For a solution, see: http://sites.inka.de/~bigred/devel/cipe.html

That may be true, but it also means that you need to hook in at the kernel
level, if I'm not mistaken.


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] OpenSSH configuration between ZEO clients storage server

2002-03-26 Thread Itamar Shtull-Trauring

Toby Dickenson wrote:

 but ssh port forwarding is only one layer of TCP. ssh port forwarding
 is good.

I'mp pretty sure it's TCP over TCP (ssh protocol does multiplexing). SSL 
OTOH is not TCP over TCP.


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] A modest proposal: Replace medusa with Twisted

2001-10-11 Thread Itamar Shtull-Trauring

kapil thangavelu wrote:

 twisted is GPL and zope is not gpl compatible and that does not appear to be 
 changing despite some mention from zc about trying to achieve compatiblity.

Twisted is LGPL, and it might be possible to license it under something that 
will work with ZPL. I don't think this will be an issue if it comes to it.


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] A modest proposal: Replace medusa with Twisted

2001-10-11 Thread Itamar Shtull-Trauring

Phil Harris wrote:

 That said, I think JPE/PJE is the best way forward, but this problem needs
 to be solved (if it hasn't already).

Latest CVS README says:
Multithreading
==

Multithreading issues are taken care of.
There is still a known issues concerning process termination
(non-deamonic thread hang out) that can require that the process be
interrupted or killed explicitely.
Some more work need to be done  on process termination
and cleanup conditions of the virtual machines.



___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] A modest proposal: Replace medusa with Twisted

2001-10-10 Thread Itamar Shtull-Trauring

Oops, forgot the URL: http://www.twistedmatrix.com/



___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] Local Factories in Products

2001-01-02 Thread Itamar Shtull-Trauring

Chris Withers wrote:

  In ZClasses it is possible to control where a ZClass instance
  should be permitted to be added, in other words show up
  in the factory listing in a ObjectManagers manage_main view.
 
 Didn't Itamar have a proposal/project on this?

It's still unimplemented - you can view the details at
http://dev.zope.org/Wikis/DevSite/Proposals/RestrictedCreation, and there's
some implementation suggestions from Jim Fulton in the discussion area.

-- 
Email: [EMAIL PROTECTED]
Web:   http://itamarst.org

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] Keyword Indexes causing Keyerrors

2000-12-21 Thread Itamar Shtull-Trauring

Here's what was causing my KeyErrors, and how I solved it, and why I think
KeywordIndexes broke. I have a keyword index on the "categories" property of
my CatalogAware object. "categories" is a list.

def manage_removeItems(self, ids=[]):
""" Remove listed items from this category """
for id in ids:
ob = getattr(self.Items, id)
categories = ob.categories # -- this is the problem
categories.remove(self.uid)
ob.manage_changeProperties(categories=categories)
ob.reindex_object()

I solved the problem by switching the problem line to say "categories =
ob.categories[:]".

What does this mean? I was mutating the same list that was attached to the
object. Doing this caused the Keyword Index to break. I assume the reason
then is that the index somewhere stored a reference to the "categories"
property, not a copy. This means that when I mutated ob.categories, I was
also mutating the contents of the index, causing it to get screwed up. The
solution would be that keyword indexes store a *copy* of the property they
are indexing, not a reference to it.

If I'm not mistaken, that means changing line 42 in UnKeywordIndex.py (2.2.4
version) from:

unindex[i] = kws

to:
unindex[i] = kws[:]

Although use of deepcopy may be a better idea?

-- 
Email: itamar(at)shtull-trauring.org
Web:   http://itamarst.org

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] Another caching scheme...

2000-11-08 Thread Itamar Shtull-Trauring

Carlos Neves wrote:

 But that just isn't enough... though it works for a specific caching scheme,
 it's not a site wide, or should I say, server wide. Mindstorming with my fellow
 workers, one (the boss, and that's why he's the boss) came up with the magic
 words... cache the html on it's way out and make some callback on request to
 test if we have that particular request in store. So I did...

Um, what you're describing is already supported using HTTP caching headers.
Set up Apache as a reverse proxy, give Zope the appropiate header handling
code (I posted how on Zope-dev a while back) and you'll get wonderful speed
up without messing with Zope's internals.

-- 
Itamar S.T.  [EMAIL PROTECTED]
Fingerprint = D365 7BE8 B81E 2B18 6534  025E D0E7 92DB E441 411C

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] ZPatterns, MySQL, Full Text Searching

2000-11-08 Thread Itamar Shtull-Trauring

Chris Withers wrote:
 
 I've read that ZPatterns and ZCatalog don't interact too well and I was
 wondering if this is also true of the new ZPatterns release. I might be
 looking to move something to ZPatterns so that it can get all benefits
 of Zope's security system and things like the Catalog, obviously if the
 Catalog doesn't work with ZPatterns, that's a bit of a problem :-S

CatalogAwareness and DataSkings don't work together. However, I wrote and
stevea maintains a replacement, for DataSkins, thats better than
CatalogAwareness - it automatically recatalogs when the object changes - no
more reindex_object() calls. The product is DataSkinAddons.

Older version of ZPatterns didn't support subtransactions - newest version
does, so it should work fine with ZCatalog.

-- 
Itamar S.T.  [EMAIL PROTECTED]

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] Fw: 2gb file size

2000-11-07 Thread Itamar Shtull-Trauring

Shane Hathaway wrote:

 Not long ago I created a wrapper around File objects which automatically
 splits the file before it reached a predefined limit.  It could handle
 any number of partitioned file segements.

Yes please! Perhaps it could be integrated into the ZODB codebase while
you're at it?

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] Adding properties in __init__

2000-11-07 Thread Itamar Shtull-Trauring

Chris Withers wrote:

 self.manage_addProperty('AProperty','1\n2\n3','lines')

 I'm guessing that this is because self isn't an acquisition wrapper in
 __init__ (even though SimpleItem is Acquisition.Implicit) but what am I
 supposed to do to add a property in __init__?

I usually override _properties in the subclass, with the new property
definition, and then doing 

self.Aproperty = '1\n2\n3'

works nicely.

-- 
Itamar S.T.  [EMAIL PROTECTED]
Fingerprint = D365 7BE8 B81E 2B18 6534  025E D0E7 92DB E441 411C

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] Fw: 2gb file size

2000-11-05 Thread Itamar Shtull-Trauring

Shane Hathaway wrote:

 Are you running Zope 2.2.1 or later?  There were pointer arithmetic
 errors that occurred on earlier versions, even with operating systems
 that support 2 GB files.

So on W2K, Zope can have 2GB databases? I'd really like to hear if you get
it to work Andy (or if anyone else did.)

-- 
Itamar S.T.  [EMAIL PROTECTED]
Fingerprint = D365 7BE8 B81E 2B18 6534  025E D0E7 92DB E441 411C

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] ZClasses not copyable - why?

2000-11-05 Thread Itamar Shtull-Trauring

Philipp Auersperg wrote:

 in ZClass I have found a nice-sounding method _setBasesHoldOnToYourButts() grin,
 and the source is commented with '#Eeeek', h
 
 What are the risks for a good shot into my foot using this function?

If your new base classes requires some variables to be initialized in
__init__, older instances may not work since they won't have them, and other
similar problems.  I've done this before, when I really had to - usually
nothing bad happens.

-- 
Itamar S.T.  [EMAIL PROTECTED]
Fingerprint = D365 7BE8 B81E 2B18 6534  025E D0E7 92DB E441 411C

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] ZPatterns + Skinscript

2000-10-31 Thread Itamar Shtull-Trauring

"Phillip J. Eby" wrote:

 DataSkin is strictly a mix-in class.  Sometimes I forget to remind people
 of that, and sometimes I even forget it myself.  :(

DataskinAddons provides a nice DataSkin-derived class for debugging purposes
- it has a debug() method that prints out __dict__, and lets you getattr
attributes through the web as well. So you can use that for testing
purposes.

http://www.zope.org/Members/stevea/DataSkinAddons

-- 
Itamar S.T.  [EMAIL PROTECTED]
Fingerprint = D365 7BE8 B81E 2B18 6534  025E D0E7 92DB E441 411C

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




[Zope-dev] Latest ZPatterns stability

2000-10-30 Thread Itamar Shtull-Trauring

How stable is the latest ZPatterns beta?  I'd like to put up a site using
it, but I'm still kinda wary of doing it.  Admittedly, I ahven't had any
TransactionErrors since upgrading. Has anyone had them?  Or are the
transaction problems solved?  That's what worries me most, since it takes
down all of Zope with it.

-- 
Itamar S.T.  [EMAIL PROTECTED]
Fingerprint = D365 7BE8 B81E 2B18 6534  025E D0E7 92DB E441 411C

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] Flat Database/ZPatterns api, performance ?

2000-10-26 Thread Itamar Shtull-Trauring

Simon Michael wrote:

 Flat Database (was ListMate) is just what I need to whip up an
 interface for non-technical administrators - thanks. So I migrated two
 data tables ("workshops"  "registrations") from gadfly to flatdb
 instances using the CSV import feature, and the admin interface is
 working fine.

I wrote flat database because I wanted some features ListMate didn't have
and didn't want ZClasses.  I basically copied the structure from ListMate,
so it's probably not the best design possible for ZPatterns. So (1) may not
be possible with the current code.

Maybe try creating entries like so:

dtml-let entry="newItem(id)"
  dtml-call "entry.manage_addProperty('col_workshopid','string','TEST')"
  dtml-call "entry.manage_addProperty('col_firstname','string','TEST')"
  dtml-call "entry.manage_addProperty('col_lastname','string','TEST')"
  ...
  /dtml-let

manage_addEntry doesn't return the new entry.

Idon't  remember how this works anymore, frankly.  The source code is your
friend :)

-- 
Itamar S.T.  [EMAIL PROTECTED]
Fingerprint = D365 7BE8 B81E 2B18 6534  025E D0E7 92DB E441 411C

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] Unique and Contant object IDs

2000-10-25 Thread Itamar Shtull-Trauring

Chris Withers wrote:

  I suspect you will have to build this yourself. Store a sufficiently random
  id inside your objects when they are created, and use a ZCatalog to index
  them.
 
 blech! ;-)

This is the normal way to keep references to objects.  I asked Jim Fulton at
IPC8, and he basically said "don't use _p_oid", which means this is the only
way.  Of course, once the observer interface is more well developed you
won't need the Catalog part.

 CatalogAware is the work of the devil anyway ;-) ZPatterns ahs got to be
 better for doing that kindof stuff ;-)

Yup - no object_reindex() every time you change the object, no need to
inherit from anything.  You can  have automatic catalogging in any DataSkin
object trivially, with no change to your class.

-- 
Itamar S.T.  [EMAIL PROTECTED]
Fingerprint = D365 7BE8 B81E 2B18 6534  025E D0E7 92DB E441 411C

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] Unique and Contant object IDs

2000-10-25 Thread Itamar Shtull-Trauring

Johan Carlsson wrote:

 Why are the _p_oid depriciated?

Not depreciated, just "don't use them."

-- 
Itamar S.T.  [EMAIL PROTECTED]
Fingerprint = D365 7BE8 B81E 2B18 6534  025E D0E7 92DB E441 411C

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] Unique and Contant object IDs

2000-10-25 Thread Itamar Shtull-Trauring

Johan Carlsson wrote:

   Why are the _p_oid depriciated?
 
  Not depreciated, just "don't use them."
 
 But I want too, why shouldn't I?
 They solves my problems with mapping relational data to objects.

I would guess multiple databases can have the same oid's for their objects -
and Zope does support multiple databases.  Plus you're breaking
encapsulation, using an implementation detail of the ZODB for other
purposes.

-- 
Itamar S.T.  [EMAIL PROTECTED]
Fingerprint = D365 7BE8 B81E 2B18 6534  025E D0E7 92DB E441 411C

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] extending objectValues() and objectIds() or ?

2000-10-24 Thread Itamar Shtull-Trauring

Write a Python Method (install the PythonMethods product first) called say,
publishableObjectValues that does that:

paramself/param

# functions that returns publishable objects
result = []
for o in self.objectValues():
   if o.isPublishable(): result.append(o)
return result

-- 
Itamar S.T.  [EMAIL PROTECTED]
Fingerprint = D365 7BE8 B81E 2B18 6534  025E D0E7 92DB E441 411C

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




[Zope-dev] Adding functions to _

2000-09-18 Thread Itamar Shtull-Trauring

I'm using CVS Zope, and I want to add a function of mine to _, so I have the
following code in a Product's __init__.py:

from log2vis import log2vis
from DocumentTemplate.DT_Util import d
d["log2vis"] = log2vis

However, when I call the function, I get an error about DocumentTemplate,
from which I discovered that when I call _.logvis('a_string'), instead of
the string being passed as the first parameter, _ is passed as the first
parameter to my function, forcing me to truncate it when calling log2vis:

from log2vis import log2vis
from DocumentTemplate.DT_Util import d

def log2vis_wrapper(*args, **kwargs):
return apply(log2vis, args[1:], kwargs)

d["log2vis"] = log2vis_wrapper


Any idea what could cause this strange behaviour?  it doesn't happen for
other functions inserted into _ in DT_Util.py.

-- 
Itamar S.T.  [EMAIL PROTECTED]
Fingerprint = D365 7BE8 B81E 2B18 6534  025E D0E7 92DB E441 411C

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




[Zope-dev] Virtual Hosting in 2.2 - a Bestiary of Buglets

2000-09-05 Thread Itamar Shtull-Trauring

I setup virtual hosting on Zope 2.2.1 with SiteAccess 2.  I used Apache with
ProxyPass (Apache acting as a reverse HTTP proxy in front of ZServer)
instead of FastCGI, since this is much faster (with caching headers apache
is about 10 times as fast as ZServer).

The setup is as follow - each site has a folder in /websites, so
www.example.com is mapped to /websites/example in Zope.  In
/websites/example I have an Access Rule that tells Zope that the base url is
http://www.example.com.


 Problem 1: HTTP and HTTPS (more of a proxypass issue)
===
I want to be able to serve both http and https versions of a site from
Apache.  Problem is, because of the way proxying works, there is no way for
Zope to know if it is origially being accessed via http or https.  My
solution? Add a folder in top level of Zope called "ssl".  If we see our
path as proxied by Apache is /ssl/websites/example, we know we are being
accessed via SSL.  Because of the magic of acquisition, this works, but it's
still an ugly hack, and slows things down.  Here's the SiteAccess rule I
used:

if REQUEST['PATH_INFO'][:5] == '/ssl/':
REQUEST.setVirtualRoot('/')
REQUEST.setServerURL(protocol='https', hostname='www.example.com',
port='443')
else:
REQUEST.setVirtualRoot('/')
REQUEST.setServerURL(hostname='www.example.com', port='80')


 Problem 2: ZCatalog
=
All the objects in /websites/example are being catalogged with paths such as
/websites/example/folder/myObject.  However, when I gets the objects path
using getpath(), it's not adjusted based on the virtual hosting settings -
it's still /websites/example/folder/myObject, not /folder/myObject as it
should be.


 Problem 3: Management interface
=
The breadcrumbs in the folder management screen (e.g. "/ folder1 /
folder2"), still show the "/ websites / example", with links, when using the
virtual hosting.  That is, the managemnt interface shows folders that we are
not supposed to be able to access when we are using virtual hosting.


 Problem 4: Access to other virtual hosts (security issue?)

When using virtual hosting, it is still possible to access the /websites
folder for example, using acquistion.  So I can view the contents of one
website from the other: www.example.com/websites/example2, and
www.example2.com/websites/example.


-- 
Itamar S.T.  [EMAIL PROTECTED]
Fingerprint = D365 7BE8 B81E 2B18 6534  025E D0E7 92DB E441 411C

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




[Zope-dev] Re: Problem 1: HTTP and HTTPS (more of a proxypass issue)

2000-09-05 Thread Itamar Shtull-Trauring

Chris Withers wrote:

 What difference does it make if you do REQUEST.setVirtualRoot('/',1)?

This might actually solve most of my problems, since it deletes the parents
I don't need from PARENTS.  However, when I do this I can't view anything -
it keeps raising Unauthorized.  Setting the permissions to not acquire and
be explicitly on does not help.

-- 
Itamar S.T.  [EMAIL PROTECTED]
Fingerprint = D365 7BE8 B81E 2B18 6534  025E D0E7 92DB E441 411C

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] remote procedure calls to manage functions

2000-08-10 Thread Itamar Shtull-Trauring

Jim Fulton wrote:

  It's not really favored, both are quite useful.  xml-rpc is more for
  when you want two different system to interoperate.  ZClient is very
  zope specific and probably gives you a bit more functionality than
  xml-rpc (because it has the 'remote object' abstraction).
 
 I don't think ZClient is really Zope specific. At least
 it's not supposed to be.  It does have a richer API, including
 features like authentication and header support.

The problem I have with ZClient is that the result of method calls is always
a string - while with XML-RPC I can get lists/dictionaries/integers, if
that's what the method returned.

-- 
Itamar S.T.  [EMAIL PROTECTED]
Fingerprint = D365 7BE8 B81E 2B18 6534  025E D0E7 92DB E441 411C

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] Use ZODB3 and ZCatalog for indexing purposes

2000-07-25 Thread Itamar Shtull-Trauring

Phil Harris wrote:

 Have you seen the Zope on CDROM howto?
 
 Try searching on zope.org (when it's back up that is) for it.

I don't think it's relevant actually.  WHat you do want is Jim Fulton's talk
about ZODB from IPC8 - search zope.org for that.

-- 
Itamar S.T.  [EMAIL PROTECTED]
Fingerprint = D365 7BE8 B81E 2B18 6534  025E D0E7 92DB E441 411C

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




[Zope-dev] Intializing the objects formerly-known-as-RackMountables

2000-07-19 Thread Itamar Shtull-Trauring

I need to do initialize some properties of new instances of a DataSkin
subclass - ASPAccount.  However, I can't put this in __init__ since the
object hasn't been stored at that point.  

Doing self.__dict__['name'] = 'Rincewind' seems kinda ugly.  Maybe newItem
should by default call a function on newly created objects, say __init?  I
don't want to have to subclass Specialist (or in my case, LoginManager) each
time I want to this, since it's a *very* common action.  For example,


*** Specialists.py.orig Wed Jul 19 12:37:32 2000
--- Specialists.py  Wed Jul 19 12:38:18 2000
***
*** 37,43 
  def newItem(self, key=None):
  """Create a new item"""
  # Default use first rack
! return self.rackList[0].__of__(self).newItem(key)
  
  def manage_refreshPlugIns(self, REQUEST=None):
  """Update plugin registries"""
--- 37,46 
  def newItem(self, key=None):
  """Create a new item"""
  # Default use first rack
! obj =  self.rackList[0].__of__(self).newItem(key)
! if hasattr(obj, '__init'):
! obj.__init()
! return obj
  
  def manage_refreshPlugIns(self, REQUEST=None):
  """Update plugin registries"""

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




[Zope-dev] Another ZPatterns bug

2000-07-19 Thread Itamar Shtull-Trauring

(ZPatterns 0.4a5, Zope 2.2.0) If an agent raises an exception, you don't get
to see the traceback.  Instead, the object is simply not added (if the
exception was in _objectAdded, donno what happens in _objectChanged).  This
makes debugging agents basically impossible...

-- 
Itamar S.T.  [EMAIL PROTECTED]
Fingerprint = D365 7BE8 B81E 2B18 6534  025E D0E7 92DB E441 411C

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] Intializing the objectsformerly-known-as-RackMountables

2000-07-19 Thread Itamar Shtull-Trauring

"Phillip J. Eby" wrote:

 Doing self.__dict__['name'] = 'Rincewind' seems kinda ugly.  Maybe newItem
 should by default call a function on newly created objects, say __init?  I
 don't want to have to subclass Specialist (or in my case, LoginManager) each
 time I want to this, since it's a *very* common action.  For example,
 
 Could you give a more specific example?  My assumption is that if you need
 to have things happen upon adding, that one uses a trigger to do it.  Or,
 if the data is specific to that instance, then the appropriate thing would
 be to manipulate properties or attributes in the code that calls newItem().

I like the OO idea that changes to an object should be done by the object,
not by someone else.  It seems silly to have to write a trigger to do this,
or a factory.  Why do classes have __init__ anyway?  So that all the
internal object creation logic is in the same place.

Okay - this is the ASP Account class.  These are user objects that I'd like
to store in a regular LoginManager.  I could subclass LoginManager of
course, but I don't want to spread my code all over the place, when there's
no real need.

class ASPAccount(LoginUser, MemberMixin):

def __init__(self, id, title=''):
LoginUser.__init__(self, id)
self.__dict__['_currentPayment'] = None
self.__dict__['debt'] = Payment.Debt(0.0)
self.__dict__['debtInPayment'] = Payment.Debt(0.0)
self.__dict__['services'] = ServicesManager.ServicesManager()
self.__dict__['lastMonthlyPayDay'] = None
# day in month on which we pay
self.__dict__['payday'] = 15
self.__dict__['log'] = ""


 Also, it isn't necessary to subclass the specialist -- you don't have to
 call your routine newItem(), after all.  newUser() would be a better choice
 of name for the method, it sounds like.

Again, why should I fagment my class into multiple parts?  I want it all to
be in once place - it's more readable, easier to debug, easier to
understand, and more portable.

-- 
Itamar S.T.  [EMAIL PROTECTED]
Fingerprint = D365 7BE8 B81E 2B18 6534  025E D0E7 92DB E441 411C

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope] Newbie:Credit-card question

2000-07-11 Thread Itamar Shtull-Trauring

[EMAIL PROTECTED] wrote:

 I'd like to build up a shopping-system that's working with
 credit-cards(it's the customers wish).

You can do CyberCash verfication and charging using the Wampum product, that
can be found on the zope.org website.  I have no idea why it's called Wampum
though.

-- 
Itamar S.T.  [EMAIL PROTECTED]
Fingerprint = D365 7BE8 B81E 2B18 6534  025E D0E7 92DB E441 411C

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope-dev] Proposed interface: Restricted creation

2000-07-05 Thread Itamar Shtull-Trauring

(URL:
http://www.zope.org/Members/michel/Projects/Interfaces/RestrictedCreation)

Restricted Creation of Objects

The problem - certain types of objects should not be added except in certain
places or with certain restrictions. For example, we may want to make sure
Laundry objects are only added inside Luggage objects, and nowhere else. Or
we may want to make sure that an object is added only if there's a MailHost
in it's acquistion path. How do we ensure this?

I propose a Restricted Creation Interface - when an ObjectManager constructs
it's Add list in manage_main, it first checks with each addable class if
it's instances can be added in this specific ObjectManager.

We do this by calling a class method called _addableIn(), that receives as a
parameter the ObjectManager to which we may want to add objects. If the
result is not true, instances of this class can't be added, and won't be
listed in the Add list.

For example, the following code will make the Laundry class show up in the
Add menu only in objectmanagers whose meta_type is "Luggage":

class Laundry(SimpleItem):
""" A Fruit class """

def _addableIn(parent):
if parent.meta_type == "Luggage": return 1
else: return 0


I'm not sure how to get from meta_type to class, so I can't show working
code, but something like this in ObjectManager.py would do the trick:

def filtered_meta_types(self, user=None):
# Return a list of the types for which the user has
# adequate permission to add that type of object.
user=getSecurityManager().getUser()
meta_types=[]
if callable(self.all_meta_types):
all=self.all_meta_types()
else:
all=self.all_meta_types
for meta_type in all:
   klass = getClassFromMetaType(meta_type)

   # If the class has a function _addableIn, it must return true or
   # that means the class doesn't want to be added to this ObjectManager:

   if not hasattr(klass, '_addableIn') or klass._addableIn(self):
   if meta_type.has_key('permission'):
   if user.has_permission(meta_type['permission'],self):
   meta_types.append(meta_type)
   else:
   meta_types.append(meta_type)
return meta_types

Comments?

-- 
Itamar S.T.  [EMAIL PROTECTED]
Fingerprint = D365 7BE8 B81E 2B18 6534  025E D0E7 92DB E441 411C

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




[Zope-dev] ZClass inheriting from ObjectManager and DataSkin?

2000-07-05 Thread Itamar Shtull-Trauring

Are there (or better yet, what are) any potential problems here?  My gut
feeling was that it wouldn't work, but you can at the very least add objects
in instances of the ZClass - deleting and renaming don't work though.

-- 
Itamar S.T.  [EMAIL PROTECTED]
Fingerprint = D365 7BE8 B81E 2B18 6534  025E D0E7 92DB E441 411C

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] Proposed interface: Restricted creation

2000-07-05 Thread Itamar Shtull-Trauring

Shane Hathaway wrote:

 The place where this is needed most (IMHO) is for ZClass factories.  So
 there needs to be a way to create meta type filters through the Web.

Yes, but in Python products too, where you have Items that should only go in
specific ItemHolders.  This is very common.

 On the other hand, the plugins framework by Phillip Eby solves this
 problem in a nice way.  I'm hoping to eventually modify the plugins
 framework so it's more accessible for ZClass development.  Do you have
 an application where plugins won't suffice?

Not right now - but I'm sure someone will at some point, so why limit
yourself?  And why limit this to ZClasses only?

-- 
Itamar S.T.  [EMAIL PROTECTED]
Fingerprint = D365 7BE8 B81E 2B18 6534  025E D0E7 92DB E441 411C

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope] how to invalidate an object in the cache?

2000-07-02 Thread Itamar Shtull-Trauring

Marc Boschma wrote:

 Sounds like you need to manipulate the expiry time for the objects. I'd
 suggest that that can either be done in the RESPONSE or via meta tags in the
 standard_html_header to mark the page and the image as non-cacheable.

Read the Cacheability Howto - http://www.mnot.net/cache_docs/

You can set the HTTP headers described there using RESPONSE.setHeader:
RESPONSE.setHeader('Cache-Control', 'no-cache')

-- 
Itamar S.T.  [EMAIL PROTECTED]
Fingerprint = D365 7BE8 B81E 2B18 6534  025E D0E7 92DB E441 411C

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] Change Notification

2000-06-21 Thread Itamar Shtull-Trauring

Bob Barter wrote:
 
 Is there a way for an object to be notified that it has been modified?

Use ZPatterns 0.4, it allows you to be notified of events - change, add and
delete of objects.

-- 
Itamar S.T.  [EMAIL PROTECTED]
Fingerprint = D365 7BE8 B81E 2B18 6534  025E D0E7 92DB E441 411C

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope-dev] Bug in Changed events in ZPatterns 0.4.0a1?

2000-06-19 Thread Itamar Shtull-Trauring

As far as I can tell, the first time an object is changed, an Agent's
_objectChanged() will be called, but as long as the object is still in the
memory cache, _objectChanged() will not be called again.

That is, I change an object - _objectChanged() is called.  However, the
object is now in the memory cache, so the next time I change the object,
_objectChanged() is not called.  If I flush the cache, or Refresh the
Product, the next _objectChanged() will be honored (but the next-next one
won't.)

Alternatively, I may be misunderstanding something about the way these
events work.

Another problem I'm having is giving default values to objects (e.g. default
UNAPPROVED status for approval).  I can do this with a trigger (whith
objectAdded being "client.status = UNAPPROVED"), but I also have a trigger
that is equivalent to CatalogAwareness. The problem is that I don't know
what order the triggers get called - will the changes made by one trigger be
consistently cataloged by the other trigger?

-- 
Itamar S.T.  [EMAIL PROTECTED]
Fingerprint = D365 7BE8 B81E 2B18 6534  025E D0E7 92DB E441 411C

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] New Help System in 2.2

2000-06-07 Thread Itamar Shtull-Trauring

"Dan L. Pierson" wrote:

 You might want to take a look at the bottom of http://www.lfw.org/python/...

He finally released it!  I've been waiting for this since IPC8.

-- 
Itamar S.T.  [EMAIL PROTECTED]   
"It don't get thingier than that!"

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] Containers in ZODB

2000-06-07 Thread Itamar Shtull-Trauring

Petr Knapek wrote:

 Container - object with some attributes and methods which can collect
 other objects (also Containers)

For these you should inherit from OFS.ObjectManager.ObjectManager.

 Item - an object with some attributes and methods which can not collect
 any other objects but can be contained in Container

For these you should inherit from OFS.SimpleItem.Item.

All you really need is to inherit from Persistent, if you're making your own
objects, but inheriting from the above will allow you to use them later in
an easier fashion.

-- 
Itamar S.T.  [EMAIL PROTECTED]   
"It don't get thingier than that!"

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope] How to backup and restore a Zope application

2000-06-06 Thread Itamar Shtull-Trauring

Jilani Khaldi wrote:

 is there a way to backup and restore a Zope application so I can move it
 from a coputer to another?
 I have seen in the utility directory but I found only "load_site.py".
 Thanks.

The Zope database is stored in var/Data.fs - that's most likely all you need
for a backup.  

If you want to have the same Zope install running on a different computer
and If you've installed Zope Products you'll also need to copy them from
lib/python/Products, and any External Methods you added from Extensions/.

-- 
Itamar S.T.  [EMAIL PROTECTED]   
"It don't get thingier than that!"

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope-dev] Re: [Zope] HappySession 0.1.0 released!

2000-06-05 Thread Itamar Shtull-Trauring

Hung Jung Lu wrote:

 I have been using RAM-based session management for a while, but never wrote
 a product for it. Since Graham Chiu has mentioned it again about making a
 real product, I have taken the time to make one, and called it HappySession.
 :) Well, in short, it uses cookie for session id, you specify a maximum
 session expiration time, and expired session data are automatically deleted.
 It's Zope-transaction-aware.

I'd be very grateful for a description of how you built the session server
in combination with persistence, transactions, and the fact that each thread
has it's own copy of data.

If I understood correctly, the references to the server are stored in the
class (which I assume is global for all Zope threads.)

-- 
Itamar S.T.  [EMAIL PROTECTED]   
"It don't get thingier than that!"

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope] Proposal for mail-in to Zope

2000-06-05 Thread Itamar Shtull-Trauring

Simon Coles wrote:

 I think this is pretty much what we're intending to do. We haven't
 decided about XML-RPC Vs ZClient. The aim is to get something
 (anything) working, however hard coded, and then improve it.

Use XML-RPC - it's a lot more powerful (e.g. it returns lists and
dictionaries and integers and floats, while ZClient can only return
strings.)

-- 
Itamar S.T.  [EMAIL PROTECTED]   
"It don't get thingier than that!"

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] Ordered list

2000-06-01 Thread Itamar Shtull-Trauring

Marcio Moreira wrote:

 My question is: How can I have an ordered listing of all popular names of all
 plants (in other words, how can I have an ordered listing of data stored in 
"lines"-type properties on diferent class instances)?

You could catalog them in a ZCatalog (make them catalogaware) and make this
property a meta-data column.

-- 
Itamar S.T.  [EMAIL PROTECTED]   
"It don't get thingier than that!"

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] ANN: Perl For Zope

2000-05-31 Thread Itamar Shtull-Trauring

Rodger Donaldson wrote:

 I'll go with that.  In fact, the sheer, stupid *hatred* directed by a big
 chunk of the list at anyone who doesn't draw and quarter perl programmers on
 sight has me convinced not to bother with Zope any more; I can work with
 a variety of *tools* like Mason and ACS, rather than buy into *religions*,
 as Zope appears to be.

Heh - some people are stopping to use Zope 'cause of Perl Methods, and now
people are stopping to use Zope because of all the other people who hate the
idea of Zope supporing Perl.  Now it's time for the third round of people,
who are going to drop Zope because obviously everyone is stopping to use
Zope, so what's the point of using it?

Niven's 16th Law:
"There is no cause so right that one cannot find a fool following it."

While we're at it, the 14th:
"There exist minds that think as well as you do, but differently.  
(The gene-tampered turkey you're talking to isn't necessarily one of 
them.)"

-- 
Itamar S.T.  [EMAIL PROTECTED]   
"It don't get thingier than that!"

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope-dev] CatalogAwareness for RackMountables

2000-05-30 Thread Itamar Shtull-Trauring

I've been playing around with ZPatterns, and I must say it's very cool -
finally you can mix ZCatalog and SQL storage.  CatalogAwareness is slightly
different than regular Zope objects in that you have to find the ZCatalog in
the Rack's acquisition path, but that's about it.

The absolute_url function I define here should be moved to the RackMountable
class since it may be useful in other situations.

-

from Products.ZCatalog.CatalogAwareness import CatalogAware
from Products.ZPatterns.Rack import _v_rack, RackMountable

class RMCatalogAwareMixIn(CatalogAware):
""" 
CatalogAwareness for RackMountables.
You need to inherit from this class before RackMountable.

Objects are NOT automatically indexed, because no rack has
been defined when we're in __init__.
"""

def absolute_url(self, relative=0):
""" URL for catalog-awareness """
return "%s/%s" % (self._v_rack.absolute_url(relative), self.id)

def index_object(self):
"""A common method to allow Findables to index themselves."""
if hasattr(self._v_rack, self.default_catalog):
getattr(self._v_rack, self.default_catalog).catalog_object(self,
self.url())

def unindex_object(self):
"""A common method to allow Findables to unindex themselves."""
if hasattr(self._v_rack, self.default_catalog):
try:
getattr(self._v_rack,
self.default_catalog).uncatalog_object(self.url())
except:
pass

def manage_delete(self, _v_rack=_v_rack):
""" Uncatalog this object and then delete it """
self.unindex_object()
return RackMountable.manage_delete(self, _v_rack)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




[Zope-dev] CatalogAwareness for RackMountables

2000-05-30 Thread Itamar Shtull-Trauring

Sorry if this arrives twice, but mailing lists seem to have swallowed my
earlier mail.

I've been playing around with ZPatterns, and I must say it's very cool -
finally you can mix ZCatalog and SQL storage.  CatalogAwareness is slightly
different than regular Zope objects in that you have to find the ZCatalog in
the Rack's acquisition path, but that's about it.

The absolute_url function I define here should be moved to the RackMountable
class since it may be useful in other situations.

-

from Products.ZCatalog.CatalogAwareness import CatalogAware
from Products.ZPatterns.Rack import _v_rack, RackMountable

class RMCatalogAwareMixIn(CatalogAware):
""" 
CatalogAwareness for RackMountables.
You need to inherit from this class before RackMountable.

Objects are NOT automatically indexed, because no rack has
been defined when we're in __init__.
"""

def absolute_url(self, relative=0):
""" URL for catalog-awareness """
return "%s/%s" % (self._v_rack.absolute_url(relative), self.id)

def index_object(self):
"""A common method to allow Findables to index themselves."""
if hasattr(self._v_rack, self.default_catalog):
getattr(self._v_rack, self.default_catalog).catalog_object(self,
self.url())

def unindex_object(self):
"""A common method to allow Findables to unindex themselves."""
if hasattr(self._v_rack, self.default_catalog):
try:
getattr(self._v_rack,
self.default_catalog).uncatalog_object(self.url())
except:
pass

def manage_delete(self, _v_rack=_v_rack):
""" Uncatalog this object and then delete it """
self.unindex_object()
return RackMountable.manage_delete(self, _v_rack)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope] A new python object which analyse HTML files and...

2000-05-29 Thread Itamar Shtull-Trauring

Oleg Broytmann wrote:

  I would like to create a python object which :
  * analyse traditional HTML files
  * indexe "IMG" tags and "A" tags
  * replace "IMG" tags by appropriated dtml tags
  * replace "A" tags by appropriated dtml tags
  * create all the resultant objects

 
You may start to adapt http://www.zope.org/Members/itamar/load_site to
 your needs. Generic HTML parser is already there.

The latest version (1.4.0) stops parsing the HTML after the body tags
because illegal HTML (e.g. because of embedded DTML tags) would cause
problems.  You could turn it back on though if we assume there's no DTML.

And if you do decide to do it add converting file.htm to file_html to your
list - it was one of the feature requests I don't have time to do and would
seem to fit in your list.

-- 
Itamar S.T.  [EMAIL PROTECTED]

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope-dev] Preprocessed Output

2000-05-28 Thread Itamar Shtull-Trauring

A common pattern when developing in Zope is to have a sort of Document that
contains text with some special codes, and then to render them and return
the output to the user.  So we have DTML Documents, and Structured Text
Documents, and Python Methods, and I've written a few for my own use and I'm
sure other people have.

Has anyone thought of making this into some sort of generalized superclass
that does this sort of I thing.  I remember Michel Pelletier worked on
something like this and was telling me about it at IPC8.  Any code written
for that?

-- 
Itamar S.T.  [EMAIL PROTECTED]


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




[Zope-dev] Problems with RackMountable

2000-05-28 Thread Itamar Shtull-Trauring

I'm adding some RackMountable objects (subclassed from RackMountable and
SimpleItem.Item) and when I try to access them via URL I get an
AttributeError like they don't have attribute __of__:

   Traceback (innermost last):
 File /hd1/zope/lib/python/ZPublisher/Publish.py, line 214,
in publish_module
 File /hd1/zope/lib/python/ZPublisher/Publish.py, line 179,
in publish
 File /hd1/zope/lib/python/Zope/__init__.py, line 202, in
zpublisher_exception_hook
   (Object: ElementWithAttributes)
 File /hd1/zope/lib/python/ZPublisher/Publish.py, line 151,
in publish
 File /hd1/zope/lib/python/ZPublisher/BaseRequest.py, line
308, in traverse
 File
/hd1/zope/lib/python/Products/ZPatterns/Specialists.py, line 27, in
__bobo_traverse__
   (Object: SheetProviderContainer)
 File
/hd1/zope/lib/python/Products/ZPatterns/Specialists.py, line 39, in getItem
   (Object: SheetProviderContainer)
 File /hd1/zope/lib/python/Products/ZPatterns/Rack.py, line
515, in __get_attr__
   (Object: cheese4)
   AttributeError: __of__

What am I doing wrong here?

-- 
Itamar S.T.  [EMAIL PROTECTED]

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] DTML tag creation.

2000-05-25 Thread Itamar Shtull-Trauring

Bill Anderson wrote:

 I am about to dive into a custom tag, it will be a 'container' tag.
 I have seen the HowTo, and it really isn't that clear when you get to
 the container tag info.
 
 Can anyone provide a better rundown?  Anyone have a custom tag they
 would mind sharing for perusal?
 Just trying to save myself sometime.

Not a container tag, but check out
http://www.zope.org/Members/noa/SpellChecker - me and Noa wrote this a while
back.  A spellchecker interface written in DTML is not a pretty sight, but
you do learn DTML really quickly :)

-- 
Itamar S.T.  [EMAIL PROTECTED]

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope] E-Commerce solution using Python and Zope.

2000-05-25 Thread Itamar Shtull-Trauring

Jilani Khaldi wrote:
 
 Hi All,
 do you know about something written in Python  Zope for e-commerce
 solutions?

Etailer - http://e-tailer.adriot.net

It's simple, but very nice.
--
Itamar S.T.  [EMAIL PROTECTED]

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] ANN: Perl For Zope

2000-05-25 Thread Itamar Shtull-Trauring

Chris Withers wrote:

 I have to say, I'm not convinced it is. Providing Perl methods is like
 drilling a hole through a dyke wall. By getting loads of perl
 programmers on board, you suddenly have a large userbase wishing they
 can do more in perl, so you implement perl products. (yes, I've read the
 FAQ too, hence my politicians comment...)
 
 This userbase gets into hacking the core and bring perl into there.

Yeah, but for that you'd need to be able to import Python code into Perl, or
alternatively reimplement all those core classes (ObjectManager, etc.).  And
integrate Perl code with ZODB (pickle instances of perl classes.)  Why would
anyone spend time doing that?

-- 
Itamar S.T.  [EMAIL PROTECTED]

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] Netscape Image Problems (LoginManager?)

2000-05-24 Thread Itamar Shtull-Trauring

[EMAIL PROTECTED] wrote:

 Using the %{If-Modified-Since}i directive in the Apache log, we have been
 able to confirm that Netscape 3.01 and 4.06 on Win32 are sending
 If-Modified-Since with "16-May-00" type dates. Dieter's solution indeed
 fixes the problem by removing the Overflow error that they cause when the
 int() function is called on them.
 
 I noticed that Zope 2.1.4 does not have these int() calls in the offending
 section of lib/python/OFS/Image.py but they are present in 2.1.6. Why were
 they introduced on the latter version? Can they be removed in future
 versions?

No, they can't - HTTP datetime headers specify time in whole seconds, while
the time() function on Unix machines returns time with a floating point
time.  In order for Zope to work correctly the you have to make timeTime()'s
result be a whole number.  long() would be fine though, or floor().

-- 
Itamar S.T.  [EMAIL PROTECTED]

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] Building ZPatterns

2000-05-24 Thread Itamar Shtull-Trauring

Oliver Maunder wrote:

 I'm trying to install ZPatterns 0.3.0 on an NT system and I've come across
 problems building the dynpersist C extension.

Someone posted the compile dynpersist to Zope-PTK or maybe devel yesterday.

-- 
Itamar S.T.  [EMAIL PROTECTED]

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] uploading a batch of files

2000-05-23 Thread Itamar Shtull-Trauring

"R. David Murray" wrote:

 Perhaps the load_site (or whatever it's name is) product would help
 with this?  I've never looked at it.

Yes - it has command line and GUI clients for uploading multiple files to
Zope.  And you shouldn't use the one included with Zope - it trashes HTML
entities like amp;.  It runs over HTTP so it doesn't need FTP access to
Zope.

http://www.zope.org/Members/itamar/load_site

-- 
Itamar S.T.  [EMAIL PROTECTED]

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )