[Zope] catalog aware not working.. help

2007-03-20 Thread Allen Huang
I made a pyhon product with catalogaware as one of my base class but my 
zcatalog named 'catalog' doesn't automatically catalog when I add a product 
item. what could be a problem?

Please help

this is part of my code that include catalogawareness:

class ShpTypePointClass(Item, Persistent, Implicit, CatalogAware):
#print ShpTypePointClass
id='ShpTypePoint'
meta_type='ShpTypePoint'
manage_options = (
{ 'label':'Properties','action':'manage_editShpTypePoint' },
) + Item.manage_options

#_properties=(
#{ 'id':'title', 'type':'string', 'mode':'w'},
#{ 'id':'x', 'type':'string', 'mode':'w'},
#{ 'id':'y', 'type':'string', 'mode':'w'}
#)

def __init__(self, id, x, y, dbfInfo):
#print 'initializing'
self.id = id
self.x = x
self.y = y
self.dbfInfo = dbfInfo
self.reindex_object()
def printPoint(self):
#print print Point
return br printPoint Method br ID: + self.id +  -- (  + self.x  
+ ,  + self.y +  )
def edit(self, x, y, REQUEST=None):
Edit the Point
#print edit
self.x = x
self.y = y
self.reindex_object()
if REQUEST is not None:
return self.manage_editShpTypePoint(self, REQUEST)
##Web Methods
index_html = HTMLFile('DTML/index_html', globals())
manage_editShpTypePoint = HTMLFile('DTML/manage_editShpTypePoint', 
globals())
InitializeClass(ShpTypePointClass)


 

Now that's room service!  Choose from over 150,000 hotels
in 45,000 destinations on Yahoo! Travel to find your fit.
http://farechase.yahoo.com/promo-generic-14795097___
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] catalog aware not working.. help

2007-03-20 Thread Jonathan


- Original Message - 
From: Allen Huang [EMAIL PROTECTED]

To: Zope zope@zope.org
Sent: Tuesday, March 20, 2007 3:09 AM
Subject: [Zope] catalog aware not working.. help


I made a pyhon product with catalogaware as one of my base class but my 
zcatalog named 'catalog' doesn't automatically catalog when I add a product 
item. what could be a problem?


I am not sure if this is your problem, but I have a vague recollection that 
the ZCatalog needs to be named 'Catalog' (initial capital).



Jonathan 


___
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] catalog aware not working.. help

2007-03-20 Thread Bakhtiar A Hamid

On 3/20/07, Allen Huang [EMAIL PROTECTED] wrote:


I made a pyhon product with catalogaware as one of my base class but my
zcatalog named 'catalog' doesn't automatically catalog when I add a product
item. what could be a problem?

Please help

this is part of my code that include catalogawareness:

class ShpTypePointClass(Item, Persistent, Implicit, CatalogAware):


iirc, CatalogAware has to first like so:
class ShpTypePointClass( CatalogAware, Item, Persistent, Implicit):

hth


#print ShpTypePointClass
id='ShpTypePoint'
meta_type='ShpTypePoint'
manage_options = (
{
'label':'Properties','action':'manage_editShpTypePoint' },
) + Item.manage_options

#_properties=(
#{ 'id':'title', 'type':'string', 'mode':'w'},
#{ 'id':'x', 'type':'string', 'mode':'w'},
#{ 'id':'y', 'type':'string', 'mode':'w'}
#)

def __init__(self, id, x, y, dbfInfo):
#print 'initializing'
self.id = id
self.x = x
self.y = y
self.dbfInfo = dbfInfo
self.reindex_object()
def printPoint(self):
#print print Point
return br printPoint Method br ID: + self.id +  -- (  +
self.x  + ,  + self.y +  )
def edit(self, x, y, REQUEST=None):
Edit the Point
#print edit
self.x = x
self.y = y
self.reindex_object()
if REQUEST is not None:
return self.manage_editShpTypePoint(self, REQUEST)
##Web Methods
index_html = HTMLFile('DTML/index_html', globals())
manage_editShpTypePoint =
HTMLFile('DTML/manage_editShpTypePoint', globals())
InitializeClass(ShpTypePointClass)


 
We won't tell. Get more on shows you hate to love
(and love to hate): Yahoo! TV's Guilty Pleasures list.
___
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 )





--
http://myzope.kedai.com.my - my-zope org
___
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] Catalog aware

2006-07-24 Thread Garito

Lennart Regebro escribió:

On 7/19/06, Garito [EMAIL PROTECTED] wrote:

 Look at the CatalogAware mixin class.
But with this class I could create a new class of PT Catalog aware,
isn't it?


Yup.


I would like to convert a normal PT is this possible?'


Yes, with monkeypatches, but really, you don't want to go that way.
This feels to me as a case of you asking the question you THINK is the
problem, because thats the problem you have right now. But often when
that happens you have been running in the wrong direction for a while.

It's like somebody asking how to break down a wall to get to the mall
on the other side, when the best way to get to the wall is to get out
of the dead-end street and then take left. :)

So in short: Why on earth would you want page templates to be 
catalogaware? :)



Sure but Is the cost so big?


Yes.


Ok, I'll rethink the question and try another aproach

Thanks by now! (I'll ask you later if needed)

--
Mis Cosas
http://blogs.sistes.net/Garito


___
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] Catalog aware

2006-07-21 Thread Lennart Regebro

On 7/19/06, Garito [EMAIL PROTECTED] wrote:

 Look at the CatalogAware mixin class.
But with this class I could create a new class of PT Catalog aware,
isn't it?


Yup.


I would like to convert a normal PT is this possible?'


Yes, with monkeypatches, but really, you don't want to go that way.
This feels to me as a case of you asking the question you THINK is the
problem, because thats the problem you have right now. But often when
that happens you have been running in the wrong direction for a while.

It's like somebody asking how to break down a wall to get to the mall
on the other side, when the best way to get to the wall is to get out
of the dead-end street and then take left. :)

So in short: Why on earth would you want page templates to be catalogaware? :)


Sure but Is the cost so big?


Yes.

--
Lennart Regebro, Nuxeo http://www.nuxeo.com/
CPS Content Management http://www.cps-project.org/
___
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: [***SPAM*** Score/Req: 04.00/04.00] Re: [Zope] Catalog aware

2006-07-21 Thread Lennart Regebro

On 7/20/06, Garito [EMAIL PROTECTED] wrote:

Ok, a real case:

I'm working on a data system (I like the concept data system) for a friend
He is Dj for that I want to create a concept like

Session
Form - A formulator
See - Used to view the session on its default view
Ask - Used to view the session to change it data (to modify the object)
Edit - Used to change the properties (via Ask view)
...

Ask will be something like

tal:b tal:repeat='field Form/get_fields'
  label tal:attributes='for field/getId' /
  tal:b tal:replace='structure field/render' /
/tal:b

As you can see a lot of entities will use the same Ask


Sure.


I will create a container to store all these kind of functionality to
use is as a generic Ask
In a normal way I can use adquisition to make these way but I want to
store things with some kind of order then I define something like

MyFriendsWeb (this is an entity)
Forms (is not an entity but I use the same product to create it)
   Session - Formulator
   Production - Formulator
Functionality (is not an entity but I use the same product to create it)
   Ask
   See
   Edit
Session (this is an entity)
   Form - points to MyFriendsWeb/Forms/Session
   See - Will use the generic one
   Ask - this one too (the generic one)
   ...
Production (this is an entity)
   Form - points to MyFriendsWeb/Forms/Production
   See - Will use the generic one
   Ask - this one too (the generic one)

MyFriendsWeb is an entity for that reason catalog everything that not in
another entity like Session

Session is another entity for that catalog See (the pointer one not the
real See), Ask (like See is a pointer) and so on

What I want is semantic structure not only usefull structure that makes
that every entity will know everything it can do or be


I think I see.


With my model I use my product for every container, formulators/page
templates/script pythons like functionality an so on


Sure, just like portal_skins does.


My model works but I would like if its possible to use something like

tal:b tal:replace='structure Session/Form/header' /

or

tal:b tal:replace='MyFriendsWeb/Sessions' /

instead of

tal:b tal:define='Form some code to retrieve the form. First if here
has Form, then in the acquisition context and finally searching on the
catalog of the entity'
tal:replace='structure Form/header' /
/tal:b

It works, its only a question of use it as simple as I can


Well, this seems complex. Can't you just have
context/Session/Form/header instead of just Session/Form/header?


For that my product is a ZCatalog with a property Entity (boolean)
If you mark Entity as true for an object every objects below these one
are catalogued by my product


Uhhh. That doesn't help.


What do you think?


Sound fine. I notice that in all of your description above there is a
complete lack of indexed page templates. ;)

--
Lennart Regebro, Nuxeo http://www.nuxeo.com/
CPS Content Management http://www.cps-project.org/
___
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] Catalog aware

2006-07-20 Thread Garito

Tino Wildenhain escribió:

Garito wrote:
  

Tino Wildenhain escribió:


Garito wrote:
...
 
  

Sure, but I can't create a new product for every product I'll use only
to do it catalog aware, isn't it?



Yes you can. Why not? I mean you are using them - so you can use
your products instead as well.

  

Yes but what if tomorrow you create a product? need work to times: you
first, me later



Who says you have a use for the product I create? Or if it makes
sense to catalog it? If you want a cataloguing framework, why
dont you use CMF or something?
  
  

I want to make every class catalogable only if I point a zcatalog id
(with self.default_catalog) but If I point it I want to catalogue the
object



And what of the object do you want to catalog?
Which kind of indexes do you want it to support?
What kind of questions do you expect your ZCatalog
(hypothetically) answered? Could you give examples?
  
Is not important what I want to catalog, for me is important that the 
object *was* in the catalog (some catalogs indexes some properties some 
others other properties)


  

Now is a search era, isn't it?



Yes, search for what and by whom is the question here.
  

I don't thing so. The question is who is in the catalog
  

Use another framework only to do the objects catalogable?

I love simple things



So why are you trying to make standard zope objects more
complicated? :)
  
More complicated? Sure, but I don't understand the cost to make every 
object in Zope catalogable. A class and a variable I don't thing is a 
big cost

And I thing in Zope when I thing in keep it simple
 
  

In my opinion (is only an opinion) these is not the best situation in a
future

Sorry but is not so acceptable for me



The point is, it makes no sense to catalog Pagetemplates,
Python Scripts, Folders and ZSQL Methods, Mailhosts
and Database connections. These are all standard zope
objects, yet they make catalogable content only in derived
work or when they play together - which is a custom
solution anyway. There you can add whatever cataloguing
awareness you want.
  
  

And if I use them dinamically (a user with the role1 use the template
Ver but a user with the role2 use the template Ver1 for the same
context)? (I'm not sure if I understand you clear, sorry If I make a
mistake, please



This would not be supported by just adding indexing to the standard
objects anyway. You would write a container which supports the bahavior
you want - and while you are at it you can easily add catalogawareness
to that - exactly where and in the way _you_ need it :-)
Individual objects cataloguing themself would get in your way.

Regards
Tino Wildenhain
  
Yes, I'm creating a specific container that works in a curious way. In 
that container I could catalog a Page Template when I'm adding it but 
perhaps sometimes I want to track its changes an so on


--
Mis Cosas
http://blogs.sistes.net/Garito


___
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] Catalog aware

2006-07-20 Thread Tino Wildenhain

Garito wrote:

Tino Wildenhain escribió:

Garito wrote:
 

Tino Wildenhain escribió:
   

Garito wrote:
...
 
 
Sure, but I can't create a new product for every product I'll use 
only

to do it catalog aware, isn't it?


Yes you can. Why not? I mean you are using them - so you can use
your products instead as well.
  

Yes but what if tomorrow you create a product? need work to times: you
first, me later


Who says you have a use for the product I create? Or if it makes
sense to catalog it? If you want a cataloguing framework, why
dont you use CMF or something?


I want to make every class catalogable only if I point a zcatalog id
(with self.default_catalog) but If I point it I want to catalogue the
object



And what of the object do you want to catalog?
Which kind of indexes do you want it to support?
What kind of questions do you expect your ZCatalog
(hypothetically) answered? Could you give examples?
  
Is not important what I want to catalog, for me is important that the 
object *was* in the catalog (some catalogs indexes some properties some 
others other properties)


Please read the catalog section again: there isnt the object in the catalog!
Again: The object is _not_ in the catalog.
Its all about usefull indexes and maybe object metadata.
So again: _what_ actually do you expect to find?



 

Now is a search era, isn't it?



Yes, search for what and by whom is the question here.
  

I don't thing so. The question is who is in the catalog
 

Use another framework only to do the objects catalogable?

I love simple things



So why are you trying to make standard zope objects more
complicated? :)
  
More complicated? Sure, but I don't understand the cost to make every 
object in Zope catalogable. A class and a variable I don't thing is a 
big cost

And I thing in Zope when I thing in keep it simple


Yes, but its nonsense. You cant do anything more with the objects
in Zope if they are catalogued.


 
 
In my opinion (is only an opinion) these is not the best situation 
in a

future

Sorry but is not so acceptable for me


The point is, it makes no sense to catalog Pagetemplates,
Python Scripts, Folders and ZSQL Methods, Mailhosts
and Database connections. These are all standard zope
objects, yet they make catalogable content only in derived
work or when they play together - which is a custom
solution anyway. There you can add whatever cataloguing
awareness you want.


And if I use them dinamically (a user with the role1 use the template
Ver but a user with the role2 use the template Ver1 for the same
context)? (I'm not sure if I understand you clear, sorry If I make a
mistake, please



This would not be supported by just adding indexing to the standard
objects anyway. You would write a container which supports the bahavior
you want - and while you are at it you can easily add catalogawareness
to that - exactly where and in the way _you_ need it :-)
Individual objects cataloguing themself would get in your way.

Regards
Tino Wildenhain
  
Yes, I'm creating a specific container that works in a curious way. In 
that container I could catalog a Page Template when I'm adding it but 
perhaps sometimes I want to track its changes an so on



Yes, but who should know what _you_ want your objects to do? You cannot
expect all people (especially the ones writing zope core) to guess
your needs - you are the one to express your wishes in the form of
code :-) If you end up having a general solution (like these frameworks
are) you can share them with others.

Regards
Tino
___
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] Catalog aware

2006-07-20 Thread Garito

Tino Wildenhain escribió:

Garito wrote:

Tino Wildenhain escribió:

Garito wrote:
 

Tino Wildenhain escribió:
  

Garito wrote:
...
 

Sure, but I can't create a new product for every product I'll 
use only

to do it catalog aware, isn't it?


Yes you can. Why not? I mean you are using them - so you can use
your products instead as well.
  
Yes but what if tomorrow you create a product? need work to 
times: you

first, me later


Who says you have a use for the product I create? Or if it makes
sense to catalog it? If you want a cataloguing framework, why
dont you use CMF or something?


I want to make every class catalogable only if I point a zcatalog id
(with self.default_catalog) but If I point it I want to catalogue the
object



And what of the object do you want to catalog?
Which kind of indexes do you want it to support?
What kind of questions do you expect your ZCatalog
(hypothetically) answered? Could you give examples?
  
Is not important what I want to catalog, for me is important that the 
object *was* in the catalog (some catalogs indexes some properties 
some others other properties)


Please read the catalog section again: there isnt the object in the 
catalog!

Again: The object is _not_ in the catalog.
Its all about usefull indexes and maybe object metadata.
So again: _what_ actually do you expect to find?

When I talk about was in the catalog I mean the object is catalogued
I expect to find *the object* in the catalog

For example:

How do you know how many cousins you have? Because you are a catalog 
that catalog the number of cousins you have


Another example: how much skills about computing do you have? Again your 
skills are objects that you need (as a catalog you are) to catalog


Like an entity (a thing, and object) you need to know some data stored 
in your life added to you




 

Now is a search era, isn't it?



Yes, search for what and by whom is the question here.
  

I don't thing so. The question is who is in the catalog
 

Use another framework only to do the objects catalogable?

I love simple things



So why are you trying to make standard zope objects more
complicated? :)
  
More complicated? Sure, but I don't understand the cost to make every 
object in Zope catalogable. A class and a variable I don't thing is a 
big cost

And I thing in Zope when I thing in keep it simple


Yes, but its nonsense. You cant do anything more with the objects
in Zope if they are catalogued.
Are you sure? I can find them!!! Then if I can find them I can count 
them, give to you (even if its don't depend on me, remember your skills 
or your cousins?)


I want to create an object that acts like an entity (like a human or a 
mortage or a paper or a product -that you can sell)


These entity need to know how is it (its properties, its characteristics)

I ask myself if I know myself but I only know about myself all I can 
catalogue



 

In my opinion (is only an opinion) these is not the best 
situation in a

future

Sorry but is not so acceptable for me


The point is, it makes no sense to catalog Pagetemplates,
Python Scripts, Folders and ZSQL Methods, Mailhosts
and Database connections. These are all standard zope
objects, yet they make catalogable content only in derived
work or when they play together - which is a custom
solution anyway. There you can add whatever cataloguing
awareness you want.


And if I use them dinamically (a user with the role1 use the template
Ver but a user with the role2 use the template Ver1 for the same
context)? (I'm not sure if I understand you clear, sorry If I make a
mistake, please



This would not be supported by just adding indexing to the standard
objects anyway. You would write a container which supports the bahavior
you want - and while you are at it you can easily add catalogawareness
to that - exactly where and in the way _you_ need it :-)
Individual objects cataloguing themself would get in your way.

Regards
Tino Wildenhain
  
Yes, I'm creating a specific container that works in a curious way. 
In that container I could catalog a Page Template when I'm adding it 
but perhaps sometimes I want to track its changes an so on



Yes, but who should know what _you_ want your objects to do? You cannot
expect all people (especially the ones writing zope core) to guess
your needs - you are the one to express your wishes in the form of
code :-) If you end up having a general solution (like these frameworks
are) you can share them with others.

Regards
Tino
I don't expect anyone guess my needs (is for that I need to develop the 
class) :)

I only ask if I can add some super classes to an object when  I create it :)
I know my needs are so particular but I want to create something new 
with a new perspective. If I can the result will be very curious (I 
suppose, I expect even)


I choose Zope because is the most near to my finall result

--
Mis Cosas

Re: [Zope] Catalog aware

2006-07-20 Thread Martijn Pieters

On 7/20/06, Garito [EMAIL PROTECTED] wrote:

 Please read the catalog section again: there isnt the object in the
 catalog!
 Again: The object is _not_ in the catalog.
 Its all about usefull indexes and maybe object metadata.
 So again: _what_ actually do you expect to find?
When I talk about was in the catalog I mean the object is catalogued
I expect to find *the object* in the catalog


No, there are indexes in the catalog that point to the object. You
will have to search for certain information that then points to
certain objects. This can be the object Type, or the path, or the id.

Note that objects do not need to be catalogue aware to be
catalogueable; just use the find tab and the catalog will index them.

Making all Zope objects catalog aware by default makes no sense
though. You have yet to come with a compelling generic use-case, let
alone with one that convinces me. Why catalog database connectors for
example? What kind of search are you performing?

Have you thought about the potential problems of making all objects
catalog-aware by default, like potential conflicts and side-effects?

I say a big -infinity from me on the whole idea.

--
Martijn Pieters
___
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] Catalog aware

2006-07-20 Thread Tino Wildenhain

Garito wrote:

Tino Wildenhain escribió:

Garito wrote:

Tino Wildenhain escribió:

Garito wrote:
 

Tino Wildenhain escribió:
 

Garito wrote:
...
 
   
Sure, but I can't create a new product for every product I'll 
use only

to do it catalog aware, isn't it?


Yes you can. Why not? I mean you are using them - so you can use
your products instead as well.
  
Yes but what if tomorrow you create a product? need work to 
times: you

first, me later


Who says you have a use for the product I create? Or if it makes
sense to catalog it? If you want a cataloguing framework, why
dont you use CMF or something?


I want to make every class catalogable only if I point a zcatalog id
(with self.default_catalog) but If I point it I want to catalogue the
object



And what of the object do you want to catalog?
Which kind of indexes do you want it to support?
What kind of questions do you expect your ZCatalog
(hypothetically) answered? Could you give examples?
  
Is not important what I want to catalog, for me is important that the 
object *was* in the catalog (some catalogs indexes some properties 
some others other properties)


Please read the catalog section again: there isnt the object in the 
catalog!

Again: The object is _not_ in the catalog.
Its all about usefull indexes and maybe object metadata.
So again: _what_ actually do you expect to find?

When I talk about was in the catalog I mean the object is catalogued
I expect to find *the object* in the catalog

For example:

How do you know how many cousins you have? Because you are a catalog 
that catalog the number of cousins you have


So you want to count objects based on their meta_type?
Of what use would be such an information?
What if you know how many pagetemplates you have? :-)

Another example: how much skills about computing do you have? Again your 
skills are objects that you need (as a catalog you are) to catalog


We have a skills object in plain zope now? Thats news for me.

Like an entity (a thing, and object) you need to know some data stored 
in your life added to you


Yes, but a zcatalog cannot work with some data - you need to specify
exactly _which_ data you want to find. So what exacly is this on
standard Zope objects?
..


Yes, but its nonsense. You cant do anything more with the objects
in Zope if they are catalogued.
Are you sure? I can find them!!! Then if I can find them I can count 
them, give to you (even if its don't depend on me, remember your skills 
or your cousins?)


Ah yes, which zope product stores cousin data?



I want to create an object that acts like an entity (like a human or a 
mortage or a paper or a product -that you can sell)


Yes, you crate it - you define its cataloguing. So what is your business
with standard zope objects here?


These entity need to know how is it (its properties, its characteristics)


You cant barely catalog all properties - the catalog would not even know
if this property is meant as keyword or fulltext or whatever...

I ask myself if I know myself but I only know about myself all I can 
catalogue

...


Regards
Tino
I don't expect anyone guess my needs (is for that I need to develop the 
class) :)
I only ask if I can add some super classes to an object when  I create 
it :)


You can, you just add it. Its there and you even know its name.
So what was your problem again? :-)

I know my needs are so particular but I want to create something new 
with a new perspective. If I can the result will be very curious (I 
suppose, I expect even)


I choose Zope because is the most near to my finall result


Exactly :-)

Regards
TIno
___
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] Catalog aware

2006-07-20 Thread Sascha Welter
(Wed, Jul 19, 2006 at 12:00:09PM -0400) [EMAIL PROTECTED] wrote/schrieb/egrapse:
 Subject: Re: [Zope] Catalog aware

Andreas Jung wrote:
  It makes little sense to index the contents of PTs. PTs are used to 
  present a view on a particular instance of your class but not for 
  providing content
  itself.

Garito wrote:
 I think it's a question of preferences
 
 Then can I inject Catalog awarness to an object?

... more on subclassing and monkeypatching in further mails.

Garito, please reread Andreas words. They are wisdom of the masters and
not to be ignored.

What would you want to catalog from the Page Template? The html,
body and div tags? The tal:content attributes?

Not these? 
But there is nothing else in there. There should be *no* content in
the page template. If there is then *you are doing something wrong* and
you will pay a heavy price down the road. Stop what you are doing and
think about doing it in a better way.

Regards,

Sascha

___
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: [***SPAM*** Score/Req: 04.00/04.00] Re: [Zope] Catalog aware

2006-07-20 Thread Garito

Tino Wildenhain escribió:

Garito wrote:

Tino Wildenhain escribió:

Garito wrote:

Tino Wildenhain escribió:

Garito wrote:
 

Tino Wildenhain escribió:
 

Garito wrote:
...
 
  
Sure, but I can't create a new product for every product I'll 
use only

to do it catalog aware, isn't it?


Yes you can. Why not? I mean you are using them - so you can use
your products instead as well.
  
Yes but what if tomorrow you create a product? need work to 
times: you

first, me later


Who says you have a use for the product I create? Or if it makes
sense to catalog it? If you want a cataloguing framework, why
dont you use CMF or something?


I want to make every class catalogable only if I point a zcatalog id
(with self.default_catalog) but If I point it I want to catalogue 
the

object



And what of the object do you want to catalog?
Which kind of indexes do you want it to support?
What kind of questions do you expect your ZCatalog
(hypothetically) answered? Could you give examples?
  
Is not important what I want to catalog, for me is important that 
the object *was* in the catalog (some catalogs indexes some 
properties some others other properties)


Please read the catalog section again: there isnt the object in the 
catalog!

Again: The object is _not_ in the catalog.
Its all about usefull indexes and maybe object metadata.
So again: _what_ actually do you expect to find?

When I talk about was in the catalog I mean the object is catalogued
I expect to find *the object* in the catalog

For example:

How do you know how many cousins you have? Because you are a catalog 
that catalog the number of cousins you have


So you want to count objects based on their meta_type?
Of what use would be such an information?
What if you know how many pagetemplates you have? :-)

Why not?
It depends on the nature of the entity
If I know now many pagetemplates has an entity I could show it to the user
Because I make some curious use of the objects of Zope, for me every 
object will be a functionality, something the object can do, then I want 
to know everything about the entity


Another example: how much skills about computing do you have? Again 
your skills are objects that you need (as a catalog you are) to catalog


We have a skills object in plain zope now? Thats news for me.

not now but I can develep it if I need


Like an entity (a thing, and object) you need to know some data 
stored in your life added to you


Yes, but a zcatalog cannot work with some data - you need to specify
exactly _which_ data you want to find. So what exacly is this on
standard Zope objects?
My entity has some default indexes like meta_type or owner, etc but you 
could be creative in order to create new ones. It only depends on your needs

..


Yes, but its nonsense. You cant do anything more with the objects
in Zope if they are catalogued.
Are you sure? I can find them!!! Then if I can find them I can count 
them, give to you (even if its don't depend on me, remember your 
skills or your cousins?)


Ah yes, which zope product stores cousin data?
Do you want to store cousins data? you need to create an object that 
stores cousin data




I want to create an object that acts like an entity (like a human or 
a mortage or a paper or a product -that you can sell)


Yes, you crate it - you define its cataloguing. So what is your business
with standard zope objects here?
They are funcionality to my entity. If the entity has a functionality 
that sends mails the entity need to has a mail host object but It's not 
important where do you create it if the entity catalogue it (you can 
always find it if you ask to the entity catalog)


These entity need to know how is it (its properties, its 
characteristics)


You cant barely catalog all properties - the catalog would not even know
if this property is meant as keyword or fulltext or whatever...
don't worry! I want to find them. It's not important what they are or 
where they are


I ask myself if I know myself but I only know about myself all I can 
catalogue

...


Regards
Tino
I don't expect anyone guess my needs (is for that I need to develop 
the class) :)
I only ask if I can add some super classes to an object when  I 
create it :)


You can, you just add it. Its there and you even know its name.
So what was your problem again? :-)
They way to add it (but you point me to find at google monkeypatch isn't 
it? Thanks again)


I know my needs are so particular but I want to create something new 
with a new perspective. If I can the result will be very curious (I 
suppose, I expect even)


I choose Zope because is the most near to my finall result


Exactly :-)

Regards
TIno



--
Mis Cosas
http://blogs.sistes.net/Garito


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

Re: [Zope] Catalog aware

2006-07-20 Thread Martijn Pieters
Please don't email me personally; let's keep this discussion on the list.

Garito wrote:
 Yes, the indexes depends on the entity (I don't know what indexes I use
 until I define the entity but I need to catalog every characteristic of
 the entity)
 
 For example if I have a entity with a container where to put my cousins
 information I will catalog a keyword index called (is an example,
 remeber) HowMuch that counts the number of the objects stored in the
 container
 
 Or if I talk about skills I will catalogue the marks or the way to print
 the certificate of excelence (again an example)

But then you can create specific subclasses that are catalog aware. What
standard objects would you use to implement this? You have a specific,
non-generic use-case that has already been catered for by the framework.

 Making all Zope objects catalog aware by default makes no sense
 though. You have yet to come with a compelling generic use-case, let
 alone with one that convinces me. Why catalog database connectors for
 example? What kind of search are you performing?

 Please, don't think in a particular case, think a way to do that if you
 need

No, we need a use-case. Otherwise you have what we call a YAGNI, a You
aint gonna need it feature that noone will maintain because noone uses it.

A vague notion that you'd like to see this for your application is not a
use-case.

 Have you thought about the potential problems of making all objects
 catalog-aware by default, like potential conflicts and side-effects?

 What kind of side-effects or conflicts (put an example to understand,
 please)

Catalog indexes retrieve their infomation from the object, through a
named attribute. If that attribute is callable, the index calls it, so
it executes the code. That may have side effects not originally forseen
because the original code never anticipated being indexed. This can
happen when the attribute name can mean different things in different
contexts.

Zope is a complex beast, and the idea of making everything catalog aware
is not going to play well.

 I say a big -infinity from me on the whole idea.

 I can't understand the last sentence (my english is a kid english, sorry
 again!)

It means I say no to the idea. A big no.

Martijn Pieters


___
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: [***SPAM*** Score/Req: 04.00/04.00] Re: [Zope] Catalog aware

2006-07-20 Thread Garito

Martijn Pieters escribió:

Please don't email me personally; let's keep this discussion on the list.

Garito wrote:
  

Yes, the indexes depends on the entity (I don't know what indexes I use
until I define the entity but I need to catalog every characteristic of
the entity)

For example if I have a entity with a container where to put my cousins
information I will catalog a keyword index called (is an example,
remeber) HowMuch that counts the number of the objects stored in the
container

Or if I talk about skills I will catalogue the marks or the way to print
the certificate of excelence (again an example)



But then you can create specific subclasses that are catalog aware. What
standard objects would you use to implement this? You have a specific,
non-generic use-case that has already been catered for by the framework.
  
I can't subclass every class I need. These will need to reajust 
(subclass) every new case

For example:
Now I know I need Page Templates and Script Python catalogaware, then I 
subclass them and I finish the work, good


But tomorrow I need a Mail host catalogaware, begin again and create a 
subclass for Mail host


I would like if there are a generic way to add catalogawareness by code. 
If there are my problem about catalogawareness finish
  

Making all Zope objects catalog aware by default makes no sense
though. You have yet to come with a compelling generic use-case, let
alone with one that convinces me. Why catalog database connectors for
example? What kind of search are you performing?
  

Please, don't think in a particular case, think a way to do that if you
need



No, we need a use-case. Otherwise you have what we call a YAGNI, a You
aint gonna need it feature that noone will maintain because noone uses it.

A vague notion that you'd like to see this for your application is not a
use-case.
  
I use these feature then YAGNI converts to AGUT (at least Garito use 
these) ;)

Again I know these way is a very particular way, nothing more

When Zopers define what Zope will be they thing in a particular use 
case? Or Ploners or CMFers? I don't think so


I have a very clear model on my brain that is possible with more or less 
code What I'm trying is to reduce the length of the code I need to put 
these model at Zope
  

Have you thought about the potential problems of making all objects
catalog-aware by default, like potential conflicts and side-effects?
  

What kind of side-effects or conflicts (put an example to understand,
please)



Catalog indexes retrieve their infomation from the object, through a
named attribute. If that attribute is callable, the index calls it, so
it executes the code. That may have side effects not originally forseen
because the original code never anticipated being indexed. This can
happen when the attribute name can mean different things in different
contexts.

Zope is a complex beast, and the idea of making everything catalog aware
is not going to play well.
  
Sure but Zopers don't stops these way only because someone could use it 
in a wrong way
But I can understand the side effects (thanks for the example, it clears 
my doubt)


Why making everything catalog aware is not going to play well?
I only want catalog aware what is on my products area (sometimes bigger 
than others)
  

I say a big -infinity from me on the whole idea.
  

I can't understand the last sentence (my english is a kid english, sorry
again!)



It means I say no to the idea. A big no.
  

Well, sorry for that!

Martijn Pieters


  



--
Mis Cosas
http://blogs.sistes.net/Garito


___
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: [***SPAM*** Score/Req: 04.00/04.00] Re: [Zope] Catalog aware

2006-07-20 Thread Tino Wildenhain

Garito wrote:

Martijn Pieters escribió:

Please don't email me personally; let's keep this discussion on the list.

Garito wrote:
 

Yes, the indexes depends on the entity (I don't know what indexes I use
until I define the entity but I need to catalog every characteristic of
the entity)

For example if I have a entity with a container where to put my cousins
information I will catalog a keyword index called (is an example,
remeber) HowMuch that counts the number of the objects stored in the
container

Or if I talk about skills I will catalogue the marks or the way to print
the certificate of excelence (again an example)



But then you can create specific subclasses that are catalog aware. What
standard objects would you use to implement this? You have a specific,
non-generic use-case that has already been catered for by the framework.
  
I can't subclass every class I need. These will need to reajust 
(subclass) every new case

For example:
Now I know I need Page Templates and Script Python catalogaware, then I 
subclass them and I finish the work, good


But tomorrow I need a Mail host catalogaware, begin again and create a 
subclass for Mail host


haha. I wonder which property of that single MailHost object you
probably use you want to catalog and what exactly would be your
Query to the ZCatalog, once you want to find out...

I would like if there are a generic way to add catalogawareness by code. 
If there are my problem about catalogawareness finish


Speaking of code: did you think about my hint? I mean the one with
the loop - if you have the weird notion you need to make anything
catalogaware, why dont you write a product which iterates over
all other products in zope, and if not catalogaware, generate
a generic catalogaware subclass for you?

Heaven, you could even half way finished by the tiem you feed the thread :-)

Regards
Tino
___
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: [***SPAM*** Score/Req: 04.00/04.00] Re: [Zope] Catalog aware

2006-07-20 Thread Martijn Pieters

On 7/20/06, Garito [EMAIL PROTECTED] wrote:

 No, we need a use-case. Otherwise you have what we call a YAGNI, a You
 aint gonna need it feature that noone will maintain because noone uses it.

 A vague notion that you'd like to see this for your application is not a
 use-case.

I use these feature then YAGNI converts to AGUT (at least Garito use
these) ;)
Again I know these way is a very particular way, nothing more


So, one isolated case doesn't make a generic use case. You still
haven't given us your particular application, only vague handwaving
about how the way you are implementing your ideas needs a catalog.

Until there is a clearly described general need for a feature like
generic catalog-awareness, there is no case for such a feature to go
into the core of Zope.

I must say that of what I have been able to understand of what you are
doing, it sounds to me as if you are approaching your problem in the
wrong way.

Page Templates and Python Scripts are there to implement application
code and presentation, not store application data. The catalog is a
means to find application data based on various aspects of that data.
So Zope provides you with framework code that makes it easy for your
data objects to re-catalogue themselves on changes, but all the
application support objects
don't implement this because they don't, normally, contain data.

If your implementation relies on Python Scripts or Page Templates to
contain application data, you are using the framework in a way it was
not designed to do (for a good reason)! If so, rethink your
application, instead of trying to make the framework fit.

--
Martijn Pieters
___
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: [***SPAM*** Score/Req: 04.00/04.00] Re: [Zope] Catalog aware

2006-07-20 Thread Garito

Martijn Pieters escribió:

On 7/20/06, Garito [EMAIL PROTECTED] wrote:
 No, we need a use-case. Otherwise you have what we call a YAGNI, a 
You
 aint gonna need it feature that noone will maintain because noone 
uses it.


 A vague notion that you'd like to see this for your application is 
not a

 use-case.

I use these feature then YAGNI converts to AGUT (at least Garito use
these) ;)
Again I know these way is a very particular way, nothing more


So, one isolated case doesn't make a generic use case. You still
haven't given us your particular application, only vague handwaving
about how the way you are implementing your ideas needs a catalog.

Until there is a clearly described general need for a feature like
generic catalog-awareness, there is no case for such a feature to go
into the core of Zope.

I must say that of what I have been able to understand of what you are
doing, it sounds to me as if you are approaching your problem in the
wrong way.

Page Templates and Python Scripts are there to implement application
code and presentation, not store application data. The catalog is a
means to find application data based on various aspects of that data.
So Zope provides you with framework code that makes it easy for your
data objects to re-catalogue themselves on changes, but all the
application support objects
don't implement this because they don't, normally, contain data.

If your implementation relies on Python Scripts or Page Templates to
contain application data, you are using the framework in a way it was
not designed to do (for a good reason)! If so, rethink your
application, instead of trying to make the framework fit.


Ok, a real case:

I'm working on a data system (I like the concept data system) for a friend
He is Dj for that I want to create a concept like

Session
   Form - A formulator
   See - Used to view the session on its default view
   Ask - Used to view the session to change it data (to modify the object)
   Edit - Used to change the properties (via Ask view)
   ...

Ask will be something like

tal:b tal:repeat='field Form/get_fields'
 label tal:attributes='for field/getId' /
 tal:b tal:replace='structure field/render' /
/tal:b

As you can see a lot of entities will use the same Ask

I will create a container to store all these kind of functionality to 
use is as a generic Ask
In a normal way I can use adquisition to make these way but I want to 
store things with some kind of order then I define something like


MyFriendsWeb (this is an entity)
   Forms (is not an entity but I use the same product to create it)
  Session - Formulator
  Production - Formulator
   Functionality (is not an entity but I use the same product to create it)
  Ask
  See
  Edit
   Session (this is an entity)
  Form - points to MyFriendsWeb/Forms/Session
  See - Will use the generic one
  Ask - this one too (the generic one)
  ...
   Production (this is an entity)
  Form - points to MyFriendsWeb/Forms/Production
  See - Will use the generic one
  Ask - this one too (the generic one)

MyFriendsWeb is an entity for that reason catalog everything that not in 
another entity like Session


Session is another entity for that catalog See (the pointer one not the 
real See), Ask (like See is a pointer) and so on


What I want is semantic structure not only usefull structure that makes 
that every entity will know everything it can do or be


With my model I use my product for every container, formulators/page 
templates/script pythons like functionality an so on


My product is about 300 lines of code but I can describe everything I need

Is like Plone but with 300 lines of code

My model works but I would like if its possible to use something like

tal:b tal:replace='structure Session/Form/header' /

or

tal:b tal:replace='MyFriendsWeb/Sessions' /

instead of

tal:b tal:define='Form some code to retrieve the form. First if here 
has Form, then in the acquisition context and finally searching on the 
catalog of the entity'

   tal:replace='structure Form/header' /
/tal:b

It works, its only a question of use it as simple as I can

For that my product is a ZCatalog with a property Entity (boolean)
If you mark Entity as true for an object every objects below these one 
are catalogued by my product


I use an override of __bobo_traverse__ and __call__

What do you think?

--
Mis Cosas
http://blogs.sistes.net/Garito


___
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: [***SPAM*** Score/Req: 04.00/04.00] Re: [Zope] Catalog aware

2006-07-20 Thread Martijn Pieters

On 7/20/06, Garito [EMAIL PROTECTED] wrote:

What do you think?


I realize this is probably because English isn't your first language,
but I completely failed to understand there what your application does
or tries to accomplish. I just cannot reconstruct what the application
should do for your friend. Sorry!

--
Martijn Pieters
___
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] Catalog aware

2006-07-19 Thread Garito

Andreas Jung escribió:



--On 18. Juli 2006 15:14:54 +0200 Garito [EMAIL PROTECTED] wrote:


Hi all!

Is possible to create an object (for example a Page Template) and 
make it

catalog aware?


Look at the CatalogAware mixin class.
But with this class I could create a new class of PT Catalog aware, 
isn't it?

I would like to convert a normal PT is this possible?


I wonder why the objects aren't catalogable by default (I need all my
object catalogables)



Because Zope is not CMF and Zope is not Plone. Because you need this 
feature it does not mean that everyone needs this feature by default.


-aj

Sure but Is the cost so big?

--
Mis Cosas
http://blogs.sistes.net/Garito


___
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] Catalog aware

2006-07-19 Thread Andreas Jung



--On 19. Juli 2006 09:34:58 +0200 Garito [EMAIL PROTECTED] wrote:


Andreas Jung escribió:



--On 18. Juli 2006 15:14:54 +0200 Garito [EMAIL PROTECTED] wrote:


Hi all!

Is possible to create an object (for example a Page Template) and
make it
catalog aware?


Look at the CatalogAware mixin class.

But with this class I could create a new class of PT Catalog aware, isn't
it?
I would like to convert a normal PT is this possible?


It makes little sense to index the contents of PTs. PTs are used to present 
a view on a particular instance of your class but not for providing content

itself.



I wonder why the objects aren't catalogable by default (I need all my
object catalogables)



Because Zope is not CMF and Zope is not Plone. Because you need this
feature it does not mean that everyone needs this feature by default.

-aj

Sure but Is the cost so big?


This is not the question. If you need catalog awareness, either implement 
it as stated above or use one of the frameworkslittle need to discuss 
the pros and cons...by default Zope default content-types  don't depend on 
the catalog. CMF and Plone depend on the catalog for various reasons. If 
you have the requirement to use a catalog you have the mentioned options.


-aj



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


Re: [Zope] Catalog aware

2006-07-19 Thread Garito

Andreas Jung escribió:



--On 19. Juli 2006 09:34:58 +0200 Garito [EMAIL PROTECTED] wrote:


Andreas Jung escribió:



--On 18. Juli 2006 15:14:54 +0200 Garito [EMAIL PROTECTED] wrote:


Hi all!

Is possible to create an object (for example a Page Template) and
make it
catalog aware?


Look at the CatalogAware mixin class.
But with this class I could create a new class of PT Catalog aware, 
isn't

it?
I would like to convert a normal PT is this possible?


It makes little sense to index the contents of PTs. PTs are used to 
present a view on a particular instance of your class but not for 
providing content

itself.



I wonder why the objects aren't catalogable by default (I need all my
object catalogables)



Because Zope is not CMF and Zope is not Plone. Because you need this
feature it does not mean that everyone needs this feature by default.

-aj

Sure but Is the cost so big?


This is not the question. If you need catalog awareness, either 
implement it as stated above or use one of the frameworkslittle 
need to discuss the pros and cons...by default Zope default 
content-types  don't depend on the catalog. CMF and Plone depend on 
the catalog for various reasons. If you have the requirement to use a 
catalog you have the mentioned options.


-aj


Yes but what about something like

if self.default_catalog != '': self.reindex_object()

?

I think it's a question of preferences

Then can I inject Catalog awarness to an object?



--
Mis Cosas
http://blogs.sistes.net/Garito


___
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] Catalog aware

2006-07-19 Thread Tino Wildenhain

Garito wrote:

Andreas Jung escribió:



--On 19. Juli 2006 09:34:58 +0200 Garito [EMAIL PROTECTED] wrote:


Andreas Jung escribió:



--On 18. Juli 2006 15:14:54 +0200 Garito [EMAIL PROTECTED] wrote:


Hi all!

Is possible to create an object (for example a Page Template) and
make it
catalog aware?


Look at the CatalogAware mixin class.
But with this class I could create a new class of PT Catalog aware, 
isn't

it?
I would like to convert a normal PT is this possible?


It makes little sense to index the contents of PTs. PTs are used to 
present a view on a particular instance of your class but not for 
providing content

itself.



I wonder why the objects aren't catalogable by default (I need all my
object catalogables)



Because Zope is not CMF and Zope is not Plone. Because you need this
feature it does not mean that everyone needs this feature by default.

-aj

Sure but Is the cost so big?


This is not the question. If you need catalog awareness, either 
implement it as stated above or use one of the frameworkslittle 
need to discuss the pros and cons...by default Zope default 
content-types  don't depend on the catalog. CMF and Plone depend on 
the catalog for various reasons. If you have the requirement to use a 
catalog you have the mentioned options.


-aj


Yes but what about something like

if self.default_catalog != '': self.reindex_object()

?

I think it's a question of preferences

Then can I inject Catalog awarness to an object?


Yes you can. Its possible with so called monkeypatching.
However if you can do that, you better just write
a product w/ subclasses of the standard zope objects and
your CatalogAwareness. Its easy and clean and you dont
interfere with further development of zope.

Regards
Tino
___
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] Catalog aware

2006-07-19 Thread Garito

Tino Wildenhain escribió:

Garito wrote:

Andreas Jung escribió:



--On 19. Juli 2006 09:34:58 +0200 Garito [EMAIL PROTECTED] wrote:


Andreas Jung escribió:



--On 18. Juli 2006 15:14:54 +0200 Garito [EMAIL PROTECTED] wrote:


Hi all!

Is possible to create an object (for example a Page Template) and
make it
catalog aware?


Look at the CatalogAware mixin class.
But with this class I could create a new class of PT Catalog aware, 
isn't

it?
I would like to convert a normal PT is this possible?


It makes little sense to index the contents of PTs. PTs are used to 
present a view on a particular instance of your class but not for 
providing content

itself.



I wonder why the objects aren't catalogable by default (I need 
all my

object catalogables)



Because Zope is not CMF and Zope is not Plone. Because you need this
feature it does not mean that everyone needs this feature by default.

-aj

Sure but Is the cost so big?


This is not the question. If you need catalog awareness, either 
implement it as stated above or use one of the frameworkslittle 
need to discuss the pros and cons...by default Zope default 
content-types  don't depend on the catalog. CMF and Plone depend on 
the catalog for various reasons. If you have the requirement to use 
a catalog you have the mentioned options.


-aj


Yes but what about something like

if self.default_catalog != '': self.reindex_object()

?

I think it's a question of preferences

Then can I inject Catalog awarness to an object?


Yes you can. Its possible with so called monkeypatching.
However if you can do that, you better just write
a product w/ subclasses of the standard zope objects and
your CatalogAwareness. Its easy and clean and you dont
interfere with further development of zope.

Regards
Tino
Sure, but I can't create a new product for every product I'll use only 
to do it catalog aware, isn't it?


Can you say more about monkeypatching?

Thanks!

--
Mis Cosas
http://blogs.sistes.net/Garito


___
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] Catalog aware

2006-07-19 Thread Tino Wildenhain
Garito wrote:
 Tino Wildenhain escribió:
 Garito wrote:
 Andreas Jung escribió:


 --On 19. Juli 2006 09:34:58 +0200 Garito [EMAIL PROTECTED] wrote:

 Andreas Jung escribió:


 --On 18. Juli 2006 15:14:54 +0200 Garito [EMAIL PROTECTED] wrote:

 Hi all!

 Is possible to create an object (for example a Page Template) and
 make it
 catalog aware?

 Look at the CatalogAware mixin class.
 But with this class I could create a new class of PT Catalog aware,
 isn't
 it?
 I would like to convert a normal PT is this possible?

 It makes little sense to index the contents of PTs. PTs are used to
 present a view on a particular instance of your class but not for
 providing content
 itself.


 I wonder why the objects aren't catalogable by default (I need
 all my
 object catalogables)


 Because Zope is not CMF and Zope is not Plone. Because you need this
 feature it does not mean that everyone needs this feature by default.

 -aj
 Sure but Is the cost so big?

 This is not the question. If you need catalog awareness, either
 implement it as stated above or use one of the frameworkslittle
 need to discuss the pros and cons...by default Zope default
 content-types  don't depend on the catalog. CMF and Plone depend on
 the catalog for various reasons. If you have the requirement to use
 a catalog you have the mentioned options.

 -aj

 Yes but what about something like

 if self.default_catalog != '': self.reindex_object()

 ?

 I think it's a question of preferences

 Then can I inject Catalog awarness to an object?

 Yes you can. Its possible with so called monkeypatching.
 However if you can do that, you better just write
 a product w/ subclasses of the standard zope objects and
 your CatalogAwareness. Its easy and clean and you dont
 interfere with further development of zope.

 Regards
 Tino
 Sure, but I can't create a new product for every product I'll use only
 to do it catalog aware, isn't it?

Yes you can. Why not? I mean you are using them - so you can use
your products instead as well.


 Can you say more about monkeypatching?

If you cant figure out (google, imagination)
you better dont do it :-)

The code to monkey-patch is roughly the same
as subclassing. So you better just subclass
and use your products.

Hint: you can use loops in python too .-)

Kind regards
Tino
___
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] Catalog aware

2006-07-19 Thread Garito

Tino Wildenhain escribió:

Garito wrote:
  

Tino Wildenhain escribió:


Garito wrote:
  

Andreas Jung escribió:


--On 19. Juli 2006 09:34:58 +0200 Garito [EMAIL PROTECTED] wrote:

  

Andreas Jung escribió:


--On 18. Juli 2006 15:14:54 +0200 Garito [EMAIL PROTECTED] wrote:

  

Hi all!

Is possible to create an object (for example a Page Template) and
make it
catalog aware?


Look at the CatalogAware mixin class.
  

But with this class I could create a new class of PT Catalog aware,
isn't
it?
I would like to convert a normal PT is this possible?


It makes little sense to index the contents of PTs. PTs are used to
present a view on a particular instance of your class but not for
providing content
itself.

  

I wonder why the objects aren't catalogable by default (I need
all my
object catalogables)



Because Zope is not CMF and Zope is not Plone. Because you need this
feature it does not mean that everyone needs this feature by default.

-aj
  

Sure but Is the cost so big?


This is not the question. If you need catalog awareness, either
implement it as stated above or use one of the frameworkslittle
need to discuss the pros and cons...by default Zope default
content-types  don't depend on the catalog. CMF and Plone depend on
the catalog for various reasons. If you have the requirement to use
a catalog you have the mentioned options.

-aj

  

Yes but what about something like

if self.default_catalog != '': self.reindex_object()

?

I think it's a question of preferences

Then can I inject Catalog awarness to an object?


Yes you can. Its possible with so called monkeypatching.
However if you can do that, you better just write
a product w/ subclasses of the standard zope objects and
your CatalogAwareness. Its easy and clean and you dont
interfere with further development of zope.

Regards
Tino
  

Sure, but I can't create a new product for every product I'll use only
to do it catalog aware, isn't it?



Yes you can. Why not? I mean you are using them - so you can use
your products instead as well.
  
Yes but what if tomorrow you create a product? need work to times: you 
first, me later
In my opinion (is only an opinion) these is not the best situation in a 
future


Sorry but is not so acceptable for me


  

Can you say more about monkeypatching?



If you cant figure out (google, imagination)
you better dont do it :-)

The code to monkey-patch is roughly the same
as subclassing. So you better just subclass
and use your products.

Hint: you can use loops in python too .-)

Kind regards
Tino
  

A! sure, I'll searched at google!

--
Mis Cosas
http://blogs.sistes.net/Garito


___
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] Catalog aware

2006-07-19 Thread Tino Wildenhain
Garito wrote:
...
 Sure, but I can't create a new product for every product I'll use only
 to do it catalog aware, isn't it?
 

 Yes you can. Why not? I mean you are using them - so you can use
 your products instead as well.
   
 Yes but what if tomorrow you create a product? need work to times: you
 first, me later

Who says you have a use for the product I create? Or if it makes
sense to catalog it? If you want a cataloguing framework, why
dont you use CMF or something?

 In my opinion (is only an opinion) these is not the best situation in a
 future
 
 Sorry but is not so acceptable for me

The point is, it makes no sense to catalog Pagetemplates,
Python Scripts, Folders and ZSQL Methods, Mailhosts
and Database connections. These are all standard zope
objects, yet they make catalogable content only in derived
work or when they play together - which is a custom
solution anyway. There you can add whatever cataloguing
awareness you want.


  
 Can you say more about monkeypatching?
 

 If you cant figure out (google, imagination)
 you better dont do it :-)

 The code to monkey-patch is roughly the same
 as subclassing. So you better just subclass
 and use your products.

 Hint: you can use loops in python too .-)

 Kind regards
 Tino
   
 A! sure, I'll searched at google!

great :-)

Regards
Tino


___
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] Catalog aware

2006-07-19 Thread Garito

Tino Wildenhain escribió:

Garito wrote:
...
  

Sure, but I can't create a new product for every product I'll use only
to do it catalog aware, isn't it?



Yes you can. Why not? I mean you are using them - so you can use
your products instead as well.
  
  

Yes but what if tomorrow you create a product? need work to times: you
first, me later



Who says you have a use for the product I create? Or if it makes
sense to catalog it? If you want a cataloguing framework, why
dont you use CMF or something?
  
I want to make every class catalogable only if I point a zcatalog id 
(with self.default_catalog) but If I point it I want to catalogue the object


Now is a search era, isn't it?

Use another framework only to do the objects catalogable?

I love simple things
  

In my opinion (is only an opinion) these is not the best situation in a
future

Sorry but is not so acceptable for me



The point is, it makes no sense to catalog Pagetemplates,
Python Scripts, Folders and ZSQL Methods, Mailhosts
and Database connections. These are all standard zope
objects, yet they make catalogable content only in derived
work or when they play together - which is a custom
solution anyway. There you can add whatever cataloguing
awareness you want.
  
And if I use them dinamically (a user with the role1 use the template 
Ver but a user with the role2 use the template Ver1 for the same 
context)? (I'm not sure if I understand you clear, sorry If I make a 
mistake, please
  
 
  

Can you say more about monkeypatching?



If you cant figure out (google, imagination)
you better dont do it :-)

The code to monkey-patch is roughly the same
as subclassing. So you better just subclass
and use your products.

Hint: you can use loops in python too .-)

Kind regards
Tino
  
  

A! sure, I'll searched at google!



great :-)

Regards
Tino


  



--
Mis Cosas
http://blogs.sistes.net/Garito


___
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] Catalog aware

2006-07-19 Thread Tino Wildenhain
Garito wrote:
 Tino Wildenhain escribió:
 Garito wrote:
 ...
  
 Sure, but I can't create a new product for every product I'll use only
 to do it catalog aware, isn't it?
 
 Yes you can. Why not? I mean you are using them - so you can use
 your products instead as well.
 
 Yes but what if tomorrow you create a product? need work to times: you
 first, me later
 

 Who says you have a use for the product I create? Or if it makes
 sense to catalog it? If you want a cataloguing framework, why
 dont you use CMF or something?
   
 I want to make every class catalogable only if I point a zcatalog id
 (with self.default_catalog) but If I point it I want to catalogue the
 object

And what of the object do you want to catalog?
Which kind of indexes do you want it to support?
What kind of questions do you expect your ZCatalog
(hypothetically) answered? Could you give examples?


 Now is a search era, isn't it?

Yes, search for what and by whom is the question here.

 
 Use another framework only to do the objects catalogable?
 
 I love simple things

So why are you trying to make standard zope objects more
complicated? :)
  
 In my opinion (is only an opinion) these is not the best situation in a
 future

 Sorry but is not so acceptable for me
 

 The point is, it makes no sense to catalog Pagetemplates,
 Python Scripts, Folders and ZSQL Methods, Mailhosts
 and Database connections. These are all standard zope
 objects, yet they make catalogable content only in derived
 work or when they play together - which is a custom
 solution anyway. There you can add whatever cataloguing
 awareness you want.
   
 And if I use them dinamically (a user with the role1 use the template
 Ver but a user with the role2 use the template Ver1 for the same
 context)? (I'm not sure if I understand you clear, sorry If I make a
 mistake, please

This would not be supported by just adding indexing to the standard
objects anyway. You would write a container which supports the bahavior
you want - and while you are at it you can easily add catalogawareness
to that - exactly where and in the way _you_ need it :-)
Individual objects cataloguing themself would get in your way.

Regards
Tino Wildenhain
___
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] Catalog aware

2006-07-18 Thread Garito

Hi all!

Is possible to create an object (for example a Page Template) and make 
it catalog aware?


I wonder why the objects aren't catalogable by default (I need all my 
object catalogables)


Any Idea?

--
Mis Cosas
http://blogs.sistes.net/Garito


___
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] Catalog aware

2006-07-18 Thread Andreas Jung



--On 18. Juli 2006 15:14:54 +0200 Garito [EMAIL PROTECTED] wrote:


Hi all!

Is possible to create an object (for example a Page Template) and make it
catalog aware?


Look at the CatalogAware mixin class.


I wonder why the objects aren't catalogable by default (I need all my
object catalogables)



Because Zope is not CMF and Zope is not Plone. Because you need this 
feature it does not mean that everyone needs this feature by default.


-aj

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


[Zope] Catalog Aware ZClass

2000-06-15 Thread Scott Burton

Hello fellow Zopists, I want to create a catalog aware Zclass. I would like
to include some specific indexable metadata when creating an instance of
that object. So when I add an instance of that object it asks me for some
information that gets indexed by ZCatalog to be searched later on.
I have tried following the instructions given here:
http://www.zope.org/Members/AlexR/CatalogAware
But I noticed there is some information which may be outdated. It also
suggests having to Patch CatalogAwareness.py I am not sure if this is still
required? Or, where do I start? TIA!

Scott


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