geoportal-server-catalog
geoportal-server-catalog copied to clipboard
GeoRSS Feed URL for GeoPortal (for adding to Feed reader)
I have updated the Geoportal Search RssWriter.js
file with our Portal's title and description. I tried using the OpenSearch query to load the feed into Outlook's RSS Feeds but received an error message. Example: https://gda.alberta.ca/geoportal/opensearch?f=georss
Is there a direct link to a file instead of a query string against the portal? For example my old portal has a URL https://geodiscover.alberta.ca/geoportal/sitemap and it loads in Outlook.
My RSS is working now, but, can we add a stylesheet, perhaps by adding a function to the XmlBuilder.js that allows us to create a stylesheet element.
Final output something like this:
<?xml-stylesheet type="text/xsl" href="https://server/geoportal/app/style/newrecords.xslt"?>
If the XmlBuilder could have a new element, say, "getStylesheet", then we could add a variable to the rssWriter.
writeStyle: {writable:true,value:function(localName,value) {
if (value === null) return;
this.writeStartStyle(localName);
this.writeCharacters(value);
this.writeEndElement();
}},,
Modify XmlBuilder.js by adding a new function to end documents. Here a xsl sheet url can be passed to the builder where it will be inserted.
writeEndDocumentwithStylesheet: {writable:true,value:function(sheet) { //console.log("writeEndDocument",this.stack.length); var self = this; var doc = { sbXml: this.sbXml, val: gs.Object.create(gs.base.Val) }; doc.sbXml.append(""); if (this.root) { doc.xml = doc.val.XML_HEADER; if (this.prefixes && this.prefixes.length > 0) { this.prefixes.forEach(function(pfx){ var a = gs.Object.create(gs.base.XmlAttribute).init("xmlns",pfx,null); a.value = self.uriByPrefix[pfx]; self.root.attributes.push(a); }); } this.root.write(doc); } }}
Modify RSSWriter.js where you will replace the current writeEndDocument call with the new call.
xmlBuilder.writeEndElement(); xmlBuilder.writeEndDocumentwithStylesheet("http://localhost:8080/geoportal/mynewrss.xsl");