[jboss-cvs] jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/core/engine ...
Christian Bauer
christian at hibernate.org
Fri Apr 27 06:34:04 EDT 2007
User: cbauer
Date: 07/04/27 06:34:04
Modified: examples/wiki/src/main/org/jboss/seam/wiki/core/engine
DefaultWikiLinkResolver.java
Log:
Now deployable on 4.2 out-of-box (local Hibernate JARs) and optimized SQL and caching
Revision Changes Path
1.3 +11 -4 jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/core/engine/DefaultWikiLinkResolver.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: DefaultWikiLinkResolver.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/core/engine/DefaultWikiLinkResolver.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- DefaultWikiLinkResolver.java 9 Apr 2007 10:57:58 -0000 1.2
+++ DefaultWikiLinkResolver.java 27 Apr 2007 10:34:03 -0000 1.3
@@ -1,13 +1,11 @@
package org.jboss.seam.wiki.core.engine;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.In;
-import org.jboss.seam.annotations.Transactional;
-import org.jboss.seam.annotations.AutoCreate;
+import org.jboss.seam.annotations.*;
import org.jboss.seam.wiki.core.model.Directory;
import org.jboss.seam.wiki.core.dao.NodeDAO;
import org.jboss.seam.wiki.core.model.*;
import org.jboss.seam.wiki.util.WikiUtil;
+import org.jboss.seam.log.Log;
import java.util.regex.Pattern;
@@ -23,6 +21,8 @@
@AutoCreate
public class DefaultWikiLinkResolver implements WikiLinkResolver {
+ @Logger static Log log;
+
// Render these strings whenever [=>wiki://123] needs to be resolved but can't
public static final String BROKENLINK_URL = "PageDoesNotExist";
public static final String BROKENLINK_DESCRIPTION = "?BROKEN LINK?";
@@ -96,6 +96,7 @@
wikiLink = new WikiLink(false, true);
wikiLink.setUrl(linkText);
wikiLink.setDescription(linkText);
+ log.debug("link resolved to known protocol: " + linkText);
// Check if it is a wiki protocol
} else if (wikiProtocolMatcher.find()) {
@@ -106,11 +107,13 @@
wikiLink = new WikiLink(false, false);
wikiLink.setNode(node);
wikiLink.setDescription(node.getName());
+ log.debug("wiki link resolved to existing node: " + linkText);
} else {
// Can't do anything, [=>wiki://123] no longer exists
wikiLink = new WikiLink(true, false);
wikiLink.setUrl(BROKENLINK_URL);
wikiLink.setDescription(BROKENLINK_DESCRIPTION);
+ log.debug("wiki link could not be resolved: " + linkText);
}
// Check if it is a custom protocol
@@ -121,10 +124,12 @@
wikiLink = new WikiLink(false, true);
wikiLink.setUrl(protocol.getRealLink(customProtocolMatcher.group(2)));
wikiLink.setDescription(protocol.getPrefix() + "://" + customProtocolMatcher.group(2));
+ log.debug("link resolved to custom protocol: " + linkText);
} else {
wikiLink = new WikiLink(true, false);
wikiLink.setUrl(BROKENLINK_URL);
wikiLink.setDescription(BROKENLINK_DESCRIPTION);
+ log.debug("link resolved to non-existant custom protocol: " + linkText);
}
// It must be a stored clear text link, such as [=>Target Name] or [=>Area Name|Target Name]
@@ -141,6 +146,7 @@
wikiLink.setDescription(node.getName());
// Indicate that caller should update the wiki text that contains this link
wikiLink.setRequiresUpdating(true);
+ log.debug("resolved wiki word link, this needs updating to the real identifier: " + linkText);
} else {
/* TODO: Not sure we should actually implement this..., one of these things that the wiki "designers" got wrong
@@ -157,6 +163,7 @@
wikiLink = new WikiLink(true, false);
wikiLink.setUrl(BROKENLINK_URL);
wikiLink.setDescription(BROKENLINK_DESCRIPTION);
+ log.debug("could not resolve link: " + linkText);
}
}
links.put(linkText, wikiLink);
More information about the jboss-cvs-commits
mailing list