mcconnell 2003/07/30 08:24:38
Modified: merlin/composition/src/java/org/apache/avalon/composition/data/writer
XMLContainmentProfileWriter.java
merlin/composition/src/test/conf data-test.xml
merlin/composition-spi/src/java/org/apache/avalon/composition/data
ContainmentProfile.java
Log:
Add support for the externalization of profile includes.
Revision Changes Path
1.4 +9 -2
avalon-sandbox/merlin/composition/src/java/org/apache/avalon/composition/data/writer/XMLContainmentProfileWriter.java
Index: XMLContainmentProfileWriter.java
===================================================================
RCS file:
/home/cvs/avalon-sandbox/merlin/composition/src/java/org/apache/avalon/composition/data/writer/XMLContainmentProfileWriter.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- XMLContainmentProfileWriter.java 30 Jul 2003 14:44:33 -0000 1.3
+++ XMLContainmentProfileWriter.java 30 Jul 2003 15:24:38 -0000 1.4
@@ -408,13 +408,20 @@
final Writer writer, final BlockIncludeDirective directive, String pad )
throws Exception
{
- throw new UnsupportedOperationException();
+ writer.write( "\n" + pad + "<include name=\"" );
+ writer.write( directive.getName() + "\">" );
+ writer.write( "\n" + pad + INDENT + "<source>" );
+ writer.write( directive.getPath() + "</source>" );
+ writer.write( "\n" + pad + "</include>" );
}
private void writeBlockCompositionDirective(
final Writer writer, final BlockCompositionDirective directive, String pad )
throws Exception
{
- throw new UnsupportedOperationException();
+ writer.write( "\n" + pad + "<include name=\"" );
+ writer.write( directive.getName() + "\" id=\"" );
+ writer.write( directive.getResource().getId() + "\" version=\"" );
+ writer.write( directive.getResource().getVersion() + "\"/>" );
}
}
1.7 +1 -3 avalon-sandbox/merlin/composition/src/test/conf/data-test.xml
Index: data-test.xml
===================================================================
RCS file: /home/cvs/avalon-sandbox/merlin/composition/src/test/conf/data-test.xml,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- data-test.xml 30 Jul 2003 14:44:33 -0000 1.6
+++ data-test.xml 30 Jul 2003 15:24:38 -0000 1.7
@@ -73,10 +73,8 @@
</parameters>
</component>
</container>
- <!--
<include name="include-1">
<source>./somename.xml</source>
</include>
- <include name="include-2" id="" version="SNAPSHOT"/>
- -->
+ <include name="include-2" id="my:widget" version="SNAPSHOT"/>
</container>
1.3 +5 -1
avalon-sandbox/merlin/composition-spi/src/java/org/apache/avalon/composition/data/ContainmentProfile.java
Index: ContainmentProfile.java
===================================================================
RCS file:
/home/cvs/avalon-sandbox/merlin/composition-spi/src/java/org/apache/avalon/composition/data/ContainmentProfile.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ContainmentProfile.java 27 Jul 2003 14:59:56 -0000 1.2
+++ ContainmentProfile.java 30 Jul 2003 15:24:38 -0000 1.3
@@ -77,6 +77,10 @@
// static
//========================================================================
+ public static final String EMBEDDED = "embedded"; // default
+ public static final String INCLUDED = "included"; // url reference
+ public static final String COMPOSED = "composed"; // resource reference
+
/**
* Container path delimiter.
*/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]