[Zope-dev] How to choose: Or, Not and And when using searchResults().

2001-04-18 Thread Erik Enge

Hi,

I was wondering, is there a way I can choose whether I want searchResults
to Or, Not or And the search?  Or do I need to combine searchResult calls
and what not?


___
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 choose: Or, Not and And when using searchResults().

2001-04-18 Thread Chris McDonough

No, unfortunately.

You need to manually do unions or intersections on results from multiple
calls to searchRequest currently.

Erik Enge wrote:
 
 Hi,
 
 I was wondering, is there a way I can choose whether I want searchResults
 to Or, Not or And the search?  Or do I need to combine searchResult calls
 and what not?
 
 ___
 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 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 choose: Or, Not and And when using searchResults().

2001-04-18 Thread Erik Enge

On Wed, 18 Apr 2001, Chris McDonough wrote:

 You need to manually do unions or intersections on results from multiple
 calls to searchRequest currently.

Is this a feature to be implemented?  If not, why not?

Oh, and by the way, "searchRequest"?


___
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 choose: Or, Not and And when using searchResults().

2001-04-18 Thread Marco Nova

  On Wed, 18 Apr 2001, Chris McDonough wrote:
  
   You need to manually do unions or intersections on 
 results from multiple
   calls to searchRequest currently.
  
  Is this a feature to be implemented?  If not, why not?
 
 DC has no no concrete plans to implement operators or precedence in
 catalog queries, although I think it's a really 
 super-worthwhile idea. 
 We're currently focusing on the things in the Zope 2.4 plan (see
 http://dev.zope.org/Resources/zope_240_plan.html).  If 
 someone wanted to
 try to implement it, they could create a fishbowl project and I can
 provide assistance.

Why don't integrate already working search engine such as pls (www.pls.com)
?
It shouldn't be so much difficult to integrate.

- mn

___
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 choose: Or, Not and And when using searchResults().

2001-04-18 Thread Chris McDonough

Marco Nova wrote:
  DC has no no concrete plans to implement operators or precedence in
  catalog queries, although I think it's a really
  super-worthwhile idea.
  We're currently focusing on the things in the Zope 2.4 plan (see
  http://dev.zope.org/Resources/zope_240_plan.html).  If
  someone wanted to
  try to implement it, they could create a fishbowl project and I can
  provide assistance.
 
 Why don't integrate already working search engine such as pls (www.pls.com)
 ?
 It shouldn't be so much difficult to integrate.

It would not be possible to do field and keyword index queries against
methods of Zope objects with a third-party indexer.  It would
additionally not be possible to full-text-index anything but the results
of a rendered HTML page.

If ZCatalog did nothing but create full text indexes of rendered HTML, I
think we'd be all for going with a third-party search engine instead of
continuing to maintain it. But ZCatalog is not just about searching
text.  ZCatalog currently lets you relate objects in a Zope instance to
each other in ways that aren't possible without it.  For example, you
can catalog a bunch of different kinds of objects, and perform a catalog
query to retrieve only DTML Document objects.  Likewise, you can create
and index and subsequently perform a query that lets you get at objects
which have an attribute "foo" that starts with the letter "g".  This
kind of granularity is not possible with nonintegrated indexers.

Of course that doesn't mean you can't use htdig or pls to index a Zope
site if that's what you'd like to do...

- C

___
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 choose: Or, Not and And when using searchResults().

2001-04-18 Thread Chris McDonough

BTW, it *is* possible to use AND, NOT, OR, and ANDNOT in the body of a
textindex query, e.g.

dtml-in "Catalog(textindex="foo and bar or farfoo andnot flea")


This is not a problem.

But the original question (and what is not possible currently), is how
to do something like:

dtml-in "Catalog(textindex='foo' AND fieldindex='bar' OR
keywordindex=['flop'])"

...currently the best you can do is:

dtml-in "Catalog(textindex='foo', fieldindex='bar',
keywordindex=['flop'])"
...

... which does an implicit intersection (AND) of all the results from
the indexes "textindex", "fieldindex" and "keywordindex".

To change this behavior, you need to do things like:

dtml-let a="Catalog(textindex='foo')"
dtml-let b="Catalog(fieldindex='bar')"
dtml-let c="Catalog(keywordindex=['flop'])"

dtml-let result="a + b + c"
dtml-in result
.

the above example is a way to service a query like "textindex='foo' OR
fieldindex='bar' OR keywordindex=['flop']".

- C


Chris McDonough wrote:
 
 Marco Nova wrote:
   DC has no no concrete plans to implement operators or precedence in
   catalog queries, although I think it's a really
   super-worthwhile idea.
   We're currently focusing on the things in the Zope 2.4 plan (see
   http://dev.zope.org/Resources/zope_240_plan.html).  If
   someone wanted to
   try to implement it, they could create a fishbowl project and I can
   provide assistance.
 
  Why don't integrate already working search engine such as pls (www.pls.com)
  ?
  It shouldn't be so much difficult to integrate.
 
 It would not be possible to do field and keyword index queries against
 methods of Zope objects with a third-party indexer.  It would
 additionally not be possible to full-text-index anything but the results
 of a rendered HTML page.
 
 If ZCatalog did nothing but create full text indexes of rendered HTML, I
 think we'd be all for going with a third-party search engine instead of
 continuing to maintain it. But ZCatalog is not just about searching
 text.  ZCatalog currently lets you relate objects in a Zope instance to
 each other in ways that aren't possible without it.  For example, you
 can catalog a bunch of different kinds of objects, and perform a catalog
 query to retrieve only DTML Document objects.  Likewise, you can create
 and index and subsequently perform a query that lets you get at objects
 which have an attribute "foo" that starts with the letter "g".  This
 kind of granularity is not possible with nonintegrated indexers.
 
 Of course that doesn't mean you can't use htdig or pls to index a Zope
 site if that's what you'd like to do...

___
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 choose: Or, Not and And when using searchResults().

2001-04-18 Thread Casey Duncan

Chris McDonough wrote:
 
 Erik Enge wrote:
 
  On Wed, 18 Apr 2001, Chris McDonough wrote:
 
   You need to manually do unions or intersections on results from multiple
   calls to searchRequest currently.
 
  Is this a feature to be implemented?  If not, why not?
 
 DC has no no concrete plans to implement operators or precedence in
 catalog queries, although I think it's a really super-worthwhile idea.
 We're currently focusing on the things in the Zope 2.4 plan (see
 http://dev.zope.org/Resources/zope_240_plan.html).  If someone wanted to
 try to implement it, they could create a fishbowl project and I can
 provide assistance.
 
 
  Oh, and by the way, "searchRequest"?
 
 __call__ works too.  ;-)
 
 - C

This is a project I have been keeping in the back of my mind for a while
now. At present I do not have the resources to devote, but it is my hope
that this will change. I feel strongly that that ZCatalog should have a
general query language on par with an SQL where clause. Much of the work
to implement this exists in various places, it really just needs
fleshing out and tying together.

I have also been waiting for the ZCatalog changes that have just taken
place in 2.3.1. Now that this has happened, it may be a good time to
start the discussion in the Fishbowl. I would be willing to draft this
proposal, but it will be a few weeks before I realistically can do 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 )



Re: [Zope-dev] How to choose: Or, Not and And when using searchResults().

2001-04-18 Thread Chris McDonough


 This is a project I have been keeping in the back of my mind for a while
 now. At present I do not have the resources to devote, but it is my hope
 that this will change. I feel strongly that that ZCatalog should have a
 general query language on par with an SQL where clause. Much of the work
 to implement this exists in various places, it really just needs
 fleshing out and tying together.

I totally agree.

 I have also been waiting for the ZCatalog changes that have just taken
 place in 2.3.1. Now that this has happened, it may be a good time to
 start the discussion in the Fishbowl. I would be willing to draft this
 proposal, but it will be a few weeks before I realistically can do it.

If you'd be willing to take it on, I think many people would give you
attaboys for years to come!  ;-)  It doesn't seem to be on the roadmap here,
so if you choose to write the proposal, I'll help in any way I can by review
or contributing code.

BTW, some changes are coming to the way we allow contributions to the Zope
codebase which have the potential to reduce the DC "drag factor" for this
and other similar projects.

- C





___
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 choose: Or, Not and And when using searchResults().

2001-04-18 Thread Casey Duncan

Chris McDonough wrote:
 
 BTW, some changes are coming to the way we allow contributions to the Zope
 codebase which have the potential to reduce the DC "drag factor" for this
 and other similar projects.
 
 - C

I await this process change with great curiousity.

As for the ZCatalog proposal, I am approaching from a fairly selfish
perpective. It would just make Zope that much better for me to use! Plus
I think it would be a fun, doable and useful project.

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



Re: [Zope-dev] Virtual dataskinned ZClass instance

2001-04-18 Thread Godefroid Chapelle



Steve Alexander a crit :

 Godefroid Chapelle wrote:

 
  where getNames is a python method in a DataSkin Class Extender.
  It is defined as :
 
   import string
   list = string.split(context.id, '_')
   return list[1]

 use getId() perhaps?

 --

 Steve Alexander

When using context.getId(), I get the id of the specialist, not of the
HumanClass instance...

Actually, what I present is a "toy test" where I try to access the id as you
do in the skinscript exapmle you sent me...


If I change the skinscript to something simpler...

WITH 'test' COMPUTE prenom=RESULT


and the DTML to :

dtml-var standard_html_header
h2dtml-var title_or_id/h2
dtml-var "defaultRack.getItem('100_Peter').prenom"
dtml-var standard_html_footer


I get the same unauthorized error response but this time when accessing
'prenom'.

I suppose ther something wrong with the default ZClass constructor which is
used by the rack to make the instance... but is that correct ... no idea...

--

Godefroid Chapelle

BubbleNet sprl
rue Victor Horta, 30
1348 Louvain-la-Neuve
Belgium

Tel 010 457490
Mob 0477 363942

TVA 467 093 008
RC Niv 49849



___
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] WebDAV etc permissions (Re: zope nautilus cabal)

2001-04-18 Thread Lalo Martins

On Fri, Apr 13, 2001 at 11:48:39PM +0100, Chris Withers wrote:
  The WebDAV (and XMLRPC) stuff either needs to be decomposed to run on its
  own port (and only that port) or more explicit permissions need to be
  associated with WebDAV/XMLRPC operations if we take for granted that being
  able to browse the root folder structure is a bad thing.
(...)
 Basically, 'access contents information' isn't a great permission. If you
 turn if off, life gets horrible, if you leave it on, bits hang out. I'd
 prefer to see something like:
 - Access Contents Information via HTTP
 - Access Contents Information via FTP
 ..etc...

When I crawled out of bed today it ocurred to me that there is
a very reasonable sollution already.

We've had a "FTP access" permission for ages. So, either:

- make WebDAV, XMLRPC etc protected by "View Management Screens"

- make WebDAV, XMLRPC etc protected by "FTP access"

- make WebDAV, XMLRPC etc protected by "DAV/RPC access"
  (a new permission)

yes? 

[]s,
   |alo
   +
--
   I say a prayer now our love's departed
That you'll come back to stay
  Bring back the perfect day

http://www.laranja.org/mailto:[EMAIL PROTECTED]
 pgp key: http://www.laranja.org/pessoal/pgp

Brazil of Darkness (RPG)  ---   http://www.BroDar.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] Virtual dataskinned ZClass instance

2001-04-18 Thread Steve Alexander

Godefroid Chapelle wrote:

 
 
 When using context.getId(), I get the id of the specialist, not of the
 HumanClass instance...


use container.getId()

Also, try setting a proxy role on the SkinScript.

--
Steve Alexander


___
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] WebDAV locking module?

2001-04-18 Thread richard

Colour me confused...

I just downloaded the 2.3.2 beta tarball and tried to run our application
against it. It appears that the locking module (webdav.Lockable) is missing
from webdav. We develop against the CVS, and the file is there. It has been
since 2.3.1 CVS - though the 2.3.1 tarball doesn't seem to have the module
either...

Can someone clue me in please?


Richard

-- 
Richard Jones
[EMAIL PROTECTED]
Senior Software Developer, Bizar Software (www.bizarsoftware.com.au)

___
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] CatalogAware does not work?

2001-04-18 Thread Casey Duncan

John Morton wrote:
 
 
   Why couldn't CatalogAware do this? If nobody has a good reason, I might
   push forth a patch to CatalogAware to implement this.
 
 A simple case for the present flexibility is that you don't need to reindex
 for every property change, just the ones that are actually indexed.
 

Agreed, CatalogAware should ideally check this to make sure reindexing
is necessary.

 A more complicated case would be an operation that changes several instances
 at once. It's expensive to reindex for every instance you change, so it would
 be useful to pass a flag to the ZClass's change method to tell it not to do a
 reindex, and reindex the lot once the operation over all the instances is
 completed.

I have actually done this for a Product I am developing. It allows you
to accumulate
property changes and reindex only once. Supposedly, the Catalog is more
efficient in this regard anyway as of 2.3.

 I guess that you could build this kind of functionality into CatalogAware,
 but I'm generally in favour of having flexible and optional rather than
 automatic reindexing, and just adding documentation to discuss some of the
 different cases.
 
 You could hack Property Sheet Interface to add a call to reindex if the
 ZClass is catalog aware.

I would not want to make PropertyManager directly aware of CatalogAware
if I could get away with it. Perhaps the way to deal with this is to
have PropertyManager call a hookable method afterChangeProperties or
some such, passing a list of properties changed. Then your ZClass could
simply call reindex_object if it feels it is necessary. That would give
full disclosure and behavior control back to your specific
implementation. But it would simultaneously cover property changes made
in the management screens and everywhere else.

I am moving this discussion over to zope-dev to see if anyone else there
has any ideas.

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



Re: [Zope-dev] WebDAV etc permissions (Re: zope nautilus cabal)

2001-04-18 Thread Bill Anderson

On 18 Apr 2001 15:39:20 -0300, Lalo Martins wrote:
 On Fri, Apr 13, 2001 at 11:48:39PM +0100, Chris Withers wrote:
   The WebDAV (and XMLRPC) stuff either needs to be decomposed to run on its
   own port (and only that port) or more explicit permissions need to be
   associated with WebDAV/XMLRPC operations if we take for granted that being
   able to browse the root folder structure is a bad thing.
 (...)
  Basically, 'access contents information' isn't a great permission. If you
  turn if off, life gets horrible, if you leave it on, bits hang out. I'd
  prefer to see something like:
  - Access Contents Information via HTTP
  - Access Contents Information via FTP
  ..etc...
 
 When I crawled out of bed today it ocurred to me that there is
 a very reasonable sollution already.
 
 We've had a "FTP access" permission for ages. So, either:
 
 - make WebDAV, XMLRPC etc protected by "View Management Screens"
 
 - make WebDAV, XMLRPC etc protected by "FTP access"
 
 - make WebDAV, XMLRPC etc protected by "DAV/RPC access"
   (a new permission)
 
 yes? 


Perhaps for webdav and ftp it would work fine. XML-RPC is a bit of a
different animal, as it runs through  http, thus on the same port as
zope's http side.  Going out on a limb here, I would guess that to move
XML-RPC to a seperate port would be very, very time consuming and
difficult; not to mention questionable with respects to the standard?

Bill

 
 []s,
|alo
+
 --
I say a prayer now our love's departed
 That you'll come back to stay
   Bring back the perfect day
 
 http://www.laranja.org/mailto:[EMAIL PROTECTED]
  pgp key: http://www.laranja.org/pessoal/pgp
 
 Brazil of Darkness (RPG)  ---   http://www.BroDar.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 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] ZCatalog catalogable types and nonproducts

2001-04-18 Thread Karl Anderson


I have a Python Product with several subobjects which are not products
in their own right.  I'm trying to make these subobjects selectable in
the Find Objects tab of a ZCatalog, so I can restrict the cataloged
objects to these types.

Whats the right way to do this?

Since they're not addable products, they don't go in the "Find objects
by type" selection by default.  Rooting through the source, I see that
this selection is populated by all_meta_types, and ObjectManager
creates that list by appending a _product_meta_types attr onto an
acquired value.

I can't create a _product_meta_types property on the ZCatalog.  I can
add a _products_meta_type dict to the ZCatalog via Python:

app.catalogtest.catalog._product_meta_types = ({'permission': 'Dummy', 'name': 
'Manageable Element', 'action':'Dummy'},)

I added the dummy permission and action becuase the contents view
doesn't display without them.

This seems to work, and these meta types aren't displayed in the add
list for the container view (becuase I don't have the 'Dummy' perm),
which is what I want.  But should I be telling the users of my product
to do this?

-- 
Karl Anderson  [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] External transaction integration bug?

2001-04-18 Thread Randall F. Kern

I may just be missing something obvious here, but it seems like there is
a hole in ZODB.Transaction.Transaction.commit and Shared.DC.ZRDB.TM.TM,
that can cause external transactions (those that use the TM mixin class,
like psycopg) to be abandoned (never get committed or rolled back).

Let's say somewhere around line 300 in Transaction.py (the call to
j.commit(o, self)) we get an exception.  Furthermore, let's say the TM
derived database object has already been committed (the only effect of
which is to move the DB into the jars mapping, since TM.tpc_begin() and
TM.commit() both do nothing).

The exception dumps us down to about line 353, where we call
_p_jar.abort() on all the uncommitted objects (note: it's important that
the database connection isn't in this list, because TM.abort() will
rollback the transaction.  the way we keep the db out of this list is by
having it appear in objects _before_ the object that failed the commit).

Next we reach line ~366, where we should "unwind TPC for the jars that
began it".  What this means is calling tpc_abort() on each jar from the
objects that were already committed (which includes the database).
However, TM.tpc_abort() does nothing, leaving the external database
transaction open.

Does this make sense?

If this makes sense (i.e. seems bad :), does catching tpc_abort() in TM
and calling TM.abort() seem like a valid fix?

Thanks,
-Randy

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