Re: [Zope3-Users] Re: ZODB - ways of storages?

2006-03-06 Thread Chris Withers

Andreas Elvers wrote:
Personally I don't like to store big files (pictures and the like) in 
ZODB. Zope provides you the functionality to store this data outside of
ZODB (somewhere on the harddrive). Although commonly a reference still 
exists in ZODB in form of a content object. This content object has the 
knowledge to access the stored data.


Be careful here, getting transactional semantics right with files _not_ 
in ZODB is hard and not something many people get right...


cheers,

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk

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


Re: [Zope3-Users] Problem with XHTML in Pagetemplates

2006-03-06 Thread Frank Burkhardt
Hi,

On Fri, Mar 03, 2006 at 11:35:58PM +, Peter Bengtsson wrote:
 
 On 3 Mar 2006, at 14:08, Frank Burkhardt wrote:
 
 Hi,
 
 I try to create XHTML documents from Pagetemplates but unfortunately
 tags are not always closed correctly. Example:
 
  br /
 
 is Rewritten to
 
  br
 
 How did you do that?
 Are you sure you haven't just used View selections source in Firefox?

It was really a firefox problem. When I chose to save the webpage for
uploading it to the w3c-validator, firefox replaced some tags invalidating
the xhtml. The page fetched by wget was fine.

Thank you Peter,

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


[Zope3-Users] Creating objects in software space when making site

2006-03-06 Thread Florian Lindner
Hello,
my content object depends on a number of utilities to be present. It is 
usually also used as a site. During development it happens often that I 
delete and recreate it.
Can I install a hook or something so I can make that these utilies are being 
created when my objects becomes a site? How do I create utitlies in software 
space?

Thanks,

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


Re: [Zope3-Users] Newbie question...

2006-03-06 Thread Thierry FLORAC
On Sat, 2006-03-04 at 16:01 +0100, Thierry FLORAC wrote:
 I've started to create a few components with Zope-3.2.
 Until now, everything is OK for simple content components and a few
 utilities.
 
 I'm actually trying to develop new adapters.
 One of these adapters is designed to use annotations, but I can't make
 it working in Zope3 management interface : page link is displayed
 correctly, in my editform properties provided by my interface are
 displayed and modified apparently correctly, but introspector show
 that these properties are stored as simple attributes and not as
 annotations ; adapter's code is never called !
 I've probably missed something, so here are the steps I followed :
 - create custom interface = OK
 - create adapter = apparently OK
 - define adapter in main configure.zcml file = OK
 - define editform in browser's configure.zcml = probably bad !

I've started to work a little more on this problem, and got a few
improvements but still a few problems. In fact :
 - I can create my main content component correctly
 - I can see the adapter's view form into ZMI
 - I can select this view ; an empty annotations PersistentDict is
then immediately created as requested
 - but I can't update adapter's interface's properties : the setData
method is called, but the properties methods are not called when
setData is called. No error is displayed, and the form just display
request values that are removed as soon as the view is refreshed...

My code is in fact very simple :

class IPhotoStorage:
identifier = TextLine(...)
hostname = TextLine(...)

PhotoStorageKey = http://www.ulthar.net/keys/storage;

class PhotoStorage:
implements(IPhotoStorage)
adapts(IPhoto)

def __init__ (self, context):
self.context = self.__parent__ = context
annotations = IAnnotations(context)
data = annotations.get(PhotoStorageKey)
if data is None:
data = annotations[PhotoStorageKey] = PersistentDict()
self._data = data

def _getIdentifier (self):
return self._data.get('identifier',None)

def _setIdentifier (self, identifier):
self._data['identifier'] = unicode(identifier)
notify(ObjectAnnotationsModifiedEvent(self.context))

identifier = property(_getIdentifier, _setIdentifier)

...then same code for hostname property...

class PhotoStorageHandler(object):

def getData(self):
result = {}
result['identifier'] = IPhotoStorage(self.context).identifier
result['hostname'] = IPhotoStorage(self.context).hostname
return result

def setData(self, data):
IPhotoStorage(self.context).identifier = data['identifier']
IPhotoStorage(self.context).hostname = data['hostname']
return uSaved changes


And here is my main configure.zcml part for the adapter :

adapter
factory=.photo.PhotoStorage
provides=.interfaces.IPhotoStorage
for=.interfaces.IGalleryPhoto
trusted=true /

class class=.photo.PhotoStorage
require
permission=zope.View
interface=.interfaces.IPhotoStorage /
require
permission=zope.ManageContent
set_schema=.interfaces.IPhotoStorage /
/class

and finally my browser configure.zcml :

form
name=storage.html
for=.interfaces.IGalleryPhoto
schema=.interfaces.IPhotoStorage
class=.forms.PhotoStorageHandler
fields=identifier hostname
label=Storage
permission=zope.ManageContent
menu=zmi_views title=Storage /


Of course, a good help would be really welcome...
Many thanks,

  Thierry



-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

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


[Zope3-Users] Re: Zope 3 Developer's LiveBook

2006-03-06 Thread Paul Dumais
Hi all, here is a callout for input on creating a zope livebook.

I have familiarized myself with docbook and am gung ho. I am fairly
new to zope3, so I will not be much help with content. I will be good
at trying out things and keeping the document up to date.

I decided to go with darcs for now, we can move to svn if darcs
doesn't work for most people.

I have a repo at z3book.unstate.ca. You can do: darcs get
http://z3book.unstate.ca; to get the book (but there's nothing
there!).

For now I am hoping to get suggestoins on how the book should be laid out.
What about something like:

 preface 
 Basic Usage 
 Framework Overview 
 Common Development Patterns 
 Content Components 

I really have no clue. I was hoping that a zope3 guru could suggest
how the parts could be best laid out. It seems to me that it is very
tricky to have an encyclopedic resource for power users as well as
easy to follow trails for newbies who are likely to get lost in the
woods.

I like the idea of trails (do the java tutorials still do this?). If a
newbie wants to explore the forest that is zope 3, she will want to
use the most well worn trails first and be confident to return home
before it gets dark. Later, when she gets a sense of the lay of the
land, she can venture deep on longer and less well-used tracks.

I have followed a bit of the discussion regarding example apps. I
really appreciated Benji York's Hello World app. It was easy to
follow and left me feelling less overwhelmed than the Zope 3 Tutorial
or the Zope 3 Book by Stephen Richter (I got lost and scared and have
not gone back - though to be fair they are still the best on-line
sources for more in depth zope 3 info). It also did a good job
covering topics in just enough detail. I also appreciated that it was
relatively up to date (Zope 3.2 apha?). Good examples could serve to
as a guide to how to layout this book. Topics could be introduced
gradually as the examples become more complicated. Also, topics could
be covered in more detail as examples are shown which best demonstrate
their use.

Anyway, let me know what you think.
For right now ideas on overall layout and a progression of example
apps would be most appreciated.

For those of you who have already authored tutorials, books, articles,
tips, etc. It would be most excellent if you could offer them up
(permission to use and alter, etc). Icing on the cake would be if you
could suggest where in the zope 3 book you envision seeing your info.
A cherry on top would be if you could update the information for the
current release.

Thanks and good night.

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


Re: [Zope3-Users] Newbie question...

2006-03-06 Thread Thierry FLORAC
On Tue, 2006-03-07 at 01:20 +0100, Thierry FLORAC wrote:
 My code is in fact very simple :
 
 class IPhotoStorage:
 identifier = TextLine(...)
 hostname = TextLine(...)
 
 PhotoStorageKey = http://www.ulthar.net/keys/storage;
 
 class PhotoStorage:
 implements(IPhotoStorage)
 adapts(IPhoto)
 
 def __init__ (self, context):
 self.context = self.__parent__ = context
 annotations = IAnnotations(context)
 data = annotations.get(PhotoStorageKey)
 if data is None:
 data = annotations[PhotoStorageKey] = PersistentDict()
 self._data = data
 
 def _getIdentifier (self):
 return self._data.get('identifier',None)
 
 def _setIdentifier (self, identifier):
 self._data['identifier'] = unicode(identifier)
 notify(ObjectAnnotationsModifiedEvent(self.context))
 
 identifier = property(_getIdentifier, _setIdentifier)
 
 ...then same code for hostname property...
 
 class PhotoStorageHandler(object):
 
 def getData(self):
 result = {}
 result['identifier'] = IPhotoStorage(self.context).identifier
 result['hostname'] = IPhotoStorage(self.context).hostname
 return result
 
 def setData(self, data):
 IPhotoStorage(self.context).identifier = data['identifier']
 IPhotoStorage(self.context).hostname = data['hostname']
 return uSaved changes

Hi,

I've finally applied the following changes to my interfaces and classes,
and now it works !

class IPhotoStorage:
identifier = TextLine(...)
def setIdentifier():
 
hostname = TextLine(...)
def setHostname():
 

class PhotoStorage:
implements(IPhotoStorage)
adapts(IPhoto)

def getIdentifier (self):
return self._data.get('identifier',None)

def setIdentifier (self, identifier):
self._data['identifier'] = unicode(identifier)
notify(ObjectModifiedEvent(self.context))

identifier = property(getIdentifier, setIdentifier)

class PhotoStorageHandler(object):

def getData(self):
result = {}
result['identifier'] = IPhotoStorage(self.context).identifier
result['hostname'] = IPhotoStorage(self.context).hostname
return result

def setData(self, data):
IPhotoStorage(self.context).setIdentifier(data['identifier'])
IPhotoStorage(self.context).setHostname(data['hostname'])
return uSaved changes

So the only real modification I've done is to add a setIdentifier
method to my interface, and to call this method instead of just setting
the property into my form handler...
Of course, this seems rather strange to me, as if the property setting
didn't work for the adapter (but worked for the setter !).
Of course, I'm not sure to understand everything... So any help,
confirmation, information or any other kind of explanation would
probably be very useful...

Thanks,
Thierry



-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

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