[Commits] (alecf) remove some old zaobao code that was sitting around

commits at osafoundation.org commits at osafoundation.org
Fri Feb 4 12:13:50 PST 2005


Commit by: alecf
Modified files:
chandler/parcels/osaf/examples/zaobao/blocks.py 1.33 1.34
chandler/parcels/osaf/views/zaobao/parcel.xml 1.34 1.35

Log message:
remove some old zaobao code that was sitting around

ViewCVS links:
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/examples/zaobao/blocks.py.diff?r1=text&tr1=1.33&r2=text&tr2=1.34
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/views/zaobao/parcel.xml.diff?r1=text&tr1=1.34&r2=text&tr2=1.35

Index: chandler/parcels/osaf/views/zaobao/parcel.xml
diff -u chandler/parcels/osaf/views/zaobao/parcel.xml:1.34 chandler/parcels/osaf/views/zaobao/parcel.xml:1.35
--- chandler/parcels/osaf/views/zaobao/parcel.xml:1.34	Thu Feb  3 18:17:31 2005
+++ chandler/parcels/osaf/views/zaobao/parcel.xml	Fri Feb  4 12:13:48 2005
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
 
-<!-- $Revision: 1.34 $ -->
-<!-- $Date: 2005/02/04 02:17:31 $ -->
+<!-- $Revision: 1.35 $ -->
+<!-- $Date: 2005/02/04 20:13:48 $ -->
 <!-- Copyright (c) 2003-2004 Open Source Applications Foundation -->
 <!-- License: http://osafoundation.org/Chandler_0.1_license_terms.htm -->
 
@@ -23,55 +23,14 @@
     <fontStyle>bold</fontStyle>
   </CharacterStyle>  
 
-  <!-- The main ZaoBao view -->
-
-  <Tree itsName="ZaoBaoTree">
-    <elementDelegate>osaf.examples.zaobao.blocks.ZaoBaoTreeDelegate</elementDelegate>
-    <rootPath itemref="zb:RSSChannel"/>
-
-    <columnHeadings>Subject</columnHeadings>
-    <columnWidths>300</columnWidths>
-    <columnHeadings>Date</columnHeadings>
-    <columnWidths>150</columnWidths>
-
-    <size>600,200</size>
-    <minimumSize>400,100</minimumSize>
-  </Tree>
-
   <ItemDetail itsName="ItemBodyArea" itemClass="osaf.examples.zaobao.blocks.ZaoBaoItemDetail">
     <blockName value="articletext"/>
     <size>100,50</size>
     <minimumSize>100,50</minimumSize>    
   </ItemDetail>
   
-  <EditText itsName="NewChannel">
-    <size>100,20</size>
-    <minimumSize>100,20</minimumSize>
-    <stretchFactor>0.0</stretchFactor>
-    <lineStyleEnum>SingleLine</lineStyleEnum>
-    <textStyleEnum>PlainText</textStyleEnum>
-    <readOnly>False</readOnly>
-    <characterStyle itemref="doc:HeaderCharacterStyle"/>
-  </EditText>
-
-  <HTML itsName="AboutZaoBao">
-    <url>parcels/osaf/examples/zaobao/AboutZaoBao.html</url>
-    <eventBoundary>True</eventBoundary>
-    <size>900,580</size>
-    <minimumSize>900,580</minimumSize>
-  </HTML>
-
-
   <!-- ## detail view for RSSItems ## -->
-  
-  <!-- ContentItem will handle display of the channel title -->
-  
-  <!-- The raw HTML channel data  -->
-  <ItemDetail itsName="ChannelItemDetail" itemClass="osaf.examples.zaobao.blocks.ZaoBaoItemDetail">
-    <size>100,50</size>
-    <minimumSize>100,50</minimumSize>
-  </ItemDetail>
-
+    
   <!-- URL -->
   <ContentItemDetail itsName="LinkArea"
     itemClass="osaf.framework.blocks.detail.Detail.DetailSynchronizedLabeledTextAttributeBlock">

Index: chandler/parcels/osaf/examples/zaobao/blocks.py
diff -u chandler/parcels/osaf/examples/zaobao/blocks.py:1.33 chandler/parcels/osaf/examples/zaobao/blocks.py:1.34
--- chandler/parcels/osaf/examples/zaobao/blocks.py:1.33	Thu Feb  3 18:17:31 2005
+++ chandler/parcels/osaf/examples/zaobao/blocks.py	Fri Feb  4 12:13:48 2005
@@ -1,8 +1,8 @@
 """ ZaoBao blocks
 """
 
-__version__ = "$Revision: 1.33 $"
-__date__ = "$Date: 2005/02/04 02:17:31 $"
+__version__ = "$Revision: 1.34 $"
+__date__ = "$Date: 2005/02/04 20:13:48 $"
 __copyright__ = "Copyright (c) 2003-2004 Open Source Applications Foundation"
 __license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -11,99 +11,6 @@
 import osaf.examples.zaobao.RSSData as RSSData
 import osaf.framework.blocks.detail.Detail as Detail
 
-# GetZaoBaoElementValues is shared between both classes
-def GetZaoBaoElementValues(element):
-    if element == RSSData.RSSChannel.getKind(element.itsView):
-        return ['','']
-
-    displayName = element.getAttributeValue('displayName',
-                                            default='<Untitled>')
-    date = element.getAttributeValue('date', default=None)
-    if not date:
-        date = element.getAttributeValue('lastModified', default='')
-    if date != '':
-        date = date.localtime().Format('%B %d, %Y    %I:%M %p')
-
-    return [displayName, str(date)]
-
-class ZaoBaoListDelegate (ListDelegate):
-    def GetElementParent(self, element):
-        if element.itsKind is RSSData.RSSChannel.getKind(element.itsView):
-            return None
-        return element.channel
-
-    def GetElementChildren(self, element):
-        if element.itsKind is RSSData.RSSChannel.getKind(element.itsView):
-            return element.items
-        return None
-
-    def GetElementValues(self, element):
-        return GetZaoBaoElementValues(element)
-
-    def ElementHasChildren(self, element):
-        if element.itsKind is RSSData.RSSChannel.getKind(element.itsView):
-            return len(element.getAttributeValue('items', default=[])) != 0
-        return False
-
-    def NeedsUpdate(self, event):
-        chanUUID = self.blockItem.rootPath.itsUUID
-        changedUUID = event.arguments['uuid']
-        if chanUUID == changedUUID:
-            self.scheduleUpdate = True
-
-class ZaoBaoTreeDelegate (ListDelegate):
-    def GetElementParent(self, element):
-        chanKind = RSSData.RSSChannel.getKind(element.itsView)
-        if element == chanKind:
-            return None
-        if element.itsKind is chanKind:
-            return chanKind
-        return element.channel
-
-    def GetElementChildren(self, element):
-        chanKind = RSSData.RSSChannel.getKind(element.itsView)
-
-        if element == chanKind:
-            return KindQuery().run([chanKind])
-
-        if element.itsKind is chanKind:
-            return element.items
-
-        return None
-
-    def GetElementValues(self, element):
-        return GetZaoBaoElementValues(element)
-
-    def ElementHasChildren(self, element):
-        chanKind = RSSData.RSSChannel.getKind(element.itsView)
-        if element == chanKind:
-            return True
-
-        if element.itsKind is chanKind:
-            return len(element.getAttributeValue('items', default=[])) != 0
-
-        return False
-
-    def NeedsUpdate(self, event):
-        view = self.blockItem.itsView
-        item = view.findUUID(event.arguments['uuid'])
-        if item.itsKind is RSSData.RSSChannel.getKind(view):
-            self.scheduleUpdate = True
-
-
-# XXX need to relocate this somewhere...
-def onEnterPressedEvent(self, event):
-    url = event.arguments['text']
-    if len(url) < 5:
-        return
-
-    view = self.itsView
-
-    view.commit()
-    chan = RSSData.NewChannelFromURL(view, url, True)
-    view.commit()
-
-
 class ZaoBaoItemDetail(Detail.HTMLDetailArea):
 
     def getHTMLText(self, item):



More information about the Commits mailing list