xowiki::Package instproc www-google-sitemap (public)
<instance of xowiki::Package> www-google-sitemap \ [ -max_entries max_entries ] [ -changefreq changefreq ] \ [ -priority priority ]
Defined in /var/www/openacs.org/packages/xowiki/tcl/package-procs.tcl
This web-callable method reports the content of xowiki folder in google site map format https://www.google.com/webmasters/sitemaps/docs/en/protocol.html
- Switches:
- -max_entries (optional)
- maximum number of entries retrieved
- -changefreq (optional, defaults to
"daily"
)- changefreq as defined by google
- -priority (optional, defaults to
"0.5"
)- priority as defined by google
- Testcases:
- No testcase defined.
Source code: set package ::${:id} set folder_id [$package folder_id] set timerange_clause "" set content {<?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.google.com/schemas/sitemap/0.84" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.google.com/schemas/sitemap/0.84 http://www.google.com/schemas/sitemap/0.84/sitemap.xsd"> } set sql [::xo::dc select -vars "ci.parent_id, s.body, p.name, p.creator, p.title, p.page_id, p.object_type as content_type, p.last_modified, p.description" -from "xowiki_pagex p, syndication s, cr_items ci" -where "ci.parent_id = :folder_id and ci.live_revision = s.object_id and s.object_id = p.page_id $timerange_clause" -orderby "p.last_modified desc" -limit $max_entries] # :log $sql ::xo::dc foreach get_pages $sql { #:log "--found $name" if {[string match "::*" $name]} continue if {$content_type eq "::xowiki::PageTemplate::"} continue set time [::xo::db::tcl_date $last_modified tz] set time "[clock format [clock scan $time] -format {%Y-%m-%dT%T}]${tz}:00" append content <url> \n <loc>[$package pretty_link -absolute true -parent_id $parent_id $name]</loc> \n <lastmod>$time</lastmod> \n <changefreq>$changefreq</changefreq> \n <priority>$priority</priority> \n </url> \n } append content </urlset> \n set :mime_type text/xml return $contentXQL Not present: Generic, PostgreSQL, Oracle