[Zope-CVS] CVS: Products/OSCOM/NOTSite - TODO.txt:1.6 content.py:1.4 setup.py:1.6

Tres Seaver tseaver@zope.com
Thu, 29 May 2003 14:50:25 -0400


Update of /cvs-repository/Products/OSCOM/NOTSite
In directory cvs.zope.org:/tmp/cvs-serv952

Modified Files:
	TODO.txt content.py setup.py 
Log Message:


  - Repair skins breakage:

    o 'story_edit' marshalling error.

  - Implement "most recent 15" for section fronts.

  - Make CMS breadcrumbs emit CMS-centric URLs.

  - Expose effective / expires dates for stories.

  - Compute section list slot.

  - Implement "Tease Story" action for stories.

  - Add knobs to change the includable types for a section (currently
    needs help from ZMI to set property).

  - Add handling for "NITF" as text_format value.

  - First pass at NITF-HTML rendering.

  - *Don't* make folders / sections workflowed.


=== Products/OSCOM/NOTSite/TODO.txt 1.5 => 1.6 ===
--- Products/OSCOM/NOTSite/TODO.txt:1.5	Tue May 27 01:44:21 2003
+++ Products/OSCOM/NOTSite/TODO.txt	Thu May 29 14:49:54 2003
@@ -28,22 +28,34 @@
 
     (x) Make 'folder_contents' do the Right Thing (tm) for actions.
 
-    ( ) Make 'breadcrumbs' do the Right Thing (tm) for CMS-side.
+    (x) Fix 'story_edit' when passing in HTML (I think it was
+        was broken marshalling file upload object inside ':record').
 
-    ( ) Make 'section_view' honor the RFP's requirement for "15 most
+  Workshop Skinning Tasks
+
+    (x) Make 'breadcrumbs' do the Right Thing (tm) for CMS-side.
+
+    (x) Surface the effective / expiration metdata of stories / teases.
+
+    (x) Make 'section_view' honor the RFP's requirement for "15 most
         recent, sorted reverse chronological."
 
-    ( ) Make section list non-static.
+    (x) Make section list non-static.
 
-    ( ) Make "Tease Story" action work, by creating tease in the
-        "Front Page" section.
+    (x) Make "Tease Story" action work, by creating tease in the
+        "Front Page" section (allow selection?)
 
-    ( ) Skin the "Front Page" section to show teases, rather than
+    (x) Skin the "Front Page" section to show teases, rather than
         stories.
 
+        - Needs help from ZMI, setting 'section_item_types' list
+          property to include only 'Story Tease'.
+
     ( ) Add dynamic ad / weather splashes.
 
   NITF Processing
+
+    ( ) Add 'NITF' as an allowed 'text_format' for News Story.
 
     ( ) Wire up PUT handling for 'text/xml'.
 


=== Products/OSCOM/NOTSite/content.py 1.3 => 1.4 ===
--- Products/OSCOM/NOTSite/content.py:1.3	Mon May 26 02:32:20 2003
+++ Products/OSCOM/NOTSite/content.py	Thu May 29 14:49:54 2003
@@ -5,6 +5,8 @@
 from Globals import InitializeClass
 from AccessControl import ClassSecurityInfo
 
+from Products.CMFCore.FSDTMLMethod import FSDTMLMethod
+from Products.CMFCore.DirectoryView import registerFileExtension
 from Products.CMFDefault.Document import Document
 from Products.CMFDefault.Favorite import Favorite
 from Products.CMFDefault.SkinnedFolder import SkinnedFolder
@@ -23,6 +25,66 @@
     """
     meta_type = 'News Story'
     security = ClassSecurityInfo()
+    
+    #
+    #   Override Document's hardwiring about 'text_format'
+    #
+    security.declareProtected( View, 'Format' )
+    def Format( self ):
+
+        """ Return a content-type style format of the underlying source.
+        """
+        if self.text_format == 'html':
+            return 'text/html'
+        elif self.text_format in ( 'NITF', ):
+            return 'text/xml'
+        else:
+            return 'text/plain'
+
+    security.declareProtected( ModifyNewsStories, 'setFormat' )
+    def setFormat( self, value ):
+
+        """ Update the 'Content-type': metadata.
+        """
+        value = str( value )
+
+        if value == 'text/html' or value == 'html':
+            self.text_format = 'html'
+
+        elif value == 'text/xml' or value == 'NITF':
+            self.text_format = 'NITF'
+
+        elif value == 'plain':
+            self.text_format = 'plain'
+
+        else:
+            self.text_format = 'structured-text'
+
+    security.declareProtected( View, 'CookedBody' )
+    def CookedBody( self, stx_level=None, setlevel=0 ):
+
+        """ Return the ready-for-consumption rendered text.
+        """
+        if self.text_format in ( 'text/xml', 'NITF' ):
+            return self.text
+        else:
+            return Document.CookedBody( stx_level, setlevel )
+
+    security.declarePrivate( '_edit' )
+    def _edit(self, text, text_format='', safety_belt=''):
+
+        """ Parse headers and cook the body.
+        """
+        if text_format in ( 'NITF', 'text/xml' ):
+
+            if not self._safety_belt_update( safety_belt=safety_belt ):
+                raise 'EditingConflict', 'You lose!'
+
+            self.text = self.cooked_text = text
+
+        else:
+            Document._edit( self, text, text_format, safety_belt )
+
 
 InitializeClass( NewsStory )
 
@@ -183,3 +245,4 @@
 )
 
 
+registerFileExtension( 'xsl', FSDTMLMethod )


=== Products/OSCOM/NOTSite/setup.py 1.5 => 1.6 ===
--- Products/OSCOM/NOTSite/setup.py:1.5	Mon May 26 02:32:20 2003
+++ Products/OSCOM/NOTSite/setup.py	Thu May 29 14:49:54 2003
@@ -92,7 +92,7 @@
                               '(Web-configurable workflow [Classic])' )
                      
             #   These objects don't participate in workflow by default.
-            #tool.setChainForPortalTypes( ( 'Folder', 'Topic' ), () )
+            tool.setChainForPortalTypes( ( 'Folder', 'News Section' ), () )
 
         
     def setupActionIcons( self, new_site ):