File Extensions in FileSystemSite Product or FileSystemDirectory View
Hi, does anybody know why and where the possible file extensions in the FileSystemSite Product or in FileSysemDirectory View (CMF) are restricted to [html, htm, dtml, py, gif, jpg, png] and why the fileids omit them in the ZMI at least on Win? I would like to extend this to zpt as it can render Pagetemplates nicely and show the extensions. Thanks for your answers, --Elena
Elena Schulz wrote at 2003-6-12 18:03 +0200:
does anybody know why and where the possible file extensions in the FileSystemSite Product or in FileSysemDirectory View (CMF) are restricted to [html, htm, dtml, py, gif, jpg, png] and why the fileids omit them in the ZMI at least on Win?
I would like to extend this to zpt as it can render Pagetemplates nicely and show the extensions.
I can only speak for "FileSystemDirectoryView": The various "FS*" modules contain registrations of the form: registerFileExtension(extension, FSClass) This specifies that files with "extension" are mapped to instances of "FSClass". Some FSClass'es discard the extension, others keep it. When you have a modern CMF version (1.3.1 or above), then you can define a "keep_extension" property with a true value to prevent the extension to be discarded for this file. Dieter
Hi Dieter, thanks a lot:
The various "FS*" modules contain registrations of the form: registerFileExtension(extension, FSClass)
with adding registerFileExtension('zpt',Page Template) I could make FileSystemSite to recognize .zpt as a Page Template too. Shouldn't that be standart as 'zpt' is the standard Extension for ZPT's and not 'pt' as implemented or am I wrong?
When you have a modern CMF version (1.3.1 or above), then you can define a "keep_extension" property with a true value to prevent the extension to be discarded for this file.
but how to add a property to an object in the filesystem? FileSystemSite doesn't allow additional properties. Another question: when I utilize the ExternalFile Product it seems to aquire the properties of the caller but FileSystemSite seems not to do so that as I get different results calling the same file with the same code and 'myExternalFileInstance' & 'myFileSystemSiteInstance' being in the same folder: zpt = getattr(context, 'myExternalFileInstance') print myExternalFileInstance[myZPTFile[:-len(ext)]](context,REQUEST) # here I get the properties of callers acquiration path extSite = getattr(context, 'myFileSystemSiteInstance') print myFileSystemSiteInstance[myZPTFile](context,REQUEST) # here not Does anybody know what's going wrong? Thanks, --Elena
Elena Schulz wrote at 2003-6-16 11:53 +0200:
... with adding registerFileExtension('zpt',Page Template) I could make FileSystemSite to recognize .zpt as a Page Template too. Shouldn't that be standart as 'zpt' is the standard Extension for ZPT's and not 'pt' as implemented or am I wrong?
Probably, it should... File a bug report...
When you have a modern CMF version (1.3.1 or above), then you can define a "keep_extension" property with a true value to prevent the extension to be discarded for this file.
but how to add a property to an object in the filesystem? FileSystemSite doesn't allow additional properties.
In "FSDirectoryView", you define properties for file "XXX" in the file "XXX.properties". As mentioned earlier, I do not know about "FileSystemSite". Dieter
Hi Dieter, thanks.
In "FSDirectoryView", you define properties for file "XXX" in the file "XXX.properties".
Oh yes, I remember, FileSystemDirectoryView adds a file '.XXX.properties' and '.properties' for the container. (there is '.' as first char which makes it very difficult to create such a file on Win! Is that wanted?) I tried it with FileSystemSite but Zope doesn't show any property, e.g. (Actually, I copied an old FileSystemDirectoryView_.property file for a zpt-Document to inshure the right syntax, but no chance even without the first '.') [properties] title:string='myTitle' keep_extension:boolean=1 -- Elena
participants (2)
-
Dieter Maurer -
Elena Schulz