[Zope] Re: [Zope-dev] Creating a namespace

2001-01-29 Thread Casey Duncan

Stephan Richter wrote:
> 
> Hello everyone,
> 
> I want to make my own name space with the following situation:
> 
> class X:
> 
> attributes = {'foo': 'bar'}
> 
> x = X()
> 
> Then I want to use it like that:
> 
> 
>   
> 
> 
> The result should be : bar
> 
> I found out that I have to somehow use TemplateDict and InstanceDict, but I
> have no clue how to use itOf course there is no documentation on any
> web site or in the Zope code itself
> 
> Thanks for you help!!!
> 
> Regards,
> stephan
> --
> Stephan Richter
> CBU - Physics and Chemistry Student
> Web2k - Web Design/Development & Technical Project Management
> 


I think the key to your problem is the "mapping" option of dtml-with. If
your class/External method returns a dictionary, you can add it to the
namespace like so:





You do not need to explicitly create a new InstanceDict yourself,
dtml-with takes care of that.

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

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




[Zope] Re: [Zope-dev] ZCatalog and 'fuzzy logic'

2001-01-10 Thread Casey Duncan

--- "Morten W. Petersen" <[EMAIL PROTECTED]> wrote:
[snip]
> 
> It seems I misunderstood the term fuzzy logic
> myself.  Fuzzy logic means
> if I search for a word, for example 'programmer', it
> will return matches
> to the words 'program', 'programming','programmable'
> etc.
> 
> I.e., it will somewhat intelligently return words
> that are similar in
> what they mean, using grammar rules (chopping off
> endings of words and
> making them match others).
> 
> Hmm.
> 
> Cheers,
> 
> Morten
> 

ZCatalog TextIndexes support this type of "wildcard"
searching. I posted a message a couple of weeks ago
that describes the query syntax. Search the mailing
list archives for it.


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

__
Do You Yahoo!?
Yahoo! Photos - Share your holiday photos online!
http://photos.yahoo.com/

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




RE: [Zope] Newbie help - method needs auth > anonymous. WHY?

2000-11-09 Thread Casey Duncan

John Wrote:
[snip]
> I am trying to use this method called objectList:
>
> 
>   
> 
>   
> 
>
> I've put it in the standard_html_header.
[snip]
> When I try looking at the root page (http://john:8080) I have to provide
authentication before the page will display.

What your method is doing, is stepping through every object at the root of
your Zope server. Not every object there is accessible by anonymous. Even in
a fresh Zope installation, Control_Panel is restricted to managers, so that
is the likely culprit.

To get around this problem, there is an argument for dtml-in called
"skip_unauthorized" which will automatically skip over any objects that the
current user is not authorized to access.

Changing your dtml-in statement to:


Will prevent this error. However, you will get every little object in your
root directory. So, standard_html_header, index_html, standard_html_footer,
etc. will appear. If you want to exclude these, specify just the meta types
you want to objectValues. For instance, to show only folders try this:



To show folders and DTML documents, try this:


etc., etc.

hth,
Casey D.


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




RE: [Zope] ZSql Strange Error

2000-11-02 Thread Casey Duncan

Duh, maybe I should learn to read.

Maybe try this sql:

select codigo, nome, case when codigo in

select codigo from user_codigo
where username = 
and tipo = 'E' )
  then 'selected' else null end as select_attr
from cad_exportacao;

Then your dtml method:



   >



Let me know if this is any better,

Casey D.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, November 02, 2000 12:08 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [Zope] ZSql Strange Error


> I'm not sure why this should *crash* zope, but you can do it with a much
> simpler query and a little DTML coding. The following should work
> (UNTESTED):

It cannot help me.

I have two tables. One called cad_exportacao, and the other is called
user_codigo. The table user_codigo maps every username with one or more
rows at cad_exportacao. I wanna fill a SELECT input with all rows in
cad_exportacao, but wanna all the records that exists for 'username' in
user_codigo to be selected.

There was the howto that explains how to do this at
http://www.zope.org/Members/Roug/select_with_multiple, but it not works
for me...

[]s
--
César A. K. Grossmann
http://members.xoom.com/ckant/


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




RE: [Zope] ZSql Strange Error

2000-11-02 Thread Casey Duncan

Cesar A. K. Grossmann wrote:

> Hi!
>
> I'm trying to emulate an outter join in a Z SQL, but Zope crashes every
> time I try the query.
...
> What is wrong? What I can do to get the job done (I need to fill an
> multiselect with 'codigo', 'nome' from 'cad_exportacao', and if exists
> any 'codigo' for 'username' in 'user_codigo', the option must be
> selected - I tryed the "Filling MULTIPLE SELECT ... HOWTO', but it
> doesn't works for me, and I don't know why)?

I'm not sure why this should *crash* zope, but you can do it with a much
simpler query and a little DTML coding. The following should work
(UNTESTED):

Z SQL Method (named sql_query):

select codigo, nome, tipo
from cad_exportacao;

DTML Method:



Selected>




hth,
Casey D.


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




RE: [Zope] Version Control in Zope / Managing releases

2000-09-22 Thread Casey Duncan


   1) "Code Collisions."  - Developers overwriting each other's work.
   2) Partial updates - Right now, we have new pages for marketing
   content that are held up because we don't have our new features for
   the application done yet.  So we can't update marketing pages without
   updating the app at the same time, (one ZODB) unless we directly
   update the production servers. (Eeek!)


Forgive me if this is overly simplistic, but these problems can both be
addressed or at least worked around by using versions, no?

Each developer should have his/her own version object. To lock the object
(and solve #1), a developer just needs to open it and click change. Then to
unlock whatever was worked on and commit it, save the changes to the
version. Granted this means only one person can work on an object at one
time. This can be worked around by proper modularization of your app. Also,
developers need to remember to save their version changes so that others can
work on those objects too. This also has a side benefit of letting you
document your changes in a more meaningful way. Also, an entire set of
changes can be rolled back if it breaks something.

#2 is more about what versions were designed for. Just work on the app code
in a version and don't commit it until it's ready. Granted this assumes that
you have sufficiently separated the data, layout and code and aren't using a
lot of external methods. If this isn't a possible solution, I would just
create a production version of the feature in one folder that might not be
complete but can be updated, and work on a second copy in another folder
that isn't accessible to everyone yet.

If this won't work please elaborate on your design and maybe someone will
have better idea.

Good Luck!
-Casey Duncan


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




RE: [Zope] Strange behaviour on authorization

2000-08-21 Thread Casey Duncan

The fact that your external method returns a class instance explains why it
fails where it does instead of in the dtml-let statement. It looks as though
Zope is allowing the object to be returned, but balking when you try to
access it. I think I will need to see exactly what your external method and
the returned object are doing before I can try explaining this behavior.

-Casey Duncan

-Original Message-
From: Jarkko Veijalainen [mailto:[EMAIL PROTECTED]]
Sent: Monday, August 21, 2000 1:17 AM
To: '[EMAIL PROTECTED]'
Cc: '[EMAIL PROTECTED]'
Subject: RE: [Zope] Strange behaviour on authorization


now, i have defined same owner to every document in that folder, but it
did'nt help me.

I cranked litle bit my pages and discovered little more where is the
problem. Problem isn't POSTING data, it's the return value that Zope doesn't
want to publish.





User  




  




Problem tag is  that that causes following traceback,
when i remove this tag. Traceback bugs me about Unauthorized: account, which
is 2nd value from external methods returned object resDTML.
So problem is publishing contest of resDTML called in -tags. This
don't make any sense if i have to validate every return value from external
method, it's just unacceptable. In external method, i have simple class and
instance of that class is return value of method. I repeat this again, ALL
THIS THINGS DID work with Zope 2.1.6. How can i fix this?


Traceback (innermost last):
File /usr/local/Zope-2.2.0/lib/python/ZPublisher/Publish.py, line 222,
in publish_module
File /usr/local/Zope-2.2.0/lib/python/ZPublisher/Publish.py, line 187,
in publish
File /usr/local/Zope-2.2.0/lib/python/ZPublisher/Publish.py, line 171,
in publish
File /usr/local/Zope-2.2.0/lib/python/ZPublisher/mapply.py, line 160, in
mapply
  (Object: email_accounts)
File /usr/local/Zope-2.2.0/lib/python/ZPublisher/Publish.py, line 112,
in call_object
  (Object: email_accounts)
File /usr/local/Zope-2.2.0/lib/python/OFS/DTMLDocument.py, line 171, in
__call__
  (Object: email_accounts)
File /usr/local/Zope-2.2.0/lib/python/DocumentTemplate/DT_String.py,
line 502, in __call__
  (Object: email_accounts)
File /usr/local/Zope-2.2.0/lib/python/DocumentTemplate/DT_Let.py, line
147, in render
  (Object: resDTML="Imap('Authentication',REQUEST,1)")
File /usr/local/Zope-2.2.0/lib/python/DocumentTemplate/DT_Util.py, line
337, in eval
  (Object: resDTML.cn)
  (Info: resDTML)
File , line 0, in ?
File /usr/local/Zope-2.2.0/lib/python/DocumentTemplate/DT_Util.py, line
142, in careful_getattr
File /usr/local/Zope-2.2.0/lib/python/OFS/DTMLMethod.py, line 194, in
validate
  (Object: email_accounts)
File /usr/local/Zope-2.2.0/lib/python/AccessControl/SecurityManager.py,
line 139, in validate
File
/usr/local/Zope-2.2.0/lib/python/AccessControl/ZopeSecurityPolicy.py, line
159, in validate
  Unauthorized: cn

jarkkov


> try so POST data to email_headers with login form, popups Authorization
> failed window. I have tried to use my manager and superuser name and same
> values that i submitted, but nothing is accepted to auth. window.
...
> so i have authenticated user and i still can't login. All these documents
> work like they're supposed to in Zope 2.1.6, but not anymore when i
> installed Zope 2.2.0 on Solaris. Why is Zopesecurity trying to validate
> 'cn', which is value that i submit to another document.
>
> What went wrong here and how i fix this problem?

Aha, it worked in 2.1.6 eh? That's the tip off. A *major* change between
2.1.x and 2.2.x is in the security dept. 2.2.x runs all methods using the
security level of the _owner_ of the method, regardless of whether this is a
lower or higher level than the currently authenticated user. My guess is
that your method has no owner (which is what pre-2.2.x objects default to
when run under 2.2.x). This means it is running as anonymous which does not
have rights to do what you want. Specify an owner for the method that has
sufficient rights to do what you want and try it again.



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




RE: [Zope] Merging multiple catalogs

2000-08-18 Thread Casey Duncan

There exists a howto on this very subject:

http://www.zope.org/Members/Zen/howto/AdvZCatalogSearching

Look under the "Or" section. Very helpful suggestions.

Enjoy,
Casey Duncan

-Original Message---
From: "Andy McKay" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Subject: [Zope] Merging multiple catalogs
Date: Fri, 18 Aug 2000 09:34:17 -0700
charset="iso-8859-1"

Before I go off into coding mode has anybody had to deal with merging
results from multiple catalogs? I have several catalogs and I would like to
make this transparent by only having one search results interface. I quickly
made one Catalog indexing multiple Catalogs but the result is multiple sets
of records returned...

Thanks.

--
 Andy McKay, Developer, ActiveState
 http://www.ActiveState.com
 Programming for the People


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




RE: [Zope] Strange behaviour on authorization

2000-08-18 Thread Casey Duncan

Jarkko Veijalainen wrote:
> i have been trying to figure this out and get help to this almost one
> week...
...
> Zope loads login form with no problem (it's basicly static page) but when
i
> try so POST data to email_headers with login form, popups Authorization
> failed window. I have tried to use my manager and superuser name and same
> values that i submitted, but nothing is accepted to auth. window.
...
> so i have authenticated user and i still can't login. All these documents
> work like they're supposed to in Zope 2.1.6, but not anymore when i
> installed Zope 2.2.0 on Solaris. Why is Zopesecurity trying to validate
> 'cn', which is value that i submit to another document.
>
> What went wrong here and how i fix this problem?

Aha, it worked in 2.1.6 eh? That's the tip off. A *major* change between
2.1.x and 2.2.x is in the security dept. 2.2.x runs all methods using the
security level of the _owner_ of the method, regardless of whether this is a
lower or higher level than the currently authenticated user. My guess is
that your method has no owner (which is what pre-2.2.x objects default to
when run under 2.2.x). This means it is running as anonymous which does not
have rights to do what you want. Specify an owner for the method that has
sufficient rights to do what you want and try it again.

Good luck,
-Casey Duncan


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




RE: [Zope] substring search on zcatalog textindex

2000-08-14 Thread Casey Duncan

This is illuminating. I have a question maybe you (or somebody else) could
answer:

Searching TextIndexes you can use "and", "or" or "andnot" as query criteria.
I also see support in the source code for near searches using "..." in the
query string. I have not been able to get this to work (although the first
three work great for me), and would like to.

Am I missing something?

-Original Message-
From: R. David Murray [mailto:[EMAIL PROTECTED]]
Sent: Monday, August 14, 2000 12:59 PM
To: Chris Withers
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [Zope] substring search on zcatalog textindex


On Thu, 10 Aug 2000, Chris Withers wrote:
> Casey Duncan wrote:
> > TextIndexes index individual words separately (using a vocabulary object
to
> > identify each word in the catalog). All non-alphanumeric characters
(such as
> > punctuation) are dropped so that excludes searching for "?" or "*" or
any
> > other non-alphanumerics using TextIndexes.
>
> IIRC, you can use another Vocabulary that wouldn't necessarilly behave
> like that.
> I wonder if this works yet?
>
> If it does, my initial question still remains ;-)

In fact, to use substring matching on a text index, you have to
set the Vocabulary to support it *when you first create the ZCatalog*.
Which seems a little bit broken to me, since unless I missed
something you have to choose not to add a vocabulary when you first
create the ZCatalog, and then go add one with substring checked
from the management screens afterwards.  In the code the difference
between the checkbox checked and not checked is two different
lexicon implementations, not just the setting of a flag.  So you
can't just change the flag, you have to see to it that the whole
lexicon gets rebuilt.  I haven't checked into how you do that yet
.

As for your question about different vocabularies, punctuation,
and globbing support, all of that happens at the lexicon level.
That is, the lexicon implements the breaking up of strings into
indexable words (calling the splitter) and it also implements the
expansion of wildcards into matches.  It gets to do that *before*
the text index machinery parses the query, so it can decide on the
syntax rules, as far as I can see.  So if you want a Vocabulary
that supports punctuation and globbing, you'll have to write one,
and then *you* get to decide what the syntax is to handle the case
you ask about .

--RDM



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




RE: [Zope] namespace conflict question needs explanation

2000-08-14 Thread Casey Duncan

Jason Cunliffe Wrote:
> Hello
>
> Please can someone help us understand how to avoid DTML method names
> conflicting with other zope objects with same name.
...
> 2. Below this my DTML file includes calls to this template like this:

> 
> 
> 
> 
> 
> 
...
> It provokes me to ask simply what is the search path priority of object
> acquistion in zope and how do you control it safely?

This appears to be a classic aquisition gotcha. You can use the "only"
option of the
dtml-with tag to eliminate namespace conflicts. However, in this case I
might suggest passing the parameters directly to objemedswf instead of using
REQUEST. like so:



This leaves no ambiguity about what is being called, where it is located and
what is being passed to it. This creates more readable code IMHO.

-Casey Duncan


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




Re: [Zope] accessing PARENTS from python???

2000-08-14 Thread Casey Duncan

>Kevin Howe wrote:
>>
>> I am trying to access the PARENT of an object in a python class of mine.
>> I want to use the absolute_url() of the parent in a variable.
>>
>> I though it could be done the following way, but got an error:
>>
>>  parent=self.PARENTS[0]
>>  aurl = parent.absolute_url()
>>
>> I then tried using REQUEST. It works, but doesn't give the correct
>> information. Instead of giving me the parent  of the current
object(self),
>> it gives the parent of the DTML page in which the object was called.
>>
>>  parent=self.REQUEST.PARENTS[0]
>>  aurl = parent.absolute_url()
>>
>> How do you resolve the PARENT object of an object?
>
>you might want to try an alternative method using acquisition
>
>aurl = self.aq_parent.absolute_url()
>
>Kapil

This should also work:

aurl = self.getParentNode().absolute_url()


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




RE: [Zope] JavaScript help!

2000-08-14 Thread Casey Duncan

How about:

document.manage_edit_form["data:text"]

---Original Message
From: "Peter Be" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Subject: [Zope] JavaScript help!
Date: Sun, 13 Aug 2000 17:18:24 +0100
charset="iso-8859-1"

Maybe not a Zope specific question but the problem arises only with Zope
DTML.

The documentEdit.dtml page in OFS has this little HTML:


And what I want to do is trigger a JavaScript that replaces specific
characters in the textarea box to others.
I.e. Replace swedish ö with HTML: ö

The problem is the name of the textarea box!
It is called "name:text"
If I replace the name of the textarea box to say "data", then my JavaScript
works fine.
I have tried to "eval" the box, but to no effect.
Any ideas??


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




RE: [Zope] substring search on zcatalog textindex

2000-08-10 Thread Casey Duncan

TextIndexes index individual words separately (using a vocabulary object to
identify each word in the catalog). All non-alphanumeric characters (such as
punctuation) are dropped so that excludes searching for "?" or "*" or any
other non-alphanumerics using TextIndexes.

Not much of this is formally documented, but you can review the source (in
Python and C) for the indexing mechanism in:

{YourZopeDir}/lib/python/SearchIndex

-Original Message-
From: Chris Withers [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 10, 2000 2:37 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [Zope] substring search on zcatalog textindex


Casey Duncan wrote:
>
> > So the question is, does anyone know of a simple way to get the zcatalog
> to
> > also find substring matches on a textindex?
> >
> > --
> > Peter Armstrong
>
> For Text Indexes you can use wildcards like * and ? in searches. So that
> searching for Foo* would find Foo, FooBar, fool, etc. I'm not sure if this
> works for Field or Keyword indexes though, I haven't tried it. My though
is
> it only works for text indexes which should help you anyway.

What do you do if you actually want to search for a '*' or a '?' ?

cheers,

Chris


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




RE: [Zope] substring search on zcatalog textindex

2000-08-09 Thread Casey Duncan

> So the question is, does anyone know of a simple way to get the zcatalog
to
> also find substring matches on a textindex?
>
> --
> Peter Armstrong

For Text Indexes you can use wildcards like * and ? in searches. So that
searching for Foo* would find Foo, FooBar, fool, etc. I'm not sure if this
works for Field or Keyword indexes though, I haven't tried it. My though is
it only works for text indexes which should help you anyway.

Good Luck,
Casey Duncan


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




RE: [Zope] Very strange problem with updating an objects properties

2000-08-09 Thread Casey Duncan

> I have made two products, one news-product and one product for
> pressreleases. ... For news this works perfectly but for pressreleases
this doesnt
> work. I am completely puzzled because the code for doing this is the
> same for both of them. Here is how it looks:
>
>  
>
>  
>  
...

You could save a line by calling this a little differently by using
manage_changeProperties instead:

change this:
  
  

to this:
  

> So the updating of both of the products are done by  "_[objId].propertysheets[1].manage_editProperties(REQUEST)"> but when I
> try to update pressreleases is says I am unauthorized.

This is probably an ownership issue. Make sure the DTML method's owner has
manager rights. In Zope 2.2 the user running a method takes on the security
level of the owner of the method even if it is lower than that of the user.
This is in order to prevent certain trojan horse type attacks.

Good Luck,
Casey Duncan



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




[Zope] (no subject)

2000-08-07 Thread Casey Duncan

Simon Coles writes:
 > We have binary files stored in Zope, for example Word documents (but
 > could be any of a variety of document types).
 >
 > We would like to be able to index and search the contents of these
 > files using ZCatalog. So if a Word file contains the word "Fred",
 > then any search for "Fred" would include that file in the list of
 > documents returned.

I have done something similar. I created a ZClass subclassing CatalogAware
and File. I added a property called text which is text indexed in a catalog.
When a Word document is added, a method I created uses the wvHtml utility to
convert the Word document to text and store it in the text property. It has
kind of a kludgey implementation at the moment, mostly because I want to
create a Python wrapper around the wv library, but it's documentation is
sketchy and I have other priorities at the moment. It does work though and
lets you search Word documents using a ZCatalog quite effectively (although
it only works for Word docs).

Check out wv at http://www.wvware.com/


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




[Zope] ZODB or not ZODB?

2000-06-16 Thread Casey Duncan

I am implementing a document Library using Zope. It has an exhaustive index
with several thousand topics in an outline residing on a PostgreSQL
database. This works well and I like it.

My question is where is the best place to store the documents themselves?
They will be static HTML documents ranging from 1-50Kb in size roughly.
There will probably be at least 10,000-15,000 of these documents in the
library once all is said and done.

In my mind I have three options:

1. Store them on the filesystem.
2. Store them in a PgSQL table as blobs.
3. Store them as DTML Docs in the ZODB.

I would like to eventually have full text searching capabilities, so that
makes #1 less attractive (I would likely need my own Python method to do
it). #2 is somewhat of a pain to implement due to limitations in the PgSQL
row size and text searching would be slow. With #3 I could in theory use a
ZCatalog to implement the searching, so that is done for me.

Is ZODB up to the task of storing this quantity of objects? What problems
might I run into? Is it a wise idea, could a data.fs file of this size
(~3-400MB) become too easily corrupted? Should I use a separate data.fs file
just to store the documents (ie using mountedFileStorage)? Or is it better
to use method #1 or #2? Information from anyone with experience in this
regard is greatly appreciated.

-Casey Duncan
[EMAIL PROTECTED]


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