Lukasz Indyk wrote at 2004-5-23 13:17 +0200:
... 1. there is a problem with file extensions. file "richedit.html" is visible in zope as "richedit", file "tools.js" is visible as "tools" and so on. zope truncates extension of files of certain types. but file "image.gif" is visible as "image.gif",
The various "FSObject" classes have different preferences with respect to keeping or removing the extension. You can always force to keep the extension for individual files by defining a "keep_extension" property in the corresponding "*.metadata" file (this assumes that you are using CMF 1.4, which you apparently do not yet do). The map from file extensions to "FSObject" subclasses is controlled by "registerFileExtension" calls. See "CMFCore/FSFile.py" for examples. You might want to remap some of the extensions. This is a bit tricky, as the last "registerFileExtension" will win. To be sure that your "registerFileExtension" is the last one, import the module that registers a competing extension and then call your "registerFileExtension". It might be necessary to define a few more classes that keep extensions. Such class definitions contain only a few lines. See "FSFile" as an example. Note that you apparently have an old code base.
From CMF 1.4 on, "FSFile" keeps extensions by default. And "FSFile" is the target for "js" extensions.
files without extension ("template_edit_form") are not visible in zope at all, they start to be visible when i add extension ("template_edit_form.html"). but such renaming also makes problem with references described above.
Files must indeed have an extension as otherwise CMF cannot determine which object type the file should get. As detailed above, some "FSObject" subclasses remove the extension. You can use such extensions without affecting references that assume no extension is there. Note, however, that you can use a specific extension only if the corresponding target type is acceptable. It may be possible that you need more "FSObject" subclasses to better control whether the extension should or should not be removed. Here is a definition for an "FSFile" class that should remove the extension (note, that a modern "FSFile" keeps the extension): class FSFileWithoutExtension(FSFile): meta_type = 'Filesystem File without extension' __init__= FSObject.__init__ # use truncated id
i have two files with same name but different extension ("richedit.html" and "richedit.css"). in zope there is twice "richedit" visible, but when i check properties of both "richedit" entries, then source of both entries points at "richedit.html", and no "richedit.css" is mentioned.
Use new CMF code (1.4), the ".css" will then no longer be stripped and this specific problem will go away. In general, problems like this may remain, though. Then, you must rename one of the problematic objects...
2. this is minor one;) i would like to keep my files at ZOPE_ROOT/MyProjects. but when i add filesystem directory view then there are only those paths available: lib/python/Products/CMFCalendar/skins lib/python/Products/CMFCalendar/skins/calendar ... lib/python/Products/CMFTopic/skins/zpt_topic
so i can only choose location from the list. how to choose other location (for example ZOPE_ROOT/MyProjects)?
Which directories are available is determined by "registerDirectory" calls. See, "CMFDefault/__init__.py", for examples. Note that it is highly recommended to keep your directories relative to your Zope installation. Otherwise, you can have problems when you migrate to a new installation with a different directory layout. The best approach (in my view): define a new directory "MyProject" in your "Products" folder. Put all necessary "registerDirectory" and "registerFileExtension" calls in its "__init__.py". Put your skins into the directory. -- Dieter