avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: avalon-phoenix/src/java/org/apache/avalon/phoenix/framework/tools/infobuilder LegacyBlockInfoReader.java
Date Sun, 06 Apr 2003 10:35:24 GMT
donaldp     2003/04/06 03:35:23

  Modified:    src/java/org/apache/avalon/phoenix/framework/tools/infobuilder
                        LegacyBlockInfoReader.java
  Log:
  Correctly set the location of the schema to
  Foo-schema.xml for the Foo block.
  
  Revision  Changes    Path
  1.8       +15 -4     avalon-phoenix/src/java/org/apache/avalon/phoenix/framework/tools/infobuilder/LegacyBlockInfoReader.java
  
  Index: LegacyBlockInfoReader.java
  ===================================================================
  RCS file: /home/cvs/avalon-phoenix/src/java/org/apache/avalon/phoenix/framework/tools/infobuilder/LegacyBlockInfoReader.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- LegacyBlockInfoReader.java	5 Apr 2003 11:21:10 -0000	1.7
  +++ LegacyBlockInfoReader.java	6 Apr 2003 10:35:23 -0000	1.8
  @@ -80,6 +80,9 @@
       extends AbstractLogEnabled
       implements InfoReader
   {
  +    /**
  +     * I18n resources.
  +     */
       private static final Resources REZ =
           ResourceManager.getPackageResources( LegacyBlockInfoReader.class );
   
  @@ -156,7 +159,7 @@
           }
   
           configuration = info.getChild( "block" );
  -        final SchemaDescriptor schema = buildConfigurationSchema( configuration );
  +        final SchemaDescriptor schema = buildConfigurationSchema( classname, configuration
);
   
           return new ComponentInfo( descriptor,
                                     services,
  @@ -170,7 +173,8 @@
        *
        * @return the a descriptor for the SchemaDescriptor,
        */
  -    private SchemaDescriptor buildConfigurationSchema( Configuration configuration )
  +    private SchemaDescriptor buildConfigurationSchema( final String classname,
  +                                                       final Configuration configuration
)
       {
           final String schemaType =
               configuration.getChild( "schema-type" ).getValue( "" );
  @@ -182,7 +186,14 @@
           {
               final String schemaUri =
                   LegacyUtil.translateToSchemaUri( schemaType );
  -            return new SchemaDescriptor( "", schemaUri, Attribute.EMPTY_SET );
  +            final int index = classname.lastIndexOf( "." );
  +            String location = classname;
  +            if( -1 != index )
  +            {
  +                location = classname.substring( index + 1 );
  +            }
  +            location += "-schema.xml";
  +            return new SchemaDescriptor( location, schemaUri, Attribute.EMPTY_SET );
           }
   
       }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org
For additional commands, e-mail: cvs-help@avalon.apache.org


Mime
View raw message