/rss_action
rss action

Sourcecode in Root/actions.js:
1:   function rss_action() {
2:      res.contentType = "text/xml";
3:   
4:      var now = new Date();
5:      var systitle = root.getTitle();
6:      var sdf = new java.text.SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
7:      sdf.setTimeZone(new java.util.SimpleTimeZone(0, "UTC"));
8:   
9:      var size = this.size();
10:     var max = req.data.max ? parseInt(req.data.max) : 25;
11:     max = Math.min(max, size, 50);
12:  
13:     var param = new Object();
14:     var items = new java.lang.StringBuffer();
15:     var resources = new java.lang.StringBuffer();
16:  
17:     for (var i=0; i<max; i++) {
18:        var site = this.get(i);
19:        if (site.online && site.lastupdate) {
20:           param.title = site.title ? site.title : site.alias;
21:           param.publisher = systitle;
22:           param.creator = site.creator.name;
23:           param.email = "";
24:           if (site.email)
25:              param.email = site.email.entitize();
26:           else if (site.creator.publishemail)
27:              param.email = site.creator.email.entitize();
28:           param.isodate = sdf.format(site.lastupdate)
29:           param.date = site.preferences.getProperty("tagline") ? "" : param.isodate;
30:           param.year = site.lastupdate.getFullYear();
31:           items.append(site.renderSkinAsString("rssItem", param));
32:           resources.append(site.renderSkinAsString("rssResource", param));
33:        }
34:     }
35:     param = new Object();
36:     param.title = systitle;
37:     param.email = root.sys_email.entitize();
38:     param.year = now.getFullYear();
39:     param.lastupdate = sdf.format(now);
40:     param.items = items.toString();
41:     param.resources = resources.toString();
42:     this.renderSkin("rss", param);
43:     return;
44:  }