[Dspace-tech] news, javascript and Manakin
Hello In the old JSP dspace we had some javascript embedded in the news html file for rendering an RSS feed. Looking at the DRI Schema there doesn't appear to be an element for scripts. Does anyone have advice on how this can be done? Regards George - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ DSpace-tech mailing list DSpace-tech@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dspace-tech
Re: [Dspace-tech] news, javascript and Manakin
javascript would need to be at the theme layer. By default Manakin will provide set the RSS feeds in the HTML header and most browsers will put an icon at the end of the URL bar for them. If you would like to change this behavior then you will need to customize it in a theme. Scott-- On Mar 19, 2008, at 6:08 AM, George Hamilton wrote: Hello In the old JSP dspace we had some javascript embedded in the news html file for rendering an RSS feed. Looking at the DRI Schema there doesn't appear to be an element for scripts. Does anyone have advice on how this can be done? Regards George - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ DSpace-tech mailing list DSpace-tech@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dspace-tech - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ DSpace-tech mailing list DSpace-tech@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dspace-tech
Re: [Dspace-tech] news, javascript and Manakin
On Wed, Mar 19, 2008 at 9:38 AM, Mark Diggory [EMAIL PROTECTED] wrote: I know where he's going with it though... Are there any generic XSLT libraries for rendering RSS feeds? Maybe the News.xmls should just be rss feeds, not DRI? I don't know about libraries, but there are several articles out there: http://www.dotnetjunkies.com/Article/9FB56D07-4052-458C-B247-37C9E4B6D719.dcik http://www.xml.com/pub/a/2003/01/02/tr.html (Bob duCharme, no less!) http://greggman.com/headlines/2005/2005-01-16-xslt-rss.htm I could probably hack something up... the danger is that RSS can be something of a shifting target, so it's hard to guarantee that XSLT will work with every horrible feed from every insane blog or other tool there is. I love the idea of using an RSS feed as news, though! LOVE IT. Doubleplusbrilliant. Dorothea -- Dorothea Salo [EMAIL PROTECTED] Digital Repository Librarian AIM: mindsatuw University of Wisconsin Rm 218, Memorial Library (608) 262-5493 - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ DSpace-tech mailing list DSpace-tech@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dspace-tech
Re: [Dspace-tech] news, javascript and Manakin
IMHO news-sourced-from-RSS would best be implemented on the server side, as an Aspect. It you had an Aspect that converted RSS (or Atom) feeds into DRI then you could plug it in as a replacement to news.xml, and still use any of the existing themes etc to render it. Coincidentally I've been doing voluntary work in the last week on a website which is an aggregation of blogs. I used Sun's Rome library which can parse and convert feeds of various formats (because there are about 1 zillion different flavours of RSS at least). I used Rome to parse and aggregate feeds and convert the result to Atom 1.0. Then I wrote an XSLT to render that as HTML. I found Rome is still not quite production quality (I used it anyway and just fixed the few bugs I found). If you're considering processing feeds in XSLT, one thing which is worth noting upfront is that sometimes feeds will contain quoted html markup, e.g. lt;div style=font-weight: boldgt;lt;pgt;Blah blahlt;/pgt;lt;divgt; Usually in XSLT you'd handle that with disable-output-escaping, but that's not going to produce well-formed DRI XML is it? (NB d-o-e simply has no effect in Cocoon). So it might be necessary to wheel in the HTMLGenerator to convert each such snippet into well-formed XHTML, and from there into DRI. Cheers Con On Wed, 2008-03-19 at 07:38 -0700, Mark Diggory wrote: I know where he's going with it though... Are there any generic XSLT libraries for rendering RSS feeds? Maybe the News.xmls should just be rss feeds, not DRI? -Mark On Mar 19, 2008, at 6:59 AM, Scott Phillips wrote: javascript would need to be at the theme layer. By default Manakin will provide set the RSS feeds in the HTML header and most browsers will put an icon at the end of the URL bar for them. If you would like to change this behavior then you will need to customize it in a theme. Scott-- On Mar 19, 2008, at 6:08 AM, George Hamilton wrote: Hello In the old JSP dspace we had some javascript embedded in the news html file for rendering an RSS feed. Looking at the DRI Schema there doesn't appear to be an element for scripts. Does anyone have advice on how this can be done? Regards George -- Conal Tuohy New Zealand Electronic Text Centre www.nzetc.org - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ DSpace-tech mailing list DSpace-tech@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dspace-tech
Re: [Dspace-tech] news, javascript and Manakin
This is why its my opinion not to go that deep into the system. Skip DRI altogether an write a document() include in the theme that retrieved the feed. Author a few xslt templates into the base xslt of the theme to handle formating. Nobody, says it has to be perfect and support every possible case at first. Thats the beauty of being Open Source, support the basic formats Atom, RSS 2.0 RSS 1.0 with default assumptions and accept fixes from there on. -Mark On Mar 19, 2008, at 3:46 PM, Conal Tuohy wrote: IMHO news-sourced-from-RSS would best be implemented on the server side, as an Aspect. It you had an Aspect that converted RSS (or Atom) feeds into DRI then you could plug it in as a replacement to news.xml, and still use any of the existing themes etc to render it. Coincidentally I've been doing voluntary work in the last week on a website which is an aggregation of blogs. I used Sun's Rome library which can parse and convert feeds of various formats (because there are about 1 zillion different flavours of RSS at least). I used Rome to parse and aggregate feeds and convert the result to Atom 1.0. Then I wrote an XSLT to render that as HTML. I found Rome is still not quite production quality (I used it anyway and just fixed the few bugs I found). If you're considering processing feeds in XSLT, one thing which is worth noting upfront is that sometimes feeds will contain quoted html markup, e.g. lt;div style=font-weight: boldgt;lt;pgt;Blah blahlt;/pgt;lt;divgt; Usually in XSLT you'd handle that with disable-output-escaping, but that's not going to produce well-formed DRI XML is it? (NB d-o-e simply has no effect in Cocoon). So it might be necessary to wheel in the HTMLGenerator to convert each such snippet into well-formed XHTML, and from there into DRI. Cheers Con On Wed, 2008-03-19 at 07:38 -0700, Mark Diggory wrote: I know where he's going with it though... Are there any generic XSLT libraries for rendering RSS feeds? Maybe the News.xmls should just be rss feeds, not DRI? -Mark On Mar 19, 2008, at 6:59 AM, Scott Phillips wrote: javascript would need to be at the theme layer. By default Manakin will provide set the RSS feeds in the HTML header and most browsers will put an icon at the end of the URL bar for them. If you would like to change this behavior then you will need to customize it in a theme. Scott-- On Mar 19, 2008, at 6:08 AM, George Hamilton wrote: Hello In the old JSP dspace we had some javascript embedded in the news html file for rendering an RSS feed. Looking at the DRI Schema there doesn't appear to be an element for scripts. Does anyone have advice on how this can be done? Regards George -- Conal Tuohy New Zealand Electronic Text Centre www.nzetc.org - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ DSpace-tech mailing list DSpace-tech@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dspace-tech
Re: [Dspace-tech] news, javascript and Manakin
On Wed, 2008-03-19 at 16:40 -0700, Mark Diggory wrote: This is why its my opinion not to go that deep into the system. Skip DRI altogether an write a document() include in the theme that retrieved the feed. Author a few xslt templates into the base xslt of the theme to handle formating. Transclusion of feeds in Manakin is problematic whether you do it in a theme or in the aspect layer. Either way you have the problem of handling escaped HTML markup. You can't just use disable-output-escaping in a Cocoon pipeline. Doing the transclusion on the client side in XSLT you could use d-o-e, but on the client side you have another problem which is complying with cross-domain security restrictions in the browser. That applies to JavaScript as well as XSLT of course. Nobody, says it has to be perfect and support every possible case at first. Thats the beauty of being Open Source, support the basic formats Atom, RSS 2.0 RSS 1.0 with default assumptions and accept fixes from there on. -Mark On Mar 19, 2008, at 3:46 PM, Conal Tuohy wrote: IMHO news-sourced-from-RSS would best be implemented on the server side, as an Aspect. It you had an Aspect that converted RSS (or Atom) feeds into DRI then you could plug it in as a replacement to news.xml, and still use any of the existing themes etc to render it. Coincidentally I've been doing voluntary work in the last week on a website which is an aggregation of blogs. I used Sun's Rome library which can parse and convert feeds of various formats (because there are about 1 zillion different flavours of RSS at least). I used Rome to parse and aggregate feeds and convert the result to Atom 1.0. Then I wrote an XSLT to render that as HTML. I found Rome is still not quite production quality (I used it anyway and just fixed the few bugs I found). If you're considering processing feeds in XSLT, one thing which is worth noting upfront is that sometimes feeds will contain quoted html markup, e.g. lt;div style=font-weight: boldgt;lt;pgt;Blah blahlt;/pgt;lt;divgt; Usually in XSLT you'd handle that with disable-output-escaping, but that's not going to produce well-formed DRI XML is it? (NB d-o-e simply has no effect in Cocoon). So it might be necessary to wheel in the HTMLGenerator to convert each such snippet into well-formed XHTML, and from there into DRI. Cheers Con On Wed, 2008-03-19 at 07:38 -0700, Mark Diggory wrote: I know where he's going with it though... Are there any generic XSLT libraries for rendering RSS feeds? Maybe the News.xmls should just be rss feeds, not DRI? -Mark On Mar 19, 2008, at 6:59 AM, Scott Phillips wrote: javascript would need to be at the theme layer. By default Manakin will provide set the RSS feeds in the HTML header and most browsers will put an icon at the end of the URL bar for them. If you would like to change this behavior then you will need to customize it in a theme. Scott-- On Mar 19, 2008, at 6:08 AM, George Hamilton wrote: Hello In the old JSP dspace we had some javascript embedded in the news html file for rendering an RSS feed. Looking at the DRI Schema there doesn't appear to be an element for scripts. Does anyone have advice on how this can be done? Regards George -- Conal Tuohy New Zealand Electronic Text Centre www.nzetc.org -- Conal Tuohy New Zealand Electronic Text Centre www.nzetc.org - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ DSpace-tech mailing list DSpace-tech@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dspace-tech
Re: [Dspace-tech] news, javascript and Manakin
On Mar 19, 2008, at 8:44 PM, Conal Tuohy wrote: On Wed, 2008-03-19 at 18:52 -0700, Mark Diggory wrote: On Mar 19, 2008, at 5:30 PM, Conal Tuohy wrote: If its a question of it being well formed xhtml coming out of the template... A simple Java class can be created to assist in this area using JTidy to process the string containing the html prior to processing it into the outputstream. You mean using JTidy as an XSLT extension function, passing a string and returning a DOM back into the XSLT? That could work. Or JTidy could be packaged into a Cocoon transformer of its own. The problem is that anything in the pipeline (generator or transformer) has to produce well formed XML. So a transformer that takes poorly formed xml would never be reached because the sax errors happen in-between it and the previous one. However, a Generator that cleaned up RSS on the way through would be a nice feature... And if it were triggered/configured from the URI of the resource being called to get the RSS, even better... the just an xpath document ('http://foo.com/feed.rss') or document(${dspace.dir}/config/ news.rss') could activate it... see http://cocoon.apache.org/2.0/userdocs/generators/html-generator.html And well designed, it would be caching as well... -Mark - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ DSpace-tech mailing list DSpace-tech@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dspace-tech
Re: [Dspace-tech] news, javascript and Manakin
On Wed, 2008-03-19 at 21:50 -0700, Mark Diggory wrote: On Mar 19, 2008, at 8:44 PM, Conal Tuohy wrote: On Wed, 2008-03-19 at 18:52 -0700, Mark Diggory wrote: On Mar 19, 2008, at 5:30 PM, Conal Tuohy wrote: If its a question of it being well formed xhtml coming out of the template... A simple Java class can be created to assist in this area using JTidy to process the string containing the html prior to processing it into the outputstream. You mean using JTidy as an XSLT extension function, passing a string and returning a DOM back into the XSLT? That could work. Or JTidy could be packaged into a Cocoon transformer of its own. The problem is that anything in the pipeline (generator or transformer) has to produce well formed XML. So a transformer that takes poorly formed xml would never be reached because the sax errors happen in-between it and the previous one. I was thinking of a transformer that would consume a SAX stream containing some nodes which contained quoted HTML, and would unquote them and parse the result as HTML. So it would be well-formed (text) before, and well-formed (XHTML) after. However, a Generator that cleaned up RSS on the way through would be a nice feature... And if it were triggered/configured from the URI of the resource being called to get the RSS, even better... the just an xpath document ('http://foo.com/feed.rss') or document(${dspace.dir}/config/ news.rss') could activate it... see http://cocoon.apache.org/2.0/userdocs/generators/html-generator.html Better not to invoke it from within XSLT though - it could be included using the XInclude transformer referring to a Cocoon pipeline with the cocoon: protocol. There are known issues with Cocoon's caching when using the XPath document() function in XSLT (I don't think these have been fixed?). Basically the cache validity of the result is based on the resources mentioned in the pipeline definition in the sitemap, and doesn't take account of resources invoked from with an XSLT itself. So the RSS could change without invalidating the cache entry of the resulting page, and you could end up serving stale content until some other part of the document changed, and the cache was invalidated. -- Conal Tuohy New Zealand Electronic Text Centre www.nzetc.org - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ DSpace-tech mailing list DSpace-tech@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dspace-tech