summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJens Vagelpohl <jens@netz.ooo>2005-09-10 21:17:49 +0000
committerJens Vagelpohl <jens@netz.ooo>2005-09-10 21:17:49 +0000
commitaa43cc8657744a65825705e80905757fd5860203 (patch)
tree9ac58792d8ad804fddbda854e4a1b9223786acc4
parente7d7427d784469b386b49d338bc2c49ec07425f5 (diff)
downloadCMFFSContent-aa43cc8657744a65825705e80905757fd5860203.zip
CMFFSContent-aa43cc8657744a65825705e80905757fd5860203.tar.gz
- Add manage_options for all types (does not work correctly yet, but
it fixes a nasty blowup) - Fix a wrong (Default) alias for FSImage which prevented the image from getting rendered - Fix up and expand the usage documentation in the README - Add commented-out code in __init__.py which can be uncommented to register a filesystem content directory with some simple content
-rw-r--r--FSDocument.py3
-rw-r--r--FSFile.py4
-rw-r--r--FSImage.py4
-rw-r--r--README.txt7
-rw-r--r--__init__.py4
-rw-r--r--profiles/default/types/FSImage.xml2
6 files changed, 19 insertions, 5 deletions
diff --git a/FSDocument.py b/FSDocument.py
index e083f21..6ec9815 100644
--- a/FSDocument.py
+++ b/FSDocument.py
@@ -17,6 +17,7 @@ from AccessControl import ClassSecurityInfo
# CMF imports
from Products.CMFCore.FSObject import FSObject
+from Products.CMFCore.FSFile import FSFile as CMFCoreFSFile
from Products.CMFCore.utils import expandpath
from Products.CMFDefault.Document import Document
from Products.CMFDefault.permissions import ModifyPortalContent
@@ -83,6 +84,8 @@ class FSDocument(FSObject, FSContent, Document):
security = ClassSecurityInfo()
security.declareObjectProtected(View)
+ manage_options = CMFCoreFSFile.manage_options
+
def __init__(self, id, filepath, fullname=None, properties=None):
id = fullname or id # Use the whole filename.
diff --git a/FSFile.py b/FSFile.py
index 49e9e41..a9e221d 100644
--- a/FSFile.py
+++ b/FSFile.py
@@ -84,6 +84,8 @@ class FSFile(FSContent, CMFCoreFSFile, File):
security = ClassSecurityInfo()
security.declareObjectProtected(View)
+ manage_options = CMFCoreFSFile.manage_options
+
InitializeClass(FSFile)
@@ -95,4 +97,6 @@ registerContentFileExtension('cab', FSFile)
registerContentFileExtension('ico', FSFile)
registerContentFileExtension('js', FSFile)
registerContentFileExtension('css', FSFile)
+registerContentFileExtension('zip', FSFile)
+registerContentFileExtension('gz', FSFile)
registerContentMetaType('File', FSFile)
diff --git a/FSImage.py b/FSImage.py
index c7fe33b..6986cde 100644
--- a/FSImage.py
+++ b/FSImage.py
@@ -41,7 +41,7 @@ factory_type_information = (
, 'immediate_view' : 'image_view'
, 'global_allow' : 0
, 'allow_discussion' : 0
- , 'aliases' : { '(Default)' : 'image_view'
+ , 'aliases' : { '(Default)' : 'index_html'
, 'view' : 'image_view'
}
, 'actions' : ( { 'id' : 'view'
@@ -78,6 +78,8 @@ class FSImage(FSContent, CMFCoreFSImage, Image):
security = ClassSecurityInfo()
security.declareObjectProtected(View)
+ manage_options = CMFCoreFSImage.manage_options
+
InitializeClass(FSImage)
diff --git a/README.txt b/README.txt
index 5da7c30..2324baf 100644
--- a/README.txt
+++ b/README.txt
@@ -22,11 +22,12 @@ README for the CMFFSContent product
to the registration of skins directories from your product code::
from Products.CMFFSContent.FSFolder import registerContentDirectory
- registerContentDirectory(directory_name, path_to_directory)
+ registerContentDirectory(directory_name, globals())
In this case, 'directory_name' is the name of the filesystem directory
- you are registering, and 'path_to_directory' is the full path to the
- directory in which 'directory_name' resides.
+ you are registering. See the __init__.py file in this directory for a
+ commented example which you may uncomment to register some sample
+ content inside the 'content' directory in this product.
Once you have registered a directory on the file system, the edit form
for 'FSFolder' objects will show the registered paths in their
diff --git a/__init__.py b/__init__.py
index f688fd5..fba1873 100644
--- a/__init__.py
+++ b/__init__.py
@@ -39,6 +39,10 @@ fti = ( FSFolder.factory_type_information
+ FSFile.factory_type_information
)
+# Uncomment the two lines below for a little bit of sample filesystem content
+#from FSFolder import registerContentDirectory
+#registerContentDirectory('content', cmffscontent_globals)
+
# Make the skins available as DirectoryViews.
registerDirectory('skins', cmffscontent_globals)
diff --git a/profiles/default/types/FSImage.xml b/profiles/default/types/FSImage.xml
index 620d739..7aa1920 100644
--- a/profiles/default/types/FSImage.xml
+++ b/profiles/default/types/FSImage.xml
@@ -16,7 +16,7 @@
<property name="allow_discussion">False</property>
<aliases>
- <alias from="(Default)" to="image_view"/>
+ <alias from="(Default)" to="index_html"/>
<alias from="view" to="image_view"/>
</aliases>