[Zope-Checkins] CVS: Packages/webdav - Resource.py:1.55.10.10

2005-06-21 Thread Sidnei da Silva
Update of /cvs-repository/Packages/webdav
In directory cvs.zope.org:/tmp/cvs-serv30574/lib/python/webdav

Modified Files:
  Tag: Zope-2_7-branch
Resource.py 
Log Message:

  - WebDAV COPY and MOVE did not call '_notifyOfCopyTo' and
'_postCopy' hooks like it was done in
OFS.CopySupport. Additionally added
'manage_changeOwnershipType' to make MOVE behave even closer
to OFS.CopySupport.


=== Packages/webdav/Resource.py 1.55.10.9 = 1.55.10.10 ===
--- Packages/webdav/Resource.py:1.55.10.9   Wed Dec 22 18:29:30 2004
+++ Packages/webdav/Resource.py Tue Jun 21 11:27:30 2005
@@ -377,6 +377,7 @@
 else:
 raise Locked, 'Destination is locked.'
 
+self._notifyOfCopyTo(parent, op=0)
 ob = self._getCopy(parent)
 ob._setId(name)
 
@@ -389,6 +390,7 @@
 parent._delObject(name)
 parent._setObject(name, ob)
 ob = parent._getOb(name)
+ob._postCopy(parent, op=0)
 ob.manage_afterClone(ob)
 # We remove any locks from the copied object because webdav clients
 # don't track the lock status and the lock token for copied resources
@@ -485,7 +487,12 @@
 raise PreconditionFailed, 'Source is locked and no '\
   'condition was passed in.'
 
-ob=aq_base(self._getCopy(parent))
+# try to make ownership explicit so that it gets carried
+# along to the new location if needed.
+self.manage_changeOwnershipType(explicit=1)
+
+self._notifyOfCopyTo(parent, op=1)
+ob = aq_base(self._getCopy(parent))
 self.aq_parent._delObject(absattr(self.id))
 ob._setId(name)
 if existing:
@@ -493,6 +500,12 @@
 self.dav__validate(object, 'DELETE', REQUEST)
 parent._delObject(name)
 parent._setObject(name, ob)
+ob = parent._getOb(name)
+ob._postCopy(parent, op=1)
+
+# try to make ownership implicit if possible
+ob.manage_changeOwnershipType(explicit=0)
+
 RESPONSE.setStatus(existing and 204 or 201)
 if not existing:
 RESPONSE.setHeader('Location', dest)

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] CVS: Zope/doc - CHANGES.txt:1.625.2.338

2005-06-21 Thread Sidnei da Silva
Update of /cvs-repository/Zope/doc
In directory cvs.zope.org:/tmp/cvs-serv30574/doc

Modified Files:
  Tag: Zope-2_7-branch
CHANGES.txt 
Log Message:

  - WebDAV COPY and MOVE did not call '_notifyOfCopyTo' and
'_postCopy' hooks like it was done in
OFS.CopySupport. Additionally added
'manage_changeOwnershipType' to make MOVE behave even closer
to OFS.CopySupport.


=== Zope/doc/CHANGES.txt 1.625.2.337 = 1.625.2.338 ===
--- Zope/doc/CHANGES.txt:1.625.2.337Sun Jun 12 20:41:06 2005
+++ Zope/doc/CHANGES.txtTue Jun 21 11:27:29 2005
@@ -14,6 +14,12 @@
 
 Bugs fixed
 
+  - WebDAV COPY and MOVE did not call '_notifyOfCopyTo' and
+'_postCopy' hooks like it was done in
+OFS.CopySupport. Additionally added
+'manage_changeOwnershipType' to make MOVE behave even closer
+to OFS.CopySupport.
+
   - Collector #1548: Fix 'httplib' usage in ZPublisher.Client.
 
   - Collector #1797: when a File/Image object returned a 304 response

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/trunk/ Forward-port fix from 2.7:

2005-06-21 Thread Sidnei da Silva
Log message for revision 30875:
  
  Forward-port fix from 2.7:
  
- WebDAV COPY and MOVE did not call '_notifyOfCopyTo' and
  '_postCopy' hooks like it was done in
  OFS.CopySupport. Additionally added
  'manage_changeOwnershipType' to make MOVE behave even closer
  to OFS.CopySupport.
  

Changed:
  U   Zope/trunk/doc/CHANGES.txt
  U   Zope/trunk/lib/python/webdav/Resource.py

-=-
Modified: Zope/trunk/doc/CHANGES.txt
===
--- Zope/trunk/doc/CHANGES.txt  2005-06-21 10:28:34 UTC (rev 30874)
+++ Zope/trunk/doc/CHANGES.txt  2005-06-21 15:30:24 UTC (rev 30875)
@@ -39,6 +39,12 @@
   - Collector #1808: manage_convertIndexes no longer tries to change the
 index types causing some trouble with CMF.
 
+  - WebDAV COPY and MOVE did not call '_notifyOfCopyTo' and
+'_postCopy' hooks like it was done in
+OFS.CopySupport. Additionally added
+'manage_changeOwnershipType' to make MOVE behave even closer
+to OFS.CopySupport.
+
   - Collector #1548: Fix 'httplib' usage in ZPublisher.Client.
 
   - Collector #1792: applied patch for broken ZClasses

Modified: Zope/trunk/lib/python/webdav/Resource.py
===
--- Zope/trunk/lib/python/webdav/Resource.py2005-06-21 10:28:34 UTC (rev 
30874)
+++ Zope/trunk/lib/python/webdav/Resource.py2005-06-21 15:30:24 UTC (rev 
30875)
@@ -373,6 +373,7 @@
 else:
 raise Locked, 'Destination is locked.'
 
+self._notifyOfCopyTo(parent, op=0)
 ob = self._getCopy(parent)
 ob._setId(name)
 
@@ -385,6 +386,7 @@
 parent._delObject(name)
 parent._setObject(name, ob)
 ob = parent._getOb(name)
+ob._postCopy(parent, op=0)
 ob.manage_afterClone(ob)
 # We remove any locks from the copied object because webdav clients
 # don't track the lock status and the lock token for copied resources
@@ -481,7 +483,12 @@
 raise PreconditionFailed, 'Source is locked and no '\
   'condition was passed in.'
 
-ob=aq_base(self._getCopy(parent))
+# try to make ownership explicit so that it gets carried
+# along to the new location if needed.
+self.manage_changeOwnershipType(explicit=1)
+
+self._notifyOfCopyTo(parent, op=1)
+ob = aq_base(self._getCopy(parent))
 self.aq_parent._delObject(absattr(self.id))
 ob._setId(name)
 if existing:
@@ -489,6 +496,12 @@
 self.dav__validate(object, 'DELETE', REQUEST)
 parent._delObject(name)
 parent._setObject(name, ob)
+ob = parent._getOb(name)
+ob._postCopy(parent, op=1)
+
+# try to make ownership implicit if possible
+ob.manage_changeOwnershipType(explicit=0)
+
 RESPONSE.setStatus(existing and 204 or 201)
 if not existing:
 RESPONSE.setHeader('Location', dest)

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-dev] Re: ZOBD and pointers

2005-06-21 Thread Tim Peters
[Yair Benita]
 Reading this answer I understand that anything I store should be
 persistent, even if its a list I don't plan to edit.

[Tim Peters]
 I wouldn't say that.  For example, for _most_ applications it would be
 foolish to create a subclass of Persistent to store an integer, as
 opposed to just storing an integer directly.  I can conceive of
 (unlikely!) applications where there may be advantages to storing
 integers as perisistent objects, though.

[Tres Seaver]
 As, for instance, where the integer changes much more frequently than
 the other attributes, which are large enough that re-storing them just
 because the integer attribute changed is painful.

Yup, that's a possible reason.  Another recently popped up, which I'll
exaggerate to make the point:  you have 100,000 distinct integer ids,
and you have 10,000 objects each with a (Python) list containing
10,000 of those ids.  If you load those all into memory, Python will
allocate space for 1*1 = 100 million integer objects, and that
will consume more than a gigabyte of RAM.  But if integers are stored
as one unique persistent object per unique integer, it can't require
more than 100 thousand distinct persistent integers in memory (because
that's the total number of distinct integer ids).  The RAM difference
is a factor of about 1000 (but ignoring that it takes more RAM to hold
a persistent wrapper than to hold a straight integer).

I'll note that IISets avoid this problem via a different route:  they
hold their integers as raw bits, not as Python integer objects.  When
you extract an element from an IISet, a Python integer object is
created on-the-fly to wrap the bits.

 Making the attribute a persistent sub-object also eliminates the chance of a
 ConflictError based on changes to the other attributes.

I didn't follow that one.  If other attributes change, they can
trigger conflict errors, right?

 This is the use case which drives BTrees.Length, right?

The important part of that is its conflict resolution method, which
keeps track of the correct final size of a BTree in the face of
concurrent mutations.  BTrees don't keep track of their own size
because every addition or deletion would have to percolate the change
in size back up to the root of the BTree, and we'd get conflict errors
on the root object then.  As is, most additions and deletions change
only the leaf Bucket node where the mutation takes place, giving
mutation often-useful spatial locality in the face of concurrent
mutations.

I wish we could do better than that, though:  from what I see, most
people don't realize that len(some_BTree) takes time linear in the
number of elements, and sucks the entire BTree into RAM.  The rest
seem to have trouble, at least at first, using BTrees.Length
correctly.  I suppose that's what you get when a scheme is driven by
pragmatic implementation compromises instead of by semantic necessity.
 Give enough pain, it should be possible to hide the BTrees.Length
strategy under the covers, although I'm not sure the increase in
storage size could be justified to users who have mastered the details
of doing it manually (the problem being that many uses for BTrees
never care to ask for the size, so wouldn't want to pay extra
overheads for keeping track of size efficiently).
___
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 )


[Zope-dev] Re: ZOBD and pointers

2005-06-21 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Tim Peters wrote:

 [Tres Seaver]

Making the attribute a persistent sub-object also eliminates the chance of a
ConflictError based on changes to the other attributes.
 
 
 I didn't follow that one.  If other attributes change, they can
 trigger conflict errors, right?

Imaging object A with attributes 'foo' (a string), 'bar' (a normal
Python int), and 'baz' (a hypothetical persistent int).  Assigning
directly to 'baz' would still conflict with assigning to 'foo' or 'bar';
 however, the persistent int object might have an update protocol
which made its value changeable without needing to rebind another PI
into its parent.

This is the use case which drives BTrees.Length, right?
 
 
 The important part of that is its conflict resolution method, which
 keeps track of the correct final size of a BTree in the face of
 concurrent mutations.  BTrees don't keep track of their own size
 because every addition or deletion would have to percolate the change
 in size back up to the root of the BTree, and we'd get conflict errors
 on the root object then.  As is, most additions and deletions change
 only the leaf Bucket node where the mutation takes place, giving
 mutation often-useful spatial locality in the face of concurrent
 mutations.
 
 I wish we could do better than that, though:  from what I see, most
 people don't realize that len(some_BTree) takes time linear in the
 number of elements, and sucks the entire BTree into RAM.  The rest
 seem to have trouble, at least at first, using BTrees.Length
 correctly.  I suppose that's what you get when a scheme is driven by
 pragmatic implementation compromises instead of by semantic necessity.
  Give enough pain, it should be possible to hide the BTrees.Length
 strategy under the covers, although I'm not sure the increase in
 storage size could be justified to users who have mastered the details
 of doing it manually (the problem being that many uses for BTrees
 never care to ask for the size, so wouldn't want to pay extra
 overheads for keeping track of size efficiently).

OK, cool.

Tres.
- --
===
Tres Seaver  +1 202-558-7113  [EMAIL PROTECTED]
Palladion Software   Excellence by Designhttp://palladion.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCuD/M+gerLs4ltQ4RAlunAKDAXewr/rGeiG7Rhz/aWlwhmnUzDgCgpV51
n/RqyKt05uUieC93uP3Mzmw=
=PX5d
-END PGP SIGNATURE-
___
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] New External Editor release 0.9

2005-06-21 Thread Peter Bengtsson
Chris,
I had problems with the .exe on a windows machine. When I downloaded
it everything got downloaded of the 1.7Mb (or whatever it was exactly)
but when I tried doubleclicking it it complained about being corrupt.

Has anybody else had similar problems? 

On 6/21/05, Chris McDonough [EMAIL PROTECTED] wrote:
 Since Casey Duncan, the original author of Zope External Editor is
 happily hacking away on other things at a new job, I figure I might as
 well pick up maintenance of this product.
 
 The new location for External Editor releases will be:
 
   http://plope.com/software/ExternalEditor/
 
 A new release (0.9) is available at that location and the changes for
 the release are visible at
 http://plope.com/software/ExternalEditor/CHANGES-0.9.txt .  Most changes
 in this release are aimed at improving zopeedit behavior under Windows.
 
 Have fun!
 
 - C
 
 
 ___
 Zope maillist  -  Zope@zope.org
 http://mail.zope.org/mailman/listinfo/zope
 **   No cross posts or HTML encoding!  **
 (Related lists -
  http://mail.zope.org/mailman/listinfo/zope-announce
  http://mail.zope.org/mailman/listinfo/zope-dev )
 


-- 
Peter Bengtsson, 
work www.fry-it.com
home www.peterbe.com
hobby www.issuetrackerproduct.com
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] New External Editor release 0.9

2005-06-21 Thread Allen Schmidt

Same here. Chris??


Peter Bengtsson wrote:


Chris,
I had problems with the .exe on a windows machine. When I downloaded
it everything got downloaded of the 1.7Mb (or whatever it was exactly)
but when I tried doubleclicking it it complained about being corrupt.

Has anybody else had similar problems? 


On 6/21/05, Chris McDonough [EMAIL PROTECTED] wrote:


Since Casey Duncan, the original author of Zope External Editor is
happily hacking away on other things at a new job, I figure I might as
well pick up maintenance of this product.

The new location for External Editor releases will be:

 http://plope.com/software/ExternalEditor/

A new release (0.9) is available at that location and the changes for
the release are visible at
http://plope.com/software/ExternalEditor/CHANGES-0.9.txt .  Most changes
in this release are aimed at improving zopeedit behavior under Windows.

Have fun!

- C


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






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

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] New External Editor release 0.9

2005-06-21 Thread Chris McDonough
Sorry, it was indeed corrupted.  The file has been corrected...

On Tue, 2005-06-21 at 09:13 -0400, Allen Schmidt wrote:
 Same here. Chris??
 
 
 Peter Bengtsson wrote:
 
  Chris,
  I had problems with the .exe on a windows machine. When I downloaded
  it everything got downloaded of the 1.7Mb (or whatever it was exactly)
  but when I tried doubleclicking it it complained about being corrupt.
  
  Has anybody else had similar problems? 
  
  On 6/21/05, Chris McDonough [EMAIL PROTECTED] wrote:
  
 Since Casey Duncan, the original author of Zope External Editor is
 happily hacking away on other things at a new job, I figure I might as
 well pick up maintenance of this product.
 
 The new location for External Editor releases will be:
 
   http://plope.com/software/ExternalEditor/
 
 A new release (0.9) is available at that location and the changes for
 the release are visible at
 http://plope.com/software/ExternalEditor/CHANGES-0.9.txt .  Most changes
 in this release are aimed at improving zopeedit behavior under Windows.
 
 Have fun!
 
 - C
 
 
 ___
 Zope maillist  -  Zope@zope.org
 http://mail.zope.org/mailman/listinfo/zope
 **   No cross posts or HTML encoding!  **
 (Related lists -
  http://mail.zope.org/mailman/listinfo/zope-announce
  http://mail.zope.org/mailman/listinfo/zope-dev )
 
  
  
  
 

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


Re: [Zope] ZPT tutorial

2005-06-21 Thread John Poltorak
On Tue, Jun 21, 2005 at 01:24:18AM +0200, Andreas Pakulat wrote:
 On 20.Jun 2005 - 23:45:34, John Poltorak wrote:
  
  Does a ZPT tutorial exist anywhere?
 
 How about the 2 chapters in the Zope book?

I just don't find this book very helpful at all. It's written as a manual 
rather than tutorial and reminds me of a book which explains how to chop 
down a tree if you are interested in putting up some bookshelves.

What I did find useful, though, was this worked example of how to put 
together a simple application:-

http://www.plope.com/Books/2_7Edition/SimpleExamples.stx#1-6

That was much more useful than anything else I've come across so. Just 
wish there were a few more examples.


 
 Andreas
 
 -- 


-- 
John


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


Re: [Zope] ZPT tutorial

2005-06-21 Thread David H




John Poltorak wrote:

  On Tue, Jun 21, 2005 at 01:24:18AM +0200, Andreas Pakulat wrote:
  
  
On 20.Jun 2005 - 23:45:34, John Poltorak wrote:


  Does a ZPT tutorial exist anywhere?
  

How about the 2 chapters in the Zope book?

  
  
I just don't find this book very helpful at all. It's written as a manual 
rather than tutorial and reminds me of a book which explains how to chop 
down a tree if you are interested in putting up some bookshelves.

What I did find useful, though, was this worked example of how to put 
together a simple application:-

http://www.plope.com/Books/2_7Edition/SimpleExamples.stx#1-6

That was much more useful than anything else I've come across so. Just 
wish there were a few more examples.


 
  
  
Andreas

-- 

  
  

  

John,
Someone put this up some time ago. Lots of Dtml-Zpt examples.
Sounds like you might wanna take a look.

http://www.zope.org/Members/peterbe/DTML2ZPT/#example1

David





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


[Zope] ZPT code sample

2005-06-21 Thread John Poltorak

Is there anything wrong with this ZPT code sample?

http://www.zopemag.com/Issue003/Section_Articles/article_ZPTintro_code.html

I get this error message when trying to save it:-

HTMLParser.HTMLParseError: malformed start tag, at line 8, column 37

-- 
John


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


Re: [Zope] ZPT code sample

2005-06-21 Thread Fred Drake
On 6/21/05, John Poltorak [EMAIL PROTECTED] wrote:
 Is there anything wrong with this ZPT code sample?
 
 http://www.zopemag.com/Issue003/Section_Articles/article_ZPTintro_code.html
 
 I get this error message when trying to save it:-
 
 HTMLParser.HTMLParseError: malformed start tag, at line 8, column 37

The cited line contains a typo; it uses  instead of  to end a tag.


  -Fred

-- 
Fred L. Drake, Jr.fdrake at gmail.com
Zope Corporation
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] ZPT code sample

2005-06-21 Thread Andreas Jung



--On 21. Juni 2005 11:58:52 -0400 Fred Drake [EMAIL PROTECTED] wrote:


On 6/21/05, John Poltorak [EMAIL PROTECTED] wrote:

Is there anything wrong with this ZPT code sample?

http://www.zopemag.com/Issue003/Section_Articles/article_ZPTintro_code.h
tml

I get this error message when trying to save it:-

HTMLParser.HTMLParseError: malformed start tag, at line 8, column 37


The cited line contains a typo; it uses  instead of  to end a tag.



...which is obvious when you look in line 8 carefully.

-aj



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


Re: [Zope] ZPT tutorial

2005-06-21 Thread J Cameron Cooper

John Poltorak wrote:

Does a ZPT tutorial exist anywhere?


How about:

http://www.zope.org/Documentation/Articles

Specifically:

http://www.zope.org/Documentation/Articles/ZPT1

http://www.zope.org/Documentation/Articles/ZPT2

There's something odd about the rendering of the second one, but it's 
all there in the source.


It's a shame these aren't done anymore.

See also:

http://www.zope.org/Wikis/DevSite/Projects/ZPT/SimpleTutorial
http://www.devshed.com/c/a/Zope/ZPT-Basics-part-1
http://plone.org/documentation/tutorial/zpt

All of which were found from the first page of:

http://www.google.com/search?q=zpt+tutorial


--jcc

--
Building Websites with Plone
http://plonebook.packtpub.com/

Enfold Systems, LLC
http://www.enfoldsystems.com
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] accessing session data error

2005-06-21 Thread Leticia Larrosa

Hi:

Thanks to Michael Dunstan. I test with the recomendation of 
Michael but I still get the error. In pages where I get the error, if I wait 
some seconds and refresh the pages, I obtain the correct 
information (no get the error).

I thinks that the problem maybe are similar to the guess of Michael, 
but I test "breaking up ``init2`` into two scripts" and the error don't 
disappear. :(

Any help will be useful.

Thanks in advance, 

Leticia Larrosa
-Original Message-From: Michael Dunstan 
[EMAIL PROTECTED]To: Leticia Larrosa 
[EMAIL PROTECTED]Cc: zope@zope.orgDate: Tue, 21 Jun 
2005 10:19:53 +1200Subject: Re: [Zope] accessing session data error
 Hi Leticia,  The mixture of ``response.write()`` 
including _javascript_ to drive the  browser to a new location 
along with writing objects in ZODB all  within the same 
transaction can break some of the promises that you'd  
normally expect Zope and a browser to keep.  My guess is 
that browser is being told to visit ``end`` before the  
transaction started by ``init2`` has finished. Perhaps a conflict 
 error is causing that transaction to take longer than you expect. 
 Normally this would not trip you up as your browser does not 
see  anything until after the transaction has finished. (In 
this normal  mode you might see a conflict error rendered in 
the browser if the  publication machinery had to give up.)
  For your example try breaking up ``init2`` into two scripts. 
The  first that writes the session data and then redirects the 
browser to  the second. The second then does not touch session 
data and manages  all the ``response.write()``s. And remove 
the unused ``sessionData =  context.REQUEST.SESSION`` from 
``external``.  Cheers Michael  On 
21/06/2005, at 6:20 AM, Leticia Larrosa wrote:   Hi 
all:   I think that I found a ZOPE bug. Is really 
very important for me   know what can I do for avoid it. 
The first 9 steps are to recreate   the situation and the 
other steps are to provoke the error.   Step 1: 
Crate a folder called "reproducingError" in Zope Interface  
 Manage   Step 2: create a page template called 
"index_html" in the   "reproducingError" folder with the 
following content:  "  !-- index_html page 
template --  form name="form1" method="post" 
action=""   input type="text" 
name="user"   input type="submit" name="Submit" 
value="Submit"  /form  " 
  Step 3: create a python script called "init" in the  
 "reproducingError" folder with the following content:  "
  # init script  sessionData = 
container.REQUEST.SESSION  sessionData.set("userId", 
container.REQUEST.user)  return context.init2_html() 
 "   Step 4: create a page template called 
"init2_html" in the   "reproducingError" folder with the 
following content:  "  !-- init2_html page 
template --  a href=""passing face 
2/a  "   Step 5: create a python 
script called "init2" in the   "reproducingError" folder 
with the following content:  "  # init2 script
  request = context.REQUEST  sessionData = 
request.SESSION  sessionData.set('idService', 'testService')
  context.first()  return context.external(context)
  "   Step 6: create a page template called 
"first_html" in the   "reproducingError" folder with the 
following content:  "  First Response  
"   Step 7: create a python script called "first" in 
the   "reproducingError" folder with the following 
content:  "  # first script  response = 
container.REQUEST.RESPONSE  str = container.first_html() 
 response.write(str)  response.flush()  "
   Step 8: create an external method called "external" 
in the   "reproducingError" folder with the following 
content, in where the   function of the external method is 
"communicationResponse" and the   module is any name that 
you give to the file:  "  # external method 
 import time  def communicationResponse(context): 
   response = context.REQUEST.RESPONSE   
 sessionData = context.REQUEST.SESSION
strDetailEnd = "scriptwindow.location='reproducingError/end'/ 
  script" for item 
in range(1, 40):  time.sleep(3)
  response.write("Response iteration:" + 
str(item))  response.flush() 
   response.write(strDetailEnd)
response.flush()  "   Step 9: create a 
python script called "end" in the   "reproducingError" 
folder with the following content:  "  # end 
script  idService = context.REQUEST.SESSION['idService'] 
 return "Fin - " + idService  "   
Step 10: open two explorer in wich call the object   
"reproducingError" (Example: localhost:8080/reproducingError) 
  Step 11: enter an example text in each one. 
  Step 12: clink in the link of one of them, and 5 second 
later clink   on the link of the other explorer. The 
waiting for around 5 second   is necesary because with 
other time interval not allways get the   error. 
  Stpe 13: and wait the "Response iteration"... Please 
if the error   don't appear in any of the pages, begins at 
Step 9 again. and try   to count to 5 witch other velocity 
:)   The correct result is:  " 
 Fin - testService  "   The 

Re: [Zope] Factory-based Type Information

2005-06-21 Thread J Cameron Cooper

Denis Mishunoff wrote:


I have a problem with my product.
I use Zope 2.7.5 and Plone 2.0.5.

I need to create the copy of Document content-type on my product's
install the same way as it is done in portal_types via
Factory-based Type Information option of dropdown.
I just need to have the copy of it and to alter some fields.


Here's some code I stole from Chapter 8 of my book, were a 
Folder-derived type is created in an install script::


  from Products.CMFCore.Expression import Expression

  # Customize types
  types_tool=getToolByName(portal,'portal_types')

  # New 'NewsFolder' type based on folder
  types_tool.manage_addTypeInformation(id='NewsFolder',
   add_meta_type=Factory-based Type Information,
   typeinfo_name=CMFPlone: Plone Folder)
  nf = getattr(types_tool, 'NewsFolder')
  nf.manage_changeProperties(filter_content_types=1,
   allowed_content_types=('News Item',))
  actions=nf._cloneActions()
  for a in actions:
  if a.id == 'view':
  a.action = Expression('string:${object_url}/newsfolder_view')
  nf._actions=(actions)

After a clone of the type is made based on Plone Folder, some changes 
are made: contents are filtered, and only News Items are allowed; also 
an action is changed to point to a custom template.


This is a better option than using the copy/paste API like you might do 
in the ZMI.


--jcc

--
Building Websites with Plone
http://plonebook.packtpub.com/

Enfold Systems, LLC
http://www.enfoldsystems.com
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] Set sort variables with nice url

2005-06-21 Thread David Pratt
Hi.  I have a nice scheme for my ordering, sorting and batch paging my  
summary columns for objects and sql data but I have been using urls  
like  
employee_edit_form?employee_id=42start:int=2sort=employeereverse:int= 
0 in my lists up till now.


These would be  tal:attributes in my zpt, (a string) for href attribute  
so that you click to edit the appropriate record.  I have hidden fields  
in my edit form that accept the start, sort, and reverse in the request  
so that when the edit is done there is a response.redirect to pass user  
back to the index_html on the proper page in the batch.


I am trying to use the Allow Simple Direct Traversal under the  
Advanced tab for ZSQL queries to give me nice urls when passing an id  
parameter to a zsql query with results in an edit form. URLs like:


/employee_by_id/42/employee_edit_form

This works nicely except I need the edit_form to also get my start,  
sort and reverse parameters and I  am hoping there might be some way of  
setting the request in the edit_form so it is possible to use this nice  
zsql traversal feature.  Can someone suggest a solution that would not  
involve direct parameter passing in the url - but in someway of setting  
the request so when the edit_form is called these other parameters are  
available in the request.  Note that start, order and reverse are  
available variables in my index_html and change based on the batch page  
and column heading urls selected.  I have tried using something like  
tal:define=dummy python:REQUEST.set('tmp_sort', sort) to see if I  
could set tmp_sort in index_form and when edit_form called tmp_sort  
might appear in the request.  Alternatively is there some type of  
javascript that might help with this to either pass the remaining  
parameters or use history in some way?


On a second note, can someone advise me of what I need to place inside  
the dtml-comment area in a filesystem zsql query so that it will use  
simple direct traversal.


Many thanks,
David




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

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] ZPT tutorial

2005-06-21 Thread Peter Bengtsson
  How about the 2 chapters in the Zope book?
 
 I just don't find this book very helpful at all. It's written as a manual
 rather than tutorial and reminds me of a book which explains how to chop
 down a tree if you are interested in putting up some bookshelves.
 
 What I did find useful, though, was this worked example of how to put
 together a simple application:-
 
 http://www.plope.com/Books/2_7Edition/SimpleExamples.stx#1-6
 
 That was much more useful than anything else I've come across so. Just
 wish there were a few more examples.
 

Interesting. 
If you like examples, be sure to get familiar with Zopelabs.com (zope cookbook)

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


-- 
Peter Bengtsson, 
work www.fry-it.com
home www.peterbe.com
hobby www.issuetrackerproduct.com
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] ZMYSQLDA 2.0.9 lock problem

2005-06-21 Thread Dieter Maurer
Dennis Allison wrote at 2005-6-20 11:31 -0700:
 ...
* Module Shared.DC.ZRDB.TM, line 59, in tpc_finish
* Module Products.ZMySQLDA.db, line 376, in _finish

error: release unlocked lock

When I remember right, I have seen such problem reports in
the mailing list.

You have checked the archives?


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


Re: [Zope] Problem with keep-alive timeout

2005-06-21 Thread Dieter Maurer
Ralph wrote at 2005-6-20 22:36 +0200:

I made a small and simple database applikation with some reports on a large 
database. But surprise, IE 6.0 (WinXP,SP2) is getting always a timeout after 
60seconds, because IE communicates with Zope through the HTTP1.0-protocoll. 
My reports needing always 40s-120s, so is there someone that could give me a 
solution for this annoying timeout problem?

The easiest way would be to use a different browser ;-)

I think IE can be customized to use a different timeout (I do not 
know as I use Mozilla -- by default without timeout).

There is a very old product around, I think its name is LocalProc,
to execute long running requests in the background and provide
some view on its face. It may not longer work in current Zope
versions but may be instructive how to proceed...

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


Re: [Zope] ZPT tutorial

2005-06-21 Thread John Poltorak
On Tue, Jun 21, 2005 at 07:04:48PM +0100, Peter Bengtsson wrote:
   How about the 2 chapters in the Zope book?
  
  I just don't find this book very helpful at all. It's written as a manual
  rather than tutorial and reminds me of a book which explains how to chop
  down a tree if you are interested in putting up some bookshelves.
  
  What I did find useful, though, was this worked example of how to put
  together a simple application:-
  
  http://www.plope.com/Books/2_7Edition/SimpleExamples.stx#1-6
  
  That was much more useful than anything else I've come across so. Just
  wish there were a few more examples.
  
 
 Interesting. 
 If you like examples, be sure to get familiar with Zopelabs.com (zope 
 cookbook)

It probably is very useful, but I know I'd get hopelessly lost because 
there is just so much stuff on it. Most of the newbie stuff about macros 
is probably quite old by now so I doubt whether I'd find it with a 
sequential browse through the Cookbook. 

It's disappointing to find that the link from Newbies under the ZOPE 
section does not function.

What I really need is something like a ZPT macro which defines a header 
and footer and leaves a slot in the middle for my own content. I don't  
expect to be able to write my own macro for quite a while - too many 
pitfalls... I'm not even sure is that is how I should be approaching 
writing a home page.



 
  
  
   Andreas
  
   --
  
  
  --
  John

 -- 
 Peter Bengtsson, 
 work www.fry-it.com
 home www.peterbe.com
 hobby www.issuetrackerproduct.com



-- 
John



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


Re: [Zope] ZPT code sample

2005-06-21 Thread John Poltorak
On Tue, Jun 21, 2005 at 06:07:36PM +0200, Andreas Jung wrote:
 
 
 --On 21. Juni 2005 11:58:52 -0400 Fred Drake [EMAIL PROTECTED] wrote:
 
  On 6/21/05, John Poltorak [EMAIL PROTECTED] wrote:
  Is there anything wrong with this ZPT code sample?
 
  http://www.zopemag.com/Issue003/Section_Articles/article_ZPTintro_code.h
  tml
 
  I get this error message when trying to save it:-
 
  HTMLParser.HTMLParseError: malformed start tag, at line 8, column 37
 
  The cited line contains a typo; it uses  instead of  to end a tag.
 
 
 ...which is obvious when you look in line 8 carefully.

It may well be obvious to anyone familiar with these things, but when you 
are struggling to understand them, the last thing you need when you are 
going through the most basic example is a typo in the example itself.

I keep wondering whether ZOPE is sponsored by wig makers...

 
 -aj
 



-- 
John


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


[Zope] Zope External Editor Problem

2005-06-21 Thread hpinson
Hello. I am having a problem with Zope External Editor 0.8 - the 
helper app running on W2K.  This problem occurred on upgrade from the 
previous version.

When I lauch the external editor, by clicking the pencil, MS Word 
lauches (and if I save, badly mangles the HTML.

In ZopeEdit.ini my editor setting has not changed:

# Uncomment and specify an editor value to override the editor
# specified by the operating system
editor = C:\Program Files\TextPad 4\TextPad.exe

I used to be able to change this path to Dreamweaver as well, but 
when I do that, only MS Word launches.

What could account for this? Is there a solution to get Zope External 
Editor working as it did prior to the upgrade?

Harlow Pinson
Indepth Learning
Email: [EMAIL PROTECTED] 
Web: http://www.indepthl.com
Voice: 505-994-2135
FAX: 208-475-7678

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


Re[2]: [Zope] Factory-based Type Information

2005-06-21 Thread Denis Mishunoff
Hello, J.

You wrote 21 èþíÿ 2005 ã., 20:27:50:

 Denis Mishunoff wrote:

 I have a problem with my product.
 I use Zope 2.7.5 and Plone 2.0.5.
 
 I need to create the copy of Document content-type on my product's
 install the same way as it is done in portal_types via
 Factory-based Type Information option of dropdown.
 I just need to have the copy of it and to alter some fields.

 Here's some code I stole from Chapter 8 of my book, were a 
 Folder-derived type is created in an install script::

from Products.CMFCore.Expression import Expression

# Customize types
types_tool=getToolByName(portal,'portal_types')

# New 'NewsFolder' type based on folder
types_tool.manage_addTypeInformation(id='NewsFolder',
 add_meta_type=Factory-based Type Information,
 typeinfo_name=CMFPlone: Plone Folder)
nf = getattr(types_tool, 'NewsFolder')
nf.manage_changeProperties(filter_content_types=1,
 allowed_content_types=('News Item',))
actions=nf._cloneActions()
for a in actions:
if a.id == 'view':
a.action =
 Expression('string:${object_url}/newsfolder_view')
nf._actions=(actions)

 After a clone of the type is made based on Plone Folder, some changes
 are made: contents are filtered, and only News Items are allowed; also
 an action is changed to point to a custom template.

 This is a better option than using the copy/paste API like you might do
 in the ZMI.

 --jcc


Thank you very much, Cameron. Definitelly will use it next time. This
time I decided to create the separate content type, because seems like
I will need to change some methods of it. But I will definitelly use
your solution next time ;)

-- 
  Best regards,
 Denis Mishunoff  mailto:[EMAIL PROTECTED]
  http://plonetarium.objectis.net

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


Re: [Zope] ZPT code sample

2005-06-21 Thread J Cameron Cooper

John Poltorak wrote:

On Tue, Jun 21, 2005 at 06:07:36PM +0200, Andreas Jung wrote:

--On 21. Juni 2005 11:58:52 -0400 Fred Drake [EMAIL PROTECTED] wrote:


On 6/21/05, John Poltorak [EMAIL PROTECTED] wrote:


Is there anything wrong with this ZPT code sample?

http://www.zopemag.com/Issue003/Section_Articles/article_ZPTintro_code.h
tml

I get this error message when trying to save it:-

HTMLParser.HTMLParseError: malformed start tag, at line 8, column 37


The cited line contains a typo; it uses  instead of  to end a tag.


...which is obvious when you look in line 8 carefully.


It may well be obvious to anyone familiar with these things, but when you 
are struggling to understand them, the last thing you need when you are 
going through the most basic example is a typo in the example itself.


That problem that has nothing to do with any of the dynamic elements in 
the page. Such a typo would bork any tag-based language.


You're not learning HTML at the same time as ZPT, are you?

One should know HTML before dealing with any HTML templating language. I 
dare say it's a fool's errand to try  to learn ZPT unless you have an 
understanding of HTML and XML-sh languages in general.



I keep wondering whether ZOPE is sponsored by wig makers...


Now that you know, you should notify the author/site and get it fixed.

--jcc

--
Building Websites with Plone
http://plonebook.packtpub.com/

Enfold Systems, LLC
http://www.enfoldsystems.com
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Zope External Editor Problem

2005-06-21 Thread Chris McDonough
Where is the ZopeEdit.ini file you're editing?  According to the 0.8
code it should pick up the editor defined in the config file up and use
it exclusively in preference to any extension- or content/type- related
executables.  The code first looks in:

os.path.expanduser('~\\ZopeEdit.ini')

(which on my system resolves to c:\Documents and Settings\chrism
\ZopeEdit.ini), and then looks in:

os.path.join(sys.path[0] or '', 'ZopeEdit.ini')

(the package directory, presumably).

- C




On Tue, 2005-06-21 at 12:37 -0600, [EMAIL PROTECTED] wrote:
 Hello. I am having a problem with Zope External Editor 0.8 - the 
 helper app running on W2K.  This problem occurred on upgrade from the 
 previous version.
 
 When I lauch the external editor, by clicking the pencil, MS Word 
 lauches (and if I save, badly mangles the HTML.
 
 In ZopeEdit.ini my editor setting has not changed:
 
 # Uncomment and specify an editor value to override the editor
 # specified by the operating system
 editor = C:\Program Files\TextPad 4\TextPad.exe
 
 I used to be able to change this path to Dreamweaver as well, but 
 when I do that, only MS Word launches.
 
 What could account for this? Is there a solution to get Zope External 
 Editor working as it did prior to the upgrade?
 
 Harlow Pinson
 Indepth Learning
 Email: [EMAIL PROTECTED] 
 Web: http://www.indepthl.com
 Voice: 505-994-2135
 FAX: 208-475-7678
 
 ___
 Zope maillist  -  Zope@zope.org
 http://mail.zope.org/mailman/listinfo/zope
 **   No cross posts or HTML encoding!  **
 (Related lists - 
  http://mail.zope.org/mailman/listinfo/zope-announce
  http://mail.zope.org/mailman/listinfo/zope-dev )
 

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


Re: [Zope] Zope External Editor Problem

2005-06-21 Thread hpinson
Hi Chris.  The ini  that I was editing is located at:

c:\program files\zopeexternaleditor

Which is where the previous versions had been looking.

I looked in:

C:\Documents and Settings\me

and yes there is another ZopeEdit.ini

Editing that resolves the problem

I wonder if this should be in the readme for upgraders?  I.e there 
can might be more than one .ini file.

Thanks a bunch!



Harlow Pinson
Indepth Learning
Email: [EMAIL PROTECTED] 
Web: http://www.indepthl.com
Voice: 505-994-2135
FAX: 208-475-7678

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


Re: [Zope] ZPT tutorial

2005-06-21 Thread J Cameron Cooper

 John Poltorak wrote:


On Tue, Jun 21, 2005 at 07:04:48PM +0100, Peter Bengtsson wrote:


How about the 2 chapters in the Zope book?



I just don't find this book very helpful at all. It's written as a 
manual
rather than tutorial and reminds me of a book which explains how to 
chop

down a tree if you are interested in putting up some bookshelves.

What I did find useful, though, was this worked example of how to put
together a simple application:-

http://www.plope.com/Books/2_7Edition/SimpleExamples.stx#1-6

That was much more useful than anything else I've come across so. Just
wish there were a few more examples.



Interesting. If you like examples, be sure to get familiar with 
Zopelabs.com (zope cookbook)



It probably is very useful, but I know I'd get hopelessly lost because 
there is just so much stuff on it. Most of the newbie stuff about 
macros is probably quite old by now so I doubt whether I'd find it 
with a sequential browse through the Cookbook.
It's disappointing to find that the link from Newbies under the ZOPE 
section does not function.


What I really need is something like a ZPT macro which defines a 
header and footer and leaves a slot in the middle for my own content. 
I don't  expect to be able to write my own macro for quite a while - 
too many pitfalls... I'm not even sure is that is how I should be 
approaching writing a home page.


You think it is harder than it is. I can show you by no more than
copy/paste from the ZMI help system.

The macro page (from Help!  Zope Help  ZPT Reference 
metal:define-slot) we will call 'master.html'::

  p metal:define-macro=hello
Hello b metal:define-slot=nameWorld/b
  /p

A client page (from metal:fill-slot)::

  p metal:use-macro=container/master.html/macros/hello
Hello b metal:fill-slot=nameKevin Bacon/b
  /p

In CMF/Plone/etc, one would usually say 'context' instead of 'container'
because of the skins sytem.

It is not a great intellectual leap to replace Hello with header-type
page structure, and replace the whitespace after the slot with
footer-type structure.

--jcc

--
Building Websites with Plone
http://plonebook.packtpub.com/

Enfold Systems, LLC
http://www.enfoldsystems.com
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] ZPT tutorial

2005-06-21 Thread Paul Winkler
On Tue, Jun 21, 2005 at 07:29:20PM +0100, John Poltorak wrote:
re. zopelabs.com:

 It probably is very useful, but I know I'd get hopelessly lost because 
 there is just so much stuff on it.

So you prefer to ignore it?

Granted, zopelabs.com has flaws. It's harder to find stuff than it
should be.  Nevertheless, browsing that site, along with reading the
Zope book (the old print version), was instrumental in getting me from
knowing nothing, to the point where I became a full-time zope developer.
We didn't even have the great resource of zopewiki.org back then.
Use that too, zopewiki is your friend.
There are tons of good links from http://zopewiki.org/PageTemplates

In general, I don't know how you expect to make any progress when your
typical response to the (many) suggestions you receive on this list is
I can't read that, it's too much work.

 Most of the newbie stuff about macros 
 is probably quite old by now so I doubt whether I'd find it with a 
 sequential browse through the Cookbook. 

probably? doubt? 

 It's disappointing to find that the link from Newbies under the ZOPE 
 section does not function.

True that. I don't know what happened to zopenewbies.net.
 
 What I really need is something like a ZPT macro which defines a header 
 and footer and leaves a slot in the middle for my own content. I don't  
 expect to be able to write my own macro for quite a while - too many 
 pitfalls... I'm not even sure is that is how I should be approaching 
 writing a home page.

Have you tried the tutorial that comes with Zope?
It includes at least one simple example of macros - see lesson 4.

Not sure how to run the tutorial?  The default index_html for a new Zope 
server tells you:

There is a built-in interactive Zope Tutorial which gets you started
with some simple tasks using the Zope managment interface. To use the
tutorial, go to any Folder and select Zope Tutorial from the add list
and click the Add button. Provide a name for the tutorial and click Add
to begin working with the tutorial.


-- 

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


Re: [Zope] Zope External Editor Problem

2005-06-21 Thread Chris McDonough
Yeah, apparently 0.8 (and 0.9) writes some defaults into the homedir
file if it doesn't find it there instead of copying over what exists.
Maybe it should not do this.

On Tue, 2005-06-21 at 13:06 -0600, [EMAIL PROTECTED] wrote:
 Hi Chris.  The ini  that I was editing is located at:
 
 c:\program files\zopeexternaleditor
 
 Which is where the previous versions had been looking.
 
 I looked in:
 
 C:\Documents and Settings\me
 
 and yes there is another ZopeEdit.ini
 
 Editing that resolves the problem
 
 I wonder if this should be in the readme for upgraders?  I.e there 
 can might be more than one .ini file.
 
 Thanks a bunch!
 
 
 
 Harlow Pinson
 Indepth Learning
 Email: [EMAIL PROTECTED] 
 Web: http://www.indepthl.com
 Voice: 505-994-2135
 FAX: 208-475-7678
 

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


Re: [Zope] Problem with keep-alive timeout (zope: addressed to exclusive sender for this address)

2005-06-21 Thread Ralph
On Tuesday 21 June 2005 19:16, Dieter Maurer - [EMAIL PROTECTED] wrote:
 Ralph wrote at 2005-6-20 22:36 +0200:

 The easiest way would be to use a different browser ;-)

 I think IE can be customized to use a different timeout (I do not
 know as I use Mozilla -- by default without timeout).
No that's not possible with HTTP1.0. The problem is, why IE is using HTTP1.0? 
With HTTP1.1 its possible to change keepalive-timeout.



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


[Zope] ZPT contents slot

2005-06-21 Thread John Poltorak

If I create a macro which defines a slot called 'content', is there any 
way to have that slot populated by a file with a specific name if it 
exists in a folder? 

What I'd like to do is create a structure text file, in each of the 
folders A B C and have it automatically loaded into a content slot of a 
master template whenever the options A B C are selected.

Can I do that, and if so how?

I have spent all day looking at ZPT references and have no idea if what 
I'd like to do is possible.

-- 
John




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


Re: [Zope] ZPT contents slot

2005-06-21 Thread J Cameron Cooper

John Poltorak wrote:
If I create a macro which defines a slot called 'content', is there any 
way to have that slot populated by a file with a specific name if it 
exists in a folder? 

What I'd like to do is create a structure text file, in each of the 
folders A B C and have it automatically loaded into a content slot of a 
master template whenever the options A B C are selected.


Can I do that, and if so how?

I have spent all day looking at ZPT references and have no idea if what 
I'd like to do is possible.


You don't have to involve macros::

 divI'm a header/div

 p tal:condition=exists:context/stxfile
tal:replace=structure context/stxfile/CookedBody
   This is sample page content
 /p

 divI'm a footer/div

If 'stxfile' can be aquired, what it renders will be included as page 
structure. (You may need to use a different method one the end of the 
path to render the object; for Documents, this is 'CookedBody'.) 
Otherwise, nothing will be rendered, though you could add a block with 
the oposite condition to supply a default action.


If you do not want the effects of acquisition, you may say instead::

  tal:condition=exists:context/aq_explicit/stxfile

since Zope assumes you generally want acquisition.

--jcc
--
Building Websites with Plone
http://plonebook.packtpub.com/

Enfold Systems, LLC
http://www.enfoldsystems.com
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] ZPT code sample

2005-06-21 Thread Andreas Jung



--On 21. Juni 2005 19:37:35 +0100 John Poltorak [EMAIL PROTECTED] wrote:

On Tue, Jun 21, 2005 at 06:07:36PM +0200, Andreas Jung wrote: It may 

well be obvious to anyone familiar with these things, but when you

are struggling to understand them, the last thing you need when you are
going through the most basic example is a typo in the example itself.

I keep wondering whether ZOPE is sponsored by wig makers...



I don't know what a wig maker is but when you work with ZPT you should have 
a certain knowledge in HTML and finding unmatched tag ends is something I 
consider really basic and which is support by nearly every text editor.


-aj


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


Re: [Zope] ZPT code sample

2005-06-21 Thread John Poltorak
On Tue, Jun 21, 2005 at 10:25:24PM +0200, Andreas Jung wrote:
 
 
 --On 21. Juni 2005 19:37:35 +0100 John Poltorak [EMAIL PROTECTED] wrote:
 
  On Tue, Jun 21, 2005 at 06:07:36PM +0200, Andreas Jung wrote: It may 
 well be obvious to anyone familiar with these things, but when you
  are struggling to understand them, the last thing you need when you are
  going through the most basic example is a typo in the example itself.
 
  I keep wondering whether ZOPE is sponsored by wig makers...
 
 
 I don't know what a wig maker is

A wig is something one might look for after tearing one's hair out - a 
state one often gets into when using Zope.

 but when you work with ZPT you should have 
 a certain knowledge in HTML and finding unmatched tag ends is something I 
 consider really basic and which is support by nearly every text editor.

Does Zope's built-in text editor include such support?


 -aj


-- 
John


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


Re: [Zope] ZPT contents slot

2005-06-21 Thread John Poltorak
On Tue, Jun 21, 2005 at 03:16:11PM -0500, J Cameron Cooper wrote:
 John Poltorak wrote:
  If I create a macro which defines a slot called 'content', is there any 
  way to have that slot populated by a file with a specific name if it 
  exists in a folder? 
  
  What I'd like to do is create a structure text file, in each of the 
  folders A B C and have it automatically loaded into a content slot of a 
  master template whenever the options A B C are selected.
  
  Can I do that, and if so how?
  
  I have spent all day looking at ZPT references and have no idea if what 
  I'd like to do is possible.
 
 You don't have to involve macros::
 
   divI'm a header/div
 
   p tal:condition=exists:context/stxfile
  tal:replace=structure context/stxfile/CookedBody
 This is sample page content
   /p
 
   divI'm a footer/div
 
 If 'stxfile' can be aquired, what it renders will be included as page 
 structure. (You may need to use a different method one the end of the 
 path to render the object; for Documents, this is 'CookedBody'.) 
 Otherwise, nothing will be rendered, though you could add a block with 
 the oposite condition to supply a default action.

Is 'stxfile' the actual filename? I'm not concerned about it being 
structured initially - just want to see it working in principle with any 
file containg some text.

 
 If you do not want the effects of acquisition, you may say instead::
 
tal:condition=exists:context/aq_explicit/stxfile
 
 since Zope assumes you generally want acquisition.
 
   --jcc
 -- 
 Building Websites with Plone
 http://plonebook.packtpub.com/
 
 Enfold Systems, LLC
 http://www.enfoldsystems.com


-- 
John


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


[Zope] Re: New External Editor release 0.9

2005-06-21 Thread Simon Michael

Chris - I and my windows users thank you!

Some little notes are gathered at http://zopewiki.org/ExternalEditor .
The biggest gotcha for EE on windows seems to be that the 
ZopeExternalEdit.ini in the \program files directory has no effect,

it needs to be moved to the user's profile.

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

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] accessing session data error

2005-06-21 Thread Michael Dunstan

On 22/06/2005, at 4:50 AM, Leticia Larrosa wrote:


Hi:

 Thanks to Michael Dunstan. I test with the recomendation of  
Michael but I still get the error. In pages where I get the error,  
if I wait some seconds and refresh the pages, I obtain the correct  
information (no get the error).


I thinks that the problem maybe are similar to the guess of  
Michael, but I test breaking up ``init2`` into two scripts and  
the error don't disappear. :(


Any help will be useful.

Thanks in advance,

Leticia Larrosa


Hi Leticia,

Just double check that you are redirecting from the init2-first-half  
to init2-second-half. Using something like the following in init2- 
first-half::


  response.redirect('init2-second-half')

rather than directly calling init2-second-half.

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

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Newbie Questions - many-many relationships? Zope 2 or 3?

2005-06-21 Thread Jim Vine
Thanks to those who posted suggestions - certainly
gave me a few things to think about. Unfortunately I
was left with one use Zope 2, one use Zope 3 and a
use Plone, but maybe that's just a reflection of the
fact that there's more than one Zope way to skin a
cat! (yeah, I know I've over-simplified the answers -
no offence is meant!)

On another thread
(http://mail.zope.org/pipermail/zope/2005-June/159738.html),
someone said:

The problem is that you develop using the ZMI. It's a
bad pattern. Don't do it.

but the Zope Book (2.7 version)'s chapter on Creating
a Basic Application all seems to be through the ZMI.

Now, Zope's original appeal to me was using the
graphical interface provided by the ZMI to create a
collection of objects which if you wire them up
correctly will become an application, a view that I
think is supported by the Zope Book. However, this
view, and what I've read about Zope 3 seems to
indicate that this way of doing things is deprecated.
Am I correct here? Particularly, if I am building an
app that I think I will want to add extra
functionality to after it has been installed and is in
use, is this a particular reason to avoid developing
with ZMI?

Say, for example that my Zope App in some way has a
House object, which records the address, the owner,
and a short description. Later on, I may wish to add
further fields to record, say, the number of bedrooms,
but the system is already in use - if I've developed
in the ZMI, will this make it harder to make an
upgrade?

Now, if the answer to all of that is yes, then I
think that steers me away from the need for TTW
development (TTW = Through The Web = ZMI, yes?) which
steers me towards Zope 3.

I'm interested by the suggestions on how to handle the
relations.

 Hmm, what I would start with is an attribute for a
 house containing a
 list of references to owners. And vice versa, each
 owner has a list of
 references to houses.

I had thought of this, but my concern was about how to
make sure that the two records are kept accurate -
basically the suggestion is to keep two records saying
the same thing, which just triggers alarm bells with
me.

Another suggestion was:

 Nah. You either let every PropertyOwner have a list
 of the ids of
 HouseProperty objects, or the other way around. Then
 you index this is
 the catalog so you can search. Tada!

I like the sound of this a bit better - just keep
records in one place. So, if I've followed, I let the
the house knows who owns it, and if I go to a
certain owner's page and want it to give me a list of
all the houses she owns, it would do a search through
all the house records to see where she's mentioned.

Thanks again for all the help so far - lots of food
for thought.

Thanks,
Jim

--- Andreas Pakulat [EMAIL PROTECTED] wrote:

 On 16.Jun 2005 - 23:17:43, Jim Vine wrote:
  Specifically, I've been scratching my head for a
 while
  about how to handle a many-many relationship: a
  property owner may own more than one house;
  conversely, a house may have more than one
 co-owner -
  consequently it's not appropriate to have either
  containing the other. I've googled for general
  information about handling many-many relationships
 in
  OO, and most of what I've come across has only
  indicated that it can be tricky!
 
 Hmm, what I would start with is an attribute for a
 house containing a
 list of references to owners. And vice versa, each
 owner has a list of
 references to houses. Now in Zope references could
 be implemented via
 storing the URL of the house and references to Users
 could be stored via
 the username (the one the user uses to log in). 
 
  While I’m on, I’ve noticed that Zope 3 has been
  released. Is this now the recommended development
  environment, or am I better off sticking with Zope
 2
  for now, and porting my application once Zope 3 is
 a
  bit further down the line?
 
 Read the archive, short answer is:
 
 If you depend only on Zope, you don't want TTW and
 you want to write a
 file based product: Zope3 would be possible
 
 If you need some existing products or if you need
 TTW-Code, then you
 have to stick to Zope2
 
 Andreas
 
 -- 
 You're ugly and your mother dresses you funny.
 ___
 Zope maillist  -  Zope@zope.org
 http://mail.zope.org/mailman/listinfo/zope
 **   No cross posts or HTML encoding!  **
 (Related lists - 
  http://mail.zope.org/mailman/listinfo/zope-announce
  http://mail.zope.org/mailman/listinfo/zope-dev )
 




___ 
How much free photo storage do you get? Store your holiday 
snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] TypeError: Cache values must be persistent objects.

2005-06-21 Thread Nikko Wolf

Help!

I'm trying to develop a filesystem-based Product (here 'ABCD') and 
unless I remove the ABCD folder from my Products directory, I get the 
following error IN THE MANAGEMENT INTERFACE.


Is it possible to determine what's causing the problem?  After multiple 
restarts, I did a global Find in the ZMI and (I think) deleted all 
objects of type ABCD Content.  But still the problem persists (no pun 
intended).


Gaah!  How can I fix this?

= event.log contains ==
2005-06-21T14:57:17 ERROR(200) ZODB Couldn't load state for 0x28b5
Traceback (most recent call last):
  File /usr/local/zope/lib/python/ZODB/Connection.py, line 600, in 
setstate

self._set_ghost_state(obj, p)
  File /usr/local/zope/lib/python/ZODB/Connection.py, line 639, in 
_set_ghost_state

state = unpickler.load()
  File /usr/local/zope/lib/python/ZODB/Connection.py, line 227, in 
_persistent_load

self._cache[oid] = object
TypeError: Cache values must be persistent objects.


== FROM THE =
Traceback (innermost last):
  Module ZPublisher.Publish, line 101, in publish
  Module ZPublisher.mapply, line 88, in mapply
  Module ZPublisher.Publish, line 39, in call_object
  Module Shared.DC.Scripts.Bindings, line 306, in __call__
  Module Shared.DC.Scripts.Bindings, line 343, in _bindAndExec
  Module App.special_dtml, line 175, in _exec
  Module DocumentTemplate.DT_Let, line 76, in render
  Module DocumentTemplate.DT_In, line 643, in renderwob
  Module DocumentTemplate.DT_In, line 771, in sort_sequence
  Module ZODB.Connection, line 600, in setstate
  Module ZODB.Connection, line 639, in _set_ghost_state
  Module ZODB.Connection, line 227, in _persistent_load
   - __traceback_info__: ('\x00\x00\x00\x00\x00\x009^', 
('Products.ABCD.XML_File', 'XML_File'))

TypeError: Cache values must be persistent objects.
=
Plone version: 2.0.5
Zope version: (Zope 2.7.6-final, python 2.3.4, linux2)
Apache version:
CMF version (if known): CMF-1.4.7
Browser(s) and version(s): Mozilla/5.0 (X11; U; Linux i686; en-US; 
rv:1.7.8) Gecko/20050511

Operating system: linux2
Python version: 2.3.4 (#1, Feb  2 2005, 12:11:53)
[GCC 3.4.2 20041017 (Red Hat 3.4.2-6.fc3)]
Debug mode: Yes
=
ABCD 0.4
ATExtensions 0.6 installed
Archetypes 1.3.3-final installed
BTreeFolder2 BTreeFolder2-1.0.1
CMFActionIcons 0.9 installed
CMFCalendar CMF-1.4.7 installed
CMFCore CMF-1.4.7
CMFDefault CMF-1.4.7
CMFFormController 1.0.4 installed
CMFMember 1.0.1 installed
CMFPlone 2.0.5
CMFQuickInstallerTool 1.5.1
CMFTopic CMF-1.4.7
CMFTutorial 0.1.2
CompositePage CompositePage-0.2
DCWorkflow CMF-1.4.7
Epoz 0.8.5 installed
ExternalEditor 0.8
ExternalMethod External Method-1-0-0
FlexibleTopic 1.1 installed
Formulator Formulator 1.6.2
GroupUserFolder 2.0.1 installed
Lesson 0.1
LocalFS LocalFS-1-7-andreas
MIMETools
MailHost MailHost-1-3-0
MimetypesRegistry 1.3.3-final05 installed
Minimal 0.1
MySite 0.4 installed
OFSP OFSP-1-0-0
OpenFlow 1.1.0
PageTemplates PageTemplates-1-4-0
PlacelessTranslationService 1.0
PloneCollectorNG 1.2.6 installed
PloneErrorReporting 0.11 installed
PluginIndexes
PortalTransforms 1.3.4-final installed
PythonScripts PythonScripts-2-0-0
Sessions
SiteAccess SiteAccess-2-0-0
SiteErrorLog
StandardCacheManagers StandardCacheManagers-1-1-0
TemporaryFolder
Transience
ZCTextIndex
ZCatalog ZCatalog-2-2-0
ZGadflyDA
ZODBMountPoint
ZReST 1.1
ZSQLMethods
ZopeTutorial Zope Tutorial 1.2
generator 1.3.0-final17
mxmCounter 1.1.0
validation 1.3.2-final
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] ZPT tutorial

2005-06-21 Thread John Poltorak
On Tue, Jun 21, 2005 at 03:15:33PM -0400, Paul Winkler wrote:
 On Tue, Jun 21, 2005 at 07:29:20PM +0100, John Poltorak wrote:
 re. zopelabs.com:
 
  It probably is very useful, but I know I'd get hopelessly lost because 
  there is just so much stuff on it.
 
 So you prefer to ignore it?

Just how much time should you spend on something when you are deriving no 
benefit just increasing frustration?

 
 Granted, zopelabs.com has flaws. It's harder to find stuff than it
 should be.  Nevertheless, browsing that site, along with reading the
 Zope book (the old print version), was instrumental in getting me from
 knowing nothing, to the point where I became a full-time zope developer.
 We didn't even have the great resource of zopewiki.org back then.
 Use that too, zopewiki is your friend.
 There are tons of good links from http://zopewiki.org/PageTemplates

Thanks. I'll check that.
 
 In general, I don't know how you expect to make any progress when your
 typical response to the (many) suggestions you receive on this list is
 I can't read that, it's too much work.

If I spend a couple of days on something and make no progress, I'd say 
it's 'too much work'. Wouldn't you.

I was on a course over the weekend where ordinary people in their 70's 
with no technical ability were knocking together websites in just a few 
hours with no prior training and no understanding of the 
underlying concepts involved. Why should Zope be just as easy?

 
  Most of the newbie stuff about macros 
  is probably quite old by now so I doubt whether I'd find it with a 
  sequential browse through the Cookbook. 
 
 probably? doubt? 
 
  It's disappointing to find that the link from Newbies under the ZOPE 
  section does not function.
 
 True that. I don't know what happened to zopenewbies.net.
  
  What I really need is something like a ZPT macro which defines a header 
  and footer and leaves a slot in the middle for my own content. I don't  
  expect to be able to write my own macro for quite a while - too many 
  pitfalls... I'm not even sure is that is how I should be approaching 
  writing a home page.
 
 Have you tried the tutorial that comes with Zope?
 It includes at least one simple example of macros - see lesson 4.
 
 Not sure how to run the tutorial?  The default index_html for a new Zope 
 server tells you:
 
 There is a built-in interactive Zope Tutorial which gets you started
 with some simple tasks using the Zope managment interface. To use the
 tutorial, go to any Folder and select Zope Tutorial from the add list
 and click the Add button. Provide a name for the tutorial and click Add
 to begin working with the tutorial.
 

There is a quantum leap between the tutorial and being able to do anything 
useful with a website. What the tutorial needs to to handhold you through 
putting together something like the homepage of zope.org.
 
 -- 
 
 Paul Winkler
 http://www.slinkp.com


-- 
John



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


Re: [Zope] ZPT tutorial

2005-06-21 Thread David H




John,

If you spent more time just *learning* Zope and HTML, etc and less time
rationalizing your lack of progress everyone would be happy.

David




John Poltorak wrote:

  On Tue, Jun 21, 2005 at 03:15:33PM -0400, Paul Winkler wrote:
  
  
On Tue, Jun 21, 2005 at 07:29:20PM +0100, John Poltorak wrote:
re. zopelabs.com:



  It probably is very useful, but I know I'd get hopelessly lost because 
there is just so much stuff on it.
  

So you prefer to ignore it?

  
  
Just how much time should you spend on something when you are deriving no 
benefit just increasing frustration?

 
  
  
Granted, zopelabs.com has flaws. It's harder to find stuff than it
should be.  Nevertheless, browsing that site, along with reading the
Zope book (the old print version), was instrumental in getting me from
knowing nothing, to the point where I became a full-time zope developer.
We didn't even have the great resource of zopewiki.org back then.
Use that too, zopewiki is your friend.
There are tons of good links from http://zopewiki.org/PageTemplates

  
  
Thanks. I'll check that.
  
  
In general, I don't know how you expect to make any progress when your
typical response to the (many) suggestions you receive on this list is
"I can't read that, it's too much work".

  
  
If I spend a couple of days on something and make no progress, I'd say 
it's 'too much work'. Wouldn't you.

I was on a course over the weekend where ordinary people in their 70's 
with no technical ability were knocking together websites in just a few 
hours with no prior training and no understanding of the 
underlying concepts involved. Why should Zope be just as easy?

 
  
  

  Most of the newbie stuff about macros 
is probably quite old by now so I doubt whether I'd find it with a 
sequential browse through the Cookbook. 
  

"probably"? "doubt"? 



  It's disappointing to find that the link from Newbies under the ZOPE 
section does not function.
  

True that. I don't know what happened to zopenewbies.net.
 


  What I really need is something like a ZPT macro which defines a header 
and footer and leaves a slot in the middle for my own content. I don't  
expect to be able to write my own macro for quite a while - too many 
pitfalls... I'm not even sure is that is how I should be approaching 
writing a home page.
  

Have you tried the tutorial that comes with Zope?
It includes at least one simple example of macros - see lesson 4.

Not sure how to run the tutorial?  The default index_html for a new Zope 
server tells you:

"""There is a built-in interactive Zope Tutorial which gets you started
with some simple tasks using the Zope managment interface. To use the
tutorial, go to any Folder and select Zope Tutorial from the add list
and click the Add button. Provide a name for the tutorial and click Add
to begin working with the tutorial.
"""

  
  
There is a quantum leap between the tutorial and being able to do anything 
useful with a website. What the tutorial needs to to handhold you through 
putting together something like the homepage of zope.org.
 
  
  
-- 

Paul Winkler
http://www.slinkp.com

  
  

  




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


[Zope] Re: Problem with keep-alive timeout (zope: addressed to exclusive sender for this address)

2005-06-21 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Ralph wrote:
 On Tuesday 21 June 2005 19:16, Dieter Maurer - [EMAIL PROTECTED] wrote:
 
Ralph wrote at 2005-6-20 22:36 +0200:

The easiest way would be to use a different browser ;-)

I think IE can be customized to use a different timeout (I do not
know as I use Mozilla -- by default without timeout).
 
 No that's not possible with HTTP1.0. The problem is, why IE is using HTTP1.0? 
 With HTTP1.1 its possible to change keepalive-timeout.

'keepalive' only refers to the lenght of time that the browser-webserver
connection stays open between the completion of one request and the
beginning of another to the same server.

The behavior we are discussing here is that IE (or sometimes Apache in
the middle) is configured to time out a single request after a period of
time;  Mozilla and derived browsers don't do that by default.


Tres
- --
===
Tres Seaver  +1 202-558-7113  [EMAIL PROTECTED]
Palladion Software   Excellence by Designhttp://palladion.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCuIaS+gerLs4ltQ4RAqT2AJ9RHuKwRMLVLI8IIjGtgpybGGX6OQCgkLEP
s0e0piS5ucm+wWYBOkL/ihY=
=1O4R
-END PGP SIGNATURE-
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] ZPT contents slot

2005-06-21 Thread J Cameron Cooper

John Poltorak wrote:


On Tue, Jun 21, 2005 at 03:16:11PM -0500, J Cameron Cooper wrote:


John Poltorak wrote:

If I create a macro which defines a slot called 'content', is there 
any way to have that slot populated by a file with a specific name 
if it exists in a folder?
What I'd like to do is create a structure text file, in each of the 
folders A B C and have it automatically loaded into a content slot 
of a master template whenever the options A B C are selected.


Can I do that, and if so how?

I have spent all day looking at ZPT references and have no idea if 
what I'd like to do is possible.



You don't have to involve macros::

 divI'm a header/div

 p tal:condition=exists:context/stxfile
tal:replace=structure context/stxfile/CookedBody
   This is sample page content
 /p

 divI'm a footer/div

If 'stxfile' can be aquired, what it renders will be included as page 
structure. (You may need to use a different method one the end of the 
path to render the object; for Documents, this is 'CookedBody'.) 
Otherwise, nothing will be rendered, though you could add a block 
with the oposite condition to supply a default action.




Is 'stxfile' the actual filename? I'm not concerned about it being 
structured initially - just want to see it working in principle with 
any file containg some text.



It's the name of an object. I made up this name for your structure text
file, in each of the folders A B C. You may call it as you will.

Note: there is no such thing as a file in the ZODB. Everything is an
object.

This is how content is viewed. One thing I forgot to mention: you
would apply this template (say it's named 'special_view') to your
folders, like:

http://localhost/A/special_view
http://localhost/B/special_view
http://localhost/C/special_view

Now, if we used a template like this (let's name it 'direct_view')::

  divI'm a header/div

  p tal:replace=structure context/CookedBody
This is sample page content
  /p

  divI'm a footer/div

we could apply it like so::

http://localhost/A/stxfile/direct_view
http://localhost/B/stxfile/direct_view
http://localhost/C/stxfile/direct_view

This is a much more typical pattern, at least for content. If you want
to apply a wrapper to page templates, then you use macros.

--jcc
--
Building Websites with Plone
http://plonebook.packtpub.com/

Enfold Systems, LLC
http://www.enfoldsystems.com
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] ZPT tutorial

2005-06-21 Thread Mark Barratt

John Poltorak wrote:


If I spend a couple of days on something and make no progress, I'd say 
it's 'too much work'. Wouldn't you.




Yes

I was on a course over the weekend where ordinary people in their 70's 
with no technical ability were knocking together websites in just a few 
hours with no prior training and no understanding of the 
underlying concepts involved. Why should Zope be just as easy?


Because Zope is hard. You can make some great sites/applications with 
Zope but for all except the very simplest you need


. advanced understanding of html and xml
or
. a thorough grounding in programming principles
or
. a working knowledge of Python

- and preferably all three.

Most (not all) of the people who hang out here have all three of these 
skill sets, and like many skilled people, they find it hard to 
understand that the skills they have seem arcane to beginners. You 
should also understand that nobody (AFAIK) is 'them' with an interest in 
making Zope easy and helping you. You depend on the kindness of 
strangers, so politeness and gratitude pay.


In addition, Zope is heading fast into even less friendly territory. 
DTML, which is technically 'mucky' but reasonably easy to grasp for 
non-programmers, is increasingly deprecated. Through-the-web editing 
likewise. I'm not saying these trends are bad, just that they are 
happening, they make the learning curve steeper, and that they lock out 
almost all casual users unless they have the skills noted above.


The alternative in the Zope world is Plone, where you can get a site up 
and rolling in very little time (as long as you are happy for it to look 
and operate like almost every other Plone site on the planet).


or there's PHP, where the communities are probably more newbie-friendly 
and there are loads of tutorials.


or you could decide that Zope does some stuff which you must have, in 
which case David H's stereotypical response



If you spent more time just *learning* Zope and HTML, etc and less time 
rationalizing your lack of progress everyone would be happy.


is appropriate.

Good luck.

--
Mark Barratt
Text Matters

Information design: we help explain things using
language | design | systems | process improvement
__
phone +44 (0)118 986 8313  email [EMAIL PROTECTED]
skype mark_barratt  web http://www.textmatters.com

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

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Newbie Questions - many-many relationships? Zope 2 or 3?

2005-06-21 Thread Andreas Pakulat
On 21.Jun 2005 - 21:59:41, Jim Vine wrote:
 Say, for example that my Zope App in some way has a
 House object, which records the address, the owner,
 and a short description. Later on, I may wish to add
 further fields to record, say, the number of bedrooms,
 but the system is already in use - if I've developed
 in the ZMI, will this make it harder to make an
 upgrade?

Such a change might not be a problem using ZMI, as you can freely add
properties to any object. You'd have to supply the data for all existing
objects though (but you'd need to do that when using a product too).

  Hmm, what I would start with is an attribute for a
  house containing a
  list of references to owners. And vice versa, each
  owner has a list of
  references to houses.
 
 I had thought of this, but my concern was about how to
 make sure that the two records are kept accurate -
 basically the suggestion is to keep two records saying
 the same thing, which just triggers alarm bells with
 me.

Yes, it should have triggered mine too, as I wouldn't do that in my own
apps

  Nah. You either let every PropertyOwner have a list
  of the ids of
  HouseProperty objects, or the other way around. Then
  you index this is
  the catalog so you can search. Tada!
 
 I like the sound of this a bit better

It is.

Andreas

-- 
You will inherit millions of dollars.
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] ZPT tutorial

2005-06-21 Thread Tamas Hegedus

Hi,

In addition, Zope is heading fast into even less friendly territory. 
DTML, which is technically 'mucky' but reasonably easy to grasp for non-programmers,

 is increasingly deprecated.

I just started to learn Zope recently. I choose dtml over page templates 
to learn as it

= seemed to me easier (maybe as I am a non-programmer);
= has the possibility to build dynamic SQL queries;
= was written in the Book to exist forever.

I would like to know that 'increasingly deprecated' means by everybody 
(I mean here: in the www-programmers-word), or just by Zope.


Does this mean that it would be better to deep into ztemplates?
In this case what are the alternatives to build sql queries on an easy way?

Thanks in advance,
Tamas

--
Tamas Hegedus   | phone: (1) 919-966 0329
UNC - Biochem  Biophys | fax:
5007A Thurston-Bowles Bldg  | mailto:[EMAIL PROTECTED]
Chapel Hill, NC, 27599-7248 | http://www.biomembrane.hu/cv/hegeduse.htm
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] accessing session data error

2005-06-21 Thread Paul Winkler
On Mon, Jun 20, 2005 at 05:20:29PM -0400, Leticia Larrosa wrote:
 Hi:
 
  I follow the steps to replicate the error in zope2.7 for Debian and i get 
 the error to.

fwiw, I have not been able to reproduce this following your instructions
(zope 2.7.6 running on gentoo linux; browser is IE 6.whatever
on win2k).
 
-- 

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


Re: [Zope] ZPT tutorial

2005-06-21 Thread Paul Winkler
On Tue, Jun 21, 2005 at 10:10:06PM +0100, John Poltorak wrote:
 On Tue, Jun 21, 2005 at 03:15:33PM -0400, Paul Winkler wrote:
  On Tue, Jun 21, 2005 at 07:29:20PM +0100, John Poltorak wrote:
  re. zopelabs.com:
  
   It probably is very useful, but I know I'd get hopelessly lost because 
   there is just so much stuff on it.
  
  So you prefer to ignore it?
 
 Just how much time should you spend on something when you are deriving no 
 benefit just increasing frustration?

Sometimes, answering questions on the mailing list feels exactly 
like that :-P

 I was on a course over the weekend where ordinary people in their 70's 
 with no technical ability were knocking together websites in just a few 
 hours with no prior training and no understanding of the 
 underlying concepts involved. Why should Zope be just as easy?

I highly doubt the stuff they were knocking together was
a sophisticated application, e.g. anything on the order of CMFDefault, not
to mention CPS or Plone.  There's a big difference between developing
web apps and slapping together some static HTML.

 There is a quantum leap between the tutorial and being able to do anything 
 useful with a website. What the tutorial needs to to handhold you through 
 putting together something like the homepage of zope.org.

That would be an immense tutorial!
There are some case studies of similar sites in Andy McKay's excellent
Plone Book. But they depend on reading and understanding
many chapters before you get that far.

Jon, I know this is frustrating for you. You are encountering
the (in)famous Z-shaped learning curve.  You have hit the upslope.
At this point, the trivial stuff (mostly) makes sense to you, but
there's a vast-looking chasm between where you are and where
you want to be. We've all been there. It *does* get better. Really.
But it can take months of perseverance to reach the other side.
And there's not really any way to skip the hard part.

You might find this interesting.
It was written by Chris McDonough years ago (back in the
pre-ZPT days).
http://www.zope.org/Members/mcdonc/HowTos/gainenlightenment

-- 

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


Re: [Zope] ZPT code sample

2005-06-21 Thread Paul Winkler
On Tue, Jun 21, 2005 at 09:58:32PM +0100, John Poltorak wrote:
 I got the impression that DTML and ZPT make some aspects of HTML 
 redundant... 

redundant? no.
DTML and ZPT are better understood as languages that you use
on top of HTML.  (Or on top of XML, as the case may be.)
  
-- 

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


Re: [Zope] ZPT tutorial

2005-06-21 Thread Jens Vagelpohl


On 21 Jun 2005, at 23:23, Tamas Hegedus wrote:


Hi,


In addition, Zope is heading fast into even less friendly  
territory. DTML, which is technically 'mucky' but reasonably easy  
to grasp for non-programmers,



 is increasingly deprecated.

I just started to learn Zope recently. I choose dtml over page  
templates to learn as it

= seemed to me easier (maybe as I am a non-programmer);
= has the possibility to build dynamic SQL queries;
= was written in the Book to exist forever.

I would like to know that 'increasingly deprecated' means by  
everybody (I mean here: in the www-programmers-word), or just by Zope.


That's FUD and not true. DTML is not being deprecated, period. Don't  
believe anyone who says that. Everyone should choose the tool they  
work with best, and DTML is suitable for many people. There's more  
people who choose to use ZPT nowadays, but that does not mean DTML  
will be deprecated.


jens


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

http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] Zope crashing after movin Plone site to RHEL 4

2005-06-21 Thread Mário Gamito

Hi,

I have this 1.0.2 Plone site running for about two years, or so.
It always ran smoothly.

Recently, i've moved it to a new server running Red Hat Enterprise Linux 4.

I've compiled Python 2.1.3 and start Zope with:
exec /usr/local/python-2.1.3/bin/python $cwd/z2.py -L 'pt_PT' -u zope $@

Now, i'm having this big problem: Zope crashes every day once or twice.
Onle restoring a previous Zope backup i can get Zope and Plone up again.

Is there something wrong here ?
Something specific to RHEL 4 ?

Thank you in advance.

Warm Regards,
Mário Gamito
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] ZPT tutorial

2005-06-21 Thread Andreas Jung



--On 21. Juni 2005 23:04:12 +0100 Mark Barratt [EMAIL PROTECTED] 
wrote:

or there's PHP, where the communities are probably more newbie-friendly
and there are loads of tutorials.

Don't compare PHP with Zope. PHP is a tiny language compared to the fat 
Zope frameworks. Working with Zope on the scripter level (ZPT, DTMl, ZSQL) 
requires similar skills as a PHP programmer. If you want to go beyond you 
have approach open-minded and come a with some solid knowledge in 
programming and understanding architectural issues in Zope. But when I read 
some questions here then I have the impression that people except that Zope 
solves their problems although neither they don't understand the problems 
themselves nor have the basic skills to  reach the goal.
That's not a but being newbie-friendly but one can expect as certain level 
of knowledge when you're working with Zope...e.g. the knowledge how HTML 
works (that's something kids learn at school nowadays).


-aj




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