geoportal-server-catalog icon indicating copy to clipboard operation
geoportal-server-catalog copied to clipboard

GeoRSS Feed URL for GeoPortal (for adding to Feed reader)

Open KathleenPate opened this issue 5 years ago • 2 comments

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.

KathleenPate avatar Sep 27 '19 18:09 KathleenPate

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();
    }},,

KathleenPate avatar May 04 '20 15:05 KathleenPate

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");

kman73 avatar May 15 '20 18:05 kman73