[Erp5-report] r37179 ivan - in /erp5/trunk/products/ERP5: Document/ PropertySheet/

nobody at svn.erp5.org nobody at svn.erp5.org
Mon Jul 19 09:48:03 CEST 2010


Author: ivan
Date: Mon Jul 19 09:48:02 2010
New Revision: 37179

URL: http://svn.erp5.org?rev=37179&view=rev
Log:
Remove Snapshot implementation.

Removed:
    erp5/trunk/products/ERP5/PropertySheet/Snapshot.py
Modified:
    erp5/trunk/products/ERP5/Document/Acknowledgement.py
    erp5/trunk/products/ERP5/Document/Document.py
    erp5/trunk/products/ERP5/Document/EmailDocument.py
    erp5/trunk/products/ERP5/Document/Event.py
    erp5/trunk/products/ERP5/Document/TextDocument.py

Modified: erp5/trunk/products/ERP5/Document/Acknowledgement.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/Acknowledgement.py?rev=37179&r1=37178&r2=37179&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/Acknowledgement.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/Acknowledgement.py [utf8] Mon Jul 19 09:48:02 2010
@@ -67,7 +67,6 @@ class Acknowledgement(EmailDocumentProxy
                     , PropertySheet.CategoryCore
                     , PropertySheet.Document
                     , PropertySheet.DublinCore
-                    , PropertySheet.Snapshot
                     , PropertySheet.Task
                     , PropertySheet.Url
                     , PropertySheet.Arrow

Modified: erp5/trunk/products/ERP5/Document/Document.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/Document.py?rev=37179&r1=37178&r2=37179&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/Document.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/Document.py [utf8] Mon Jul 19 09:48:02 2010
@@ -82,48 +82,6 @@ DEFAULT_QUALITY = 75
 
 DEFAULT_CONTENT_TYPE = 'text/html'
 
-
-class SnapshotMixin:
-  """
-    This class provides a generic API to store in the ZODB
-    PDF snapshots of objects and documents with the
-    goal to keep a facsimile copy of documents as they
-    were at a given date.
-  """
-
-  # Declarative security
-  security = ClassSecurityInfo()
-  security.declareObjectProtected(Permissions.AccessContentsInformation)
-
-  security.declareProtected(Permissions.ModifyPortalContent, 'createSnapshot')
-  def createSnapshot(self):
-    """
-      Create a snapshot (PDF). This is the normal way to modifiy
-      snapshot_data. Once a snapshot is taken, a new snapshot
-      can not be taken.
-
-      NOTE: use getSnapshotData and hasSnapshotData accessors
-      to access a snapshot.
-
-      NOTE2: implementation of createSnapshot should probably
-      be delegated to a types base method since this it
-      is configuration dependent.
-    """
-    if self.hasSnapshotData():
-      raise ConversionError('This document already has a snapshot.')
-    self._setSnapshotData(self.convert(format='pdf'))
-
-  security.declareProtected(Permissions.ManagePortal, 'deleteSnapshot')
-  def deleteSnapshot(self):
-    """
-      Deletes the snapshot - in theory this should never be done.
-      It is there for programmers and system administrators.
-    """
-    try:
-      del(self.snapshot_data)
-    except AttributeError:
-      pass
-
 class ConversionError(Exception):pass
 
 class DocumentProxyError(Exception):pass
@@ -132,8 +90,7 @@ class NotConvertedError(Exception):pass
 allow_class(NotConvertedError)
 
 class Document(DocumentExtensibleTraversableMixin, XMLObject, UrlMixIn, CachedConvertableMixin,
-               SnapshotMixin, CrawableMixin, TextConvertableMixin,
-               DownloadableMixin, DocumentMixin):
+               CrawableMixin, TextConvertableMixin, DownloadableMixin, DocumentMixin):
   """Document is an abstract class with all methods related to document
   management in ERP5. This includes searchable text, explicit relations,
   implicit relations, metadata, versions, languages, etc.
@@ -334,7 +291,6 @@ class Document(DocumentExtensibleTravers
                     , PropertySheet.ExternalDocument
                     , PropertySheet.Url
                     , PropertySheet.Periodicity
-                    , PropertySheet.Snapshot
                     )
 
   index_html = DownloadableMixin.index_html

Modified: erp5/trunk/products/ERP5/Document/EmailDocument.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/EmailDocument.py?rev=37179&r1=37178&r2=37179&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/EmailDocument.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/EmailDocument.py [utf8] Mon Jul 19 09:48:02 2010
@@ -145,7 +145,6 @@ class EmailDocument(TextDocument):
                     , PropertySheet.DublinCore
                     , PropertySheet.Version
                     , PropertySheet.Document
-                    , PropertySheet.Snapshot
                     , PropertySheet.ExternalDocument
                     , PropertySheet.Url
                     , PropertySheet.TextDocument

Modified: erp5/trunk/products/ERP5/Document/Event.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/Event.py?rev=37179&r1=37178&r2=37179&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/Event.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/Event.py [utf8] Mon Jul 19 09:48:02 2010
@@ -116,7 +116,6 @@ class Event(EmailDocument, Movement, Ack
                     , PropertySheet.CategoryCore
                     , PropertySheet.Document
                     , PropertySheet.DublinCore
-                    , PropertySheet.Snapshot
                     , PropertySheet.Task
                     , PropertySheet.Url
                     , PropertySheet.TextDocument

Modified: erp5/trunk/products/ERP5/Document/TextDocument.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/TextDocument.py?rev=37179&r1=37178&r2=37179&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/TextDocument.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/TextDocument.py [utf8] Mon Jul 19 09:48:02 2010
@@ -67,7 +67,6 @@ class TextDocument(CachedConvertableMixi
                       , PropertySheet.DublinCore
                       , PropertySheet.Version
                       , PropertySheet.Document
-                      , PropertySheet.Snapshot
                       , PropertySheet.ExternalDocument
                       , PropertySheet.Url
                       , PropertySheet.TextDocument

Removed: erp5/trunk/products/ERP5/PropertySheet/Snapshot.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/PropertySheet/Snapshot.py?rev=37178&view=auto
==============================================================================
--- erp5/trunk/products/ERP5/PropertySheet/Snapshot.py [utf8] (original)
+++ erp5/trunk/products/ERP5/PropertySheet/Snapshot.py (removed)
@@ -1,49 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2006 Nexedi SARL and Contributors. All Rights Reserved.
-#          Jean-Paul Smets <jp at nexedi.com>
-#
-# WARNING: This program as such is intended to be used by professional
-# programmers who take the whole responsability of assessing all potential
-# consequences resulting from its eventual inadequacies and bugs
-# End users who are looking for a ready-to-use solution with commercial
-# garantees and support are strongly adviced to contract a Free Software
-# Service Company
-#
-# This program is Free Software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-#
-##############################################################################
-
-class Snapshot:
-  """
-     This property sheet defines the way to store data (file, images, etc.)
-     in the form of an object of any type
-  """
-
-  _properties = (
-    { 'id'          : 'snapshot_data',
-      'description' : 'An object (string, stream, etc.) which contains raw data'
-                      'of a snapshot. Snapshot is used to keep a visual representation'
-                      'of a document such as an invoice.',
-      'type'        : 'data',
-      'write_permission' : 'Manage properties',
-      'default'     : '',
-      'mode'        : 'w' },
-    { 'id'          : 'snapshot_content_type',
-      'description' : 'A string which represents the mime type of the snapshot data',
-      'type'        : 'string',
-      'default'     : 'application/pdf',
-      'mode'        : 'w' },
-   )




More information about the Erp5-report mailing list