[jboss-svn-commits] JBL Code SVN: r16812 - in labs/jbossforums/branches/forums101P22: forums/src/main/org/jboss/portlet/forums/format/parser/bbcode and 4 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Mon Nov 26 03:27:30 EST 2007


Author: unibrew
Date: 2007-11-26 03:27:30 -0500 (Mon, 26 Nov 2007)
New Revision: 16812

Modified:
   labs/jbossforums/branches/forums101P22/.classpath
   labs/jbossforums/branches/forums101P22/forums/src/main/org/jboss/portlet/forums/format/parser/bbcode/Analyzer.flex
   labs/jbossforums/branches/forums101P22/forums/src/main/org/jboss/portlet/forums/format/parser/bbcode/Analyzer.java
   labs/jbossforums/branches/forums101P22/forums/src/main/org/jboss/portlet/forums/format/parser/bbcode/BBCodeParser.java
   labs/jbossforums/branches/forums101P22/forums/src/main/org/jboss/portlet/forums/format/parser/html/Analyzer.java
   labs/jbossforums/branches/forums101P22/forums/src/main/org/jboss/portlet/forums/format/render/bbcodehtml/ToHTMLRenderer.java
   labs/jbossforums/branches/forums101P22/forums/src/main/org/jboss/portlet/forums/ui/PortalUtil.java
   labs/jbossforums/branches/forums101P22/forums/src/resources/portal-forums-war/WEB-INF/classes/ResourceJSF.properties
   labs/jbossforums/branches/forums101P22/forums/src/resources/portal-forums-war/WEB-INF/classes/ResourceJSF_fr.properties
Log:
[JBFORUMS-20] I've added support for [url=<URL>]text[/url] and [img]<URL>[/img] bbcode tags. Additionally, I switched to own libs in Portal util and I modified .classpath for eclipse project as new libs are needed for compiling.

Modified: labs/jbossforums/branches/forums101P22/.classpath
===================================================================
--- labs/jbossforums/branches/forums101P22/.classpath	2007-11-26 08:26:23 UTC (rev 16811)
+++ labs/jbossforums/branches/forums101P22/.classpath	2007-11-26 08:27:30 UTC (rev 16812)
@@ -33,5 +33,8 @@
 	<classpathentry kind="lib" path="thirdparty/jboss-jaae-engine/lib/jboss-identity-management.jar"/>
 	<classpathentry kind="lib" path="thirdparty/jbportal/lib/portal-identity-lib.jar"/>
 	<classpathentry kind="lib" path="thirdparty/apache-myfaces/lib/myfaces-api.jar"/>
+	<classpathentry kind="lib" path="thirdparty/jboss-system/lib/jboss-common.jar"/>
+	<classpathentry kind="lib" path="thirdparty/dom4j/lib/dom4j.jar"/>
+	<classpathentry kind="lib" path="thirdparty/javassist/lib/javassist.jar"/>
 	<classpathentry kind="output" path="bin"/>
 </classpath>

Modified: labs/jbossforums/branches/forums101P22/forums/src/main/org/jboss/portlet/forums/format/parser/bbcode/Analyzer.flex
===================================================================
--- labs/jbossforums/branches/forums101P22/forums/src/main/org/jboss/portlet/forums/format/parser/bbcode/Analyzer.flex	2007-11-26 08:26:23 UTC (rev 16811)
+++ labs/jbossforums/branches/forums101P22/forums/src/main/org/jboss/portlet/forums/format/parser/bbcode/Analyzer.flex	2007-11-26 08:27:30 UTC (rev 16812)
@@ -55,6 +55,7 @@
 public static final int LIST_ITEM = 19;
 public static final int LINK = 20;
 public static final int TEXT = 21;
+public static final int IMAGE = 22;
 
 private static final int FROM_1 = "[url".length();
 private static final int FROM_2 = "[url=".length();
@@ -107,5 +108,6 @@
    "[/list]" { return token(CLOSE_LIST, null); }
    "[*]" { return token(LIST_ITEM, null); }
    "[url"~["]"]~["["]"/url]" { return token(LINK, yytext().substring(4, yytext().length() - 6)); }
+   "[img"~["]"]~["["]"/img]" { return token(IMAGE, yytext().substring(5, yytext().length() - 6)); }
    .|\n { return token(TEXT, yytext()); }
 }

Modified: labs/jbossforums/branches/forums101P22/forums/src/main/org/jboss/portlet/forums/format/parser/bbcode/Analyzer.java
===================================================================
--- labs/jbossforums/branches/forums101P22/forums/src/main/org/jboss/portlet/forums/format/parser/bbcode/Analyzer.java	2007-11-26 08:26:23 UTC (rev 16811)
+++ labs/jbossforums/branches/forums101P22/forums/src/main/org/jboss/portlet/forums/format/parser/bbcode/Analyzer.java	2007-11-26 08:27:30 UTC (rev 16812)
@@ -1,4 +1,4 @@
-/* The following code was generated by JFlex 1.4.1 on 24.11.07 23:16 */
+/* The following code was generated by JFlex 1.4.1 on 25.11.07 19:07 */
 
 /*
 * JBoss, Home of Professional Open Source
@@ -30,7 +30,7 @@
 /**
  * This class is a scanner generated by 
  * <a href="http://www.jflex.de/">JFlex</a> 1.4.1
- * on 24.11.07 23:16 from the specification file
+ * on 25.11.07 19:07 from the specification file
  * <tt>/Users/rysiek/Work/forums101P26/forums/src/main/org/jboss/portlet/forums/format/parser/bbcode/Analyzer.flex</tt>
  */
 public class Analyzer {
@@ -50,9 +50,9 @@
   private static final String ZZ_CMAP_PACKED = 
     "\12\0\1\0\30\0\1\15\6\0\1\30\4\0\1\4\1\16\1\26"+
     "\10\16\3\0\1\13\3\0\6\17\24\14\1\1\1\0\1\3\3\0"+
-    "\1\27\1\2\1\7\1\25\1\22\1\17\2\14\1\5\2\14\1\11"+
-    "\2\14\1\10\1\14\1\23\1\12\1\20\1\24\1\6\4\14\1\21"+
-    "\uff85\0";
+    "\1\27\1\2\1\7\1\25\1\22\1\17\1\32\1\14\1\5\2\14"+
+    "\1\11\1\31\1\14\1\10\1\14\1\23\1\12\1\20\1\24\1\6"+
+    "\4\14\1\21\uff85\0";
 
   /** 
    * Translates characters to character classes
@@ -65,14 +65,14 @@
   private static final int [] ZZ_ACTION = zzUnpackAction();
 
   private static final String ZZ_ACTION_PACKED_0 =
-    "\1\0\2\1\11\0\1\2\7\0\1\3\1\4\5\0"+
-    "\1\5\1\6\1\7\1\10\34\0\1\11\1\12\4\0"+
-    "\1\13\1\14\1\15\6\0\1\16\1\0\1\17\1\20"+
-    "\3\0\1\21\1\22\1\23\1\0\1\24\1\0\1\25"+
-    "\3\0\1\26\4\0";
+    "\1\0\2\1\11\0\1\2\7\0\1\3\1\0\1\4"+
+    "\5\0\1\5\1\6\1\7\1\10\37\0\1\11\1\12"+
+    "\4\0\1\13\1\14\1\15\7\0\1\16\1\0\1\17"+
+    "\1\20\4\0\1\21\1\22\1\23\1\0\1\24\2\0"+
+    "\1\25\4\0\1\26\1\27\4\0";
 
   private static int [] zzUnpackAction() {
-    int [] result = new int[96];
+    int [] result = new int[105];
     int offset = 0;
     offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result);
     return result;
@@ -97,21 +97,23 @@
   private static final int [] ZZ_ROWMAP = zzUnpackRowMap();
 
   private static final String ZZ_ROWMAP_PACKED_0 =
-    "\0\0\0\31\0\62\0\113\0\144\0\175\0\226\0\257"+
-    "\0\310\0\341\0\372\0\u0113\0\31\0\u012c\0\u0145\0\u015e"+
-    "\0\u0177\0\u0190\0\u01a9\0\u01c2\0\31\0\31\0\u01db\0\u01f4"+
-    "\0\u020d\0\u0226\0\u023f\0\31\0\31\0\31\0\31\0\u0258"+
-    "\0\u0271\0\u028a\0\u02a3\0\u02bc\0\u02d5\0\u02ee\0\u0307\0\u0320"+
-    "\0\u0339\0\u0352\0\u036b\0\u0384\0\u039d\0\u03b6\0\u03cf\0\u03e8"+
-    "\0\u0401\0\u041a\0\u0433\0\u044c\0\u0465\0\u047e\0\u0497\0\u04b0"+
-    "\0\u04c9\0\u04e2\0\u04fb\0\31\0\31\0\u0514\0\u052d\0\u0546"+
-    "\0\u055f\0\31\0\31\0\31\0\u0578\0\u0591\0\u05aa\0\u05c3"+
-    "\0\u05dc\0\u05f5\0\31\0\u060e\0\31\0\31\0\u0627\0\u0640"+
-    "\0\u0659\0\31\0\31\0\31\0\u0672\0\31\0\u068b\0\31"+
-    "\0\u06a4\0\u06bd\0\u06d6\0\31\0\u06ef\0\u0708\0\u0721\0\u073a";
+    "\0\0\0\33\0\66\0\121\0\154\0\207\0\242\0\275"+
+    "\0\330\0\363\0\u010e\0\u0129\0\33\0\u0144\0\u015f\0\u017a"+
+    "\0\u0195\0\u01b0\0\u01cb\0\u01e6\0\33\0\u0201\0\33\0\u021c"+
+    "\0\u0237\0\u0252\0\u026d\0\u0288\0\33\0\33\0\33\0\33"+
+    "\0\u02a3\0\u02be\0\u02d9\0\u02f4\0\u030f\0\u032a\0\u0345\0\u0360"+
+    "\0\u037b\0\u0396\0\u03b1\0\u03cc\0\u03e7\0\u0402\0\u041d\0\u0438"+
+    "\0\u0453\0\u046e\0\u0489\0\u04a4\0\u04bf\0\u04da\0\u04f5\0\u0510"+
+    "\0\u052b\0\u0546\0\u0561\0\u057c\0\u0597\0\u05b2\0\u05cd\0\33"+
+    "\0\33\0\u05e8\0\u0603\0\u061e\0\u0639\0\33\0\33\0\33"+
+    "\0\u0654\0\u066f\0\u068a\0\u06a5\0\u06c0\0\u06db\0\u06f6\0\33"+
+    "\0\u0711\0\33\0\33\0\u072c\0\u0747\0\u0762\0\u077d\0\33"+
+    "\0\33\0\33\0\u0798\0\33\0\u07b3\0\u07ce\0\33\0\u07e9"+
+    "\0\u0804\0\u081f\0\u083a\0\33\0\33\0\u0855\0\u0870\0\u088b"+
+    "\0\u08a6";
 
   private static int [] zzUnpackRowMap() {
-    int [] result = new int[96];
+    int [] result = new int[105];
     int offset = 0;
     offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result);
     return result;
@@ -134,42 +136,45 @@
   private static final int [] ZZ_TRANS = zzUnpackTrans();
 
   private static final String ZZ_TRANS_PACKED_0 =
-    "\1\2\1\3\27\2\33\0\1\4\1\0\1\5\1\6"+
+    "\1\2\1\3\31\2\35\0\1\4\1\0\1\5\1\6"+
     "\1\7\1\10\1\0\1\11\6\0\1\12\2\0\1\13"+
-    "\4\0\1\14\3\0\1\15\27\0\1\16\2\0\1\17"+
+    "\4\0\1\14\5\0\1\15\31\0\1\16\2\0\1\17"+
     "\1\20\1\21\1\0\1\22\6\0\1\23\2\0\1\24"+
-    "\10\0\1\25\30\0\1\26\6\0\1\27\26\0\1\30"+
-    "\25\0\1\31\30\0\1\32\31\0\1\33\25\0\1\34"+
-    "\30\0\1\35\30\0\1\36\30\0\1\37\35\0\1\40"+
-    "\25\0\1\41\30\0\1\42\31\0\1\43\33\0\1\44"+
-    "\30\0\1\45\13\0\1\46\23\0\1\47\31\0\1\50"+
-    "\17\0\1\51\31\0\1\52\13\0\1\53\23\0\1\54"+
-    "\31\0\1\55\17\0\1\56\20\0\3\44\1\57\25\44"+
-    "\10\0\1\60\42\0\1\61\32\0\1\62\26\0\1\63"+
-    "\32\0\1\64\14\0\1\65\42\0\1\66\32\0\1\67"+
-    "\26\0\1\70\32\0\1\71\4\0\1\57\1\72\27\57"+
-    "\12\0\1\73\21\0\1\74\30\0\1\75\7\0\1\76"+
-    "\30\0\1\77\37\0\1\100\20\0\1\101\21\0\1\102"+
-    "\30\0\1\103\30\0\1\104\47\0\1\105\12\0\1\106"+
-    "\37\0\1\107\43\0\1\110\1\111\17\0\1\112\7\0"+
-    "\1\112\5\0\1\113\7\0\1\114\20\0\1\115\30\0"+
-    "\1\116\33\0\1\117\24\0\1\120\2\0\6\120\1\0"+
-    "\1\120\1\121\1\0\7\120\1\0\1\120\4\0\1\122"+
-    "\30\0\1\123\30\0\1\124\12\0\1\125\7\0\1\125"+
-    "\2\0\3\114\1\126\25\114\12\0\1\127\20\0\1\120"+
-    "\1\130\1\0\6\120\1\0\1\120\2\0\7\120\1\0"+
-    "\1\120\3\0\1\131\4\0\1\131\6\0\2\131\2\0"+
-    "\1\131\2\0\3\131\4\0\1\124\36\0\1\132\21\0"+
-    "\1\133\4\0\1\133\6\0\2\133\2\0\1\133\2\0"+
-    "\3\133\4\0\1\134\27\0\1\135\4\0\1\135\6\0"+
-    "\2\135\2\0\1\135\2\0\3\135\3\0\1\136\4\0"+
-    "\1\136\6\0\2\136\2\0\1\136\2\0\3\136\3\0"+
-    "\1\137\4\0\1\137\6\0\2\137\2\0\1\137\2\0"+
-    "\3\137\3\0\1\140\4\0\1\140\6\0\2\140\2\0"+
-    "\1\140\2\0\3\140\4\0\1\130\25\0";
+    "\12\0\1\25\25\0\1\26\4\0\1\27\6\0\1\30"+
+    "\30\0\1\31\27\0\1\32\32\0\1\33\33\0\1\34"+
+    "\27\0\1\35\32\0\1\36\32\0\1\37\32\0\1\40"+
+    "\37\0\1\41\27\0\1\42\32\0\1\43\33\0\1\44"+
+    "\56\0\1\45\11\0\1\46\32\0\1\47\13\0\1\50"+
+    "\25\0\1\51\33\0\1\52\21\0\1\53\33\0\1\54"+
+    "\13\0\1\55\25\0\1\56\33\0\1\57\21\0\1\60"+
+    "\22\0\3\45\1\61\27\45\3\46\1\62\27\46\10\0"+
+    "\1\63\44\0\1\64\34\0\1\65\30\0\1\66\34\0"+
+    "\1\67\16\0\1\70\44\0\1\71\34\0\1\72\30\0"+
+    "\1\73\34\0\1\74\6\0\1\61\1\75\31\61\1\62"+
+    "\1\76\31\62\12\0\1\77\23\0\1\100\32\0\1\101"+
+    "\7\0\1\102\32\0\1\103\41\0\1\104\22\0\1\105"+
+    "\23\0\1\106\32\0\1\107\32\0\1\110\51\0\1\111"+
+    "\14\0\1\112\32\0\1\113\41\0\1\114\45\0\1\115"+
+    "\1\116\21\0\1\117\7\0\1\117\7\0\1\120\7\0"+
+    "\1\121\22\0\1\122\32\0\1\123\34\0\1\124\33\0"+
+    "\1\125\26\0\1\126\2\0\6\126\1\0\1\126\1\127"+
+    "\1\0\7\126\1\0\1\126\1\0\2\126\3\0\1\130"+
+    "\32\0\1\131\32\0\1\132\12\0\1\133\7\0\1\133"+
+    "\4\0\3\121\1\134\27\121\31\0\1\135\13\0\1\136"+
+    "\22\0\1\126\1\137\1\0\6\126\1\0\1\126\2\0"+
+    "\7\126\1\0\1\126\1\0\2\126\2\0\1\140\4\0"+
+    "\1\140\6\0\2\140\2\0\1\140\2\0\3\140\6\0"+
+    "\1\132\61\0\1\141\11\0\1\142\23\0\1\143\4\0"+
+    "\1\143\6\0\2\143\2\0\1\143\2\0\3\143\6\0"+
+    "\1\144\32\0\1\145\31\0\1\146\4\0\1\146\6\0"+
+    "\2\146\2\0\1\146\2\0\3\146\5\0\1\147\4\0"+
+    "\1\147\6\0\2\147\2\0\1\147\2\0\3\147\5\0"+
+    "\1\150\4\0\1\150\6\0\2\150\2\0\1\150\2\0"+
+    "\3\150\5\0\1\151\4\0\1\151\6\0\2\151\2\0"+
+    "\1\151\2\0\3\151\6\0\1\137\27\0";
 
   private static int [] zzUnpackTrans() {
-    int [] result = new int[1875];
+    int [] result = new int[2241];
     int offset = 0;
     offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result);
     return result;
@@ -207,13 +212,13 @@
   private static final int [] ZZ_ATTRIBUTE = zzUnpackAttribute();
 
   private static final String ZZ_ATTRIBUTE_PACKED_0 =
-    "\1\0\1\11\1\1\11\0\1\11\7\0\2\11\5\0"+
-    "\4\11\34\0\2\11\4\0\3\11\6\0\1\11\1\0"+
-    "\2\11\3\0\3\11\1\0\1\11\1\0\1\11\3\0"+
-    "\1\11\4\0";
+    "\1\0\1\11\1\1\11\0\1\11\7\0\1\11\1\0"+
+    "\1\11\5\0\4\11\37\0\2\11\4\0\3\11\7\0"+
+    "\1\11\1\0\2\11\4\0\3\11\1\0\1\11\2\0"+
+    "\1\11\4\0\2\11\4\0";
 
   private static int [] zzUnpackAttribute() {
-    int [] result = new int[96];
+    int [] result = new int[105];
     int offset = 0;
     offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result);
     return result;
@@ -304,6 +309,7 @@
 public static final int LIST_ITEM = 19;
 public static final int LINK = 20;
 public static final int TEXT = 21;
+public static final int IMAGE = 22;
 
 private static final int FROM_1 = "[url".length();
 private static final int FROM_2 = "[url=".length();
@@ -361,7 +367,7 @@
     char [] map = new char[0x10000];
     int i = 0;  /* index in packed string  */
     int j = 0;  /* index in unpacked array */
-    while (i < 82) {
+    while (i < 86) {
       int  count = packed.charAt(i++);
       char value = packed.charAt(i++);
       do map[j++] = value; while (--count > 0);
@@ -621,91 +627,95 @@
         case 1: 
           { return token(TEXT, yytext());
           }
-        case 23: break;
+        case 24: break;
         case 16: 
           { return token(CLOSE_QUOTE, null);
           }
-        case 24: break;
+        case 25: break;
         case 10: 
           { return token(OPEN_LIST_UNORDERED, null);
           }
-        case 25: break;
+        case 26: break;
         case 18: 
           { return token(OPEN_LIST_ORDERED_ALPHABETICAL, null);
           }
-        case 26: break;
+        case 27: break;
+        case 22: 
+          { return token(IMAGE, yytext().substring(5, yytext().length() - 6));
+          }
+        case 28: break;
         case 11: 
           { return token(CLOSE_CODE, null);
           }
-        case 27: break;
+        case 29: break;
         case 4: 
           { return token(OPEN_U, null);
           }
-        case 28: break;
+        case 30: break;
         case 7: 
           { return token(CLOSE_I, null);
           }
-        case 29: break;
+        case 31: break;
         case 14: 
           { return token(OPEN_QUOTE_ANONYMOUS, null);
           }
-        case 30: break;
+        case 32: break;
         case 12: 
           { return token(CLOSE_LIST, null);
           }
-        case 31: break;
+        case 33: break;
         case 3: 
           { return token(OPEN_I, null);
           }
-        case 32: break;
+        case 34: break;
         case 20: 
           { return token(OPEN_QUOTE, yytext().substring(7, yytext().length() - 1));
           }
-        case 33: break;
+        case 35: break;
         case 19: 
           { return token(OPEN_SIZE, yytext().substring(6, yytext().length() - 1));
           }
-        case 34: break;
+        case 36: break;
         case 2: 
           { return token(OPEN_B, null);
           }
-        case 35: break;
+        case 37: break;
         case 21: 
           { return token(OPEN_COLOR, yytext().substring(7, yytext().length() - 1));
           }
-        case 36: break;
+        case 38: break;
         case 8: 
           { return token(CLOSE_U, null);
           }
-        case 37: break;
-        case 22: 
+        case 39: break;
+        case 23: 
           { return token(LINK, yytext().substring(4, yytext().length() - 6));
           }
-        case 38: break;
+        case 40: break;
         case 15: 
           { return token(CLOSE_COLOR, null);
           }
-        case 39: break;
+        case 41: break;
         case 13: 
           { return token(CLOSE_SIZE, null);
           }
-        case 40: break;
+        case 42: break;
         case 17: 
           { return token(OPEN_LIST_ORDERED_NUMERICAL, null);
           }
-        case 41: break;
+        case 43: break;
         case 5: 
           { return token(LIST_ITEM, null);
           }
-        case 42: break;
+        case 44: break;
         case 9: 
           { return token(OPEN_CODE, null);
           }
-        case 43: break;
+        case 45: break;
         case 6: 
           { return token(CLOSE_B, null);
           }
-        case 44: break;
+        case 46: break;
         default: 
           if (zzInput == YYEOF && zzStartRead == zzCurrentPos) {
             zzAtEOF = true;

Modified: labs/jbossforums/branches/forums101P22/forums/src/main/org/jboss/portlet/forums/format/parser/bbcode/BBCodeParser.java
===================================================================
--- labs/jbossforums/branches/forums101P22/forums/src/main/org/jboss/portlet/forums/format/parser/bbcode/BBCodeParser.java	2007-11-26 08:26:23 UTC (rev 16811)
+++ labs/jbossforums/branches/forums101P22/forums/src/main/org/jboss/portlet/forums/format/parser/bbcode/BBCodeParser.java	2007-11-26 08:27:30 UTC (rev 16812)
@@ -58,6 +58,7 @@
    public static final int EVENT_UNORDERED_LIST = 10;
    public static final int EVENT_ALPHABETICALLY_ORDERED_LIST = 11;
    public static final int EVENT_NUMERICALLY_ORDERED_LIST = 12;
+   public static final int EVENT_IMAGE = 13;
 
    public static final String BUNDLE_KEY_CODE = "Message_code";
    public static final String BUNDLE_KEY_QUOTE = "Message_quote";
@@ -177,6 +178,11 @@
                _end(EVENT_CODE);
                break;
 
+            case Analyzer.IMAGE:
+                _start(EVENT_IMAGE, t.value);
+                _end(EVENT_IMAGE);
+                break;
+               
             case Analyzer.OPEN_LIST_UNORDERED:
                _start(EVENT_UNORDERED_LIST, null);
                break;
@@ -223,8 +229,8 @@
                   {
                      // todo add support for the link value which is not used yet
                      String url = t.value.substring(1, bracket);
-                     String link = t.value.substring(bracket + 1);
-                     _start(EVENT_LINK, url);
+                     String name = t.value.substring(bracket + 1);
+                     _start(EVENT_LINK, url , name );
                      _end(EVENT_LINK);
                   }
                }
@@ -233,7 +239,6 @@
                   _start(EVENT_LINK, t.value.substring(1));
                   _end(EVENT_LINK);
                }
-
                break;
 
             case Analyzer.TEXT:
@@ -265,8 +270,19 @@
       CloseEvent closeEvent = (CloseEvent)stack.push();
       openEvent.type = closeEvent.type = type;
       openEvent.string = string;
+      openEvent.string2 = null;
       handler.handle(openEvent);
    }
+   
+   private void _start(int type, String string1 , String string2 )
+   {
+       _text();
+       CloseEvent closeEvent = (CloseEvent)stack.push();
+       openEvent.type = closeEvent.type = type;
+       openEvent.string = string1;
+       openEvent.string2= string2;
+       handler.handle(openEvent); 
+   }
 
    private void _end(int type)
    {
@@ -287,11 +303,13 @@
    {
       protected int type;
       protected String string;
+      protected String string2;
 
       public CodeKey()
       {
          type = -1;
          string = null;
+         string2 = null;
       }
 
       public int getType()
@@ -303,6 +321,11 @@
       {
          return string;
       }
+      
+      public String getString2()
+      {
+         return string2;
+      }
    }
 
    public static class OpenEvent extends CodeKey implements ParseEvent

Modified: labs/jbossforums/branches/forums101P22/forums/src/main/org/jboss/portlet/forums/format/parser/html/Analyzer.java
===================================================================
--- labs/jbossforums/branches/forums101P22/forums/src/main/org/jboss/portlet/forums/format/parser/html/Analyzer.java	2007-11-26 08:26:23 UTC (rev 16811)
+++ labs/jbossforums/branches/forums101P22/forums/src/main/org/jboss/portlet/forums/format/parser/html/Analyzer.java	2007-11-26 08:27:30 UTC (rev 16812)
@@ -1,4 +1,4 @@
-/* The following code was generated by JFlex 1.4.1 on 24.11.07 23:16 */
+/* The following code was generated by JFlex 1.4.1 on 25.11.07 03:07 */
 
 /*
 * JBoss, Home of Professional Open Source
@@ -30,7 +30,7 @@
 /**
  * This class is a scanner generated by 
  * <a href="http://www.jflex.de/">JFlex</a> 1.4.1
- * on 24.11.07 23:16 from the specification file
+ * on 25.11.07 03:07 from the specification file
  * <tt>/Users/rysiek/Work/forums101P26/forums/src/main/org/jboss/portlet/forums/format/parser/html/Analyzer.flex</tt>
  */
 public class Analyzer {

Modified: labs/jbossforums/branches/forums101P22/forums/src/main/org/jboss/portlet/forums/format/render/bbcodehtml/ToHTMLRenderer.java
===================================================================
--- labs/jbossforums/branches/forums101P22/forums/src/main/org/jboss/portlet/forums/format/render/bbcodehtml/ToHTMLRenderer.java	2007-11-26 08:26:23 UTC (rev 16811)
+++ labs/jbossforums/branches/forums101P22/forums/src/main/org/jboss/portlet/forums/format/render/bbcodehtml/ToHTMLRenderer.java	2007-11-26 08:27:30 UTC (rev 16812)
@@ -117,6 +117,7 @@
          {
             BBCodeParser.OpenEvent openEvent = (BBCodeParser.OpenEvent)event;
             String string = openEvent.getString();
+            String string2 = openEvent.getString2();
             switch (openEvent.getType())
             {
                case BBCodeParser.EVENT_BOLD:
@@ -151,6 +152,10 @@
                   isInPre++;
                   config.r_code_open.render(ctx, writer);
                   break;
+               case BBCodeParser.EVENT_IMAGE:
+                   ctx.put("URL", string);
+                   config.r_img.render(ctx, writer);
+                   break;
                case BBCodeParser.EVENT_UNORDERED_LIST:
                   config.r_ulist_open.render(ctx, writer);
                   break;
@@ -166,8 +171,16 @@
                   config.r_listitem.render(ctx, writer);
                   break;
                case BBCodeParser.EVENT_LINK:
-                  ctx.put("URL", string);
-                  ctx.put("DESCRIPTION", string);
+                  if (string2==null)
+                  {
+                     ctx.put("URL", string);
+                     ctx.put("DESCRIPTION", string);
+                  }
+                  else
+                  {
+                      ctx.put("URL", string);
+                      ctx.put("DESCRIPTION", string2); 
+                  }
                   config.r_url.render(ctx, writer);
                   break;
             }
@@ -199,6 +212,8 @@
                   isInPre--;
                   config.r_code_close.render(ctx, writer);
                   break;
+               case BBCodeParser.EVENT_IMAGE:
+                   break;
                case BBCodeParser.EVENT_UNORDERED_LIST:
                   config.r_ulist_close.render(ctx, writer);
                   break;

Modified: labs/jbossforums/branches/forums101P22/forums/src/main/org/jboss/portlet/forums/ui/PortalUtil.java
===================================================================
--- labs/jbossforums/branches/forums101P22/forums/src/main/org/jboss/portlet/forums/ui/PortalUtil.java	2007-11-26 08:26:23 UTC (rev 16811)
+++ labs/jbossforums/branches/forums101P22/forums/src/main/org/jboss/portlet/forums/ui/PortalUtil.java	2007-11-26 08:27:30 UTC (rev 16812)
@@ -47,9 +47,9 @@
 import javax.servlet.http.HttpServletRequest;
 import org.apache.log4j.Logger;
 import org.jboss.portal.core.modules.ModuleConstants;
-import org.jboss.portal.format.render.bbcodehtml.ToHTMLConfig;
-import org.jboss.portal.format.render.bbcodehtml.ToHTMLRenderer;
-import org.jboss.portal.format.util.CLLoader;
+import org.jboss.portlet.forums.format.render.bbcodehtml.ToHTMLConfig;
+import org.jboss.portlet.forums.format.render.bbcodehtml.ToHTMLRenderer;
+import org.jboss.portlet.forums.format.util.CLLoader;
 import org.jboss.portal.core.CoreConstants;
 import org.jboss.portal.core.modules.UserModule;
 import org.jboss.portal.core.model.NoSuchUserException;

Modified: labs/jbossforums/branches/forums101P22/forums/src/resources/portal-forums-war/WEB-INF/classes/ResourceJSF.properties
===================================================================
--- labs/jbossforums/branches/forums101P22/forums/src/resources/portal-forums-war/WEB-INF/classes/ResourceJSF.properties	2007-11-26 08:26:23 UTC (rev 16811)
+++ labs/jbossforums/branches/forums101P22/forums/src/resources/portal-forums-war/WEB-INF/classes/ResourceJSF.properties	2007-11-26 08:27:30 UTC (rev 16812)
@@ -243,7 +243,7 @@
 bbcode_l_help=List: [list]text[/list] (alt+l)
 bbcode_o_help=Ordered list: [list=]text[/list]  (alt+o)
 bbcode_p_help=Insert image: [img]http://image_url[/img]  (alt+p)
-bbcode_w_help=Insert URL: [url]http://url[/url]  (alt+w)
+bbcode_w_help=Insert URL: [url]http://url[/url] or [url=http://url]URL text[/url]  (alt+w)
 bbcode_a_help=Close all open bbCode tags
 bbcode_s_help=Font color: [color=red]text[/color]  Tip: you can also use color=#FF0000
 bbcode_f_help=Font size: [size=x-small]small text[/size]

Modified: labs/jbossforums/branches/forums101P22/forums/src/resources/portal-forums-war/WEB-INF/classes/ResourceJSF_fr.properties
===================================================================
--- labs/jbossforums/branches/forums101P22/forums/src/resources/portal-forums-war/WEB-INF/classes/ResourceJSF_fr.properties	2007-11-26 08:26:23 UTC (rev 16811)
+++ labs/jbossforums/branches/forums101P22/forums/src/resources/portal-forums-war/WEB-INF/classes/ResourceJSF_fr.properties	2007-11-26 08:27:30 UTC (rev 16812)
@@ -243,7 +243,7 @@
 bbcode_l_help=Liste: [list]texte[/list] (alt+l)
 bbcode_o_help=Liste ordonnée: [list=]texte[/list]  (alt+o)
 bbcode_p_help=Insérer une image: [img]http://adresse_image[/img]  (alt+p)
-bbcode_w_help=Insérer un hyperlien: [url]http://url[/url]  (alt+w)
+bbcode_w_help=Insérer un hyperlien: [url]http://url[/url] ou [url=http://url]URL texte[/url] (alt+w)
 bbcode_a_help=Fermer les balises restées ouvertes
 bbcode_s_help=Couleur de la police: [color=red]texte[/color]  Truc: vous pouvez également utiliser color=#FF0000
 bbcode_f_help=taille de la police: [size=x-small]petits caractères[/size]




More information about the jboss-svn-commits mailing list