[jboss-cvs] jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/core/ui ...
Christian Bauer
christian at hibernate.org
Thu Mar 8 12:50:59 EST 2007
User: cbauer
Date: 07/03/08 12:50:58
Modified: examples/wiki/src/main/org/jboss/seam/wiki/core/ui
WikiUtil.java UIWikiFormattedText.java
Log:
Refactored Node editing framework, work on permission system
Revision Changes Path
1.2 +7 -0 jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/core/ui/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/core/ui/WikiUtil.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- WikiUtil.java 7 Mar 2007 18:37:39 -0000 1.1
+++ WikiUtil.java 8 Mar 2007 17:50:58 -0000 1.2
@@ -16,6 +16,9 @@
@Name("wikiUtil")
public class WikiUtil {
+ // Used against page names, simply remove everything that is not alphanumeric, should do for most strings
+ public static final String WIKINAME_REMOVECHARACTERS = "[^\\p{Alnum}]+";
+
// Replacement for missing instaceOf in EL (can't use string comparison, might be proxy)
public static boolean isDirectory(Node node) {
return node != null && Directory.class.isAssignableFrom(node.getClass());
@@ -47,6 +50,10 @@
}
}
+ public static String convertToWikiName(String realName) {
+ return realName.replaceAll(WIKINAME_REMOVECHARACTERS, "");
+ }
+
/**
* Need to bind UI components to non-conversational backing beans.
* That this is even needed makes no sense. Why can't I call the UI components
1.3 +2 -0 jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/core/ui/UIWikiFormattedText.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: UIWikiFormattedText.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/core/ui/UIWikiFormattedText.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- UIWikiFormattedText.java 8 Mar 2007 10:44:15 -0000 1.2
+++ UIWikiFormattedText.java 8 Mar 2007 17:50:58 -0000 1.3
@@ -51,9 +51,11 @@
context.getResponseWriter().write(parser.toString());
// Flush persistence context after parsing/rendering - resolved and updated links need to be stored
+ /* TODO: can't flush after rendering some wiki text, breaks preview feature in docEdit flushmode.manual conversation
EntityManager em = ((EntityManager)org.jboss.seam.Component.getInstance("entityManager"));
em.joinTransaction();
em.flush();
+ */
// Put attachments (wiki links...) into the event context for later rendering
Contexts.getEventContext().set("wikiTextAttachments", parser.getAttachments());
More information about the jboss-cvs-commits
mailing list