RE: [Zope] LocalFS and ZPT
Hello, Jeff. I'm sorry for my lack of clarity; I'm a zope newbie. What I need to do is store ZPTs on the local filesystem, and have them treated as page templates when they are browsed. As it stands, they are served as the text of the source. If you have LocalFS installed, you can see what I mean by trying two things: 1) try to add a Page Template to a localFS directory: Error Value: Cannot add objects of type 'Page Template' to local directories. 2) copy the text of a ZPT into a file ending in .zpt in the directory on the filesystem, and try to 'view' it. I see that in the edit menu of the localFS instance (as well as in the source of the module), I have the ability to add new types to the type map. I have tried inserting an entry for .zpt, but nothing I've tried will get it to treat these files as page templates. Does this all make sense? Thanks for your help! blossom
LocalFS was created before ZPT, I am pretty sure. Thus, ZPT is not a built in type with LocalFS and that's why it won't save. Adding the extension and content type to the LocalFS will not help because I do not believe zope will natively deal with file extensions that way. Finally, if you add a dtml doc to the LocalFS it also renders it as text/plain, leading me to believe that this is simply the behavior that was intended. So, short of modifying the LocalFS code, I think you've reached an impasse. The first question I asked myself when reading the problem description was "why do you need to add and render ZPT from the local filesystem?" I came up with: 1) You want to use ZPT stand alone. Which can be done but it requires changes to ZPT if I am not mistaken. or 2) You want to share files between 2 Zope instances. If you can maybe explain the *why* we can help find a more suitable solution. I could be wrong about this, I wont claim to know it all about LocalFS or ZPT but based on what I know and what I have observed with some cursory examination, this is what I think. Hope to have helped at least some. -- Jeffrey D. Peterson Webmaster & Resident Standards Warrior "The Trouble with doing anything right the first time is that nobody appreciates how difficult it was."
-----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of blossom merz Sent: Tuesday, April 09, 2002 5:25 PM To: jpeterso@rangebroadband.com Cc: zope@zope.org Subject: RE: [Zope] LocalFS and ZPT
Hello, Jeff.
I'm sorry for my lack of clarity; I'm a zope newbie.
What I need to do is store ZPTs on the local filesystem, and have them treated as page templates when they are browsed. As it stands, they are served as the text of the source.
If you have LocalFS installed, you can see what I mean by trying two things: 1) try to add a Page Template to a localFS directory: Error Value: Cannot add objects of type 'Page Template' to local directories. 2) copy the text of a ZPT into a file ending in .zpt in the directory on the filesystem, and try to 'view' it.
I see that in the edit menu of the localFS instance (as well as in the source of the module), I have the ability to add new types to the type map. I have tried inserting an entry for .zpt, but nothing I've tried will get it to treat these files as page templates.
Does this all make sense?
Thanks for your help! blossom
_______________________________________________ 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 )
Hello, Jeff. Thanks for your clear response. I had reached the same conclusion. Let me explain a little more what I want to do. I am setting up a photo server for a professional photographer. He shot 40,000 photos last year - a slow year. He has some existing php-based gallery software that's difficult to interface with a filesystem-based archive. He needs to have the organization happen in a series of directories with the galleries automatically reflecting these changes. As I make changes to the site, they are all checked into CVS (from the commandline). I tried ZCVSfolder, and found that I'd rather use the commandline. This is one reason to store even ZPT objects in the filesystem. The photos themselves are stored in the filesystem, to reduce Zope overhead and interface with external photo organizing software. The design of the site is happening in a WYSIWYG HTML editor - thus the need for ZPT. Using filesystem-based ZPT objects makes this integration seamless as well. (I'm looking at a scenario where the ZPT files exist on a partition that's shared with Windows for easy editing by the designer.) I've been pointed toward the CMF Filesystem Directory View as an alternative for LocalFS. I don't want to use the CMF. The learning curve is too steep for what is supposed to be a fairly simple project. I was told that I need to "register" the directory that I want to make available, and after a week of scanning docs and reading source, I am no closer to knowing what that means or how to do it. I'm attracted to using the CMF because it does provide some functionality that I'll need later on, but it seems just too difficult for me to get started. Thanks again for you help. blossom On Wed, 2002-04-10 at 08:54, Jeff Peterson wrote:
LocalFS was created before ZPT, I am pretty sure. Thus, ZPT is not a built in type with LocalFS and that's why it won't save. Adding the extension and content type to the LocalFS will not help because I do not believe zope will natively deal with file extensions that way. Finally, if you add a dtml doc to the LocalFS it also renders it as text/plain, leading me to believe that this is simply the behavior that was intended.
So, short of modifying the LocalFS code, I think you've reached an impasse.
The first question I asked myself when reading the problem description was "why do you need to add and render ZPT from the local filesystem?" I came up with:
1) You want to use ZPT stand alone. Which can be done but it requires changes to ZPT if I am not mistaken.
or
2) You want to share files between 2 Zope instances.
If you can maybe explain the *why* we can help find a more suitable solution.
I could be wrong about this, I wont claim to know it all about LocalFS or ZPT but based on what I know and what I have observed with some cursory examination, this is what I think.
Hope to have helped at least some.
-- Jeffrey D. Peterson Webmaster & Resident Standards Warrior "The Trouble with doing anything right the first time is that nobody appreciates how difficult it was."
blossom merz writes:
What I need to do is store ZPTs on the local filesystem, and have them treated as page templates when they are browsed. As it stands, they are served as the text of the source. You need to extend "LocalFS".
Look at the source, how the currently supported types are made. Do it for ZPT in a similar way. Or use "Filesystem Directory View" (which comes with CMF) as an alternative. Dieter
Hello, Dieter. I've been looking into your suggestion to use Filesystem Directory View, and find it difficult to understand. In a previous post, you said that I need to register the directory that should be made available as directory views. I've really tried to understand what that means, and have found nothing in the documentation or the sources that gives me a decent understanding. Would you mind giving me a short synopsis of what registering a directory is, and how I would go about doing it? Thanks for your help. blossom On Wed, 2002-04-10 at 11:32, Dieter Maurer wrote:
blossom merz writes:
What I need to do is store ZPTs on the local filesystem, and have them treated as page templates when they are browsed. As it stands, they are served as the text of the source. You need to extend "LocalFS".
Look at the source, how the currently supported types are made. Do it for ZPT in a similar way.
Or use "Filesystem Directory View" (which comes with CMF) as an alternative.
Dieter
blossom merz writes:
I've been looking into your suggestion to use Filesystem Directory View, and find it difficult to understand. In a previous post, you said that I need to register the directory that should be made available as directory views. I've really tried to understand what that means, and have found nothing in the documentation or the sources that gives me a decent understanding.
Would you mind giving me a short synopsis of what registering a directory is, and how I would go about doing it? Didn't I do this?
I am sure, I answered a similar question, maybe not to you. Please look in the mailing list archive. An alternative would be to look in "CMFDefault/__init__.py". There, you find an example usage -- for CMF. Dieter
participants (3)
-
blossom merz -
Dieter Maurer -
Jeff Peterson