[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/OFS/File - FileFields.py:1.1.2.1 File.py:1.1.2.3.2.1 FileChunk.py:1.1.2.1.4.1 IFile.py:1.1.2.2.2.1 NaiveFile.py:1.1.2.3.2.1 __init__.py:1.1.2.1.4.1 FileEdit.py:NONE edit.pt:NONE

Stephan Richter srichter@cbu.edu
Fri, 1 Mar 2002 01:37:37 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/App/OFS/File
In directory cvs.zope.org:/tmp/cvs-serv10334/File

Modified Files:
      Tag: srichter-OFS_Formulator-branch
	File.py FileChunk.py IFile.py NaiveFile.py __init__.py 
Added Files:
      Tag: srichter-OFS_Formulator-branch
	FileFields.py 
Removed Files:
      Tag: srichter-OFS_Formulator-branch
	FileEdit.py edit.pt 
Log Message:
Okay, I am finally ready to check this stuff in:

- Reorganized the internal directory structure of every content object. For
  each content object you have now a Views directory that contains further
  directories for different protocols, such as Browser (HTML), XUL, FTP ...

  Note: None of the directories is file-type, but functionality-based. It 
        is a bad idea to create directories for a particular file type, as
        it was common in Zope 2.

- Made Folder, File and Image forms Formulator-based. This allows us now to
  create forms for new protocols. such as XUL very quickly (often just a
  few lines of code). More to Formulator when it is being checked in.

- Cleaned up most files. Almost all files should have now the correct 
  license disclaimer.

- A new object called LoadedFolder was added. LoadedFolder currently 
  provides two new functionalities to folders:
    1. Ordering. You can change the order of the objects. This idea was 
       taking from the Zope 2 product OrderedFolders.
    2. Limit. You can specify the maximal amount of items the folder is 
       allowed to store. This idea was also taken from OrderedFolders.

  Note: Due to much rearranging during this development, there are no tests
        yet written for this. This needs to be done, before we merge with
        the Zoep-3x-branch again.

- Started XUL implementation of screens.

- Fixed some bugs I found lying around.


=== Added File Zope3/lib/python/Zope/App/OFS/File/FileFields.py ===
##############################################################################
#
# Copyright (c) 2001, 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
# 
##############################################################################
"""
Revision information: 
$Id: FileFields.py,v 1.1.2.1 2002/03/01 06:37:06 srichter Exp $
"""

from Zope.App.Formulator.FieldRegistry import getField
from Zope.App.Formulator.ValidatorRegistry import getValidator


ContentTypeField = getField('StringField')(
    id = 'contentType',
    title = 'Content Type',
    description = 'The content type identifies the type of data.',
    default = 'text/plain',
    )


DataField = getField('FileField')(
    id = 'data',
    title = 'Data',
    description = 'The actual content of the object.',
    )


=== Zope3/lib/python/Zope/App/OFS/File/File.py 1.1.2.3 => 1.1.2.3.2.1 ===
 #
-# Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
-#
+# Copyright (c) 2001, 2002 Zope Corporation and Contributors. 
+# All Rights Reserved.
+# 
 # This software is subject to the provisions of the Zope Public License,
-# Version 1.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# 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.
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE
+# 
 ##############################################################################
 """
 
@@ -27,7 +29,10 @@
 class File(Persistence.Persistent):
     """ """
 
-    __implements__ = IFile
+    __implements__ = (
+        IFile,
+        IAttributeRolePermissionManageable,
+        )      
 
 
     def __init__(self, data=None, contentType=None):
@@ -41,12 +46,8 @@
             self._contentType = contentType
         
 
-    def __str__(self):
-        return self.getData()
-
-
     def __len__(self):
-        return 1
+        return self.getSize()
 
 
     ############################################################


=== Zope3/lib/python/Zope/App/OFS/File/FileChunk.py 1.1.2.1 => 1.1.2.1.4.1 ===
+#
+# Copyright (c) 2001, 2002 Zope Corporation and Contributors. 
+# All Rights Reserved.
+# 
 # This software is subject to the provisions of the Zope Public License,
-# Version 1.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# 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.
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE
+# 
+##############################################################################
+"""
 
+$Id$
+"""
 import Persistence
 
 class FileChunk(Persistence.Persistent):


=== Zope3/lib/python/Zope/App/OFS/File/IFile.py 1.1.2.2 => 1.1.2.2.2.1 ===
 #
-# Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
-#
+# Copyright (c) 2001, 2002 Zope Corporation and Contributors. 
+# All Rights Reserved.
+# 
 # This software is subject to the provisions of the Zope Public License,
-# Version 1.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# 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.
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE
+# 
 ##############################################################################
 """
 


=== Zope3/lib/python/Zope/App/OFS/File/NaiveFile.py 1.1.2.3 => 1.1.2.3.2.1 ===
 #
-# Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
+# Copyright (c) 2001, 2002 Zope Corporation and Contributors. 
+# All Rights Reserved.
 #
 # This software is subject to the provisions of the Zope Public License,
 # Version 1.1 (ZPL).  A copy of the ZPL should accompany this distribution.


=== Zope3/lib/python/Zope/App/OFS/File/__init__.py 1.1.2.1 => 1.1.2.1.4.1 ===
+#
+# Copyright (c) 2001, 2002 Zope Corporation and Contributors. 
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 1.1 (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$
+"""

=== Removed File Zope3/lib/python/Zope/App/OFS/File/FileEdit.py ===

=== Removed File Zope3/lib/python/Zope/App/OFS/File/edit.pt ===