[jboss-cvs] jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/util ...
Christian Bauer
christian at hibernate.org
Fri Jul 6 10:38:40 EDT 2007
User: cbauer
Date: 07/07/06 10:38:40
Modified: examples/wiki/src/main/org/jboss/seam/wiki/util
WikiUtil.java
Log:
Compiles and runs on latest Seam CVS
Revision Changes Path
1.10 +5 -0 jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/util/WikiUtil.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: WikiUtil.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/util/WikiUtil.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- WikiUtil.java 21 Jun 2007 06:06:15 -0000 1.9
+++ WikiUtil.java 6 Jul 2007 14:38:40 -0000 1.10
@@ -89,6 +89,7 @@
}
public static String renderPermLink(Node node) {
+ if (node == null) return "";
if (isFile(node)) return renderFileLink((File)node);
WikiPreferences wikiPrefs = (WikiPreferences) Component.getInstance("wikiPreferences");
String contextPath = FacesContext.getCurrentInstance().getExternalContext().getRequestContextPath();
@@ -96,6 +97,7 @@
}
public static String renderWikiLink(Node node) {
+ if (node == null) return "";
String contextPath = FacesContext.getCurrentInstance().getExternalContext().getRequestContextPath();
if (node.getArea().getWikiname().equals(node.getWikiname()))
return contextPath + "/" + node.getArea().getWikiname();
@@ -103,11 +105,14 @@
}
private static String renderFileLink(File file) {
+ if (file == null) return "";
String contextPath = FacesContext.getCurrentInstance().getExternalContext().getRequestContextPath();
return contextPath + "/servlets/files/download.seam?fileId=" + file.getId();
}
public static String renderHomeURL(User user) {
+ if (user == null) return "";
+ if (user.getMemberHome() == null) throw new IllegalArgumentException("User does not have a home directory");
String contextPath = FacesContext.getCurrentInstance().getExternalContext().getRequestContextPath();
return contextPath + "/" + user.getMemberHome().getParent().getWikiname() + "/" + user.getMemberHome().getWikiname();
More information about the jboss-cvs-commits
mailing list