[Zope] ERROR ZODB.Connection Couldn't load state for 0x04

2009-04-13 Thread Mark Gibson
Zope 2.9.7

Apparently, I've done something bad and created "cross database 
reference".  At least, that's what I gather from googling the ZODB error.

I have 3 filesystem storages.  One contains a ZCatalog that references 
objects in the other.  Is this the cause of the error?  I can't start 
zope now - how can I recover from this?

2009-04-13 10:46:24 ERROR ZODB.Connection Couldn't load state for 0x04
Traceback (most recent call last):
   File "/home/zope/zope_2_9_7/lib/python/ZODB/Connection.py", line 732, 
in setstate
 self._setstate(obj)
   File "/home/zope/zope_2_9_7/lib/python/ZODB/Connection.py", line 786, 
in _setstate
 self._reader.setGhostState(obj, p)
   File "/home/zope/zope_2_9_7/lib/python/ZODB/serialize.py", line 617, 
in setGhostState
 obj.__setstate__(state)
AttributeError: keys
___
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] Multiple zope instances using the same storage

2008-12-08 Thread Mark Gibson
Dieter Maurer wrote:
> Mark Gibson wrote at 2008-12-6 11:22 -0700:
>> I have an unusual setup.  I have 4 distinct Zope instances (4 seperate 
>> Data.fs').  Each Data.fs is identical - Data is kept in a RDBMS.  I have 
>> a product I need to install that stores data in the ZODB.  This data is 
>> stored in one folder.
>>
>> Now, I *think* I can simply mount this folder in each ZODB and serve the 
>> storage through a ZEO server - however I've never done this setup, so I 
>> want to make sure this makes sense and I'm not overlooking potential 
>> problems.
> 
> This should be possible -- though I expect that you can
> use a single "Data.fs", serve it with ZEO and mount it in each of
> your Zope instances. There is little reason to have 4 identical
> "Data.fs" once you have decided to use ZEO anywhere.

Thanks Dieter.  I agree with you.  This isn't my setup, so I would like 
to avoid having too much of an impact on their setup, but I'll bring it 
up with the client.

Mark

___
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] Multiple zope instances using the same storage

2008-12-06 Thread Mark Gibson
I have an unusual setup.  I have 4 distinct Zope instances (4 seperate 
Data.fs').  Each Data.fs is identical - Data is kept in a RDBMS.  I have 
a product I need to install that stores data in the ZODB.  This data is 
stored in one folder.

Now, I *think* I can simply mount this folder in each ZODB and serve the 
storage through a ZEO server - however I've never done this setup, so I 
want to make sure this makes sense and I'm not overlooking potential 
problems.

This is a legacy setup that I'm not responsible for, so I'm trying to 
keep my footprint in this setup as small as possible.  Using Zope 2.7.9.

Thanks,
Mark
___
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] Five and editform

2008-10-17 Thread Mark Gibson
Hi JeanMichel,  thanks for our reply.

This is not an egg - just a simple product I have in 
/lib/python.  I'm working with Zope 2.9.7, not a buildout 
environment.  I get the Boring product in the "Add" dropdown, and I can 
create the object.  I do have the product included in site.zcml, and it 
does implement the IBoring interface.  Any other ideas?  I read 
somewhere that I have to include this:



And read somewhere else that five:traversable is deprecated.  In any 
case, including or not including this makes no difference.

Thanks,
Mark

JeanMichel FRANCOIS wrote:

> Hi Mark Gibson,
>
> Do you develop this with egg ? throw Products namespace ?
>
> The zcml seems good. If you develop outside of the Products namespace 
> don't forget to include your package in the site.zcml. You can verify 
> this by making a mistake in the zcml and try to start zope.
>
> Does you content implements boring.interfaces.IBoring ?
>
> -- 
>
> JeanMichel FRANCOIS
>
> Makina Corpus
>
> Le Friday 17 October 2008 05:51:34 Mark Gibson, vous avez écrit :
>
> > I created a simple content type. I can create an object, but I can't
>
> > call my view or edit form on it. If I try object/boring_editform or
>
> > object/index.html I get a Not Found error. Here's what I have in my
>
> > configure.zcml:
>
> >
>
> > ---
>
> >
>
> > 
> > schema="boring.interfaces.IBoring"
>
> > for="boring.interfaces.IBoring"
>
> > name="boring_editform"
>
> > label="Edit Boring Folder"
>
> > permission="boring.ManageBoring"
>
> > />
>
> >
>
> > 
> > name="index.html"
>
> > template="view.pt"
>
> > permission="zope2.View"
>
> > menu="zmi_views" title="View">
>
> > 
>
> > ---
>
> >
>
> > What am I missing?
>
> >
>
> > Thanks,
>
> > Mark
>
> >
>
> >
>
> > ___
>
> > 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 )
>  
>


___
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] Five and editform

2008-10-16 Thread Mark Gibson
I created a simple content type.  I can create an object, but I can't 
call my view or edit form on it.   If I try object/boring_editform or 
object/index.html I get a Not Found error.  Here's what I have in my 
configure.zcml:

---

  

  
  
---

What am I missing?

Thanks,
Mark


___
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] Five pointers

2008-10-16 Thread Mark Gibson
I'm developing a new product for a Zope 2.9.7 site (no CMF).  I'd like 
to use Zope 3 technologies for this product.  I've been looking around 
for a few days, most of what I see describes development for Zope 3, or 
Five in the context of Plone.

Is there a tutorial or a product I can reference that describes how to 
build a few simple content types "the Zope 3 way" in Zope 2?


___
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] ZServer error

2006-10-02 Thread Mark Gibson

Great, Thanks!

Mark

Pascal Peregrina wrote:

As far as I know, this means that the requester closed the connection (like
a browser timing out, etc...).
In general, I would say, nothing to worry about...

Pascal



De : Mark Gibson <[EMAIL PROTECTED]>
Date : Mon, 02 Oct 2006 11:58:31 -0600
À : 
Objet : [Zope] ZServer error

(Zope 2.8.7-final, python 2.4.3, linux2)

I see the following error in my event.log a couple of times a day:

2006-10-02T07:13:00 ERROR ZServer uncaptured python exception, closing
channel  (socket.error:(104, 'Connection
reset by peer') [/usr/lib/python2.4/asynchat.py|initiate_send|219]
[/usr/local/zope/Zope-2.8.7/lib/python/ZServer/medusa/http_server.py|send|417]
[/usr/lib/python2.4/asyncore.py|send|332])


Anyone familiar with this?

Thanks,

Mark
___
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 )




**
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.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] ZServer error

2006-10-02 Thread Mark Gibson

(Zope 2.8.7-final, python 2.4.3, linux2)

I see the following error in my event.log a couple of times a day:

2006-10-02T07:13:00 ERROR ZServer uncaptured python exception, closing 
channel -0x68ce9834 channel#: 1517 requests:> (socket.error:(104, 'Connection 
reset by peer') [/usr/lib/python2.4/asynchat.py|initiate_send|219] 
[/usr/local/zope/Zope-2.8.7/lib/python/ZServer/medusa/http_server.py|send|417] 
[/usr/lib/python2.4/asyncore.py|send|332])



Anyone familiar with this?

Thanks,

Mark
___
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] Packing Data.fs

2006-08-29 Thread Mark Gibson
I know zope makes a copy of Data.fs before packing.  Is it possible to 
specify a location other than /var to place that copy?


Mark
___
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] Basic Template question : 'truthiness'

2006-06-11 Thread Mark Gibson
I thought I knew how this stuff worked, but this has gotten me banging 
my head against a wall.


I'm trying to evaluate a condition expression, and I'm not getting what 
I expect when using path, and I get a different result when using 
python.  The following expressions


results=
dosearch=
querytpe=/>



TRUE IN PYTHON


<-- This doesn't evaluate to true -->
THIS DOESN'T SHOW UP



Produces:
results=[]
dosearch=NO SEARCH
querytpe=mps
TRUE IN PYTHON


As you can see, the second expression doesn't evaluate to True.  Can 
someone explain the subtleties I seem to be missing?


Thanks,
Mark
___
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] ZCatalog Strategy

2006-03-22 Thread Mark Gibson
I'm struggling to weigh the cost of getObject() vs. the cost of adding 
more metadata to the catalog.  I'll explain my situation.


I have 10,000 widgets cataloged.  I do a path and date query that 
returns me maybe 12 of these.  Then I have a choice of calling 
getObject().getData() on each of these, or I could add getData to the 
catalog metadata.


Does the cost of calling getObject() for a dozen objects justify 
creating a new metadata field?


More generally how does a large amount of metadata in the catalog affect 
performance of queries?


The wisdom of those more knowledgeable than me would be appreciated.

Mark
___
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] Render a string as tal

2005-11-15 Thread Mark Gibson
On Mon, 2005-11-14 at 13:38, Paul Winkler wrote:
> On Mon, Nov 14, 2005 at 01:19:18PM -0700, Mark Gibson wrote:
> > I would like to be able to render an arbitrary string as tal, having the
> > tal statements evaluated correctly.
> > 
> > How would I go about doing this?
> 
> I assume you  mean TALES expressions.
> See:
> http://zopelabs.com/cookbook/1037762730

Thanks for your suggestion.  This has shed some light on the subject.

However, what I'm looking for is being able to take a string such as 
'The url'

and be able to evaluate the TALES expression in the string to produced
something like: 'http://mydomain.com/theUrl'

Any chance there's a recipe for this?
-- 
Mark Gibson <[EMAIL PROTECTED]>

___
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] Render a string as tal

2005-11-14 Thread Mark Gibson
I would like to be able to render an arbitrary string as tal, having the
tal statements evaluated correctly.

How would I go about doing this?


-- 
Mark Gibson <[EMAIL PROTECTED]>

___
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] fine grained, dynamic permissions based on attribute values

2005-10-18 Thread Mark Gibson
On Tue, 2005-10-18 at 11:05, Chris Crownhart wrote:
> Good day,
> 
> I am wondering if/how I could control the permissions on an object based 
> on the value of an attribute.  I am using CMF, and thus portal_catalog, 
> and have built a custom content type.  My type has a category field.  I 
> would like to control the view permission of the object dynamically 
> based on the value of category.
> 
> So, as an example, I have multiple users, and multiple values for the 
> category field.  I would like User A to access the object if the 
> category ='financial', and User B access the object if the 
> category='other'.
> 
> Thanks for any ideas.


I assume user A and B have different roles?  Instead of dynamically controlling 
the permission, could you set the permission on the object explicitly when the 
object is edited?

e.g.

def manage_edit(self, ...):
   ...
   if REQUEST.get('category') == 'other':
   self.set_permission_so_user_B_can_access()
   elif REQUEST.get('category') == 'financial':
  self.set_permission_so_user_A_can_access()

___
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] DateTime and TimeZone

2005-09-06 Thread Mark Gibson
It seems that since the Pacific timezone is in daylight savings time,
the correct offset is -7.

So nevermind.

On Tue, 2005-09-06 at 00:53, Mark Gibson wrote:
> I installed zope 2.7.6 on a windows 2000 machine.   This machine is set
> to the pacific timezone.
> 
> When I run python from the command line, and check DateTime, I get: 
> 
> >>> from DateTime import DateTime
> >>> DateTime()
> DateTime('2005/09/06 23:55:29.620 GMT-7')
> 
> The 'GMT-7' is the Mountain timezone.  The actual time should read
>  DateTime('2005/09/06 23:55:29.620 GMT-8') for the Pacific timezone.
> 
> What controls the default timezone behavior of DateTime on Windows?  How
> can I get this working correctly?
> 
> Thanks,
> Mark
-- 
Mark Gibson <[EMAIL PROTECTED]>

___
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] DateTime and TimeZone

2005-09-05 Thread Mark Gibson
I installed zope 2.7.6 on a windows 2000 machine.   This machine is set
to the pacific timezone.

When I run python from the command line, and check DateTime, I get: 

>>> from DateTime import DateTime
>>> DateTime()
DateTime('2005/09/06 23:55:29.620 GMT-7')

The 'GMT-7' is the Mountain timezone.  The actual time should read
 DateTime('2005/09/06 23:55:29.620 GMT-8') for the Pacific timezone.

What controls the default timezone behavior of DateTime on Windows?  How
can I get this working correctly?

Thanks,
Mark
-- 
Mark Gibson <[EMAIL PROTECTED]>

___
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] Help me with acquisition and custom types

2005-08-21 Thread Mark Gibson
I've got a problem...

I've created two objects, A folderish object called myfolder, and a
document-type object called mydocument.  Here's how my classes are
defined...

class mydocument(
   CatalogAware,
   Implicit,
   Persistent,
   RoleManager,
   PropertyManager,
   Item):
class myfolder(
   CatalogAware,
   Implicit,
   Persistent,
   RoleManager,
   PropertyManager,
   Folder)

So, say I have a hierarchy like this...

/
/ObjectA
/folder
/folder/mydocument ( an instance of mydocument)
/folder/myfolder (an instance of myfolder)
/folder/myfolder/ObjectA

Ok.. I want to be able to call

http://mysite/folder/mydocument/ObjectA 
  - this works fine
http://mysite/folder/myfolder/ObjectA
 - this works fine
http://mysite/folder/myfolder/mydocument/ObjectA
 - this returns the ObjectA at '/ObjectA', I'd like it to return ObjectA
at '/folder/myfolder/ObjectA'

Any ideas how I would go about making this happen?

-- 
Mark Gibson <[EMAIL PROTECTED]>

___
Zope maillist  -  [EMAIL PROTECTED]
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 )