[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/OFS/Content/File - FSSync.py:1.2 configure.zcml:1.9.6.1
Jim Fulton
jim@zope.com
Fri, 11 Oct 2002 02:28:36 -0400
Update of /cvs-repository/Zope3/lib/python/Zope/App/OFS/Content/File
In directory cvs.zope.org:/tmp/cvs-serv1649/lib/python/Zope/App/OFS/Content/File
Modified Files:
Tag: FileSystemSync-branch
configure.zcml
Added Files:
FSSync.py
Log Message:
adding (back) changed to branch
=== Zope3/lib/python/Zope/App/OFS/Content/File/FSSync.py 1.1 => 1.2 ===
--- /dev/null Fri Oct 11 02:28:36 2002
+++ Zope3/lib/python/Zope/App/OFS/Content/File/FSSync.py Fri Oct 11 02:28:06 2002
@@ -0,0 +1,44 @@
+##############################################################################
+#
+# Copyright (c) 2002 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""
+$Id$
+"""
+
+__metaclass__ = type
+
+
+from Zope.App.FSSync.IObjectFile import IObjectFile
+from Zope.App.FSSync.ObjectEntryAdapter import ObjectEntryAdapter
+from Zope.App.FSSync.AttrMapping import AttrMapping
+
+attrs = ('contentType', )
+
+class ObjectFileAdapter(ObjectEntryAdapter):
+ "ObjectFile adapter for file objects"
+
+ __implements__ = IObjectFile
+
+ def getBody(self):
+ "See Zope.App.FSSync.IObjectFile.IObjectFile"
+ return self.context.getData() or ''
+
+ def setBody(self, data):
+ "See Zope.App.FSSync.IObjectFile.IObjectFile"
+ self.context.setData(data)
+
+ def extra(self):
+ "See Zope.App.FSSync.IObjectEntry.IObjectEntry"
+ return AttrMapping(self.context, attrs)
+
+__doc__ = ObjectFileAdapter.__doc__ + __doc__
=== Zope3/lib/python/Zope/App/OFS/Content/File/configure.zcml 1.9 => 1.9.6.1 ===
--- Zope3/lib/python/Zope/App/OFS/Content/File/configure.zcml:1.9 Fri Oct 4 16:02:02 2002
+++ Zope3/lib/python/Zope/App/OFS/Content/File/configure.zcml Fri Oct 11 02:28:06 2002
@@ -1,63 +1,68 @@
-<zopeConfigure xmlns='http://namespaces.zope.org/zope'>
-
-<content class=".File.">
-
- <factory
- id="File"
- permission="Zope.ManageContent"
- title="File"
- description="A File" />
-
- <require
- permission="Zope.View"
- interface=".IFile.IReadFile" />
-
- <require
- permission="Zope.ManageContent"
- interface=".IFile.IWriteFile" />
-
- <implements interface="Zope.App.OFS.Annotation.IAttributeAnnotatable." />
-
-</content>
-
-<content class=".NaiveFile.">
-
- <factory
- id="NaiveFile"
- permission="Zope.ManageContent"
- title="Naive File"
- description="This is a simple file" />
- <require like_class=".File." />
-
- <implements interface="Zope.App.OFS.Annotation.IAttributeAnnotatable." />
-
-</content>
-
-<content class=".I18nFile.">
- <factory
- id="I18nFile"
- permission="Zope.ManageContent"
- title="I18n File"
- description="An Internationalized File" />
- <require
- permission="Zope.View"
- interface=".IFile.IReadFile" />
- <require
- permission="Zope.ManageContent"
- interface=".IFile.IWriteFile" />
- <require
- permission="Zope.View"
- attributes="getDefaultLanguage getAvailableLanguages" />
- <require
- permission="Zope.ManageContent"
- attributes="setDefaultLanguage removeLanguage" />
-
- <implements interface="Zope.App.OFS.Annotation.IAttributeAnnotatable." />
-
-</content>
-
-<include package=".Views" />
-
-</zopeConfigure>
-
-
+<zopeConfigure xmlns='http://namespaces.zope.org/zope'>
+
+<content class=".File.">
+
+ <factory
+ id="File"
+ permission="Zope.ManageContent"
+ title="File"
+ description="A File" />
+
+ <require
+ permission="Zope.View"
+ interface=".IFile.IReadFile" />
+
+ <require
+ permission="Zope.ManageContent"
+ interface=".IFile.IWriteFile" />
+
+ <implements interface="Zope.App.OFS.Annotation.IAttributeAnnotatable." />
+
+</content>
+
+<adapter
+ factory=".FSSync.ObjectFileAdapter"
+ provides="Zope.App.FSSync.IObjectFile."
+ for=".IFile." />
+
+<!-- NaiveFile Directives -->
+
+<content class=".NaiveFile.">
+
+ <factory
+ id="NaiveFile"
+ permission="Zope.ManageContent"
+ title="Naive File"
+ description="This is a simple file" />
+ <require like_class=".File." />
+
+ <implements interface="Zope.App.OFS.Annotation.IAttributeAnnotatable." />
+
+</content>
+
+<content class=".I18nFile.">
+ <factory
+ id="I18nFile"
+ permission="Zope.ManageContent"
+ title="I18n File"
+ description="An Internationalized File" />
+ <require
+ permission="Zope.View"
+ interface=".IFile.IReadFile" />
+ <require
+ permission="Zope.ManageContent"
+ interface=".IFile.IWriteFile" />
+ <require
+ permission="Zope.View"
+ attributes="getDefaultLanguage getAvailableLanguages" />
+ <require
+ permission="Zope.ManageContent"
+ attributes="setDefaultLanguage removeLanguage" />
+
+ <implements interface="Zope.App.OFS.Annotation.IAttributeAnnotatable." />
+
+</content>
+
+<include package=".Views" />
+
+</zopeConfigure>