tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hls...@apache.org
Subject cvs commit: jakarta-tapestry/framework/src/test/org/apache/tapestry/junit/parse InvalidComponentAlias.application
Date Sun, 03 Apr 2005 23:09:36 GMT
hlship      2005/04/03 16:09:36

  Modified:    framework/src/java/org/apache/tapestry/parse
                        SpecificationParser.java
               framework/src/test/org/apache/tapestry/junit/parse
                        InvalidComponentAlias.application
  Log:
  Allow page names (in the <page> element of application and library specifications)
to contain folder names seperated by slashes, before the final page name.
  
  Revision  Changes    Path
  1.23      +17 -5     jakarta-tapestry/framework/src/java/org/apache/tapestry/parse/SpecificationParser.java
  
  Index: SpecificationParser.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/framework/src/java/org/apache/tapestry/parse/SpecificationParser.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- SpecificationParser.java	1 Apr 2005 16:04:56 -0000	1.22
  +++ SpecificationParser.java	3 Apr 2005 23:09:36 -0000	1.23
  @@ -74,6 +74,10 @@
    */
   public class SpecificationParser extends AbstractParser implements ISpecificationParser
   {
  +    private static final String IDENTIFIER_PATTERN = "_?[a-zA-Z]\\w*";
  +
  +    private static final String EXTENDED_IDENTIFIER_PATTERN = "_?[a-zA-Z](\\w|-)*";
  +
       /**
        * Perl5 pattern for asset names. Letter, followed by letter, number or underscore.
Also allows
        * the special "$template" value.
  @@ -116,7 +120,8 @@
        * @since 2.2
        */
   
  -    public static final String COMPONENT_TYPE_PATTERN = "^(_?[a-zA-Z]\\w*:)?[a-zA-Z_](\\w)*$";
  +    public static final String COMPONENT_TYPE_PATTERN = "^(" + IDENTIFIER_PATTERN + ":)?"
  +            + IDENTIFIER_PATTERN + "$";
   
       /**
        * We can share a single map for all the XML attribute to object conversions, since
the keys are
  @@ -126,12 +131,15 @@
       private final Map CONVERSION_MAP = new HashMap();
   
       /**
  -     * Like modified property name, but allows periods in the name as well.
  +     * Extended version of {@link Tapestry.SIMPLE_PROPERTY_NAME_PATTERN}, but allows a
series of
  +     * individual property names, seperated by periods. In addition, each name within the
dotted
  +     * sequence is allowed to contain dashes.
        * 
        * @since 2.2
        */
   
  -    public static final String EXTENDED_PROPERTY_NAME_PATTERN = "^_?[a-zA-Z](\\w|-|\\.)*$";
  +    public static final String EXTENDED_PROPERTY_NAME_PATTERN = "^" + EXTENDED_IDENTIFIER_PATTERN
  +            + "(\\." + EXTENDED_IDENTIFIER_PATTERN + ")*$";
   
       /**
        * Per5 pattern for extension names. Letter followed by letter, number, dash, period
or
  @@ -165,12 +173,16 @@
       private boolean _DTD_3_1;
   
       /**
  -     * Perl5 pattern for page names. Letter followed by letter, number, dash, underscore
or period.
  +     * Perl5 pattern for page names. Page names appear in library and application specifications,
in
  +     * the &lt;page&gt; element. Starting with 3.1, the page name may look more
like a path name,
  +     * consisting of a number of ids seperated by slashes. This is used to determine the
folder
  +     * which contains the page specification or the page's template.
        * 
        * @since 2.2
        */
   
  -    public static final String PAGE_NAME_PATTERN = EXTENDED_PROPERTY_NAME_PATTERN;
  +    public static final String PAGE_NAME_PATTERN = "^" + IDENTIFIER_PATTERN + "(/"
  +            + IDENTIFIER_PATTERN + ")*$";
   
       /**
        * Perl5 pattern that parameter names must conform to. Letter, followed by letter,
number or
  
  
  
  1.3       +4 -4      jakarta-tapestry/framework/src/test/org/apache/tapestry/junit/parse/InvalidComponentAlias.application
  
  Index: InvalidComponentAlias.application
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/framework/src/test/org/apache/tapestry/junit/parse/InvalidComponentAlias.application,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- InvalidComponentAlias.application	6 Jan 2005 02:17:13 -0000	1.2
  +++ InvalidComponentAlias.application	3 Apr 2005 23:09:36 -0000	1.3
  @@ -25,17 +25,17 @@
     <page name="Home" specification-path="/tutorial/workbench/Home.jwc"/>
     
     <page name="Palette" specification-path="/tutorial/workbench/palette/Palette.jwc"/>
  -  <page name="palette.Results" specification-path="/tutorial/workbench/palette/Results.jwc"/>
  +  <page name="palette/Results" specification-path="/tutorial/workbench/palette/Results.jwc"/>
     
     <page name="Localization" specification-path="/tutorial/workbench/localization/Localization.jwc"/>
  -  <page name="localization.Change" 
  +  <page name="localization/Change" 
     	specification-path="/tutorial/workbench/localization/Change.jwc"/>
       
     <page name="Fields" specification-path="/tutorial/workbench/fields/Fields.jwc"/>
  -  <page name="fields.Results" specification-path="/tutorial/workbench/fields/Results.jwc"/>
  +  <page name="fields/Results" specification-path="/tutorial/workbench/fields/Results.jwc"/>
     
     <page name="Upload" specification-path="/tutorial/workbench/upload/Upload.jwc"/>
  -  <page name="upload.Results" specification-path="/tutorial/workbench/upload/Results.jwc"/>
  +  <page name="upload/Results" specification-path="/tutorial/workbench/upload/Results.jwc"/>
   
     <page name="Chart" specification-path="/tutorial/workbench/chart/Chart.jwc"/>
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org


Mime
View raw message