Return-Path: Delivered-To: apmail-jakarta-avalon-cvs-archive@apache.org Received: (qmail 78491 invoked from network); 15 Nov 2002 22:41:32 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 15 Nov 2002 22:41:32 -0000 Received: (qmail 10166 invoked by uid 97); 15 Nov 2002 22:42:37 -0000 Delivered-To: qmlist-jakarta-archive-avalon-cvs@jakarta.apache.org Received: (qmail 10125 invoked by uid 97); 15 Nov 2002 22:42:36 -0000 Mailing-List: contact avalon-cvs-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Avalon CVS List" Reply-To: "Avalon Developers List" Delivered-To: mailing list avalon-cvs@jakarta.apache.org Received: (qmail 10097 invoked by uid 97); 15 Nov 2002 22:42:35 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Date: 15 Nov 2002 22:41:26 -0000 Message-ID: <20021115224126.16783.qmail@icarus.apache.org> From: donaldp@apache.org To: jakarta-avalon-excalibur-cvs@apache.org Subject: cvs commit: jakarta-avalon-excalibur/info/src/test/org/apache/avalon/framework/tools/infobuilder/test/data component3-info.xml service1-info.xml X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N donaldp 2002/11/15 14:41:26 Modified: info/src/java/org/apache/avalon/framework/tools/infobuilder LegacyBlockInfoReader.java info/src/test/org/apache/avalon/framework/tools/infobuilder/test/data component3-info.xml Removed: info/src/test/org/apache/avalon/framework/tools/infobuilder/test/data service1-info.xml Log: Bring legacy descriptor support more into line with new schema element changes. Revision Changes Path 1.4 +24 -10 jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/tools/infobuilder/LegacyBlockInfoReader.java Index: LegacyBlockInfoReader.java =================================================================== RCS file: /home/cvs/jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/tools/infobuilder/LegacyBlockInfoReader.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- LegacyBlockInfoReader.java 15 Nov 2002 22:31:14 -0000 1.3 +++ LegacyBlockInfoReader.java 15 Nov 2002 22:41:26 -0000 1.4 @@ -114,15 +114,37 @@ getLogger().debug( message ); } + configuration = info.getChild( "block" ); + final SchemaDescriptor schema = buildSchema( configuration ); + return new ComponentInfo( descriptor, services, new LoggerDescriptor[ 0 ], buildPhoenixContext(), - new SchemaDescriptor( "", "", "", new Attribute[ 0 ] ), + schema, dependencies ); } /** + * A utility method to build a descriptor for SchemaDescriptor, + * + * @return the a descriptor for the SchemaDescriptor, + */ + private SchemaDescriptor buildSchema( Configuration configuration ) + { + String category = ""; + String schemaType = + configuration.getChild( "schema-type" ).getValue( "" ); + if( !"".equals( schemaType ) ) + { + //TODO: Map phoenix type to uri space when figured out + category = "configuration"; + } + + return new SchemaDescriptor( category, "", schemaType, new Attribute[ 0 ] ); + } + + /** * A utility method to build a descriptor for Phoenixs BlockContext * object, * @@ -279,17 +301,9 @@ throws ConfigurationException { final String version = config.getChild( "version" ).getValue(); - final String schemaType = config.getChild( "schema-type" ).getValue( null ); - final ArrayList attributeSet = new ArrayList(); final Attribute attribute = createSimpleAttribute( "avalon", "version", version ); attributeSet.add( attribute ); - if( null != schemaType ) - { - final Attribute schemaAttribute = - createSimpleAttribute( "phoenix", "schema-type", schemaType ); - attributeSet.add( schemaAttribute ); - } final Attribute[] attributes = (Attribute[])attributeSet.toArray( new Attribute[ attributeSet.size() ] ); return new ComponentDescriptor( classname, attributes ); 1.2 +2 -3 jakarta-avalon-excalibur/info/src/test/org/apache/avalon/framework/tools/infobuilder/test/data/component3-info.xml Index: component3-info.xml =================================================================== RCS file: /home/cvs/jakarta-avalon-excalibur/info/src/test/org/apache/avalon/framework/tools/infobuilder/test/data/component3-info.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- component3-info.xml 4 Oct 2002 06:10:35 -0000 1.1 +++ component3-info.xml 15 Nov 2002 22:41:26 -0000 1.2 @@ -10,9 +10,6 @@ - - - @@ -29,5 +26,7 @@ + + -- To unsubscribe, e-mail: For additional commands, e-mail: