Closed GoogleCodeExporter closed 9 years ago
Hi Ryan
The URL is build in the methods
org.jamwiki.parser.bliki.JAMWikiModel#appendInternalLink() and
org.jamwiki.parser.bliki.JAMWikiModel#buildTopicUrlNoEdit()
did you checked already if the building of the virtual wiki link could be
maintained there?
private static String buildTopicUrlNoEdit(String context, String virtualWiki,
String topicName, String section, String queryString) {
// TODO same as LinkUtil#buildTopicUrlNoEdit()
if (StringUtils.isBlank(topicName) && !StringUtils.isBlank(section)) {
return "#" + Utilities.encodeAndEscapeTopicName(section);
}
StringBuilder url = new StringBuilder();
if (context != null) {
url.append(context);
}
// context never ends with a "/" per servlet specification
url.append('/');
// get the virtual wiki, which should have been set by the parent servlet
url.append(Utilities.encodeAndEscapeTopicName(virtualWiki));
url.append('/');
url.append(Utilities.encodeAndEscapeTopicName(topicName));
if (!StringUtils.isBlank(queryString)) {
if (queryString.charAt(0) != '?') {
url.append('?');
}
url.append(queryString);
}
if (!StringUtils.isBlank(section)) {
if (section.charAt(0) != '#') {
url.append('#');
}
url.append(Utilities.encodeAndEscapeTopicName(section));
}
return url.toString();
}
Original comment by axelclk@gmail.com
on 25 Jan 2012 at 5:36
Sorry for the delayed response. I'll take a look at the JAMWikiModel code
again, but as I'm not familiar with the Bliki parser I was not entirely sure
where in the interface file to begin. Based on the behavior I'm seeing it
looks like (for example) appendInterWikiLink() is interpreting a link like
[[ca:Topic]] as an interwiki link when it is actually a virtual wiki. If you
have any insight or can provide a pointer as to where to look in the Bliki
source to determine the parsing flow I'd be grateful, otherwise I'll try to
figure this out when I again have some time.
Original comment by ryan.hol...@gmail.com
on 27 Jan 2012 at 5:16
I think because JAMWiki is doing some special handling with virtual wikis it's
best to analyze the raw wiki link [[...]].
Therefore you could override the AbstractModel#appendRawWikipediaLink(String
rawLinkText, String suffix) method.
See:
http://code.google.com/p/gwtwiki/source/browse/trunk/info.bliki.wiki/bliki-core/src/main/java/info/bliki/wiki/model/AbstractWikiModel.java and
http://code.google.com/p/gwtwiki/source/browse/trunk/info.bliki.wiki/bliki-core/src/main/java/info/bliki/wiki/model/IWikiModel.java
Original comment by axelclk@gmail.com
on 27 Jan 2012 at 3:37
Original comment by axelclk@gmail.com
on 27 Jan 2012 at 3:39
Thanks for the pointers. After looking at the
AbstractModel#appendRawWikipediaLink code I was able to solve the problem by
overriding AbstractModel#appendRawNamespaceLinks. Virtual wikis again seem to
parse more-or-less correctly with JAMWiki (fix to be included in JAMWiki 1.1.5)
so this issue can be closed.
Original comment by ryan.hol...@gmail.com
on 29 Jan 2012 at 8:15
Original comment by axelclk@gmail.com
on 6 Mar 2012 at 5:29
Original issue reported on code.google.com by
ryan.hol...@gmail.com
on 24 Jan 2012 at 4:28