Changeset 3005 in products
- Timestamp:
- Nov 12, 2010 1:07:34 PM (13 years ago)
- Location:
- quintagroup.plonegooglesitemaps/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
quintagroup.plonegooglesitemaps/trunk/docs/HISTORY.txt
r3002 r3005 2 2 ========= 3 3 4 1.6.0 (2010-1 0-11)4 1.6.0 (2010-11-12) 5 5 ------------------ 6 6 … … 8 8 with default "id" and "path" filters. 9 9 [mylan] 10 * Updated tests, added filtering doctests ,10 * Updated tests, added filtering doctests. 11 11 [mylan] 12 12 -
quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/README.txt
r2845 r3005 1 ===============================2 quintagroup.plonegooglesitemaps3 ===============================4 5 1 Plone Google Sitemaps product allows Plone websites to get better visibility for Google search engine by providing it with complete listing of URLs to website content. 6 2 … … 22 18 ===== 23 19 24 20 To enable Google Sitemaps on your site: 25 21 26 22 * Add Sitemap(s) at Google Sitemap "Settings" tab (Add-on Products Configuarion -> Google Sitemaps). You can add any of the Sitemap types: content, mobile or news. 27 23 28 24 * Let Google know about your Sitemap(s) by adding your Sitemap to Google Sitemaps. 29 25 30 26 See more detailed instructions on Plone Google Sitemaps usage at http://projects.quintagroup.com/products/wiki/qPloneGoogleSitemaps 31 27 32 28 MIGRATION 33 29 ========= 34 30 35 If you UPGRADE older version of quintagroup.plonegooglesitemaps package to newer: 36 -------------------------------------------------------------------------------- 37 1. In your zope instance configuration or buildout - replace old package version 38 with new one. 39 2. Run plone instance and reinstall package with Quickinstaller tool 40 ("Add-on Products" in plone control panel). 31 If you UPGRADE older version of quintagroup.plonegooglesitemaps package to newer: 32 --------------------------------------------------------------------------------- 41 33 42 If your MIGRATE from Products.qPloneGoogleSitemaps to quintagroup.plonegooglesitemaps: 43 ------------------------------------------------------------------------------------- 44 1. Add to new plone instance/buildout both qPloneGoogleSitemaps product and 45 last version quintagroup.plonegooglesitemaps package. 46 2. Copy Data.fs from old Plone instance to new one. 47 3. Start your new zope instance/buildout. 34 1. In your zope instance configuration or buildout - replace old package version with new one. 35 2. Run plone instance and reinstall package with Quickinstaller tool ("Add-on Products" in plone control panel). 48 36 49 _The following steps are performed in the plone instance_ 50 4. With portal_migration (ZMI) - upgrade plone instance. 51 5. With Quickinstaller tool ("Add-on Products" in plone control panel) 52 deinstall old "Plone Google Sitemaps" product and install new version. 53 6. Go to *Import* tab in portal_setup tool (ZMI), select "Migrate from 54 qPloneGoogleSitemaps to quintagroup.plonegooglesitemaps" profile from 55 selection box and choose same-named import step and push "Import 56 selected steps" button. 37 If your MIGRATE from Products.qPloneGoogleSitemaps to quintagroup.plonegooglesitemaps: 38 -------------------------------------------------------------------------------------- 57 39 58 _And the last clean-up steps:_ 59 7. Remove qPloneGoogleSitemaps product from your zope instance/buildout 60 configuration. 40 1. Add to new plone instance/buildout both qPloneGoogleSitemaps product and last version quintagroup.plonegooglesitemaps package. 41 2. Copy Data.fs from old Plone instance to new one. 42 3. Start your new zope instance/buildout. 43 44 The following steps are performed in the plone instance: 45 46 4. With portal_migration (ZMI) - upgrade plone instance. 47 5. With Quickinstaller tool ("Add-on Products" in plone control panel) deinstall old "Plone Google Sitemaps" product and install new version. 48 6. Go to *Import* tab in portal_setup tool (ZMI), select "Migrate from qPloneGoogleSitemaps to quintagroup.plonegooglesitemaps" profile from selection box and choose same-named import step and push "Import selected steps" button. 49 50 And the last clean-up steps: 51 52 7. Remove qPloneGoogleSitemaps product from your zope instance/buildout configuration. 61 53 62 54 … … 64 56 ========== 65 57 66 58 Watch Plone Google Sitemaps Screencasts at http://quintagroup.com/cms/screencasts/qplonegooglesitemaps to see how to use this products on your Plone instance. Learn about how to install and configure Sitemaps on your Plone instance, how to create new Google Sitemaps, and how to let Google know about them. 67 59 68 60 LINKS 69 61 ===== 70 62 71 * See "Google Sitemaps": https://www.google.com/webmasters/sitemaps website for more information. 72 73 * Product Homepage: http://quintagroup.com/services/plone-development/products/google-sitemaps 74 75 * Documentation Area: http://projects.quintagroup.com/products/wiki/qPloneGoogleSitemaps 76 77 * Repository: http://svn.quintagroup.com/products/quintagroup.plonegooglesitemaps 78 79 * Releases: http://plone.org/products/qplonegooglesitemaps/releases 80 81 * Watch "Plone Google Sitemeps" Screencast at http://quintagroup.com/cms/screencasts/qplonegooglesitemaps 82 63 * See "Google Sitemaps": https://www.google.com/webmasters/sitemaps website for more information. 64 * Product Homepage: http://quintagroup.com/services/plone-development/products/google-sitemaps 65 * Documentation Area: http://projects.quintagroup.com/products/wiki/qPloneGoogleSitemaps 66 * Repository: http://svn.quintagroup.com/products/quintagroup.plonegooglesitemaps 67 * Releases: http://plone.org/products/qplonegooglesitemaps/releases 68 * Watch "Plone Google Sitemeps" Screencast at http://quintagroup.com/cms/screencasts/qplonegooglesitemaps 83 69 84 70 AUTHORS 85 71 ======= 86 72 87 73 The product was developed by Quintagroup.com team: 88 74 89 * Myroslav Opyr 75 * Myroslav Opyr 76 * Andriy Mylenkyi 77 * Nazar Ilchuk 78 * Mykola Kharechko 79 80 Copyright (c) "Quintagroup": http://quintagroup.com, 2004-2010 90 81 91 * Andriy Mylenkyi92 93 * Nazar Ilchuk94 95 * Mykola Kharechko96 97 98 Copyright (c) "Quintagroup": http://quintagroup.com, 2004-2010 -
quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/filters.txt
r3002 r3005 3 3 ================== 4 4 5 Filtering introductioin 6 ======================= 7 8 Sitemap portal type has an option, designed to filter out 9 objects which should be excluded from a sitemap. This option is 10 accessable in sitemap edit form and is labeled as 11 "Blackout entries". 5 Introduction 6 ============ 7 8 Sitemap portal type has an option that filters objects that 9 should be excluded from a sitemap. This option is accessable 10 on sitemap edit form and is labeled as "Blackout entries". 12 11 13 12 In earlier versions of the package (<4.0.1 for plone-4 branch 14 13 and <3.0.7 for plone-3 branch) this field allowed to 15 filter objects only by their ids, and looked like:14 filter objects only by their ids, and it looked like: 16 15 17 16 <pre> … … 20 19 </pre> 21 20 22 So, all objects with "index.html" or "index_html" ids were 23 excluded from the sitemap. 24 25 In the new versions of GoogleSitemaps filtering was remade 26 to pluggable architecture. Now filters became named multi 27 adapters. There are only two default filters - "id" and 28 "path". 21 As a result, all objects with "index.html" or "index_html" ids 22 were excluded from the sitemap. 23 24 In the new versions of GoogleSitemaps filtering was refactored 25 to pluggable architecture. Now filters turned to be named multi 26 adapters. There are only two default filters: "id" and "path". 29 27 30 28 Since different filters can be used - new syntax was applied … … 34 32 [<filter name>:]<filter arguments> 35 33 36 If no <filter name> is specified - "id" filter will 37 be used. If <filter name> is specified - system will look 38 for <filter name>-named multiadapter to IBlackoutFilter 39 interface. If such multiadapter is not found - filter 40 will be ignored without raising any errors. 41 42 43 Following parts demonstrate working of the filtering. 44 Aspects of default filters ("id" and "path") 45 are considered yet. 46 47 Setup demonstration environment 34 * If no <filter name> is specified - "id" filter will be used. 35 * If <filter name> is specified - system will look for 36 <filter name>-named multiadapter to IBlackoutFilter interface. 37 If such multiadapter is not found - filter ill be ignored without 38 raising any errors. 39 40 The following parts demonstrate how to work with filtering. 41 Aspects of default filters ("id" and "path") will also be 42 considered. 43 44 Demonstration environment setup 48 45 =============================== 49 46 50 First, we must perform some setup. We use the testbrowser that is47 First, we have to do some setup. We use testbrowser that is 51 48 shipped with Five, as this provides proper Zope 2 integration. Most 52 49 of the documentation, though, is in the underlying zope.testbrower … … 57 54 >>> portal_url = self.portal.absolute_url() 58 55 59 Th e following is useful when writing and debugging testbrowser tests.60 It letsus see all error messages in the error_log.56 This is useful when writing and debugging testbrowser tests. It lets 57 us see all error messages in the error_log. 61 58 62 59 >>> self.portal.error_log._ignored_exceptions = () … … 88 85 ============= 89 86 90 First create some content for demonstrations.87 First, create some content for demonstration purpose. 91 88 92 89 In the root of the portal … … 105 102 >>> browser.getControl('Add Content Sitemap').click() 106 103 107 Now we bring-up to edit form of the newly created content sitemap.108 W e are interested in two things: "Blackout entries" field must109 present in the form and by default it should be empty.104 Now we are landed on the newly-created sitemap edit form. 105 What we are interested in is "Blackout entries" field on the edit 106 form, it should be empty by default settings. 110 107 111 108 >>> file("/tmp/browser.0.html","wb").write(browser.contents) … … 121 118 122 119 123 Click on "Save" button lead us to resultsitemap view.120 Clicking on "Save" button will lead us to the sitemap view. 124 121 125 122 >>> print browser.contents … … 127 124 128 125 129 "sitemap.xml" link should appear in "Settings" page of the130 Plone Google Sitemap configlet when"Content Sitemap"126 "sitemap.xml" link should appear on "Settings" page of the 127 Plone Google Sitemap configlet after "Content Sitemap" 131 128 was added. 132 129 … … 135 132 >>> smedit_url = smedit_link.url 136 133 137 This link points to edit form of the newly created sitemap.xml.138 Let prepare view link to simplifierfollowing demonstrations.134 This link points to the newly-created sitemap.xml edit form. 135 Let's prepare view link to simplify the following demonstrations. 139 136 140 137 >>> smedit_url.endswith("sitemap.xml/edit") … … 146 143 ========== 147 144 148 Created sitemap has no filtersand all documents should appear in it.145 The created sitemap has no filters applied and all documents should appear in it. 149 146 150 147 >>> browser.open(smview_url) … … 152 149 >>> no_filters_content = browser.contents 153 150 154 Check if result ed page really issitemap...151 Check if result page is really a sitemap... 155 152 156 153 >>> print browser.contents … … 158 155 159 156 160 Create regular expression, which help us to test which urls pass the filters.157 Create regular expression, which will help us to test which urls pass the filters. 161 158 162 159 >>> reloc = re.compile("<loc>%s([^\<]*)</loc>" % self.portal.absolute_url(), re.S) 163 160 164 Test if all 4 documents and default front-page present in the sitemap 165 without filters. 161 Test if all 4 documents and default front-page are in the sitemap without filters. 166 162 167 163 >>> no_filters_res = reloc.findall(no_filters_content) … … 178 174 ================= 179 175 180 Go to the edit form of the sitemap and add "doc1" 181 and "front-page" lines with "id:" prefix to the 182 "Blackout entries" field. 176 Go to the sitemap edit form and add "doc1" and "front-page" lines with "id:" 177 prefix to the "Blackout entries" field. 183 178 184 179 >>> browser.open(smedit_url) … … 191 186 >>> id_filter_content = browser.contents 192 187 193 "doc1" and "front-page" documents should be excluded from the188 "doc1" and "front-page" documents should now be excluded from the 194 189 sitemap. 195 190 … … 204 199 =================== 205 200 206 Suppo use we wont to exclude the "front_page" from portal root207 and "doc2" document, located in test_user_1_ home folder, 208 but leave untouched "doc2"in portal root with all other objects.201 Suppose we want to exclude "front_page" from portal root and "doc2" 202 document, located in test_user_1_ home folder, but leave "doc2" 203 untouched in portal root with all other objects. 209 204 210 205 >>> browser.open(smedit_url) … … 231 226 ==================== 232 227 233 Now I have the question: "What filter will be used when no 234 filter name prefix was specified (old-fashion filters for 235 example)?" 236 237 Go to the edit form of the sitemap and add "doc1" and 238 "front-page" lines without any filter name prefix to the 239 "Blackout entries" field. 228 Now I have a question: "What filter will be used when no 229 filter name prefix is specified (e.g. old-fashion filters)?" 230 231 Go to the sitemap edit form and add "doc1" and "front-page" 232 lines without any filter name prefix to the "Blackout entries" 233 field. 240 234 241 235 >>> browser.open(portal_url + "/sitemap.xml/edit") … … 248 242 >>> default_filter_content = browser.contents 249 243 250 "id" filter must be used as default filter. So all "doc1" and244 "id" filter must be used as default filter. So, all "doc1" and 251 245 "front-page" objects should be excluded from the sitemap. 252 246 … … 258 252 259 253 260 Creat ionown filters261 ==================== 262 263 Suppo use we want to create own blackout filter,264 which behave like id-filter, but has some differencies. 265 Our fitler hasfollowing format:254 Create your own filters 255 ======================= 256 257 Suppose we want to create our own blackout filter, which will 258 behave like id-filter, but will have some differences. Our fitler 259 has the following format: 266 260 267 261 (+|-)<filtered id> 268 262 269 - when 1st sign is "+" then only objects with <filtered id> 270 should be leaved in sitemap after filetering; 271 - if 1st sign is "-" then all objects with <filtered id> 272 should be excluded from the sitemap (like default id 273 filter). 274 275 You need create new IBlckoutFilter multi-adapter, 276 and register it with unique name. 263 - if the 1st sign is "+" then only objects with <filtered id> 264 should be left in sitemap after filetering; 265 - if the 1st sign is "-" then all objects with <filtered id> 266 should be excluded from the sitemap (like default id filter). 267 268 You need to create new IBlckoutFilter multi-adapter, and register 269 it with unique name. 277 270 278 271 >>> from zope.component import adapts … … 302 295 ... name=u'signedid') 303 296 304 So that's all what needed to add new filter. 305 Now test newly createdfilter.297 So that's all what needed to add new filter. Now test newly-created 298 filter. 306 299 307 300 Check whether white filtering ("+" prefix) works correctly. 308 Go to edit form of the sitemapand add "signedid:+doc1"301 Go to the sitemap edit form and add "signedid:+doc1" 309 302 to the "Blackout entries" field. 310 303 … … 317 310 >>> signedid_filter_content = browser.contents 318 311 319 Only objects with "doc1" id should be le avedin the sitemap.312 Only objects with "doc1" id should be left in the sitemap. 320 313 321 314 >>> signedid_filter_res = reloc.findall(signedid_filter_content) … … 326 319 327 320 328 And for the last - check wheter black filtering ("-" prefix) 329 works correctly. 330 Go to the edit form of the sitemap and add "signedid:-doc1" 331 to the "Blackout entries" field. 321 Finally, check whether black filtering ("-" prefix) works correctly. 322 Go to the sitemaps edit form and add "signedid:-doc1" to the "Blackout 323 entries" field. 332 324 333 325 >>> browser.open(smedit_url) … … 339 331 >>> signedid_filter_content = browser.contents 340 332 341 All objects except those having "doc1" idmust be included in333 All objects, except those having "doc1" id, must be included in 342 334 the sitemap. 343 335
Note: See TracChangeset
for help on using the changeset viewer.