[jboss-cvs] jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/core/action ...

Christian Bauer christian at hibernate.org
Wed Sep 26 05:36:18 EDT 2007


  User: cbauer  
  Date: 07/09/26 05:36:18

  Modified:    examples/wiki/src/main/org/jboss/seam/wiki/core/action 
                        DocumentHome.java
  Log:
  New handling for Seam Text errors, no more STDERR garbage
  
  Revision  Changes    Path
  1.29      +29 -13    jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/core/action/DocumentHome.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: DocumentHome.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/core/action/DocumentHome.java,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -b -r1.28 -r1.29
  --- DocumentHome.java	24 Sep 2007 08:23:21 -0000	1.28
  +++ DocumentHome.java	26 Sep 2007 09:36:18 -0000	1.29
  @@ -16,6 +16,7 @@
   import org.jboss.seam.wiki.core.dao.UserRoleAccessFactory;
   import org.jboss.seam.wiki.core.action.prefs.DocumentEditorPreferences;
   import org.jboss.seam.wiki.core.action.prefs.CommentsPreferences;
  +import org.jboss.seam.wiki.core.ui.SeamTextValidator;
   import org.jboss.seam.wiki.preferences.PreferenceSupport;
   import org.jboss.seam.Component;
   import org.jboss.seam.ScopeType;
  @@ -25,6 +26,9 @@
   
   import java.util.List;
   
  +import antlr.RecognitionException;
  +import antlr.ANTLRException;
  +
   @Name("documentHome")
   @Scope(ScopeType.CONVERSATION)
   public class DocumentHome extends NodeHome<Document> {
  @@ -187,6 +191,9 @@
           parser.setCurrentDocument(getInstance());
           parser.setCurrentDirectory(getParentDirectory());
           parser.setResolver((WikiLinkResolver)Component.getInstance("wikiLinkResolver"));
  +
  +        try {
  +
           parser.setRenderer(
               new WikiTextRenderer() {
                   public String renderInlineLink(WikiLink inlineLink) { return null; }
  @@ -201,6 +208,15 @@
                   }
               }
           ).parse(false);
  +
  +        } catch (RecognitionException rex) {
  +            // Swallow and log and low debug level
  +            getLog().debug( "Ignored parse error finding plugins in text: " + SeamTextValidator.getErrorMessage(formContent, rex) );
  +        } catch (ANTLRException ex) {
  +            // All other errors are fatal;
  +            throw new RuntimeException(ex);
  +        }
  +
           return usedPlugins.toString();
       }
   
  
  
  



More information about the jboss-cvs-commits mailing list