[xwiki-devs] Blog Wiki 2.0 Upgrade 7th Draft
Hi I just attached the 7th draft of the Blog 2.0 Wiki Syntax upgrade to this JIRA report: http://jira.xwiki.org/jira/browse/XABLOG-50 This one includes the upgrades of the Panels to the 2.0 syntax. The only thing remaining are the RSS feeds and these cannot be upgraded now because the XHTML renderer does add the macro content as comment to the top of the output AHEAD of the <?xml> which is not allowed by the XML specification. So far I could not find a way to suppress that. I tried to create a XML renderer macro but got nowhere with it. My own Blog: http://madplanet.com/xwiki/bin/view/Blog/ uses the latest (7th) draft of the blog upgrade. Cheers Andreas Schaefer CEO of Madplanet.com Inc. EMail: [email protected] [email protected] Twitter: andy_mpc AIM: [email protected]
Hi Andreas, The RSS feeds should be reworked anyway since there is now in the feed plugin some functions to generate RSS feeds, even for Blogs. It would be much better to use that instead of the manual RSS feeds generated in wiki pages. If you are interested you could work on this rework as it is not planned yet. See https://svn.xwiki.org/svnroot/xwiki/platform/core/trunk/xwiki-core/src/main/... /** * Instantiates the default article feed. * * @param query the HQL query used for retrieving the articles * @param count the maximum number of articles to retrieve * @param start the start index * @param metadata feed meta data (includes the author, description, copyright, encoding, url, title) * @return a new feed * @see #getArticleFeed(String, int, int, Map) */ public SyndFeed getBlogFeed(String query, int count, int start, Map metadata) { if (query == null) { XWikiRequest request = getXWikiContext().getRequest(); String category = request.getParameter("category"); if (category == null || category.equals("")) { query = ", BaseObject as obj where obj.name=doc.fullName and obj.className='XWiki.ArticleClass' and obj.name<>'XWiki.ArticleClassTemplate' order by doc.creationDate desc"; } else { query = ", BaseObject as obj, DBStringListProperty as prop join prop.list list where obj.name=doc.fullName and obj.className='XWiki.ArticleClass' and obj.name<>'XWiki.ArticleClassTemplate' and obj.id=prop.id.id and prop.id.name='category' and list = '" + category + "' order by doc.creationDate desc"; } } SyndFeed blogFeed = getArticleFeed(query, count, start, fillBlogFeedMetadata(metadata)); if (blogFeed != null) { blogFeed.setImage(getDefaultFeedImage()); } return blogFeed; } Ludovic Andreas Schaefer a écrit :
Hi
I just attached the 7th draft of the Blog 2.0 Wiki Syntax upgrade to this JIRA report:
http://jira.xwiki.org/jira/browse/XABLOG-50
This one includes the upgrades of the Panels to the 2.0 syntax. The only thing remaining are the RSS feeds and these cannot be upgraded now because the XHTML renderer does add the macro content as comment to the top of the output AHEAD of the <?xml> which is not allowed by the XML specification. So far I could not find a way to suppress that. I tried to create a XML renderer macro but got nowhere with it.
My own Blog: http://madplanet.com/xwiki/bin/view/Blog/ uses the latest (7th) draft of the blog upgrade.
Cheers
Andreas Schaefer CEO of Madplanet.com Inc. EMail: [email protected] [email protected] Twitter: andy_mpc AIM: [email protected] _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Ludovic Dubost Blog: http://blog.ludovic.org/ XWiki: http://www.xwiki.com Skype: ldubost GTalk: ldubost
Hi I tried to use get this working but I turned out that there are some basic flaws in the FeedPlugin/Api. First many of the "getBlogFeed" method use the Collections.EMPTY_MAP but this one is immutable but the Feed Plugin still wants to add Metadata making it fail with an UnsupportedOperationException. Secondly the Feed Plugin expects the document class to be of type 'XWiki.ArticleClass' but for a Blog it is 'Blog.BlogPostClass' making it fail to create entries on the SyncedFeed. Cheers - Andy Schaefer On Aug 4, 2009, at 3:49 AM, Ludovic Dubost wrote:
Hi Andreas,
The RSS feeds should be reworked anyway since there is now in the feed plugin some functions to generate RSS feeds, even for Blogs. It would be much better to use that instead of the manual RSS feeds generated in wiki pages.
If you are interested you could work on this rework as it is not planned yet.
See https://svn.xwiki.org/svnroot/xwiki/platform/core/trunk/xwiki-core/src/main/...
/** * Instantiates the default article feed. * * @param query the HQL query used for retrieving the articles * @param count the maximum number of articles to retrieve * @param start the start index * @param metadata feed meta data (includes the author, description, copyright, encoding, url, title) * @return a new feed * @see #getArticleFeed(String, int, int, Map) */ public SyndFeed getBlogFeed(String query, int count, int start, Map metadata) { if (query == null) { XWikiRequest request = getXWikiContext().getRequest(); String category = request.getParameter("category"); if (category == null || category.equals("")) { query = ", BaseObject as obj where obj.name=doc.fullName and obj.className='XWiki.ArticleClass' and obj.name<>'XWiki.ArticleClassTemplate' order by doc.creationDate desc"; } else { query = ", BaseObject as obj, DBStringListProperty as prop join prop.list list where obj.name=doc.fullName and obj.className='XWiki.ArticleClass' and obj.name<>'XWiki.ArticleClassTemplate' and obj.id=prop.id.id and prop.id.name='category' and list = '" + category + "' order by doc.creationDate desc"; } } SyndFeed blogFeed = getArticleFeed(query, count, start, fillBlogFeedMetadata(metadata)); if (blogFeed != null) { blogFeed.setImage(getDefaultFeedImage()); } return blogFeed; }
Ludovic
Andreas Schaefer a écrit :
Hi
I just attached the 7th draft of the Blog 2.0 Wiki Syntax upgrade to this JIRA report:
http://jira.xwiki.org/jira/browse/XABLOG-50
This one includes the upgrades of the Panels to the 2.0 syntax. The only thing remaining are the RSS feeds and these cannot be upgraded now because the XHTML renderer does add the macro content as comment to the top of the output AHEAD of the <?xml> which is not allowed by the XML specification. So far I could not find a way to suppress that. I tried to create a XML renderer macro but got nowhere with it.
My own Blog: http://madplanet.com/xwiki/bin/view/Blog/ uses the latest (7th) draft of the blog upgrade.
Cheers
Andreas Schaefer CEO of Madplanet.com Inc. EMail: [email protected] [email protected] Twitter: andy_mpc AIM: [email protected] _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Ludovic Dubost Blog: http://blog.ludovic.org/ XWiki: http://www.xwiki.com Skype: ldubost GTalk: ldubost
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
Andreas Schaefer a écrit :
Hi
I tried to use get this working but I turned out that there are some basic flaws in the FeedPlugin/Api. First many of the "getBlogFeed" method use the Collections.EMPTY_MAP but this one is immutable but the Feed Plugin still wants to add Metadata making it fail with an UnsupportedOperationException.
Maybe Marius can provide some help on it.
Secondly the Feed Plugin expects the document class to be of type 'XWiki.ArticleClass' but for a Blog it is 'Blog.BlogPostClass' making it fail to create entries on the SyncedFeed.
Right the blog was changed since then. These two issues should not be too difficult to patch. Do you need some help or can you provide a patch that I could review ? Ludovic
Cheers - Andy Schaefer
On Aug 4, 2009, at 3:49 AM, Ludovic Dubost wrote:
Hi Andreas,
The RSS feeds should be reworked anyway since there is now in the feed plugin some functions to generate RSS feeds, even for Blogs. It would be much better to use that instead of the manual RSS feeds generated in wiki pages.
If you are interested you could work on this rework as it is not planned yet.
See https://svn.xwiki.org/svnroot/xwiki/platform/core/trunk/xwiki-core/src/main/...
/** * Instantiates the default article feed. * * @param query the HQL query used for retrieving the articles * @param count the maximum number of articles to retrieve * @param start the start index * @param metadata feed meta data (includes the author, description, copyright, encoding, url, title) * @return a new feed * @see #getArticleFeed(String, int, int, Map) */ public SyndFeed getBlogFeed(String query, int count, int start, Map metadata) { if (query == null) { XWikiRequest request = getXWikiContext().getRequest(); String category = request.getParameter("category"); if (category == null || category.equals("")) { query = ", BaseObject as obj where obj.name=doc.fullName and obj.className='XWiki.ArticleClass' and obj.name<>'XWiki.ArticleClassTemplate' order by doc.creationDate desc"; } else { query = ", BaseObject as obj, DBStringListProperty as prop join prop.list list where obj.name=doc.fullName and obj.className='XWiki.ArticleClass' and obj.name<>'XWiki.ArticleClassTemplate' and obj.id=prop.id.id and prop.id.name='category' and list = '" + category + "' order by doc.creationDate desc"; } } SyndFeed blogFeed = getArticleFeed(query, count, start, fillBlogFeedMetadata(metadata)); if (blogFeed != null) { blogFeed.setImage(getDefaultFeedImage()); } return blogFeed; }
Ludovic
Andreas Schaefer a écrit :
Hi
I just attached the 7th draft of the Blog 2.0 Wiki Syntax upgrade to this JIRA report:
http://jira.xwiki.org/jira/browse/XABLOG-50
This one includes the upgrades of the Panels to the 2.0 syntax. The only thing remaining are the RSS feeds and these cannot be upgraded now because the XHTML renderer does add the macro content as comment to the top of the output AHEAD of the <?xml> which is not allowed by the XML specification. So far I could not find a way to suppress that. I tried to create a XML renderer macro but got nowhere with it.
My own Blog: http://madplanet.com/xwiki/bin/view/Blog/ uses the latest (7th) draft of the blog upgrade.
Cheers
Andreas Schaefer CEO of Madplanet.com Inc. EMail: [email protected] [email protected] Twitter: andy_mpc AIM: [email protected] _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Ludovic Dubost Blog: http://blog.ludovic.org/ XWiki: http://www.xwiki.com Skype: ldubost GTalk: ldubost
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Ludovic Dubost Blog: http://blog.ludovic.org/ XWiki: http://www.xwiki.com Skype: ldubost GTalk: ldubost
Well, I got the Feed Plugin to work with Blog (at least one of the calls). Now I am wondering how I would transfer the SyndFeedImpl object into an RSS stream. Any idea? Thanks - Andreas Schaefer On Tuesday, August 04, 2009, at 03:48PM, "Ludovic Dubost" <[email protected]> wrote:
Andreas Schaefer a écrit :
Hi
I tried to use get this working but I turned out that there are some basic flaws in the FeedPlugin/Api. First many of the "getBlogFeed" method use the Collections.EMPTY_MAP but this one is immutable but the Feed Plugin still wants to add Metadata making it fail with an UnsupportedOperationException.
Maybe Marius can provide some help on it.
Secondly the Feed Plugin expects the document class to be of type 'XWiki.ArticleClass' but for a Blog it is 'Blog.BlogPostClass' making it fail to create entries on the SyncedFeed.
Right the blog was changed since then.
These two issues should not be too difficult to patch. Do you need some help or can you provide a patch that I could review ?
Ludovic
Cheers - Andy Schaefer
On Aug 4, 2009, at 3:49 AM, Ludovic Dubost wrote:
Hi Andreas,
The RSS feeds should be reworked anyway since there is now in the feed plugin some functions to generate RSS feeds, even for Blogs. It would be much better to use that instead of the manual RSS feeds generated in wiki pages.
If you are interested you could work on this rework as it is not planned yet.
See https://svn.xwiki.org/svnroot/xwiki/platform/core/trunk/xwiki-core/src/main/...
/** * Instantiates the default article feed. * * @param query the HQL query used for retrieving the articles * @param count the maximum number of articles to retrieve * @param start the start index * @param metadata feed meta data (includes the author, description, copyright, encoding, url, title) * @return a new feed * @see #getArticleFeed(String, int, int, Map) */ public SyndFeed getBlogFeed(String query, int count, int start, Map metadata) { if (query == null) { XWikiRequest request = getXWikiContext().getRequest(); String category = request.getParameter("category"); if (category == null || category.equals("")) { query = ", BaseObject as obj where obj.name=doc.fullName and obj.className='XWiki.ArticleClass' and obj.name<>'XWiki.ArticleClassTemplate' order by doc.creationDate desc"; } else { query = ", BaseObject as obj, DBStringListProperty as prop join prop.list list where obj.name=doc.fullName and obj.className='XWiki.ArticleClass' and obj.name<>'XWiki.ArticleClassTemplate' and obj.id=prop.id.id and prop.id.name='category' and list = '" + category + "' order by doc.creationDate desc"; } } SyndFeed blogFeed = getArticleFeed(query, count, start, fillBlogFeedMetadata(metadata)); if (blogFeed != null) { blogFeed.setImage(getDefaultFeedImage()); } return blogFeed; }
Ludovic
Andreas Schaefer a écrit :
Hi
I just attached the 7th draft of the Blog 2.0 Wiki Syntax upgrade to this JIRA report:
http://jira.xwiki.org/jira/browse/XABLOG-50
This one includes the upgrades of the Panels to the 2.0 syntax. The only thing remaining are the RSS feeds and these cannot be upgraded now because the XHTML renderer does add the macro content as comment to the top of the output AHEAD of the <?xml> which is not allowed by the XML specification. So far I could not find a way to suppress that. I tried to create a XML renderer macro but got nowhere with it.
My own Blog: http://madplanet.com/xwiki/bin/view/Blog/ uses the latest (7th) draft of the blog upgrade.
Cheers
Andreas Schaefer CEO of Madplanet.com Inc. EMail: [email protected] [email protected] Twitter: andy_mpc AIM: [email protected] _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Ludovic Dubost Blog: http://blog.ludovic.org/ XWiki: http://www.xwiki.com Skype: ldubost GTalk: ldubost
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Ludovic Dubost Blog: http://blog.ludovic.org/ XWiki: http://www.xwiki.com Skype: ldubost GTalk: ldubost
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
I'm not sure I get your question. But the idea would be to just modify https://svn.xwiki.org/svnroot/xwiki/platform/core/trunk/xwiki-core/src/main/... /** * Instantiates the default strategy for converting articles in feed entries. * * @return a new {@link SyndEntrySourceApi} wrapping a {@link SyndEntryArticleSource} object */ public SyndEntrySourceApi getSyndEntryArticleSource() { return getSyndEntryArticleSource(Collections.EMPTY_MAP); } /** * Instantiates the default strategy for converting articles in feed entries, allowing you to customize it through * parameters. * * @return a new {@link SyndEntrySourceApi} wrapping a {@link SyndEntryArticleSource} object */ public SyndEntrySourceApi getSyndEntryArticleSource(Map params) { Map defParams = new HashMap(); defParams.put(SyndEntryDocumentSource.FIELD_TITLE, "XWiki.ArticleClass_title"); defParams.put(SyndEntryDocumentSource.FIELD_DESCRIPTION, "XWiki.ArticleClass_content"); defParams.put(SyndEntryDocumentSource.FIELD_CATEGORIES, "XWiki.ArticleClass_category"); defParams.put(SyndEntryDocumentSource.CONTENT_LENGTH, new Integer(400)); defParams.putAll(params); return this.getSyndEntrySource(SyndEntryDocumentSource.class.getName(), defParams); } And then you can call "getBlogFeed" -- If there is an issue with Collectons.EMTPY_MAP we can replace it with new HashMap() Ludovic Andreas Schaefer a écrit :
Well, I got the Feed Plugin to work with Blog (at least one of the calls).
Now I am wondering how I would transfer the SyndFeedImpl object into an RSS stream. Any idea?
Thanks - Andreas Schaefer
On Tuesday, August 04, 2009, at 03:48PM, "Ludovic Dubost" <[email protected]> wrote:
Andreas Schaefer a écrit :
Hi
I tried to use get this working but I turned out that there are some basic flaws in the FeedPlugin/Api. First many of the "getBlogFeed" method use the Collections.EMPTY_MAP but this one is immutable but the Feed Plugin still wants to add Metadata making it fail with an UnsupportedOperationException.
Maybe Marius can provide some help on it.
Secondly the Feed Plugin expects the document class to be of type 'XWiki.ArticleClass' but for a Blog it is 'Blog.BlogPostClass' making it fail to create entries on the SyncedFeed.
Right the blog was changed since then.
These two issues should not be too difficult to patch. Do you need some help or can you provide a patch that I could review ?
Ludovic
Cheers - Andy Schaefer
On Aug 4, 2009, at 3:49 AM, Ludovic Dubost wrote:
Hi Andreas,
The RSS feeds should be reworked anyway since there is now in the feed plugin some functions to generate RSS feeds, even for Blogs. It would be much better to use that instead of the manual RSS feeds generated in wiki pages.
If you are interested you could work on this rework as it is not planned yet.
See https://svn.xwiki.org/svnroot/xwiki/platform/core/trunk/xwiki-core/src/main/...
/** * Instantiates the default article feed. * * @param query the HQL query used for retrieving the articles * @param count the maximum number of articles to retrieve * @param start the start index * @param metadata feed meta data (includes the author, description, copyright, encoding, url, title) * @return a new feed * @see #getArticleFeed(String, int, int, Map) */ public SyndFeed getBlogFeed(String query, int count, int start, Map metadata) { if (query == null) { XWikiRequest request = getXWikiContext().getRequest(); String category = request.getParameter("category"); if (category == null || category.equals("")) { query = ", BaseObject as obj where obj.name=doc.fullName and obj.className='XWiki.ArticleClass' and obj.name<>'XWiki.ArticleClassTemplate' order by doc.creationDate desc"; } else { query = ", BaseObject as obj, DBStringListProperty as prop join prop.list list where obj.name=doc.fullName and obj.className='XWiki.ArticleClass' and obj.name<>'XWiki.ArticleClassTemplate' and obj.id=prop.id.id and prop.id.name='category' and list = '" + category + "' order by doc.creationDate desc"; } } SyndFeed blogFeed = getArticleFeed(query, count, start, fillBlogFeedMetadata(metadata)); if (blogFeed != null) { blogFeed.setImage(getDefaultFeedImage()); } return blogFeed; }
Ludovic
Andreas Schaefer a écrit :
Hi
I just attached the 7th draft of the Blog 2.0 Wiki Syntax upgrade to this JIRA report:
http://jira.xwiki.org/jira/browse/XABLOG-50
This one includes the upgrades of the Panels to the 2.0 syntax. The only thing remaining are the RSS feeds and these cannot be upgraded now because the XHTML renderer does add the macro content as comment to the top of the output AHEAD of the <?xml> which is not allowed by the XML specification. So far I could not find a way to suppress that. I tried to create a XML renderer macro but got nowhere with it.
My own Blog: http://madplanet.com/xwiki/bin/view/Blog/ uses the latest (7th) draft of the blog upgrade.
Cheers
Andreas Schaefer CEO of Madplanet.com Inc. EMail: [email protected] [email protected] Twitter: andy_mpc AIM: [email protected] _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Ludovic Dubost Blog: http://blog.ludovic.org/ XWiki: http://www.xwiki.com Skype: ldubost GTalk: ldubost
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Ludovic Dubost Blog: http://blog.ludovic.org/ XWiki: http://www.xwiki.com Skype: ldubost GTalk: ldubost
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Ludovic Dubost Blog: http://blog.ludovic.org/ XWiki: http://www.xwiki.com Skype: ldubost GTalk: ldubost
Ludovic Dubost wrote:
I'm not sure I get your question. But the idea would be to just modify
https://svn.xwiki.org/svnroot/xwiki/platform/core/trunk/xwiki-core/src/main/...
And then you can call "getBlogFeed"
The question I think is "where to call getBlogFeed". If it were put in a 2.0 document inside a {{velocity}} macro, it would print macro markers which break the XML. The goal of using the FeedPlugin was to obtain valid XML. Fortunately, Vincent just committed a renderer that does not print these markers anymore, so even the original solution of using plain velocity to render the feed would work. Vincent, is this XHTML renderer used by default now? -- Sergiu Dumitriu http://purl.org/net/sergiu/
On Aug 8, 2009, at 1:53 PM, Sergiu Dumitriu wrote: [snipped because I'm only answering to the question below]
Fortunately, Vincent just committed a renderer that does not print these markers anymore, so even the original solution of using plain velocity to render the feed would work.
Vincent, is this XHTML renderer used by default now?
yes. It's the XHTML Renderer for the "xhtml/1.0" syntax. If you want annotated XHTML you need to ask for the renderer for the "annotatedxhtml/1.0" syntax (which is used only by the wysiwyg editor right now). -Vincent
Hi Vicent Great news. I am going to update my source and try it out right away. That said I was wondering how difficult it would be to backport that to 1.9.2. I am running the Blog 2.0 upgrade on my regular blog and one eye sore is the RSS feed. I would love to patch the fix to the 1.9.2 source, compile it and patch my server with it. If you could tell me what classes are involved I would diff them and try to apply it. Thanks Andreas Schaefer On Saturday, August 08, 2009, at 04:59AM, "Vincent Massol" <[email protected]> wrote:
On Aug 8, 2009, at 1:53 PM, Sergiu Dumitriu wrote:
[snipped because I'm only answering to the question below]
Fortunately, Vincent just committed a renderer that does not print these markers anymore, so even the original solution of using plain velocity to render the feed would work.
Vincent, is this XHTML renderer used by default now?
yes. It's the XHTML Renderer for the "xhtml/1.0" syntax. If you want annotated XHTML you need to ask for the renderer for the "annotatedxhtml/1.0" syntax (which is used only by the wysiwyg editor right now).
-Vincent
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
On Aug 10, 2009, at 8:50 PM, Andreas Schaefer wrote:
Hi Vicent
Great news. I am going to update my source and try it out right away. That said I was wondering how difficult it would be to backport that to 1.9.2. I am running the Blog 2.0 upgrade on my regular blog and one eye sore is the RSS feed. I would love to patch the fix to the 1.9.2 source, compile it and patch my server with it. If you could tell me what classes are involved I would diff them and try to apply it.
It's hard. I did a big refactoring to implement this cleanly (Renderers are now components and thus can be added dynamically for example). The easiest is really if you can upgrade your install on XE 2.0M3 (latest trunk). FYI 2.0M3 should be released tomorrow (if all goes fine). We'd also love to get feedback on 2.0M3 (or latest trunk). We think it's pretty stable and nice but someone using it for real would be great to verify all is fine before the final release. You'd also wiki macros btw (amongst other things) ;) Thanks -Vincent
Thanks
Andreas Schaefer
On Saturday, August 08, 2009, at 04:59AM, "Vincent Massol" <[email protected]
wrote:
On Aug 8, 2009, at 1:53 PM, Sergiu Dumitriu wrote:
[snipped because I'm only answering to the question below]
Fortunately, Vincent just committed a renderer that does not print these markers anymore, so even the original solution of using plain velocity to render the feed would work.
Vincent, is this XHTML renderer used by default now?
yes. It's the XHTML Renderer for the "xhtml/1.0" syntax. If you want annotated XHTML you need to ask for the renderer for the "annotatedxhtml/1.0" syntax (which is used only by the wysiwyg editor right now).
-Vincent
Hi Andreas, Ludovic Dubost wrote:
Andreas Schaefer a écrit :
Hi
I tried to use get this working but I turned out that there are some basic flaws in the FeedPlugin/Api. First many of the "getBlogFeed" method use the Collections.EMPTY_MAP but this one is immutable but the Feed Plugin still wants to add Metadata making it fail with an UnsupportedOperationException.
Maybe Marius can provide some help on it.
Collections.EMPTY_MAP is used to fill a "missing" parameter when a method is overloaded. Use the signature that specifies the parameter: public SyndEntrySourceApi getSyndEntryArticleSource() public SyndEntrySourceApi getSyndEntryArticleSource(Map params)
Secondly the Feed Plugin expects the document class to be of type 'XWiki.ArticleClass' but for a Blog it is 'Blog.BlogPostClass' making it fail to create entries on the SyncedFeed.
Can you try something like http://tinyurl.com/cps7oa ? Hope this helps, Marius
Right the blog was changed since then.
These two issues should not be too difficult to patch. Do you need some help or can you provide a patch that I could review ?
Ludovic
Cheers - Andy Schaefer
On Aug 4, 2009, at 3:49 AM, Ludovic Dubost wrote:
Hi Andreas,
The RSS feeds should be reworked anyway since there is now in the feed plugin some functions to generate RSS feeds, even for Blogs. It would be much better to use that instead of the manual RSS feeds generated in wiki pages.
If you are interested you could work on this rework as it is not planned yet.
See https://svn.xwiki.org/svnroot/xwiki/platform/core/trunk/xwiki-core/src/main/...
/** * Instantiates the default article feed. * * @param query the HQL query used for retrieving the articles * @param count the maximum number of articles to retrieve * @param start the start index * @param metadata feed meta data (includes the author, description, copyright, encoding, url, title) * @return a new feed * @see #getArticleFeed(String, int, int, Map) */ public SyndFeed getBlogFeed(String query, int count, int start, Map metadata) { if (query == null) { XWikiRequest request = getXWikiContext().getRequest(); String category = request.getParameter("category"); if (category == null || category.equals("")) { query = ", BaseObject as obj where obj.name=doc.fullName and obj.className='XWiki.ArticleClass' and obj.name<>'XWiki.ArticleClassTemplate' order by doc.creationDate desc"; } else { query = ", BaseObject as obj, DBStringListProperty as prop join prop.list list where obj.name=doc.fullName and obj.className='XWiki.ArticleClass' and obj.name<>'XWiki.ArticleClassTemplate' and obj.id=prop.id.id and prop.id.name='category' and list = '" + category + "' order by doc.creationDate desc"; } } SyndFeed blogFeed = getArticleFeed(query, count, start, fillBlogFeedMetadata(metadata)); if (blogFeed != null) { blogFeed.setImage(getDefaultFeedImage()); } return blogFeed; }
Ludovic
Andreas Schaefer a écrit :
Hi
I just attached the 7th draft of the Blog 2.0 Wiki Syntax upgrade to this JIRA report:
http://jira.xwiki.org/jira/browse/XABLOG-50
This one includes the upgrades of the Panels to the 2.0 syntax. The only thing remaining are the RSS feeds and these cannot be upgraded now because the XHTML renderer does add the macro content as comment to the top of the output AHEAD of the <?xml> which is not allowed by the XML specification. So far I could not find a way to suppress that. I tried to create a XML renderer macro but got nowhere with it.
My own Blog: http://madplanet.com/xwiki/bin/view/Blog/ uses the latest (7th) draft of the blog upgrade.
Cheers
Andreas Schaefer CEO of Madplanet.com Inc. EMail: [email protected] [email protected] Twitter: andy_mpc AIM: [email protected] _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Ludovic Dubost Blog: http://blog.ludovic.org/ XWiki: http://www.xwiki.com Skype: ldubost GTalk: ldubost
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
Hi Marius
Andreas Schaefer a écrit :
I tried to use get this working but I turned out that there are some basic flaws in the FeedPlugin/Api. First many of the "getBlogFeed" method use the Collections.EMPTY_MAP but this one is immutable but the Feed Plugin still wants to add Metadata making it fail with an UnsupportedOperationException.
Maybe Marius can provide some help on it.
Collections.EMPTY_MAP is used to fill a "missing" parameter when a method is overloaded. Use the signature that specifies the parameter:
public SyndEntrySourceApi getSyndEntryArticleSource() public SyndEntrySourceApi getSyndEntryArticleSource(Map params)
I noticed that but the problem is that later these maps are used to add values to it and that subsequently fails because these maps are immutable. I had to use an empty map to make it work and so maybe we should do that there as well.
Secondly the Feed Plugin expects the document class to be of type 'XWiki.ArticleClass' but for a Blog it is 'Blog.BlogPostClass' making it fail to create entries on the SyncedFeed.
Can you try something like http://tinyurl.com/cps7oa ?
The FeedPlugin has two problems. A default query is not working because it looks for XWiki.ArticleClass which I changed but also it uses the XWiki.ArticleClass to define the properties to read out the values and that fails with a NPE. I had to change the Source Parameters in order to make it work. I will have a closer look at the Feed Plugin and provide a patch when I could make it work. Cheers - Andy
Andreas Schaefer wrote:
Hi Marius
Andreas Schaefer a écrit :
I tried to use get this working but I turned out that there are some basic flaws in the FeedPlugin/Api. First many of the "getBlogFeed" method use the Collections.EMPTY_MAP but this one is immutable but the Feed Plugin still wants to add Metadata making it fail with an UnsupportedOperationException.
Maybe Marius can provide some help on it. Collections.EMPTY_MAP is used to fill a "missing" parameter when a method is overloaded. Use the signature that specifies the parameter:
public SyndEntrySourceApi getSyndEntryArticleSource() public SyndEntrySourceApi getSyndEntryArticleSource(Map params)
I noticed that but the problem is that later these maps are used to
Used where? In your code or in the feed plug-in code? I doubt it's in the feed plug-in code because the semantic I choose was: if you don't specify any parameters then you don't have any parameters and thus there's no need to change the map. If you want to specify parameters then you have to provide at least an empty (mutable) map. Can you give me a code snipped that shows the failure?
add values to it and that subsequently fails because these maps are immutable. I had to use an empty map to make it work and so maybe we should do that there as well.
Secondly the Feed Plugin expects the document class to be of type 'XWiki.ArticleClass' but for a Blog it is 'Blog.BlogPostClass' making it fail to create entries on the SyncedFeed. Can you try something like http://tinyurl.com/cps7oa ?
The FeedPlugin has two problems. A default query is not working because it looks for XWiki.ArticleClass which I changed but also it uses the XWiki.ArticleClass to define the properties to read out the values and that fails with a NPE. I had to change the Source Parameters in order to make it work. I will have a closer look at the Feed Plugin and provide a patch when I could make it work.
Again, can you provide a code snipped that shows the issue? SyndEntryDocumentSource is a generic feed entry source that knows nothing about XWiki.ArticleClass. It can generate a feed entry by collecting values from different properties of different objects attached to the source document. You can even specify velocity expressions to fill feed entry fields. Feed plug-in provides some helper methods for generating a feed from XWiki.ArticleClass objects. Forget about it. For the new blog you have to use the generic API and specify the mapping between feed entry fields and Blog.BlogPostClass properties. Take a closer look at my example http://tinyurl.com/cps7oa . As you can see I map: * ContentLength field -> a constant, 10 * title field -> document title * description field -> the content property of the first XWiki.ArticleClass object attached to the source document * publishedDate -> the date property of the XWiki.ArticleClass object with index 0 among all the XWiki.ArticleClass objects attached to the source document * updatedDate -> a velocity expression, $doc.date.time * categories -> a list: $doc.space, $doc.name, $doc.isNew() So what stops you from mapping feed entry fields to Blog.BlogPostClass properties ? Hope this helps, Marius
Cheers - Andy
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
Since the upgrade to the 7th draft I experience some out-of-memory errors or stack overflow erors causing XWiki to become unresponsive. I replaced the panels with the old version to to see if that fixes the issue. Does anyone have an idea how to figure out what is going wrong ? Thanks Andreas Schaefer CEO of Madplanet.com Inc. EMail: [email protected] [email protected] Twitter: andy_mpc AIM: [email protected] On Monday, August 03, 2009, at 02:12PM, "Andreas Schaefer" <[email protected]> wrote:
Hi
I just attached the 7th draft of the Blog 2.0 Wiki Syntax upgrade to this JIRA report:
http://jira.xwiki.org/jira/browse/XABLOG-50
This one includes the upgrades of the Panels to the 2.0 syntax. The only thing remaining are the RSS feeds and these cannot be upgraded now because the XHTML renderer does add the macro content as comment to the top of the output AHEAD of the <?xml> which is not allowed by the XML specification. So far I could not find a way to suppress that. I tried to create a XML renderer macro but got nowhere with it.
My own Blog: http://madplanet.com/xwiki/bin/view/Blog/ uses the latest (7th) draft of the blog upgrade.
Cheers
Andreas Schaefer CEO of Madplanet.com Inc. EMail: [email protected] [email protected] Twitter: andy_mpc AIM: [email protected] _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
Andreas Schaefer wrote:
Since the upgrade to the 7th draft I experience some out-of-memory errors or stack overflow erors causing XWiki to become unresponsive. I replaced the panels with the old version to to see if that fixes the issue. Does anyone have an idea how to figure out what is going wrong ?
Normally, wiki content should not cause memory problems. Can you get a stacktrace of the JVM? "kill -QUIT <pid of java>" should print it in the logs. You can try to increase the maximum memory available to the JVM a bit. If nothing else works, I can profile it to see what's going on. -- Sergiu Dumitriu http://purl.org/net/sergiu/
participants (5)
-
Andreas Schaefer -
Ludovic Dubost -
Marius Dumitru Florea -
Sergiu Dumitriu -
Vincent Massol