How can I turn off the "shortcut" URLs where /bin/Space/Page is
interpreted as /bin/view/Space/Page?
(Specifically, I'm using mod_redirect to clean up the URL
architecture and need to assume that anything prefixed /bin that
isn't /bin/view needs to be passed through as an action.)
- - -
Hans Gerwitz
http://phobia.com/
I've posted a fix for bug #XWIKI-283, and I hope someone can include it
in the next release.
When trying to show an RSS or RSS2 feed in a wiki page using the {rss}
macro, you will see text like:
"SyndContentImpl.value= ... {blog text} ...
SyndContentImpl.type=text/plain"
Here's the fix to java/com/xpn/xwiki/render/macro/rss/RSSMacro.java.
It applies to xwiki 0.9.743 through subversion June 20, 2006. and to
rome 0.6 through 0.8.
185c184
< .append(NEWLINE).append(entry.getDescription())
---
> .append(NEWLINE).append(entry.getDescription().getValue())
218c217
< .append(NEWLINE).append(entry.getDescription())
---
> .append(NEWLINE).append(entry.getDescription().getValue())
Explanation:
The following code appends the result of
com.sun.syndication.feed.synd.SyndEntry.getDescription(). That would be
fine if getDescription returned a String, but in fact it returns a
feed.synd.SyndContent object.
buf.append(NEWLINE).append("<div class='rssitemdescription'>")
.append(NEWLINE).append(entry.getDescription())
.append(NEWLINE).append("</div>");
My test cases were:
RSS: {rss:feed=http://gigazad.blogspot.com/rss.xml|count=4|full=true}
RSS2:
{rss:feed=http://www.mikegiesbrecht.com/Blog.php?feed_type=rss2|count=1|full=true}
More details below.
--
Trevor Cox
skahasoftware.com
Vancouver, Canada
Ludovic Dubost wrote:
>
> Looks like I missed this one !! There is probably a bug with to little
> encoding of what we get from the feeds.
> You should report an issue in http://jira.xwiki.org
>
> Ludovic
>
> Trevor Cox a écrit :
>
>> Has anyone looked in to RSS2 feeds and the {rss} macro? As far as I
>> can figure out, RSS2 is a new version of RSS. My {rss} macro works
>> fine with RSS feeds that are not labelled RSS2 (although Google seems
>> to block access somehow).
>>
>> I tried upgrading to the latest version of rome.jar, 0.7, but that
>> didn't help. A Google search showed that many XWiki users are having
>> the same problem I am.
>>
>> When I use {rss... |full=true} I see the following text. I've put in
>> bold the text that I should be seeing. The rest is coming from the
>> ROME code (not directly from the RSS source).
>>
>> SyndContentImpl.value=*Be sure to check out my November Newsletter
>> for important tips for Buyers! Click on the Newsletter tab on my
>> Home Page and read about 6 questions a Buyer should ask before making
>> an offer. Read More <http://mikegiesbrecht.com/ViewBlog/14/>*
>> SyndContentImpl.type=text/plain SyndContentImpl.interface=interface
>> com.sun.syndication.feed.synd.SyndContent
>>
>>
>> -Trevor Cox
>> http://skahasoftware.com
>> ------------------------------------------------------------------------
>
Hi,
This is really a question for Jeremi, concerning the following changes
to com.xpn.xwiki.user.impl.xwiki.XWikiRightServiceImpl.checkRight():
- From r965, "XWiki." was prepended to all group names stored in a
rights object that did not already contain "XWiki.", before they were
compared against the users's groups. This broke group access rights
for any groups not in the XWiki space.
NB: the variable name "userarray" here is very misleading since it
actually can refer to a list of users OR groups depending on some
flag. See the rest of the method to understand.
String fieldName = user ? "users" : "groups";
[...]
String users = bobj.getStringValue(fieldName);
[...]
String[] userarray = StringUtils.split(users, " ,|");
[...]
for (int ii = 0; ii < userarray.length; ii++) {
String value = userarray[ii];
if (value.indexOf("XWiki.") == -1)
userarray[ii] = "XWiki." + value;
}
- This was fixed in r1634: now it only prepends "XWiki." if the group
name does not contain a ".":
for (int ii = 0; ii < userarray.length; ii++) {
String value = userarray[ii];
if (value.indexOf(".") == -1)
userarray[ii] = "XWiki." + value;
}
I would like to understand why modifying the group name at this stage
is required at all.
Firstly, the editrights.vm template is now such that XWiki groups are
selected from a fixed list. Users cannot omit the space name.
Secondly, this code cause problems if, like us, you have a customised
GroupService implementation to provide support for non-XWiki groups.
The groupname that an admin enters into a rights form might be
tampered with in some opaque manner before being checked against the
list of groups the users belong to when they visit the page. Therefore
it becomes very difficult to implement a working custom group service.
Our implementation of GroupService queries an LDAP server and adds a
bunch of non-xwiki groups to the user's groups in listGroupsForUser().
We also provide a modified editrights template so that users can
define access rights in terms of these custom groups, along with
normal XWiki groups.
This cannot work if CheckRights messes with the group names before
doing the comparison. We could modify it to work around the
RightService's behaviour, but I'd like to understand why this would be
necessary.
Cheers,
Robin