[Zope] CatalogAware ZClass with File base class

Fusion Group Fusion Group" <contact@the-fusion-group.com
Mon, 1 May 2000 15:37:48 -0600


This is a multi-part message in MIME format.

------=_NextPart_000_0011_01BFB383.3418EE40
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

I might be barking up the wrong tree with my attempt to make file =
objects catalogaware.  I have a separate ZClass that stores information =
about my File Object (Article or Book) and creating instantiations of =
that ZClass (with the proper code in my ZClass_add method, just like =
your example below) works just fine.  I wanted to store my File Objects =
separate from my information ZClass objects because a single information =
ZClass object might define information for several file objects.=20

Really what this all comes down to is I need a way to programmatically =
add File objects to my Catalog when a new file is uploaded so that it's =
immediately available through the search engine.  Creating a ZClass with =
base (File and CatalogAware) classes was the first thing I thought of, =
but if there is any other way...

If you have any ideas...

I appreciate your help.

Best Regards,

Chad

----- Original Message -----=20
  From: Kevin Dangoor=20
  To: Fusion Group ; zope@zope.org=20
  Sent: Monday, May 01, 2000 3:06 PM
  Subject: Re: [Zope] CatalogAware ZClass with File base class


  Caveat: I've never made a ZClass with File as a base class...

  I just thought I would double check that in your ZClass_add method, =
you do this:

  <dtml-with "createInObjectManager...">
    <dtml-call =
"propertysheet.YourPropSheet.manage_editProperties(REQUEST)">
    <dtml-call reindex_object>
  </dtml-with>

  If you don't store the properties and reindex the object, the object =
will be added to the catalog but won't be particularly useful because =
there won't be any values for the properties stored in the indexes and =
meta data.

  Kevin
    ----- Original Message -----=20
    From: Fusion Group=20
    To: zope@zope.org=20
    Sent: Monday, May 01, 2000 4:27 PM
    Subject: [Zope] CatalogAware ZClass with File base class


    I wanted to make my new File objects CatalogAware so I created a new =
ZClass with CatalogAware and File as my base classes (in that order).  =
When I upload a new file, calling manage_addFile from my ZClass, it of =
course is not made available for my Catalog. =20

    I know I'm doing this wrong, but I'm starting to run out of time on =
this project and can't afford the luxury of fiddling until I figure it =
out anymore.  I probably should have fiddled with Zope a little before I =
used it for a client's project, but it's too late now.


------=_NextPart_000_0011_01BFB383.3418EE40
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2314.1000" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>I might be barking up the wrong tree =
with my=20
attempt to make file objects catalogaware.&nbsp; I have a separate =
ZClass that=20
stores information about my File Object (Article or Book)&nbsp;and =
creating=20
instantiations of </FONT><FONT face=3DArial size=3D2>that ZClass (with =
the proper=20
code in my ZClass_add method, just like your example below) works just=20
fine.&nbsp; I wanted to store my File Objects separate from my =
information=20
ZClass&nbsp;objects because a single information ZClass object might =
define=20
information for several file objects.&nbsp;</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Really what this all comes down to is I =
need a way=20
to programmatically add File objects to my Catalog when a new file is =
uploaded=20
so that it's immediately available through the search engine.&nbsp; =
Creating a=20
ZClass with&nbsp;base (File and CatalogAware) classes was the first =
thing I=20
thought of, but if there is any other way...</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>If you have any ideas...</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I appreciate your help.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Best Regards,</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Chad</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>----- Original Message ----- </DIV>
<BLOCKQUOTE=20
style=3D"BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: =
0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px">
  <DIV=20
  style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: =
black"><B>From:</B>=20
  <A href=3D"mailto:kid@kendermedia.com" =
title=3Dkid@kendermedia.com>Kevin=20
  Dangoor</A> </DIV>
  <DIV style=3D"FONT: 10pt arial"><B>To:</B> <A=20
  href=3D"mailto:contact@the-fusion-group.com"=20
  title=3Dcontact@the-fusion-group.com>Fusion Group</A> ; <A=20
  href=3D"mailto:zope@zope.org" title=3Dzope@zope.org>zope@zope.org</A> =
</DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Sent:</B> Monday, May 01, 2000 3:06 =
PM</DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Subject:</B> Re: [Zope] =
CatalogAware ZClass=20
  with File base class</DIV>
  <DIV><BR></DIV>
  <DIV><FONT size=3D2>Caveat: I've never made a ZClass with File as a =
base=20
  class...</FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT size=3D2>I just thought I would double check that in your =
ZClass_add=20
  method, you do this:</FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT size=3D2>&lt;dtml-with =
"createInObjectManager..."&gt;</FONT></DIV>
  <DIV><FONT size=3D2>&nbsp; &lt;dtml-call=20
  =
"propertysheet.YourPropSheet.manage_editProperties(REQUEST)"&gt;</FONT></=
DIV>
  <DIV><FONT size=3D2>&nbsp; &lt;dtml-call =
reindex_object&gt;</FONT></DIV>
  <DIV><FONT size=3D2>&lt;/dtml-with&gt;</FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT size=3D2>If you don't store the properties and reindex the =
object,=20
  the object will be added to the catalog but won't be particularly =
useful=20
  because there won't be any values for the properties stored in the =
indexes and=20
  meta data.</FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT size=3D2>Kevin</FONT></DIV>
  <BLOCKQUOTE=20
  style=3D"BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; =
MARGIN-RIGHT: 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px">
    <DIV style=3D"FONT: 10pt arial">----- Original Message ----- </DIV>
    <DIV=20
    style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: =
black"><B>From:</B>=20
    <A href=3D"mailto:spencec@the-fusion-group.com"=20
    title=3Dspencec@the-fusion-group.com>Fusion Group</A> </DIV>
    <DIV style=3D"FONT: 10pt arial"><B>To:</B> <A =
href=3D"mailto:zope@zope.org"=20
    title=3Dzope@zope.org>zope@zope.org</A> </DIV>
    <DIV style=3D"FONT: 10pt arial"><B>Sent:</B> Monday, May 01, 2000 =
4:27=20
PM</DIV>
    <DIV style=3D"FONT: 10pt arial"><B>Subject:</B> [Zope] CatalogAware =
ZClass=20
    with File base class</DIV>
    <DIV><BR></DIV>
    <DIV><FONT face=3DArial size=3D2>I wanted to make my new File =
objects=20
    CatalogAware so I created a new ZClass with CatalogAware and File as =
my base=20
    classes (in that order).&nbsp; When I upload a new file, calling=20
    manage_addFile from my ZClass, it of course&nbsp;is not&nbsp;made=20
    available&nbsp;for my Catalog.&nbsp; </FONT></DIV>
    <DIV>&nbsp;</DIV>
    <DIV><FONT face=3DArial size=3D2>I know I'm doing this wrong, but =
I'm starting=20
    to run out of time on this project and can't afford the luxury of =
fiddling=20
    until I figure it out anymore.&nbsp; I probably should have fiddled =
with=20
    Zope a little before I used it for a client's project, but it's too =
late=20
    now.</FONT></DIV>
    <DIV>&nbsp;</DIV></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_0011_01BFB383.3418EE40--