[Zope-dev] aq_inContextOf attribute error

2001-01-02 Thread Alex V Koval


Hello All !

After installing latest stable version of Zope (2.2.4) I tried to 
install ZFormulator version 0.2. And as result got 2 problems with
permissions system. First was in ZFormulator itself, and was corrected:

__roles__ = ('manager',)

was changed to 

__roles__ = ('Manager',)

but this bug correction worked fine for previous versions of Zope, 
and in current version adding of field produced error:

Attribute Error: aq_inContextOf in line 231 of
lib/python/AccessControl/User.py

I am nor Zope nor Python hacker, but I tried to correct this line a little,
and this worked for me. Please advice did I made it correct way or not.

User.py line 231:


Here was the original code (which produced error):

if not parent.aq_inContextOf(self.aq_parent.aq_parent,1):

Here is replacement (added check is attribute exists):

if hasattr(parent, 'aq_inContextOf') and not 
parent.aq_inContextOf(self.aq_parent.aq_parent,1):

After this correction everything works fine, but since I am not Zope/Python
guru, but just a user which wanted some program to start working, I keeping
changed locally, but of course I am interested was this correction OK.

Regards.

--
Alex V. Koval



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




Re: [Zope-dev] ZCatalog catalog_object

2001-01-02 Thread Chris Withers

Itamar Shtull-Trauring wrote:
 
 Chris Withers wrote:
 
  ...in which case, I wonder why CatalogAwareness goes to the trouble of
  unindexing and then re-indexing?
 
 Because in older ZCatalog (before 2.3 and maybe before 2.2.4),
 catalog_object did not uncatalog automatically. When in doubt, assume
 ZCatalog is broken :p

Hmmm...

I wonder if Chris P or anyone else in the know could confirm the
recommended steps to recatalog an object?

cheers,

Chris

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




Re: [Zope-dev] Local Factories in Products

2001-01-02 Thread Chris Withers

Johan Carlsson wrote:
 
 In ZClasses it is possible to control where a ZClass instance
 should be permitted to be added, in other words show up
 in the factory listing in a ObjectManagers manage_main view.

Didn't Itamar have a proposal/project on this?

How did it work out?

cheers,

Chris

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




Re: [Zope-dev] CatalogAware

2001-01-02 Thread Michael Bernstein

Chris Withers wrote:
 
 Michael Bernstein wrote:
 
  Hmm. Aren't postings CatalogAware? If they're not, shouldn't
  they be?
 
 Why? ;-)
 
 Squishdot manages the cataloging, re-cataloging and un-cataloging of its
 own postings. I don't think CatalogAware would make that process any
 simpler or more reliable...

I guess it's just a matter of only reinventing the wheels
you have to, and writing less code as a result. Squishdot
seems like it would fall into the category covered by the
following howtos:

http://www.zope.org/Members/tseaver/inherit_ZCatalog
http://www.zope.org/Members/AlexR/CatalogAware

But I'm probably overlooking something.

Cheers,

Michael Bernstein.

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




[Zope-dev] dynamic permissions in zope

2001-01-02 Thread Heinz-Josef Claes

Hi,

I'm very new to zope and have to eximine, if it's usable for our
requirements.

The question I have, is very simple or perhaps very difficult, I don't
know.

Our requrements are a permissioning system which depends on a matrix:
There are two independend qualities which describe, if a user is allowed
to see a document. This can be displayed in a matrix. Only if *both*
qualities match, the user is allowed to see it.
As far as I understand zope, it is not possible to map this directly (as
by all other systems I know).

So my question:
Is it possible to connect a permission (or role) in zope with a method
(instead of a static flag which was set)? If it is possible, it should
be possible to call a special  algorithm with this request, which can
implement whatever is needed. So, it would be (easy) possible to
*integrate* this functionality.
(I called this permissions "dynamic", because the are evaluated when
requestet.)

Or does anybody has another (better) idea?

Any help is very apreciated,
Heinz-Josef Claes
[EMAIL PROTECTED]



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




Re: [Zope-dev] Local Factories in Products

2001-01-02 Thread Itamar Shtull-Trauring

Chris Withers wrote:

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

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

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

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




Re: [Zope-dev] ZPatterns example update....

2001-01-02 Thread Phillip J. Eby

At 03:08 PM 1/2/01 +1100, Itai Tavor wrote:
Hi Steve,

Steve Spicklemire wrote:

   "Itai" == Itai Tavor [EMAIL PROTECTED] writes:

 Itai Maybe with this
 Itai SkinScript: WITH Doers.getItem(self.doerID) CALCULATE
 Itai self.doerID=RESULT.id or '' ?  But I'm not really sure about
 Itai this...

Ahh.. I think my brain just imploded in a recursive death spiral,
but I get intent of the idea. This would work I think:

WITH Doers.getItem(self.doerID) COMPUTE self.myDoer=RESULT or 
Doers.getItem('doNothing')

where there is a default 'doer' named 'doNothing' in one of the Doers
Racks.  This guy would 'fill in' for the ToDo's doer when no 'real'
doer can be found... I like that. ;-)

Yeah, this looks good... whether it's appropriate or not depends on 
how you expect the case where there's no Doer to behave - if you 
needed to know explicitly that a Doer doesn't exist, returning a 
'nothing' doer could confuse things. BTW, I can't see the recursion 
in my script... but maybe my brain is still in vacation mode :)

Your script uses an attribute (doerID) in the WITH clause that is provided
by the COMPUTE clause.  This is infinitely recursive in theory.  In
practice, it will result in the non-existence of the doerID attribute, as
ZPatterns treats recursive attribute references as non-existence of the
attribute.  The WITH clause will fail with an AttributeError.


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




Re: [Zope-dev] Conflict Errors

2001-01-02 Thread Chris Withers

Chris McDonough wrote:
 
 The ZODB tries
 hard to avoid error conditions for you by retrying conflicting writes, but
 if you really pound the snot out of a particular object, it'll let you know.

That's gotta be one for the Zope quotes board, if I could onyl remember
the URL :-)

 and step through a real-world ConflictError situation.  Neither of which I
 have time to do right now... sorry, Chris.
 
 this one by saying "I don't know" because it's one of those things where
 learning exactly what is going on can chew up time like nobody's business,
 because I'd need to step through the code line-by-line.  I shouldn't even be
 in here.  :-(

Hey, no problem, the help was much appreciated :-)

However, if anyone does know what constitutes a 'seperate object' in
ZODB terms, it be really useful to know.
I'm guessing a class which inherits from Persistent? Dictionaries don't,
'cos they're python builtins, which I'm pretty certain was the problem
in my case...

cheers,

Chris

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




Re: [Zope-dev] Local Factories in Products

2001-01-02 Thread Shane Hathaway

Itamar Shtull-Trauring wrote:
 
 Chris Withers wrote:
 
   In ZClasses it is possible to control where a ZClass instance
   should be permitted to be added, in other words show up
   in the factory listing in a ObjectManagers manage_main view.
 
  Didn't Itamar have a proposal/project on this?
 
 It's still unimplemented - you can view the details at
 http://dev.zope.org/Wikis/DevSite/Proposals/RestrictedCreation, and there's
 some implementation suggestions from Jim Fulton in the discussion area.

I think the point was missed slightly in the discussion.  Right now
containers can limit what kinds of objects they can contain.  It should
also be possible for objects to limit what kinds of containers can
contain them.

Shane

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




Re: [Zope-dev] How to confuse the publishing process

2001-01-02 Thread Chris Withers

Steve Spicklemire wrote:
 
 Hi Chris,
 
OK... you need to tell us where the index_html's are and what they have
 in them!  ;-)

Doesn't seem to matter what's in them...

Say there's one in folder1 and one in folder2, which one should be used?
Why are neither of them being used?

cheers,

Chris

 Do you have a
 
 dtml-var folderx
 
 somewhere?

don't think so...

 Chris If you go to a URL that ends in a folder, you get the
 Chris index_html in that folder, right?
 
 Chris Well, yes and no...
 
 Chris If you go to: http://server.com/folder1/folder2/folder1
 
 Chris ...where folder1 is a folder in your Zope's root, folder2
 Chris is contained in folder1, but doesn't itself contain a
 Chris folder1 (so the last folder1 in the url is also the first
 Chris one, just acquired), Zope returns the following:
 
 Chris htmlhead base
 Chris href="http://localhost:8080/testnav/normaltest/testnav/"
 Chris /head
 
 Chris body Folder instance at 014B3D80 /body /html

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




Re: [Zope-dev] ANNOUNCE: PartitionedFileStorage

2001-01-02 Thread Shane Hathaway

Chris Withers wrote:
 
 Shane Hathaway wrote:
 
  I just realized I could use the "patch" command to backport.  So I made
  a new tarball.  Have fun!
 
  
http://www.zope.org/Members/hathawsh/PartitionedFileStorage/PartitionedFileStorage-0.0.1-2_2.tar.gz/view
 
 great :-)
 
 It's installed and running now. No problems yet, btu then I haven't seen
 any partitioning either... how long doI have to wait? ;-)

Until 512 MB.  However, you can change the default partition size in
FileStorage.py.  Note that it behaves correctly with partitions of
varying size, so you don't have to worry that it'll get confused if you
set it to a partition size of 10 MB when your first partition is already
50 MB.

BTW, Evan helped me find and correct a bug.  You'll only run into it if
you set your partition size to less than the size of the largest ZODB
objects.

--- PartitionedFile.py~ Wed Nov 22 16:14:27 2000
+++ PartitionedFile.py  Mon Dec 11 12:01:18 2000
@@ -343,7 +343,7 @@
 file = self.__seekToNextPartition()
 if file is not None:
 state = self.__state
-toAppend = file.read(size)
+toAppend = file.read(size - len(data))
 data = data + toAppend
 else:
 break

Shane

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




[Zope-dev] PartitionedFileStorage - Eek!

2001-01-02 Thread Chris Withers

Shane Hathaway wrote:
 
 BTW, Evan helped me find and correct a bug.  You'll only run into it if
 you set your partition size to less than the size of the largest ZODB
 objects.

That's fixed in 0.0.2, right?

Well, anyway, I changed the line in FileStorage.py as follows:
# Use 0.5 GB partitions because that's what fits on a CD.
defaultOps = PartitionedFileOperations(
DefaultPartitionNamingStrategy(partlen=4))
#DefaultPartitionNamingStrategy(partlen=2L**29))

...so I could try and provoke a split, but, now, when I try to add
objects, I get:

Error Type: CorruptedDataError
Error Value: 41904222L

Traceback (innermost last):
  File E:\Zope\22C38D~1.5B1\lib\python\ZPublisher\Publish.py, line 222,
in publish_module
  File E:\Zope\22C38D~1.5B1\lib\python\ZPublisher\Publish.py, line 187,
in publish
  File E:\Zope\22C38D~1.5B1\lib\python\Zope\__init__.py, line 221, in
zpublisher_exception_hook
(Object: ApplicationDefaultPermissions)
  File E:\Zope\22C38D~1.5B1\lib\python\ZPublisher\Publish.py, line 171,
in publish
  File E:\Zope\22C38D~1.5B1\lib\python\ZPublisher\mapply.py, line 160,
in mapply
(Object: manage_main)
  File E:\Zope\22C38D~1.5B1\lib\python\ZPublisher\Publish.py, line 112,
in call_object
(Object: manage_main)
  File E:\Zope\22C38D~1.5B1\lib\python\App\special_dtml.py, line 120, in
__call__
(Object: manage_main)
(Info: E:\Zope\2.2.5b1\lib\python\OFS\main.dtml)
  File E:\Zope\22C38D~1.5B1\lib\python\DocumentTemplate\DT_String.py,
line 528, in __call__
(Object: manage_main)
  File E:\Zope\22C38D~1.5B1\lib\python\App\special_dtml.py, line 120, in
__call__
(Object: manage_tabs)
(Info: E:\Zope\2.2.5b1\lib\python\App\manage_tabs.dtml)
  File E:\Zope\22C38D~1.5B1\lib\python\DocumentTemplate\DT_String.py,
line 528, in __call__
(Object: manage_tabs)
  File E:\Zope\22C38D~1.5B1\lib\python\DocumentTemplate\DT_With.py, line
146, in render
(Object: _(manage_options=filtered_manage_options()))
  File E:\Zope\22C38D~1.5B1\lib\python\App\PersistentExtra.py, line 114,
in locked_in_version
(Object: ApplicationDefaultPermissions)
  File E:\Zope\22C38D~1.5B1\lib\python\ZODB\Connection.py, line 432, in
modifiedInVersion
  File E:\Zope\22C38D~1.5B1\lib\python\ZODB\DB.py, line 364, in
modifiedInVersion
  File E:\Zope\2.2.5b1\lib\python\ZODB\FileStorage.py, line 679, in
modifiedInVersion
(Object: E:\Zope\2.2.5b1/var/Data.fs)
CorruptedDataError: (see above)

Any ideas?

cheers,

Chris

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




Re: [Zope-dev] dynamic permissions in zope

2001-01-02 Thread Steve Alexander

Steve Alexander wrote:


 I believe the latest LoginManager allows you to specify what roles a 
 user has, and compute these each request, based on the details of the 
 request.
 
 This is probably more useful than having dynamically computed 
 permissions; While I can see how a user's roles will vary according to 
 where they are, what they are doing and when they are doing it, I cannot 
 see why permissions need to change in that way.
 
 However, you mention that you are new to Zope. ZPatterns can be 
 difficult to understand and get into. Other than the creators of 
 ZPatterns, I haven't heard of anyone using this computed permissions 
 system.

What I forgot to mention: LoginManager is a Zope product that is built 
using ZPatterns, another Zope product.

When you are doing advanced things with LoginManager, you need to know 
how ZPatterns works.

There are a couple of HOWTO documents on using LoginManager. It will be 
only a small change to alter the "userRoles" method that returns the 
roles a user should have to calculate these roles based on other criteria.

See these documents for information about how to set up LoginManager.

   http://www.zope.org/Members/dlpierson/sqlLogin
   http://www.zope.org/Members/jok/SQL_based_LoginManager

-- 
Steve Alexander
Software Engineer
Cat-Box limited
http://www.cat-box.net


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




Re: [Zope-dev] OracleStorage, and possibly others

2001-01-02 Thread Chris Withers

Jim Fulton wrote:
 
   - Policies to control whether multiple revisions are stored
 or whether revisions are removed by packing on a object-by-object
 or transaction-by-transaction basis.

 You could keep significant historical revisions for important objects, such
 as Wiki pages, templates, scripts, etc., with a policy to decide
 which revisions are significant.
 
   - The ability to set policies to implement quotas.

 
 We are also working on ZEO storage replication. This may have a big
 impact on the storage API, or lead to specialized APIs for replicated
 storages.

very cool :-)

Any idea when these will be around to play with?

  Please help stamp out Data.fs! :-)

Nah... we like it, especially once Shane's PartionedFile storage makes
it into production...

cheers,

Chris

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




Re: [Zope-dev] ANNOUNCE: PartitionedFileStorage

2001-01-02 Thread Steve Alexander

Shane Hathaway wrote:


 BTW, Evan helped me find and correct a bug.  You'll only run into it if
 you set your partition size to less than the size of the largest ZODB
 objects.

The new version of FileStorage.py in PartitionedFileStorage for 2.3 
overwrites some of the changes made the FileStorage locking protocol in CVS.

These are the ones using  _commit_lock_acquire _commit_lock_release.

--
Steve Alexander
Software Engineer
Cat-Box limited
http://www.cat-box.net


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




Re: [Zope-dev] What's 'section' in blocks[0] in block dtml tag?

2001-01-02 Thread Brett Carter

Lee, I've been diddling around with the same stuff.  It took me a lot
of introspection with printing of errors via MrCreosote/Spew.  To
answer your question, 'section' is an object which contains an
attribute 'blocks'.  If you want to render the dtml in there, you can
run the 'render_blocks' method in
'zope-instance/lib/Python/pDocumentTemplate.py' You pass it the
section.blocks object and a mapping dictionary which is the current
namespace stack that gets passed in as the only argument to the
'render' method in you tag definition.  If you just want the raw text,
check you the render_blocks method, so you can see how they take apart
the 'section.blocks' object.  As to the object hiarchy of everything,
your guess is as good as mine as to why there's a list of tuples of
blocks wrapped in a section object, wrapped in another blocks object,
I have know idea.  Perhaps the designer of the document templates
could answer...  
-Brett


 "LEE" == LEE Kwan Soo [EMAIL PROTECTED] writes:

LEE Hi. I'm playing/struggling to make a custom block dtml tag.
LEE Let me call it, dtml-quote tag.
LEE dtml-quote tag is similar to dtml-comment tag except it will emit
LEE html_quoted, not rendered version of what lies 
LEE between dtml-quote ... /dtml-quote.
LEE (I feel it will be usefull when I show  write some dtml examples on my
LEE korean zope site).

LEE After seeing around some python sources,
LEE I finally got that tname is the name of the tag, args is args, and section
LEE is something, in the following code.

LEE def __init__(self, blocks):
LEE tname, args, section = blocks[0]

LEE and section seems to have 6 attributes/methods:
LEE '__name__', '_v_blocks', '_v_cooked', '_vars', 'blocks', 'globals', 'raw'

LEE But that mistic raw is null string, '' and blocks is no help for me.

LEE How can I retrieve the raw source string enclosed in a block tag pair?

LEE LEE Kwan Soo.

LEE ps. My English is evem more cryptic this morning. Sorry I've sat up alnight 
play 
LEE Kingdom Under Fire.

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


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




Re: [Zope-dev] PartitionedFileStorage - Eek!

2001-01-02 Thread Shane Hathaway

Chris Withers wrote:
 
 Shane Hathaway wrote:
 
  BTW, Evan helped me find and correct a bug.  You'll only run into it if
  you set your partition size to less than the size of the largest ZODB
  objects.
 
 That's fixed in 0.0.2, right?

Should be, although I just realized I don't know whether 0.0.2 was
intended for Zope 2.2 or 2.3.

 Well, anyway, I changed the line in FileStorage.py as follows:
 # Use 0.5 GB partitions because that's what fits on a CD.
 defaultOps = PartitionedFileOperations(
 DefaultPartitionNamingStrategy(partlen=4))
 #DefaultPartitionNamingStrategy(partlen=2L**29))
 
 ...so I could try and provoke a split, but, now, when I try to add
 objects, I get:
 
 Error Type: CorruptedDataError
 Error Value: 41904222L

Ugh.  I have no idea what might have happened.  That's why I'm wary: if
something goes wrong, the symptoms will show up a long time after the
problems occur.

Now BerkeleyStorage is on its way and once that's ready,
PartitionedFileStorage will have such a small audience that it won't be
worth the trouble.  Oh well, it was a fun experiment.

Shane

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




Re: [Zope-dev] ANNOUNCE: PartitionedFileStorage

2001-01-02 Thread Shane Hathaway

Steve Alexander wrote:
 
 Shane Hathaway wrote:
 
 
  BTW, Evan helped me find and correct a bug.  You'll only run into it if
  you set your partition size to less than the size of the largest ZODB
  objects.
 
 The new version of FileStorage.py in PartitionedFileStorage for 2.3
 overwrites some of the changes made the FileStorage locking protocol in CVS.
 
 These are the ones using  _commit_lock_acquire _commit_lock_release.

Well, it's pretty easy to use diff and patch to correct it.

But like I told ChrisW, I think BerkeleyStorage will fill the need that
PartitionedFileStorage was only partitially addressing.

OTOH I've been running it for a while now on my box and have had no
signs of problems.

Shane

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




Re: [Zope-dev] Conflict Errors

2001-01-02 Thread Chris McDonough

Y'know since replying to this message originally, I've learned a lot about
pickled representations of Zope objects and I think I can answer this more
cogently:

- Instances of classes which inherit from Persistence.Persistent are
represented as an individual pickle.  Their attributes are contained in this
pickle, unless those attributes are themselves instances of something that
inherits from Persistence.Persistent.

- References to persistent objects in other objects are kept as an object
identifier.  This means, for example, that a dictionary of integers to
persistent object instances looks something like this in a pickle::

  {1:oid 1, 2:oid 2, ...}

  If this dictionary is an attribute of a persistent object, adding,
changing, or removing items from it will modify its containing persistent
object.

It was this "reference by oid" concept that turned the light on for me here,
hopefully it can do the same for you.

One of the potential big wins with the current Zope implementation of a
BTree is that it exposes a mapping interface, so you can treat it just like
a dictionary.  However, internally, it's composed of a number of separate
persistent objects that can be changed independently of each other.  This
means that changing one item in a BTree will change one persistent object
that makes up a BTree, but will not necessarily effect the other persistent
objects that compose it.  Unortunately, currently, the BTree implementation
has some problems that cause that *not* to be the case in many situations,
and independent writes to it often conflict.  We are working on another
BTree implementation to resolve the issue.

- Original Message -
From: "Chris Withers" [EMAIL PROTECTED]
To: "Chris McDonough" [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Tuesday, January 02, 2001 11:50 AM
Subject: Re: [Zope-dev] Conflict Errors


 Chris McDonough wrote:
 
  The ZODB tries
  hard to avoid error conditions for you by retrying conflicting writes,
but
  if you really pound the snot out of a particular object, it'll let you
know.

 That's gotta be one for the Zope quotes board, if I could onyl remember
 the URL :-)

  and step through a real-world ConflictError situation.  Neither of which
I
  have time to do right now... sorry, Chris.
 
  this one by saying "I don't know" because it's one of those things where
  learning exactly what is going on can chew up time like nobody's
business,
  because I'd need to step through the code line-by-line.  I shouldn't
even be
  in here.  :-(

 Hey, no problem, the help was much appreciated :-)

 However, if anyone does know what constitutes a 'seperate object' in
 ZODB terms, it be really useful to know.
 I'm guessing a class which inherits from Persistent? Dictionaries don't,
 'cos they're python builtins, which I'm pretty certain was the problem
 in my case...

 cheers,

 Chris



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




Re: [Zope-dev] PartitionedFileStorage - Eek!

2001-01-02 Thread Jason Cunliffe

Shane Hathaway [EMAIL PROTECTED] wrote:
 Now BerkeleyStorage is on its way and once that's ready,
 PartitionedFileStorage will have such a small audience that it won't be
 worth the trouble.  Oh well, it was a fun experiment.

Can you pleae expand on this.. what about BerkeleyStorage is on its way and
when ?

Been using it for soem tests and like it very much, sincerely hoping it
might get rolled into Zope and Python before long.


thanks

- Jason
___
Jason CUNLIFFE = NOMADICS['Interactive Art and Technology']


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




Re: [Zope-dev] PartitionedFileStorage - Eek!

2001-01-02 Thread Steve Alexander

Shane Hathaway wrote:


 Should be, although I just realized I don't know whether 0.0.2 was
 intended for Zope 2.2 or 2.3.

There is no difference between the PartitionedFile.py files in the 2.2 
and 2.3 versions, so I guess 0.0.2 will do as well for either.

--
Steve Alexander
Software Engineer
Cat-Box limited
http://www.cat-box.net


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




Re: [Zope-dev] PartitionedFileStorage - Eek!

2001-01-02 Thread Shane Hathaway

Steve Alexander wrote:
 
 Shane Hathaway wrote:
 
 
  Should be, although I just realized I don't know whether 0.0.2 was
  intended for Zope 2.2 or 2.3.
 
 There is no difference between the PartitionedFile.py files in the 2.2
 and 2.3 versions, so I guess 0.0.2 will do as well for either.

Silly me, of course you're right. :-)

BTW I'm happy to hear someone's putting it to good use.

Shane

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




[Zope-dev] uncataloging objects

2001-01-02 Thread Robert Prosenc

hi there.

i have certain problems with the catalog class. i have something over 9000
objects (all of the same type) cataloged, and it does not only take REAL
long to reindex them (but hey, i could live with that), sometimes it also
makes the python-process sort of 'hang up' - it merly crushes the whole zope
process..

the even bigger problem is that it makes trouble when uncataloging
objectsthat seems to fail completely:
  here's some code from the class-definition, where i try to uncatalog the
object:

def killMe(self):
"deletes the record. in fact the record has to be
uncataloged first."
try:
 
self.Catalog.uncatalog_object('/'+self.absolute_url(1))
except:
return "couldn't uncatalog the record."
try:
self.records.manage_delObjects(ids=self.getId())
# 'records' is a folder, in which the objects are stored
except:
return "couldn't delete the record."
return Globals.MessageDialog(
titel='Record deleted',
message='Record deleted successfully.',
)

so i let my objects kill themselves;)
what really confuses me is the fact that while performing that function, no
exeption is raised. the uncataloging-call is inside a try/except, but it
seems to be performed regulary. but: it isn't!
the object, while already deleted, remains still cataloged, which leads to
some unpleasant error-pages (key-error) when contained inside the result-set
of a search.

i have a zope 2.2.2 under linux installed, with hotfixes 2000-10-02,
2000-10-11, 2000-12-08, 2000-12-15a and 2000-12-18, zcatalog 2.2.0 and some
selfwritten stuff

does anybody have an idea what goes wrong here?

regards, rob.



 Robert Prosencweb:  http://www.matrixware.at/
   mail: [EMAIL PROTECTED]
   Matrixware  phone:+43(  1)   713 43 06 - 2
   postal:   Geusaugasse 39
 (Ecke Kundmanngasse)
 A-1030 Vienna, AUSTRIA

while !asleep() sheep++ 



 winmail.dat


[Zope-dev] ANN: CoreSessionTracking Release 0.4

2001-01-02 Thread Chris McDonough

Hello,

A new development release of the "Core Session Tracking" product (0.4) is
available at http://www.zope.org/Members/mcdonc/Products/CoreSessionTracking

This release makes substantial interface and feature changes including using
an internal mounted storage to provide an "internal" session data container
to each session data manager, autoexpiring session data objects, as well as
vastly improved documentation.

Please check it out!

Thanks,

Chris



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




Re: [Zope-dev] dynamic permissions in zope

2001-01-02 Thread Tres Seaver

Steve Alexander [EMAIL PROTECTED] wrote:

 Steve Alexander wrote:
 
 
  I believe the latest LoginManager allows you to specify what roles a
  user has, and compute these each request, based on the details of the
  request.
 
  This is probably more useful than having dynamically computed
  permissions; While I can see how a user's roles will vary according to
  where they are, what they are doing and when they are doing it, I cannot
  see why permissions need to change in that way.
 
  However, you mention that you are new to Zope. ZPatterns can be
  difficult to understand and get into. Other than the creators of
  ZPatterns, I haven't heard of anyone using this computed permissions
  system.
 
 What I forgot to mention: LoginManager is a Zope product that is built
 using ZPatterns, another Zope product.
 
 When you are doing advanced things with LoginManager, you need to know
 how ZPatterns works.
 
 There are a couple of HOWTO documents on using LoginManager. It will be
 only a small change to alter the "userRoles" method that returns the
 roles a user should have to calculate these roles based on other criteria.
 
 See these documents for information about how to set up LoginManager.
 
http://www.zope.org/Members/dlpierson/sqlLogin
http://www.zope.org/Members/jok/SQL_based_LoginManager


The workflow-as-finite-state-machine implementation I am working on
for the PTK has similar requirements:  the permission associated with
a particular method (e.g., 'edit'), depends on the workflow status of
the object (e.g., you need more privileges to edit the object once it
has been "published").

My temporary workaround is to have each method assert the appropriate
permission, as part of creating its audit trail entry.  I plan to
arrange
for the permission-role mapping computation to be handled by the
workflow
tool, as well.

Tres.
-- 
===
Tres Seaver[EMAIL PROTECTED]
Digital Creations "Zope Dealers"   http://www.zope.org

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




[Zope-dev] Re: [Zope-PTK] A subclass from PortalMember of Membership Product andObjectManager won't list contained objectsObjectManager won't list contained objects

2001-01-02 Thread Tres Seaver

Dirksen wrote:

 My site is installed with the Membership system. I want to
 store some photos in each member. So I create a new member
 ZClass, subclassing PortalMember and ObjectManager, and set the
 'manage_main' as the main view. Under the instance of this new
 member ZClass, I can add images, but I can't find them!
 'objectItems' always return None. Yet the image file is there.
 I can edit their properties as in
 '/test/acl_users/jay/photo1/manage_main', but
 '/test/acl_users/jay/manage_main' just won't show a thing!

I'm guessing you have installed the latest tarball of the PTK, and
not the CVS version;  that tarball shipped with a bug in PortalFolder,
which prevented classes which had not registered as "portal content"
from showing up in its objectItems()/objectValues/objectIds() lists.

Please try upgrading to the latest CVS and see if the problem persists 
(http://www.zope.org/Products/PTK/ has directions for getting the CVS
version).  Alternately, here is the patch for PTKBase/PortalFolder.py:

diff -u -r1.25 -r1.27
--- PortalFolder.py 2000/11/08 22:48:38 1.25
+++ PortalFolder.py 2000/11/21 21:36:17 1.27
@@ -110,9 +110,22 @@
  )
 
 def all_meta_types( self ):
-return ( self.content_meta_types
-   + PortalFolder.inheritedAttribute( 'meta_types' )
-   )
+
+names = {}
+types = []
+
+for cmt in self.content_meta_types:
+names[ cmt[ 'name' ] ] = 1
+types.append( cmt )
+
+superTypes = PortalFolder.inheritedAttribute( 'all_meta_types'
)( self )
+
+for smt in superTypes:
+if not names.has_key( smt[ 'name' ] ):
+names[ smt[ 'name' ] ] = 1
+types.append( smt )
+
+return tuple( types )
 
 def manage_addPortalFolder(self, id, title='',
REQUEST=None):
@@ -130,11 +143,13 @@
 listActions__roles__ = ()
 def listActions( self, info ):
 
-return [ { 'name'   : 'View'
+return ( { 'name'   : 'View'
  , 'url': info.folder_url
  , 'permissions': []
  , 'category'   : 'folder'
- } ]
+ }
+   ,
+   )
 
 _morphSpec__roles__ = ()
 def _morphSpec( self, spec ):


Tres.
-- 
===
Tres Seaver[EMAIL PROTECTED]
Digital Creations "Zope Dealers"   http://www.zope.org

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




RE: [Zope-dev] ANNOUNCE: PartitionedFileStorage

2001-01-02 Thread Magnus Heino (Rivermen)


 But like I told ChrisW, I think BerkeleyStorage will fill the 
 need that
 PartitionedFileStorage was only partitially addressing.

How is the new BerkeleyStorage product coming along?

/Magnus
###

This message has been scanned by F-Secure Anti-Virus for Microsoft Exchange.
For more information, connect to http://www.F-Secure.com/

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




[Zope-dev] Allowed characters in Zope ids

2001-01-02 Thread Dieter Maurer

I recently read RFC 2396 which defines the generic URI syntax
and especially the URL syntax.
I recognized, that

 * Zope forbids many characters in ids (with the error message
   "not allowed in URLs"), that are legal characters
   in URL path segments:

  generally allowed in URL's: -_.!~*'()
 Zope accepted:_. ~

  allowed in path segments:   :@=+$,
 Zope accepted: ,


   This, probably, is not a big problem.
   But, it would be easy to fix.


 * Zope allows space characters in (ObjectManager) id's.
   The space is not a valid URL character.

   Zope forbids spaces in property ids.


 * The URL path segment syntax provides for a parameter section
   suffix where each parameter is introduced with ';'.

   Future Zope versions should probably take care of this
   (recent) extension.

   It might, too, provide a good way to pass values
   in URLs without the pollution of the query string.


Dieter


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