Changeset 608
- Timestamp:
- 10/25/06 06:47:28
- Files:
-
- qRSS2Syndication/trunk/HISTORY.txt (modified) (2 diffs)
- qRSS2Syndication/trunk/README.txt (modified) (2 diffs)
- qRSS2Syndication/trunk/skins/qrss2syndication/RSS2.pt (modified) (4 diffs)
- qRSS2Syndication/trunk/skins/qrss2syndication/ataudio_item.pt (modified) (1 diff)
- qRSS2Syndication/trunk/skins/qrss2syndication/blogentry_item.pt (modified) (1 diff)
- qRSS2Syndication/trunk/skins/qrss2syndication/getFileFieldContentType.py (modified) (previous)
- qRSS2Syndication/trunk/skins/qrss2syndication/getItemMacros.py (modified) (previous)
- qRSS2Syndication/trunk/skins/qrss2syndication/getSynProp.py (modified) (2 diffs)
- qRSS2Syndication/trunk/skins/qrss2syndication/getSyndicatableContent.py (modified) (1 diff)
- qRSS2Syndication/trunk/skins/qrss2syndication/save_rss2_setup.cpy (modified) (1 diff)
- qRSS2Syndication/trunk/skins/qrss2syndication/setup_rss2.cpt (modified) (3 diffs)
- qRSS2Syndication/trunk/skins/qrss2syndication/validate_rss2_setup.vpy (modified) (previous)
- qRSS2Syndication/trunk/utils.py (modified) (3 diffs)
- qRSS2Syndication/trunk/version.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
qRSS2Syndication/trunk/HISTORY.txt
r607 r608 1 0.4.5 2005-03-062 3 * added full body of article <content:encoded> support for Documents and SimpleBlog.4 5 * added Smart Folders/Topic syndication suport in Plone 2.1.2. The standart CMFTopic in Plone 2.0.5 does not implement getSyndicatableValues.6 7 * added basic iTunes support8 9 1 0.4.1 2005-08-25 10 2 11 3 * fixed RSS1 headers 12 4 … … 20 12 21 13 * Added <content:encoded> support to RSS2 template. 22 14 23 15 * blogentry_item.pt now supports <enclosure> for ATAudio. 24 16 25 17 * Added template RSS1, rssBody1 - RSS 0.92 feed with <content:encoded> tag. 26 18 qRSS2Syndication/trunk/README.txt
r607 r608 1 1 qRSS2Syndication simple product that adds RSS2 functionality to Plone. 2 * includes support of audio and video feeds. 2 * includes support of audio and video feeds. 3 3 * the syndication of ATAudio objects, mp3, wmv, ppt, jpg files using RSS 2.0 with enclosures. 4 * full body of article <content:encoded> support for Documents and SimpleBlog.5 * Smart Folders/Topic syndication suported in Plone 2.1.2. The standart CMFTopic in Plone 2.0.5 does not implement getSyndicatableValues.6 * basic iTunes support7 4 8 5 … … 19 16 which is controled with portal_syndication tool 20 17 21 EXTENDING22 18 23 If you need to introduce your custom content type into RSS2 refer to the document_item.pt template in the skin (or any other *_item.pt).24 25 AUTHORS26 27 Volodymyr Cherepanyak <chervol@quintagroup.com>28 Wolfgang Reutz <wolfgang.reutz@fhv.at> - iTunes support, mediacoop audio/video support.qRSS2Syndication/trunk/skins/qrss2syndication/RSS2.pt
r607 r608 4 4 xmlns:metal="http://xml.zope.org/namespaces/metal" 5 5 xmlns:content="http://purl.org/rss/1.0/modules/content/" 6 xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"7 6 tal:define="results python:here.getSyndicatableContent();" 8 7 tal:on-error="nothing"> 9 <tal:x define="dummy python:request.RESPONSE.setHeader('Content-Type', 'text/xml');" /> 10 <channel tal:define="author python:here.getObjectCreator(here.Creator()); 11 author_email python:author and author.getProperty('email','') or ''; 12 author_fullname python:author and author.getProperty('fullname','') or ''; 13 syInfo python:here.getSynProp(); 14 itunesEnabled python: syInfo['enable_itunes']"> 8 <tal:x define="dummy python:request.RESPONSE.setHeader('Content-Type', 'text/xml')" /> 9 <channel> 10 15 11 <title tal:define="portal_title here/portal_properties/title; 16 12 here_title here/title_or_id; … … 19 15 tal:content="string:$portal_title - $here_title">Title of page</title> 20 16 <link tal:content="here/absolute_url"></link> 21 <description tal:content="here/Description"></description> 17 <description tal:content="here/Description"> 18 </description> 22 19 <language>en-us</language> 23 <generator>Plone CMS</generator> 24 <author tal:condition="author_fullname" 25 tal:content="author_fullname"></author> 26 27 <tal:block condition="itunesEnabled"> 28 <ttl>240</ttl> 29 <itunes:author tal:condition="author_fullname" tal:content="author_fullname"></itunes:author> 30 <itunes:explicit tal:content="python:test(syInfo['itunes_explicit'],'yes','no')"></itunes:explicit> 31 <itunes:owner tal:condition="author"> 32 <itunes:name tal:condition="author_fullname" tal:content="author_fullname"></itunes:name> 33 <itunes:email tal:condition="author_email" tal:content="author_email"></itunes:email> 34 </itunes:owner> 35 <itunes:image href="" 36 tal:condition="python:syInfo['itunes_image_url']" 37 tal:attributes="href python:syInfo['itunes_image_url']" /> 38 <itunes:subtitle tal:condition="here/longDescription" tal:content="here/Description"></itunes:subtitle> 39 <itunes:summary tal:condition="here/longDescription|nothing" tal:content="here/longDescription"></itunes:summary> 40 </tal:block> 20 <generator>Plone 2.0</generator> 41 21 42 22 <tal:block repeat="res results"> 43 23 <tal:block define="macros nocall: python:here.getItemMacros(res.portal_type); 44 24 item_path python: res.absolute_url(); 45 item_creator python:here.getObjectCreator(res.Creator()); 46 item_creator python:item_creator and '%s (%s)' % (item_creator.getProperty('fullname',''),item_creator.getProperty('email','')) or ''"> 25 item_path python: res.portal_type=='ATAudio' and item_path+'/file_download/'+res.getId() or item_path;"> 47 26 <item> 48 27 <title tal:content="res/title_or_id"></title> … … 50 29 <description tal:content="res/Description"> 51 30 </description> 52 <tal:block condition="itunesEnabled"> 53 <itunes:subtitle tal:condition="res/longDescription|nothing" tal:content="res/Description"></itunes:subtitle> 54 <itunes:summary tal:condition="res/longDescription|nothing" tal:content="res/longDescription"></itunes:summary> 55 </tal:block> 56 <author tal:condition="item_creator" 57 tal:content="item_creator"></author> 31 <author tal:content="res/Creator"></author> 58 32 <tal:repeat repeat="subj res/Subject"> 59 33 <category tal:content="subj"> … … 63 37 <metal:block use-macro="macros"/> 64 38 </item> 39 65 40 </tal:block> 41 66 42 </tal:block> 43 44 67 45 </channel> 46 68 47 </rss> 69 48 qRSS2Syndication/trunk/skins/qrss2syndication/ataudio_item.pt
r607 r608 2 2 <rss version="2.0" 3 3 xmlns:tal="http://xml.zope.org/namespaces/tal" 4 xmlns:metal="http://xml.zope.org/namespaces/metal" 5 xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" > 4 xmlns:metal="http://xml.zope.org/namespaces/metal" > 6 5 <metal:block define-macro="item"> 7 <tal:define define="item_size res/getFileSize | python: 0; 8 content_type res/getMimeType;"> 6 <tal:define define="file res/getFile; 7 item_size file/get_size | python: file and len(file) or 0; 8 content_type python:here.getFileFieldContentType(res); 9 "> 9 10 <enclosure 10 11 tal:attributes="type content_type; 11 12 url item_path; 12 13 length item_size"/> 13 <tal:block condition="itunesEnabled">14 <itunes:duration tal:content="res/getLengthString"></itunes:duration>15 </tal:block>16 14 </tal:define> 17 15 </metal:block> qRSS2Syndication/trunk/skins/qrss2syndication/blogentry_item.pt
r607 r608 7 7 <tal:repeat repeat="tag res/EntryTag"> 8 8 <category tal:content="tag"></category> 9 </tal:repeat> 10 <content:encoded tal:content="structure res/render_body"> </content:encoded> 9 </tal:repeat> 10 <content:encoded> 11 <tal:x replace="structure python:'<![CDATA['+res.getBody()+']]>'"/> 12 </content:encoded> 11 13 <tal:x tal:on-error="string:" 12 14 define="files python:res.objectValues('ATAudio'); qRSS2Syndication/trunk/skins/qrss2syndication/getSynProp.py
r607 r608 1 ## Script (Python) "get SynProp"1 ## Script (Python) "getAudioFiles" 2 2 ##bind container=container 3 3 ##bind context=context … … 5 5 ##bind script=script 6 6 ##bind subpath=traverse_subpath 7 ##parameters= object=None7 ##parameters= object=None 8 8 ##title= 9 9 ## qRSS2Syndication/trunk/skins/qrss2syndication/getSyndicatableContent.py
r607 r608 11 11 if not obj: 12 12 obj = context 13 if hasattr(context,'synContentValues') or context.portal_type=='Topic':13 if hasattr(context,'synContentValues'): 14 14 count = context.portal_syndication.getMaxItems(obj) 15 15 res = context.portal_syndication.getSyndicatableContent(obj) 16 # has to check and cut number of items to be displayed17 # to prevent feed bloat18 16 count = count<len(res) and count or len(res) 19 17 res = res[:count] qRSS2Syndication/trunk/skins/qrss2syndication/save_rss2_setup.cpy
r607 r608 6 6 ##bind state=state 7 7 ##bind subpath=traverse_subpath 8 ##parameters= rss2_types=(),only_published=0,include_subfolders=0, articles_number=20, enable_itunes=0, itunes_image_url='', itunes_explicit=0,REQUEST=None8 ##parameters= rss2_types=(),only_published=0,include_subfolders=0, articles_number=20,REQUEST=None 9 9 ##title= 10 10 ## 11 11 if REQUEST: 12 12 from Products.qRSS2Syndication.utils import setupRSS2Types 13 status,message=setupRSS2Types(context,rss2_types,only_published,include_subfolders,articles_number, enable_itunes,itunes_image_url,itunes_explicit,REQUEST)13 status,message=setupRSS2Types(context,rss2_types,only_published,include_subfolders,articles_number,REQUEST) 14 14 return state.set(status=status, portal_status_message=message) 15 15 qRSS2Syndication/trunk/skins/qrss2syndication/setup_rss2.cpt
r607 r608 49 49 </metal:block> 50 50 51 </select>51 </select> 52 52 </div> 53 53 … … 75 75 </div> 76 76 77 77 78 <div class="field" 78 79 tal:define="error errors/articles_number|nothing;" … … 91 92 </div> 92 93 93 <fieldset> 94 <legend i18n:translate="legend_itunes">iTunes</legend> 95 <div class="field"> 96 <input type="checkbox" 97 name="enable_itunes" 98 value="0" 99 tal:define="checked python:sy_info['enable_itunes'] and 'checked'" 100 tal:attributes="checked checked"/> 101 <label for="enable_itunes" i18n:translate="label_enable_itunes">Enable support for iTunes Music Store (good for Podcasts/Vodcasts)</label> 102 </div> 103 104 <div class="field"> 105 <input type="checkbox" 106 name="itunes_explicit" 107 value="0" 108 tal:define="checked python:sy_info['itunes_explicit'] and 'checked'" 109 tal:attributes="checked checked"/> 110 <label for="itunes_explicit" i18n:translate="label_itunes_explicit">This channel contains explicit content, strong language, sexuality, ...</label> 111 </div> 112 113 <div class="field"> 114 <label for="itunes_image_url" i18n:translate="label_itunes_image_url">Artwork for this Channel</label> 115 <div class="formHelp" i18n:translate="help_itunes_image_url"> 116 Please enter a url to a image for the artwork of this channel. Should be in JPEG or PNG format and 300x300 pixels. 117 </div> 118 <input type="text" 119 name="itunes_image_url" 120 value="" 121 size="60" 122 tal:define="itunes_image_url python:request.get('itunes_image_url',None) or sy_info['itunes_image_url'] or ''" 123 tal:attributes="value itunes_image_url"/> 124 </div> 125 </fieldset> 94 95 126 96 <div class="formControls"> 127 97 qRSS2Syndication/trunk/utils.py
r607 r608 8 8 include_subfolders = 0, 9 9 articles_number = 20, 10 enable_itunes = 0,11 itunes_image_url = '',12 itunes_explicit = 0,13 10 REQUEST = None): 14 11 """ Save all needed RSS2 properties into 'syndication_information' """ … … 26 23 syInfo.include_subfolders = include_subfolders 27 24 syInfo.max_items = articles_number 28 syInfo.enable_itunes = enable_itunes29 syInfo.itunes_image_url = itunes_image_url30 syInfo.itunes_explicit = itunes_explicit31 25 return status, message 32 26 … … 40 34 syPropeties['include_subfolders'] = getattr(syInfo,'include_subfolders',0) 41 35 syPropeties['articles_number'] =int(getattr(syInfo,'max_items',20)) 42 syPropeties['enable_itunes'] = getattr(syInfo,'enable_itunes',0)43 syPropeties['itunes_image_url'] = getattr(syInfo,'itunes_image_url','')44 syPropeties['itunes_explicit'] = getattr(syInfo,'itunes_explicit',0)45 36 return syPropeties 46 37 qRSS2Syndication/trunk/version.txt
r607 r608 1 0.4. 51 0.4.1
