Hi, I am trying to catalog and uncatalog objects into a ZCatalog, but when I uncatalog/catalog I have to do it twice to work. Do I have to index or something like? I`m just doing this: <dtml-call "mycatalog.uncatalog_object(xobject)"> Thanks. ________________________________________________ Don't E-Mail, ZipMail! http://www.zipmail.com/
After Dark wrote:
Hi, I am trying to catalog and uncatalog objects into a ZCatalog, but when I uncatalog/catalog I have to do it twice to work. Do I have to index or something like?
I`m just doing this: <dtml-call "mycatalog.uncatalog_object(xobject)">
Thanks. ________________________________________________
If you create a ZClass with a base class of CatalogAware, it will automatically catalog and uncatalog itself when objects of the class are created and deleted. You also get several method on the object to index, reindex, unindex, etc. See this aged, but still helpful how-to: http://www.zope.org/Members/AlexR/CatalogAware -- | Casey Duncan | Kaivo, Inc. | cduncan@kaivo.com `------------------>
Casey Duncan <cduncan@kaivo.com> said:
If you create a ZClass with a base class of CatalogAware, it will automatically catalog and uncatalog itself when objects of the class are created and deleted. You also get several method on the object to index, reindex, unindex, etc.
I did this today, but it doesn't seem to uncatalog itself on deletion - I put debugging code in the ZCatalog CatalogAware class and the deletion methods weren't called. Furthermore, the catalog name is hardcoded and by the time you get to your constructor method, the add-to-catalog code bit seems to have been executed (or, again, it is not called) - I needed to call the indexing method manually in my ZClass. (Zope 2.3.1) BTW, it's a really neat ZClass: it is called "Virtual Host Folder" and adds itself to a "sites" catalog - it's just CatalogAware and Folder, and contains a single object - a SiteRoot. My AccessRule on the Zope root is a bit custom, it first looks in the catalog for a host folder with a name matching the sitename, and then goes on to do other things based on a database table (like showing redirects, or our business card sites, etcetera). Some maybe useful snippets: -- ZClass constructor set custom catalog: ... <dtml-call "manage_editCataloger(default='sites')"> <dtml-call index_object> ... -- Virtual hosting bit based no catalog (external method in my case, it -- does some more things): def vhost(self, REQUEST): hostname = string.split(REQUEST['HTTP_HOST'], ':')[0] r = self.sites({ 'id': string.replace(hostname, '.', '_')}) if len(r) == 1: path = string.split(r[0].getPath(), '/')[1:] path.reverse() REQUEST['TraversalRequestNameStack'].extend(path) REQUEST.set('SiteRootPATH', '/') else: ... # the other bits :-) --
Ok, I created and use a little bit CatalogAware. But now how can I do this with it? <dtml-call expr="manage_addFile(id='',file=arquivo, title=titulo)"> Can I create a ZClass simulating a file? I want to when I add a file, to be cataloged. And wich command do I use to add a new object of my Zclass? Thanks. On Tue, 17 Apr 2001 09:10:56 -0600 Casey Duncan <cduncan@kaivo.com> wrote:
After Dark wrote:
Hi, I am trying to catalog and uncatalog objects into a ZCatalog, but when I uncatalog/catalog I have to do it
twice
to work. Do I have to index or something like?
I`m just doing this: <dtml-call "mycatalog.uncatalog_object(xobject)">
Thanks. ________________________________________________
If you create a ZClass with a base class of CatalogAware, it will automatically catalog and uncatalog itself when objects of the class are created and deleted. You also get several method on the object to index, reindex, unindex, etc.
See this aged, but still helpful how-to:
http://www.zope.org/Members/AlexR/CatalogAware
-- | Casey Duncan | Kaivo, Inc. | cduncan@kaivo.com `------------------>
-- --Ricardo Kohler Costa ________________________________________________ Don't E-Mail, ZipMail! http://www.zipmail.com/
After Dark wrote:
Ok, I created and use a little bit CatalogAware. But now how can I do this with it?
<dtml-call expr="manage_addFile(id='',file=arquivo, title=titulo)">
Can I create a ZClass simulating a file? I want to when I add a file, to be cataloged. And wich command do I use to add a new object of my Zclass?
Thanks.
Check out: http://www.zope.org/Members/tazzzzz/addZClasses -- | Casey Duncan | Kaivo, Inc. | cduncan@kaivo.com `------------------>
After Dark wrote:
Ok, I created and use a little bit CatalogAware. But now how can I do this with it?
<dtml-call expr="manage_addFile(id='',file=arquivo, title=titulo)">
Can I create a ZClass simulating a file? I want to when I add a file, to be cataloged. And wich command do I use to add a new object of my Zclass?
Yes, just subclass OFS.File Search Zope.org for "Add ZClass". There is a how-to -- | Casey Duncan | Kaivo, Inc. | cduncan@kaivo.com `------------------>
Can I build a ZClass of the type of ZCatalogAware and OFS.file? Should I use it like a file then, or I have to make a property called file, title... Thanks. On Thu, 19 Apr 2001 11:14:26 -0600 Casey Duncan <cduncan@kaivo.com> wrote:
After Dark wrote:
Ok, I created and use a little bit CatalogAware. But now
how
can I do this with it?
<dtml-call expr="manage_addFile(id='',file=arquivo, title=titulo)">
Can I create a ZClass simulating a file? I want to when I add a file, to be cataloged. And wich command do I use to add a new object of my Zclass?
Yes, just subclass OFS.File
Search Zope.org for "Add ZClass". There is a how-to
-- | Casey Duncan | Kaivo, Inc. | cduncan@kaivo.com `------------------>
-- --Ricardo Kohler Costa ________________________________________________ Don't E-Mail, ZipMail! http://www.zipmail.com/
After Dark wrote:
Can I build a ZClass of the type of ZCatalogAware and OFS.file? Should I use it like a file then, or I have to make a property called file, title...
Thanks.
Yes, and make sure CatalogAware is the first base class. It's picky about that. You will then get an object that looks like a file, but is CatalogAware and you can make custom methods and property sheets for it. -- | Casey Duncan | Kaivo, Inc. | cduncan@kaivo.com `------------------>
I did that, creates a ZClass of ZCatalogAware and OFS.file, but when I try to add a new element gives the following error: type error unsliceable object But I did the same as others examples that worked, the only diference was that they were just ZCatalogAware. Thanks. On Thu, 19 Apr 2001 12:19:11 -0600 Casey Duncan <cduncan@kaivo.com> wrote:
After Dark wrote:
Can I build a ZClass of the type of ZCatalogAware and OFS.file? Should I use it like a file then, or I have to make a property called file, title...
Thanks.
Yes, and make sure CatalogAware is the first base class. It's picky about that.
You will then get an object that looks like a file, but is CatalogAware and you can make custom methods and property sheets for it.
-- | Casey Duncan | Kaivo, Inc. | cduncan@kaivo.com `------------------>
-- --Ricardo Kohler Costa ________________________________________________ Don't E-Mail, ZipMail! http://www.zipmail.com/
There's an example at http://www.zope.org/Members/lstaffor/zProperties that is similar to what you want to do. That example is getting yellow around the edges, so if you did all the steps in that example but still got an error, maybe it's the example that need to be corrected. -- Loren
-----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of After Dark Sent: Thursday, April 19, 2001 11:49 To: Casey Duncan Cc: zope@zope.org Subject: Re: [Zope] Cataloging and uncataloging...
I did that, creates a ZClass of ZCatalogAware and OFS.file, but when I try to add a new element gives the following error:
type error unsliceable object
But I did the same as others examples that worked, the only diference was that they were just ZCatalogAware.
Thanks.
On Thu, 19 Apr 2001 12:19:11 -0600 Casey Duncan <cduncan@kaivo.com> wrote:
After Dark wrote:
Can I build a ZClass of the type of ZCatalogAware and OFS.file? Should I use it like a file then, or I have to make a property called file, title...
Thanks.
Yes, and make sure CatalogAware is the first base class. It's picky about that.
You will then get an object that looks like a file, but is CatalogAware and you can make custom methods and property sheets for it.
-- | Casey Duncan | Kaivo, Inc. | cduncan@kaivo.com `------------------>
-- --Ricardo Kohler Costa ________________________________________________ Don't E-Mail, ZipMail! http://www.zipmail.com/
_______________________________________________ Zope maillist - Zope@zope.org 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 )
After Dark wrote:
I did that, creates a ZClass of ZCatalogAware and OFS.file, but when I try to add a new element gives the following error:
type error unsliceable object
But I did the same as others examples that worked, the only diference was that they were just ZCatalogAware.
Thanks.
This is a bug in the way the ZClass passes the id to the ObjectManager (Folder). It appears to be fixed in 2.3.2 -- | Casey Duncan | Kaivo, Inc. | cduncan@kaivo.com `------------------>
I hope so... Thanks, people! On Thu, 19 Apr 2001 13:36:36 -0600 Casey Duncan <cduncan@kaivo.com> wrote:
After Dark wrote:
I did that, creates a ZClass of ZCatalogAware and
OFS.file,
but when I try to add a new element gives the following error:
type error unsliceable object
But I did the same as others examples that worked, the only diference was that they were just ZCatalogAware.
Thanks.
This is a bug in the way the ZClass passes the id to the ObjectManager (Folder). It appears to be fixed in 2.3.2
-- | Casey Duncan | Kaivo, Inc. | cduncan@kaivo.com `------------------>
-- --Ricardo Kohler Costa ________________________________________________ Don't E-Mail, ZipMail! http://www.zipmail.com/
Somebody knows if this resource (email below - ZClass) is fixed in 2.3.2?? And any changes in ZCatalog that solve tha accentuation problem??? Thanks. -- --Ricardo Kohler Costa Casey Duncan <cduncan@kaivo.com> wrote:
After Dark wrote:
I did that, creates a ZClass of ZCatalogAware and
OFS.file,
but when I try to add a new element gives the following error:
type error unsliceable object
But I did the same as others examples that worked, the only diference was that they were just ZCatalogAware.
Thanks.
This is a bug in the way the ZClass passes the id to the ObjectManager (Folder). It appears to be fixed in 2.3.2
-- | Casey Duncan | Kaivo, Inc. | cduncan@kaivo.com `------------------>
-- --Ricardo Kohler Costa ________________________________________________ Don't E-Mail, ZipMail! http://www.zipmail.com/
ZCatalog indexes words with accentuation, when made a search without the accent it doesn't bring the accentuated word. Example: search: top --> three results. search: tóp --> ten results. Solutions??? Chris Withers <chrisw@nipltd.com> wrote:
Chris McDonough wrote:
And any changes in ZCatalog that solve tha
accentuation
problem???
What's the "accentuation problem"?
He probably means the splitter doing stupid things with accentuated characters...
cheers,
Chris
-- --Ricardo Kohler Costa ________________________________________________ Don't E-Mail, ZipMail! http://www.zipmail.com/
Why should it bring back both? Surely they are different words? ----- Original Message ----- From: "After Dark" <afterz@zipmail.com> To: "Chris Withers" <chrisw@nipltd.com>; "Chris McDonough" <chrism@digicool.com> Cc: "Casey Duncan" <cduncan@kaivo.com>; <zope@zope.org> Sent: Thursday, May 17, 2001 1:44 PM Subject: Re: [Zope] Zope 2.3.2 version
ZCatalog indexes words with accentuation, when made a search without the accent it doesn't bring the accentuated word.
Example: search: top --> three results. search: tóp --> ten results.
Solutions???
Chris Withers <chrisw@nipltd.com> wrote:
Chris McDonough wrote:
And any changes in ZCatalog that solve tha
accentuation
problem???
What's the "accentuation problem"?
He probably means the splitter doing stupid things with accentuated characters...
cheers,
Chris
-- --Ricardo Kohler Costa ________________________________________________ Don't E-Mail, ZipMail! http://www.zipmail.com/
_______________________________________________ Zope maillist - Zope@zope.org 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 )
When you make a search in a site, for example AltaVista, how does it work?? The site ignores accentuation. I realy need to do that. The search has to bring related results to the keyword, not only results that has it. A basic feature to do that is to ignore accentuation. Maybe in english that doesn`t make much diference, but in many other languages, like in portuguese that has almost the half of the words with accents, it is impossible to have a search without it. So, someone see any solution? Thanks. "Phil Harris" <phil.harris@zope.co.uk> wrote:
Why should it bring back both?
Surely they are different words?
----- Original Message ----- From: "After Dark" <afterz@zipmail.com> To: "Chris Withers" <chrisw@nipltd.com>; "Chris McDonough" <chrism@digicool.com> Cc: "Casey Duncan" <cduncan@kaivo.com>; <zope@zope.org> Sent: Thursday, May 17, 2001 1:44 PM Subject: Re: [Zope] Zope 2.3.2 version
ZCatalog indexes words with accentuation, when made a search without the accent it doesn't bring the accentuated word.
Example: search: top --> three results. search: tóp --> ten results.
Solutions???
Chris Withers <chrisw@nipltd.com> wrote:
Chris McDonough wrote:
And any changes in ZCatalog that solve tha
accentuation
problem???
What's the "accentuation problem"?
He probably means the splitter doing stupid things with accentuated characters...
cheers,
Chris
-- --Ricardo Kohler Costa ________________________________________________ Don't E-Mail, ZipMail! http://www.zipmail.com/
_______________________________________________ Zope maillist - Zope@zope.org 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 )
-- --Ricardo Kohler Costa ________________________________________________ Don't E-Mail, ZipMail! http://www.zipmail.com/
Well, the Catalog doesn't do that. Sorry! - C ----- Original Message ----- From: "After Dark" <afterz@zipmail.com> To: "Phil Harris" <phil.harris@zope.co.uk>; "Chris Withers" <chrisw@nipltd.com>; "Chris McDonough" <chrism@digicool.com> Cc: "Casey Duncan" <cduncan@kaivo.com>; <zope@zope.org> Sent: Thursday, May 17, 2001 11:30 AM Subject: Re: [Zope] Zope 2.3.2 version When you make a search in a site, for example AltaVista, how does it work?? The site ignores accentuation. I realy need to do that. The search has to bring related results to the keyword, not only results that has it. A basic feature to do that is to ignore accentuation. Maybe in english that doesn`t make much diference, but in many other languages, like in portuguese that has almost the half of the words with accents, it is impossible to have a search without it. So, someone see any solution? Thanks. "Phil Harris" <phil.harris@zope.co.uk> wrote:
Why should it bring back both?
Surely they are different words?
----- Original Message ----- From: "After Dark" <afterz@zipmail.com> To: "Chris Withers" <chrisw@nipltd.com>; "Chris McDonough" <chrism@digicool.com> Cc: "Casey Duncan" <cduncan@kaivo.com>; <zope@zope.org> Sent: Thursday, May 17, 2001 1:44 PM Subject: Re: [Zope] Zope 2.3.2 version
ZCatalog indexes words with accentuation, when made a search without the accent it doesn't bring the accentuated word.
Example: search: top --> three results. search: tóp --> ten results.
Solutions???
Chris Withers <chrisw@nipltd.com> wrote:
Chris McDonough wrote:
And any changes in ZCatalog that solve tha
accentuation
problem???
What's the "accentuation problem"?
He probably means the splitter doing stupid things with accentuated characters...
cheers,
Chris
-- --Ricardo Kohler Costa ________________________________________________ Don't E-Mail, ZipMail! http://www.zipmail.com/
_______________________________________________ Zope maillist - Zope@zope.org 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 )
-- --Ricardo Kohler Costa ________________________________________________ Don't E-Mail, ZipMail! http://www.zipmail.com/ _______________________________________________ Zope maillist - Zope@zope.org 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 )
Hi, I am having problems with ZClass. I`m creating a ZClass with base class OFS:File, but when I add an object of my new type it doesn`t work like it should. I can add a new object like an usual file, but when I want to view it, just show the path of the file, not data of the file. Is it a bug? Or am I doing something wrong? Thanks. ________________________________________________ Don't E-Mail, ZipMail! http://www.zipmail.com/
After Dark wrote:
ZCatalog indexes words with accentuation, when made a search without the accent it doesn't bring the accentuated word.
Example: search: top --> three results. search: tóp --> ten results.
Solutions???
None right now that don't involve programming, sorry...
participants (7)
-
After Dark -
Casey Duncan -
cg@cdegroot.com -
Chris McDonough -
Chris Withers -
Loren Stafford -
Phil Harris