Re: [Zope3-Users] Indexing PDF files

2006-05-11 Thread Frank Burkhardt
Hi,

On Wed, May 10, 2006 at 03:29:34PM -0500, Sreeram Raghav wrote:

[snip]

 Initially the only files being indexed were ZPT pages, but after writing
 the adapter even text files were being indexed.
 However the problem is that when I try to add a PDF of Word documents, the
 files are not being indexed and showing an error that cannot decode files.

This adapter was just a demonstration on how to index a content object
containing a text field. It assumes that context.data contains just a plain
string. To index pdf files, you'll have to somehow convert the pdf data to
plain text:

from ModuleYouHaveToWrite import MagicPdfToText

class SearchableTextAdapter(object):
[...]
   def getSearchableText(self):
  text=MagicPdfToText(context.pdfdata)
  return (text,)

I don't know, if there's a pure python solution for extraction text from pdf 
files.
But you might consider calling an external program like 'pdftotxt' to do the 
job.
However, it's your adapters responsibility to act as define by the interface and
'ISearchableText' says, the adapter must provide plain indexable text.

Regards,

Frank
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] Problems with ZDC upgrading to Zope 3.3.0b1

2006-05-11 Thread Tom Dossis
I've encountered a problem running zope 3.3.0 beta1 against a zodb 
created 3.2.
As a consequence of moving zope.app.dublincore to zope.dublincore, it 
seems DC annotations on old instances break, i.e.


persistent broken 
zope.app.dublincore.annotatableadapter.ZDCAnnotationData instance 
'\x00\x00\x00\x00\x00\x00\x00%'


In the meantime I can work around this by dummy'ing zope.app.dublincore.

Is there a migration operation I need to run?

Clicking evolve: http://localhost:8080/++etc++process/@@generations.html 
doesn't seem to do the trick.

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] Skinning in Zope 3.3

2006-05-11 Thread Achim Domma

Hi,

I try to understand how to customize the look  feel of my page using 
the new skin/layer implementation of version 3.3. I followed the example 
on 
http://www.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/SimplifySkinning 
 but still don't understand on how to change the layout of my page.


Could somebody provide a short hint on how to override 
@@standard_macros/page for the ShanghaiSkin in the example above?


regards,
Achim
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Problems with ZDC upgrading to Zope 3.3.0b1

2006-05-11 Thread Stephan Richter
On Thursday 11 May 2006 03:44, Tom Dossis wrote:
 Is there a migration operation I need to run?

 Clicking evolve: http://localhost:8080/++etc++process/@@generations.html
 doesn't seem to do the trick.

It seems to me that no generation scripts were written. :-( This is a real 
show-stopper! I will not make another Zope 3.3 release before this is fixed.

Regards,
Stephan
-- 
Stephan Richter
CBU Physics  Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


RE: [Zope3-Users] Skinning in Zope 3.3

2006-05-11 Thread David Johnson
Both of the Zope 3 developer's books explain this quite well.  I think
Phillip's has the shortest example.  Skins are one of the few Zope 3
concepts I was able to implement quickly.  All sources will assume that you
understand TAL, and METAL. 

You can download the source from either book either of the Zope 3 SVN or the
worldcookery site.



 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 On Behalf Of Achim Domma
 Sent: Thursday, May 11, 2006 4:04 AM
 To: zope3-users@zope.org
 Subject: [Zope3-Users] Skinning in Zope 3.3
 
 Hi,
 
 I try to understand how to customize the look  feel of my page using
 the new skin/layer implementation of version 3.3. I followed the example
 on
 http://www.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/SimplifyS
 kinning
   but still don't understand on how to change the layout of my page.
 
 Could somebody provide a short hint on how to override
 @@standard_macros/page for the ShanghaiSkin in the example above?
 
 regards,
 Achim
 ___
 Zope3-users mailing list
 Zope3-users@zope.org
 http://mail.zope.org/mailman/listinfo/zope3-users

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] Re: Problems with ZDC upgrading to Zope 3.3.0b1

2006-05-11 Thread Philipp von Weitershausen
Stephan Richter wrote:
 On Thursday 11 May 2006 03:44, Tom Dossis wrote:
 Is there a migration operation I need to run?

 Clicking evolve: http://localhost:8080/++etc++process/@@generations.html
 doesn't seem to do the trick.
 
 It seems to me that no generation scripts were written. :-( This is a real 
 show-stopper! I will not make another Zope 3.3 release before this is fixed.

On the other hand, it seems that the BBB packages that would guarantee
the pickle to be loaded were not included in the release
(http://www.zope.org/Collectors/Zope3-dev/603).

And yes, no generation scripts were written. Why? Because

a) there doesn't (yet) seem to be an API that lets you iterate over
objects (perferrably of a certain class) in the ZODB so that you could
have them repickled (at least that's what Jim told me when I asked him)

b) no persistent class was moved for this reason. Of course,
non-persistent classes might still have been pickled. However, IIRC even
if we had such an API described in a), it wouldn't be of any use because
the objects that were moved don't have their own pickle but live in the
pickle of some persistent object that makes a reference to it.

As said, BBB packages were provided, but not included in the release.
This is a packaging problem.

Philipp

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Re: Problems with ZDC upgrading to Zope 3.3.0b1

2006-05-11 Thread Stephan Richter
On Thursday 11 May 2006 10:06, Philipp von Weitershausen wrote:
 On the other hand, it seems that the BBB packages that would guarantee
 the pickle to be loaded were not included in the release
 (http://www.zope.org/Collectors/Zope3-dev/603).


This is not enough. You are required to provide BBB *and* generation scripts 
for objects that are referenced in the ZODB

 And yes, no generation scripts were written. Why? Because

 a) there doesn't (yet) seem to be an API that lets you iterate over
 objects (perferrably of a certain class) in the ZODB so that you could
 have them repickled (at least that's what Jim told me when I asked him)

 b) no persistent class was moved for this reason. Of course,
 non-persistent classes might still have been pickled. However, IIRC even
 if we had such an API described in a), it wouldn't be of any use because
 the objects that were moved don't have their own pickle but live in the
 pickle of some persistent object that makes a reference to it.

 As said, BBB packages were provided, but not included in the release.
 This is a packaging problem.

-- 
Stephan Richter
CBU Physics  Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] Re: Problems with ZDC upgrading to Zope 3.3.0b1

2006-05-11 Thread Stephan Richter
On Thursday 11 May 2006 10:06, Philipp von Weitershausen wrote:
 On the other hand, it seems that the BBB packages that would guarantee
 the pickle to be loaded were not included in the release
 (http://www.zope.org/Collectors/Zope3-dev/603).

This is not enough. You are required to provide BBB *and* generation scripts 
for objects that are referenced in the ZODB. Once the BBB references are 
removed the database will not load anymore.

 And yes, no generation scripts were written. Why? Because

 a) there doesn't (yet) seem to be an API that lets you iterate over
 objects (perferrably of a certain class) in the ZODB so that you could
 have them repickled (at least that's what Jim told me when I asked him)

This is a problem, not a reason not to do it. At least for FileStorage, which 
most people use I assume, there is a way. Here is a good example of its use:

http://source.schooltool.org/viewcvs/trunk/schooltool/src/schooltool/generations/evolve5.py?rev=5669view=auto

 b) no persistent class was moved for this reason. Of course,
 non-persistent classes might still have been pickled. However, IIRC even
 if we had such an API described in a), it wouldn't be of any use because
 the objects that were moved don't have their own pickle but live in the
 pickle of some persistent object that makes a reference to it.

This is not true. See

http://svn.zope.org/Zope3/trunk/src/zope/dublincore/annotatableadapter.py?rev=67630view=auto

class ZDCAnnotationData(PersistentDict):
Data for a Dublin Core annotation.

A specialized class is used to allow an alternate fssync
serialization to be registered.  See the
zope.dublincore.fssync package.


 As said, BBB packages were provided, but not included in the release.
 This is a packaging problem.

Right, this is fixable. I am not too concerned about that.

Regards,
Stephan
-- 
Stephan Richter
CBU Physics  Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Re: Problems with ZDC upgrading to Zope 3.3.0b1

2006-05-11 Thread Philipp von Weitershausen
Stephan Richter wrote:
 On Thursday 11 May 2006 10:06, Philipp von Weitershausen wrote:
 On the other hand, it seems that the BBB packages that would guarantee
 the pickle to be loaded were not included in the release
 (http://www.zope.org/Collectors/Zope3-dev/603).
 
 This is not enough. You are required to provide BBB *and* generation scripts 
 for objects that are referenced in the ZODB

If you tell me how to do it, I'll be happy to. As said, I asked Jim
before and he just said that the object-iteration APIs of ZODB weren't
yet plumbed through.

I'll also state again that NO persistent class was moved. I'm therefore
not sure if the object-iteration APIs would even help with this problem
as they might only return persistent objects, not arbitrary references
to non-persistent objects.

 And yes, no generation scripts were written. Why? Because

 a) there doesn't (yet) seem to be an API that lets you iterate over
 objects (perferrably of a certain class) in the ZODB so that you could
 have them repickled (at least that's what Jim told me when I asked him)

 b) no persistent class was moved for this reason. Of course,
 non-persistent classes might still have been pickled. However, IIRC even
 if we had such an API described in a), it wouldn't be of any use because
 the objects that were moved don't have their own pickle but live in the
 pickle of some persistent object that makes a reference to it.

 As said, BBB packages were provided, but not included in the release.
 This is a packaging problem.
 

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Re: Problems with ZDC upgrading to Zope 3.3.0b1

2006-05-11 Thread Philipp von Weitershausen
Philipp von Weitershausen wrote:
 Stephan Richter wrote:
 On Thursday 11 May 2006 10:06, Philipp von Weitershausen wrote:
 On the other hand, it seems that the BBB packages that would guarantee
 the pickle to be loaded were not included in the release
 (http://www.zope.org/Collectors/Zope3-dev/603).
 This is not enough. You are required to provide BBB *and* generation scripts 
 for objects that are referenced in the ZODB
 
 If you tell me how to do it, I'll be happy to. As said, I asked Jim
 before and he just said that the object-iteration APIs of ZODB weren't
 yet plumbed through.
 
 I'll also state again that NO persistent class was moved.

I take that back :). There seems to be at least one persistent class. I
was looking at the wrong file before.

Philipp
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] ComponentLookupError

2006-05-11 Thread Jachin Rupe

hi there

here's a smaller, hopefully more clearer example of a problem I have  
been stuck on.  I should probably also lead off by saying that I  
think what I am asking is basically this question.


http://www.mail-archive.com/zope3-users@zope.org/msg00052.html

However I have read objectwidget.txt( http://svn.zope.org/Zope3/trunk/ 
src/zope/app/form/browser/objectwidget.txt ) several times and I  
don't see where a custom widget gets created.  I also suspect that  
because the object I need to create a custom widget for has more  
than just one field I have to do something different.


If there's a short fix for the problem that would be great, otherwise  
a little explanation to point me in the right direction would be  
greatly appreciated too.


thanks.

-jachin

Here's the error I'm getting any my code:

2006-05-11T11:56:47 ERROR SiteError http://localhost:8080/@@+/ 
action.html

Traceback (most recent call last):
  File /usr/local/Zope-3.2.1/lib/python/zope/publisher/publish.py,  
line 138, in publish

result = publication.callObject(request, object)
  File /usr/local/Zope-3.2.1/lib/python/zope/app/publication/ 
zopepublication.py, line 161, in callObject

return mapply(ob, request.getPositionalArguments(), request)
  File /usr/local/Zope-3.2.1/lib/python/zope/publisher/publish.py,  
line 113, in mapply

return debug_call(object, args)
  File /usr/local/Zope-3.2.1/lib/python/zope/publisher/publish.py,  
line 119, in debug_call

return object(*args)
  File /usr/local/Zope-3.2.1/lib/python/zope/app/container/browser/ 
adding.py, line 128, in action

name=view_name) is not None:
  File /usr/local/Zope-3.2.1/lib/python/zope/component/ 
__init__.py, line 165, in queryMultiAdapter
return sitemanager.queryMultiAdapter(objects, interface, name,  
default)
  File /usr/local/Zope-3.2.1/lib/python/zope/component/site.py,  
line 75, in queryMultiAdapter

default)
  File /usr/local/Zope-3.2.1/lib/python/zope/interface/adapter.py,  
line 475, in queryMultiAdapter

return factory(*objects)
  File /usr/local/Zope-3.2.1/lib/python/zope/app/form/browser/ 
editview.py, line 64, in __init__

self._setUpWidgets()
  File /usr/local/Zope-3.2.1/lib/python/zope/app/form/browser/ 
add.py, line 49, in _setUpWidgets
setUpWidgets(self, self.schema, IInputWidget,  
names=self.fieldNames)
  File /usr/local/Zope-3.2.1/lib/python/zope/app/form/utility.py,  
line 153, in setUpWidgets

context=context)
  File /usr/local/Zope-3.2.1/lib/python/zope/app/form/utility.py,  
line 97, in setUpWidget

widget = _createWidget(context, field, viewType, view.request)
  File /usr/local/Zope-3.2.1/lib/python/zope/app/form/utility.py,  
line 65, in _createWidget

return zapi.getMultiAdapter((field, request), viewType)
  File /usr/local/Zope-3.2.1/lib/python/zope/component/ 
__init__.py, line 154, in getMultiAdapter

raise ComponentLookupError(objects, interface, name)
ComponentLookupError: ((zope.schema._field.Object object at  
0x4282b70, zope.publisher.browser.BrowserRequest instance  
URL=http://localhost:8080/@@+/action.html), InterfaceClass  
zope.app.form.interfaces.IInputWidget, u'')
127.0.0.1 - - [11/May/2006:11:56:47 -0500] GET /@@+/action.html? 
type_name=AddPerson.html HTTP/1.1 500 84 http://localhost:8080/ 
@@contents.html Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en- 
US; rv:1.8.0.3) Gecko/20060427 Camino/1.0.1


interfaces.py

from zope.interface import Interface
import zope.schema

class IStreetAddress(Interface):
A vine street address

street = zope.schema.Text (
title=uStreet 1,
description=uThe street address,
required = False
)

city = zope.schema.TextLine (
title=uCity,
description=uThe city.,
required = False
)

state = zope.schema.TextLine (
title=uState,
description=uThe state.,
required = False
)

zipcode = zope.schema.TextLine (
title=uZip Code,
description=uThe zip code,
required = False,
min_length = 5
)


class IPerson(Interface):
firstName = zope.schema.TextLine (
title=uFirst Name,
description=uThe person's first name,
required=False
)

lastName = zope.schema.TextLine (
title=uLast Name,
description=uThe person's last name,
required=False
)

address = zope.schema.Object (
title=uAddress,
description=uThe person's adderess,
required=False,
schema = IStreetAddress
)


person.py

from persistent import Persistent
from zope.interface import implements

from 

Re: [Zope3-Users] ComponentLookupError

2006-05-11 Thread Jachin Rupe

hi there

opps I forgot:

streetAddress.py

from persistent import Persistent
from zope.interface import implements

from abook.interfaces import IStreetAddress


class StreetAddress(Persistent):

implements(IStreetAddress)

street = u
city = u
state = u
zipcode = u



On May 11, 2006, at 2:02 PM, Egon Frerich wrote:


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi Jachin,


Jachin Rupe schrieb am 11.05.2006 19:12:


interfaces.py

from zope.interface import Interface
import zope.schema

class IStreetAddress(Interface):
A vine street address

street = zope.schema.Text (
title=uStreet 1,
description=uThe street address,
required = False
)

city = zope.schema.TextLine (
title=uCity,
description=uThe city.,
required = False
)

state = zope.schema.TextLine (
title=uState,
description=uThe state.,
required = False
)

zipcode = zope.schema.TextLine (
title=uZip Code,
description=uThe zip code,
required = False,
min_length = 5
)





Can you please me your implementation for this?

Egon

- --
Egon Frerich, Freudenbergstr. 16, 28213 Bremen

E-Mail: [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.2 (MingW32)
Comment: GnuPT 2.7.2
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEY4pDuTzybIiyjvURAlPqAJ4tupOdpsCvIK7SBco58WJ7rQEpGwCfdl+u
poVz3T26Wfap0sRx8X0Ed7A=
=KQ3V
-END PGP SIGNATURE-


___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] Re: Skinning in Zope 3.3

2006-05-11 Thread Daniel Nouri
Achim Domma wrote:
 Hi,
 
 I try to understand how to customize the look  feel of my page using
 the new skin/layer implementation of version 3.3. I followed the example
 on
 http://www.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/SimplifySkinning
  but still don't understand on how to change the layout of my page.
 
 Could somebody provide a short hint on how to override
 @@standard_macros/page for the ShanghaiSkin in the example above?


With the exception of the layer attribute value, this works the same as
with before the 3.3 ::

  browser:page
  for=*
  name=standard_macros
  permission=zope.View
  class=.standardmacros.StandardMacros
  layer=.interfaces.ShanghaiSkin
  allowed_interface=zope.interface.common.mapping.IItemMapping
  /

  browser:page
  for=*
  name=shanghai_macros
  permission=zope.View
  layer=interfaces.ShanghaiSkin
  template=shanghai_macros.pt
  /

and in standardmacros.py ::

  from zope.app.rotterdam.standardmacros import StandardMacros \
 as BaseMacros
  class StandardMacros(BaseMacros):
  macro_pages = ('shanghai_macros',) + BaseMacros.macro_pages

(this hasn't changed at all)

HTH,
Daniel

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users