Re: [Zope-dev] catalog and versions

2001-05-04 Thread Flynt

Dieter Maurer wrote:
> 
> Stefane Fermigier writes:
>  > It seems to me that when I create a CatalogAware objet in a version,
>  > it doesn't get into the catalog after the version is committed (in fact,
>  > it doesn't event get into the catalog inside the version).=20
>  >
>  > Am I right? Is this considered normal behavio(u)r? Any idea for a workaro=
>  > und?
> I do not know, but I would be happy if it is this way...
> 
>Otherwise, any change in a version would look the catalog into this
>version. No two versions could work in parallel, as
>all would need the catalog.
> 
> But I fear, that precisely that will happen
> 
> In my applications, I make heavy use of versions but not
> yet essential use of CatalogAware. This starts to
> change with the CMF as it uses corresponding methods
> to keep the catalog updated.
> 
> Dieter
> 
Maybe, the problem I got in CMF after customizing the
"discussion_reply_form" in a version are related to that (I posted a
message to the CMF list yesterday, no answers yet though).

I got a "NotFound" error, when replying to a document. Usually one gets
the failing URL in the trace as well, which was not the case here (it
was empty).
Nevertheless the reply **was generated and added to the catalog and was
searchable and viewable**. However, it was not generated as
"document/talkback/8849776" as usual, but as (Portal is the root of the
CMF site) "/Portal//talkback/8849776", with the two slashes after
"Portal". And so didn't show up neither at the bottom of the document.

So, is the moral: NO working within versions when changing (customizing)
CMF sites (or other catalogaware objects ?

Flynt

___
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] catalog and versions

2001-05-04 Thread Dieter Maurer

Stefane Fermigier writes:
 > It seems to me that when I create a CatalogAware objet in a version,
 > it doesn't get into the catalog after the version is committed (in fact,
 > it doesn't event get into the catalog inside the version).=20
 > 
 > Am I right? Is this considered normal behavio(u)r? Any idea for a workaro=
 > und?
I do not know, but I would be happy if it is this way...

   Otherwise, any change in a version would look the catalog into this
   version. No two versions could work in parallel, as
   all would need the catalog.

But I fear, that precisely that will happen


In my applications, I make heavy use of versions but not
yet essential use of CatalogAware. This starts to
change with the CMF as it uses corresponding methods
to keep the catalog updated.


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 )



Re: [Zope-dev] determining database manager type from z database connection?

2001-05-04 Thread Kent Polk

On 3 May 2001 21:15:01 -0500, Andreas Heckel wrote:
> Kent Polk wrote:
>> 
>> Is there a generic way to determine what 'brand' of database manager
>> a Zope database connection is connected to by interrogating the
>> connection object?
> 
> 
> ID: 
> title: 
> type:
> 
> 
> 
> database_type is the 'brand' of the Zope DA. If you are connectet to a 
> PostgreSQL DB using ZPyGreSQLDA you get 'PyGreSQL'. Using ZPoPyDA it
> returns 'PoPy'. That's not exactly what you are looking for but I hope
> it helps.

Actually, that is exactly what I was looking for.

Thanks Much!


___
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] [Fwd: CopySupport bug]

2001-05-04 Thread Casey Duncan

Casey Duncan wrote:
> 
> There is a subtle bug in the CopySupport module that makes it impossible
> to copy and paste a folder that contains a ZCatalog with CatalogAware
> objects indexed in the catalog also in that folder. The reason is as
> follows, CopySupport calls a hookable method manage_afterClone (which is
> hooked by CatalogAware). It does so after a copy is made of the object
> but BEFORE the copy is mounted in the ZODB.
> 
> manage_afterClone in CatalogAware tries to reindex the object, and in
> doing so tries to derive its URL for use as the ZCatalog uid by calling
> absolute_url on the object. This fails of course because the object as
> yet has no URL because it is not mounted. The error reported is a
> KeyError on SERVER_URL.
> 
> To make a long story somewhat shorter, I have a simple patch for this,
> but there is still one more subtle bit of behavior to take note of:
> 
> When the ZCatalog is copied, all of its indexed data gets copied. Then
> the new copies of the objects index themselves. This means that the
> copied catalog has twice as many objects in it as the original. This
> bugged me at first, but it makes sense and I don't see any obvious
> solution that would be consistent.
> 
> For those interested, the patch is here:
> 
> http://classic.zope.org:8080/Collector/2205/view
> 

This didn't ssem to go through yesterday, so I am resending it.

-- 
| Casey Duncan
| Kaivo, Inc.
| [EMAIL PROTECTED]
`-->

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



[Zope-dev] Threads...

2001-05-04 Thread Magnus Heino (Rivermen)


Hi.

I want to start a thread from my product.

I'm doing it in the same way as the code below.

Label is set to 'a' as default. If I change this to 'b' and save, Label is
changed to contain 'b'.

But, it seems as if Label is loaded with the saved value at some later point
than the last row below, because Label always contains 'a' at that point.

So the question is; Where should I start the thread? When are the saved
properties loaded?


class FooBar(SimpleItem, PropertyManager):
""" """
 
meta_type = 'FooBar'
 
_properties = (
{'id':'Label', 'type':'selection', 'mode':'w',
'select_variable':'values'}
)
 
values = ('a', 'b', 'c')
 
Label = values[0]
 
manage_options = (
{'label':'Edit', 'action':'manage_main'},
)+PropertyManager.manage_options+\
SimpleItem.manage_options
 
# Create a SecurityInfo to define security
# assertions later on
security = ClassSecurityInfo()
 
_v_fooThread = FooThread.FooThread(Label)
_v_fooThread.start()

/Magnus

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



SV: [Zope-dev] manage_tabs

2001-05-04 Thread Magnus Heino (Rivermen)
Title: RE: [Zope-dev] manage_tabs



Ok, I 
get it. Sorry :-P
 
security.declareProtected('View management screens', 
'manage')manage_editForm = DTMLFile('dtml/editForm', 
globals()) security.declareProtected('View management screens', 
'manage')manage_main = manage_editForm
 
And it 
works...
 
Maybe I shold do some more reading about it on http://www.zope.org/Documentation/ZDG
 
Thanks!
 
/Magnus


  Could this be an "Internet Explorer failing to pass the AUTH 
  info" problem? 
  It sounds as though you are getting access to the edit tab via 
  Anonymous permissions (Have you restricted access to the manage_main method 
  using the __permissions__ settings)? In that case, Zope will not show you the 
  other tabs because the Anonymous User is not allow to see them.
   


SV: [Zope-dev] manage_tabs

2001-05-04 Thread Magnus Heino (Rivermen)
Title: RE: [Zope-dev] manage_tabs



Well, 
right now I'm doing it like this...
 
security = 
ClassSecurityInfo()
 
security.declarePublic('manage_editForm')manage_editForm = 
DTMLFile('dtml/editForm', 
globals()) security.declarePublic('manage_main')manage_main = 
manage_editForm
 
 
 
Browser doesn't change anything.
 
/Magnus
 
 

  Could this be an "Internet Explorer failing to pass the AUTH 
  info" problem? 
  It sounds as though you are getting access to the edit tab via 
  Anonymous permissions (Have you restricted access to the manage_main method 
  using the __permissions__ settings)? In that case, Zope will not show you the 
  other tabs because the Anonymous User is not allow to see them.
  (Does it show that this one got me too???) 
  What version of which browser are you using? 
  Adrian... -- Adrian Hungate Manager, European I.S. 
  Acucorp UK Limited 
  -Original Message- From: 
  Magnus Heino (Rivermen) [mailto:[EMAIL PROTECTED]] 
  Sent: Friday, 04 May 2001 13:09 To: 
  '[EMAIL PROTECTED]' Subject: [Zope-dev] 
  manage_tabs 
  Hi. 
  In my Zope product, I've got this; 
   manage_options = SimpleItem.manage_options+( 
      {'label':'Edit', 
  'action':'manage_main'},     ) 
  
  If I view the management sceen of this product, I get four 
  tabs (Undo, Ownership, Security and Edit). 
  But If I click on "Edit", all tabs but the edit tab is 
  removed. Why? 
  My "Edit" dtml looks like this; 
  
   This is 
  the edit form.     
  Thanks, 
  /Magnus 
  ___ 
  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] manage_tabs

2001-05-04 Thread Adrian Hungate
Title: RE: [Zope-dev] manage_tabs





Could this be an "Internet Explorer failing to pass the AUTH info" problem?


It sounds as though you are getting access to the edit tab via Anonymous permissions (Have you restricted access to the manage_main method using the __permissions__ settings)? In that case, Zope will not show you the other tabs because the Anonymous User is not allow to see them.

(Does it show that this one got me too???)


What version of which browser are you using?


Adrian...
--
Adrian Hungate
Manager, European I.S.
Acucorp UK Limited



-Original Message-
From: Magnus Heino (Rivermen) [mailto:[EMAIL PROTECTED]]
Sent: Friday, 04 May 2001 13:09
To: '[EMAIL PROTECTED]'
Subject: [Zope-dev] manage_tabs




Hi.


In my Zope product, I've got this;


 manage_options = SimpleItem.manage_options+(
    {'label':'Edit', 'action':'manage_main'},
    )


If I view the management sceen of this product, I get four tabs (Undo,
Ownership, Security and Edit).


But If I click on "Edit", all tabs but the edit tab is removed. Why?


My "Edit" dtml looks like this;




 

This is the edit form.

 



Thanks,


/Magnus


___
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] manage_tabs

2001-05-04 Thread Magnus Heino (Rivermen)


Hi.

In my Zope product, I've got this;

 manage_options = SimpleItem.manage_options+(
{'label':'Edit', 'action':'manage_main'},
)

If I view the management sceen of this product, I get four tabs (Undo,
Ownership, Security and Edit).

But If I click on "Edit", all tabs but the edit tab is removed. Why?

My "Edit" dtml looks like this;



 

This is the edit form.

 


Thanks,

/Magnus

___
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] ANN: Proposal ContentNegotiation

2001-05-04 Thread Toby Dickenson



> -Original Message-
> From: Andreas Jung [mailto:[EMAIL PROTECTED]]
> Sent: 03 May 2001 20:23
> To: Toby Dickenson
> Cc: zope-dev
> Subject: Re: [Zope-dev] ANN: Proposal ContentNegotiation
> 
> 
> 
> From: "Toby Dickenson" <[EMAIL PROTECTED]>
> To: "'Andreas Jung'" <[EMAIL PROTECTED]>
> Sent: Thursday, May 03, 2001 1:04 PM
> Subject: RE: [Zope-dev] ANN: Proposal ContentNegotiation
> 
> 
> > Your proposal suggests that published objects should 
> generally return
> > pre-encoded objects in 8-bit strings. This is the one 
> detail which in my
> > experience looks *wrong* and is very much dependant on my proposal.
 
> Not really - I only say that the internal character set is currently
> ascii/iso-8859-1.
> I did not mention that this will be the default character set 
> in the future.

Its not a question of the 'default' encoding if (as in your proposal) the
published object explicity specifies the character encoding of a pre-encoded
object.

Im referring to the section where you say:

: If the object creates a RESPONSE in another character set
: than the internal character set it must indicate this by
: setting an attribute of the RESPONSE object to the used
: character set e.g.:

:   RESPONSE.charset = 'utf-8'(either as attribute or by a method
call)

I think we are mixing up 'character set' and 'character encoding' here.
The character set of html (and xml) is the Unicode set.
utf-8 is a character encoding, not a character set.
Given the semantic of this proposed attribute, the name 'character_encoding'
would be more appropriate.

In my experience, forcing published methods to deal with character encoding
is a bad idea (I know because I tried that in my first iteration). Your
proposal suggests that methods return 8-bit strings, specifying the
character encoding of that string in the RESPONSE. This makes it hard to
combine methods from two different components that happen use different
character encodings.

Note that since many components already use latin-1, the usefulness of this
aspect proposal is low.

If they need a wider character set then using Unicode is the only practical
approach.

Ill write up a full proposal for how this would fit together on the wiki.

(On a different subject, I think the default encoding will always have to
stay as latin1 in order to support pre-existing object databases )







___
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] catalog and versions

2001-05-04 Thread Stefane Fermigier

It seems to me that when I create a CatalogAware objet in a version,
it doesn't get into the catalog after the version is committed (in fact,
it doesn't event get into the catalog inside the version). 

Am I right? Is this considered normal behavio(u)r? Any idea for a workaround?

Regards,

S.

-- 
Stéfane Fermigier, Tel: +33 (0)6 63 04 12 77 (mobile).
http://nuxeo.com/ & http://portalux.com/ & http://aful.org/
"Amazon: we patent the dot in .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 )