Skip to Content.
Sympa Menu

notify-dpml - svn commit: r1962 - in development/laboratory/plus: . test tools/block/src/main/net/dpml/metro/tools/block

notify-dpml AT lists.ibiblio.org

Subject: DPML Notify

List archive

Chronological Thread  
  • From: mcconnell AT dpml.net
  • To: notify-dpml AT lists.ibiblio.org
  • Subject: svn commit: r1962 - in development/laboratory/plus: . test tools/block/src/main/net/dpml/metro/tools/block
  • Date: Sun, 06 Mar 2005 18:07:35 -0500

Author: mcconnell AT dpml.net
Date: Sun Mar 6 17:34:39 2005
New Revision: 1962

Added:

development/laboratory/plus/tools/block/src/main/net/dpml/metro/tools/block/ComponentPartHandler.java

development/laboratory/plus/tools/block/src/main/net/dpml/metro/tools/block/ContainerPartHandler.java
Modified:
development/laboratory/plus/index.xml
development/laboratory/plus/test/build.xml

development/laboratory/plus/tools/block/src/main/net/dpml/metro/tools/block/BlockPartHandler.java
Log:
add a component and container handler to deal with clasic block creation

Modified: development/laboratory/plus/index.xml
==============================================================================
--- development/laboratory/plus/index.xml (original)
+++ development/laboratory/plus/index.xml Sun Mar 6 17:34:39 2005
@@ -75,6 +75,7 @@
<type>jar</type>
</info>
<dependencies>
+ <include key="dpml-metro-tools-component"/>
<include key="dpml-metro-tools-block"/>
<include key="acme-component-builder"/>
</dependencies>

Modified: development/laboratory/plus/test/build.xml
==============================================================================
--- development/laboratory/plus/test/build.xml (original)
+++ development/laboratory/plus/test/build.xml Sun Mar 6 17:34:39 2005
@@ -3,17 +3,17 @@
<project name="dpml-tools-part-test" default="test" basedir="."
xmlns:transit="antlib:net.dpml.transit"
xmlns:x="plugin:dpml/magic/dpml-magic-core"
- xmlns:m="plugin:dpml/metro/tools/dpml-metro-tools-component">
+ xmlns:m="plugin:dpml/metro/tools/dpml-metro-tools-component"
+ xmlns:b="plugin:dpml/metro/tools/dpml-metro-tools-block">

<transit:import uri="artifact:template:dpml/magic/standard"/>

- <target name="init" depends="standard.init">
+ <target name="test" depends="test-component,test-block"/>
+
+ <target name="test-component" depends="init">
<x:property name="acme.uri" feature="plugin"
key="acme-component-builder"/>
<x:property name="metro.component" feature="plugin"
key="dpml-metro-tools-component"/>
<transit:plugin uri="${metro.component}"/>
- </target>
-
- <target name="test" depends="standard.test">
<m:component>
<parts>
<part/>
@@ -22,5 +22,11 @@
</m:component>
</target>

+ <target name="test-block" depends="init">
+ <x:property name="metro.block" feature="plugin"
key="dpml-metro-tools-block"/>
+ <transit:plugin uri="${metro.block}"/>
+ <b:block/>
+ </target>
+
</project>


Modified:
development/laboratory/plus/tools/block/src/main/net/dpml/metro/tools/block/BlockPartHandler.java
==============================================================================
---
development/laboratory/plus/tools/block/src/main/net/dpml/metro/tools/block/BlockPartHandler.java
(original)
+++
development/laboratory/plus/tools/block/src/main/net/dpml/metro/tools/block/BlockPartHandler.java
Sun Mar 6 17:34:39 2005
@@ -35,20 +35,11 @@
* @author <a href="mailto:dev-dpml AT lists.ibiblio.org";>The Digital Product
Meta Library</a>
* @version $Revision: 1.2 $ $Date: 2004/03/17 10:30:09 $
*/
-public class BlockPartHandler extends Task implements Part
+public class BlockPartHandler extends ContainerPartHandler
{
- /**
- * Part preparation.
- */
- public void prepare( Part parent ) throws BuildException
- {
- log( "initization with parent: " + parent );
- }
-
- public String toString()
+ public BlockPartHandler()
{
- return "[class:" + getClass().getName()
- + ":" + System.identityHashCode( Part.class );
+ super( null );
}

/**

Added:
development/laboratory/plus/tools/block/src/main/net/dpml/metro/tools/block/ComponentPartHandler.java
==============================================================================
--- (empty file)
+++
development/laboratory/plus/tools/block/src/main/net/dpml/metro/tools/block/ComponentPartHandler.java
Sun Mar 6 17:34:39 2005
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2005 Stephen J. McConnell
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package net.dpml.metro.tools.block;
+
+import java.io.File;
+import java.net.URI;
+import java.net.URL;
+
+import net.dpml.metro.tools.part.Part;
+
+import org.apache.tools.ant.Task;
+import org.apache.tools.ant.ProjectComponent;
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Project;
+
+/**
+ * The DPML component buildtime handler for the classic 'block'.
+ *
+ * @author <a href="mailto:dev-dpml AT lists.ibiblio.org";>The Digital Product
Meta Library</a>
+ * @version $Revision: 1.2 $ $Date: 2004/03/17 10:30:09 $
+ */
+public class ComponentPartHandler extends ProjectComponent implements Part
+{
+ //--------------------------------------------------------------------
+ // state
+ //--------------------------------------------------------------------
+
+ private Task m_owner;
+
+ //--------------------------------------------------------------------
+ // constructor
+ //--------------------------------------------------------------------
+
+ public ComponentPartHandler( Task owner )
+ {
+ m_owner = owner;
+ }
+
+ //--------------------------------------------------------------------
+ // Task
+ //--------------------------------------------------------------------
+
+ /**
+ * Load the resource and assign the locally cached file path to the
supplied property name.
+ * @exception BuildException if an error occurs during resource resolution
+ */
+ public void execute() throws BuildException
+ {
+ log( "executing: " + this );
+ prepare( this );
+ }
+
+ //--------------------------------------------------------------------
+ // Part
+ //--------------------------------------------------------------------
+
+ /**
+ * Part initialization.
+ */
+ public void prepare( Part parent ) throws BuildException
+ {
+ log( "class: " + getClass().getName() );
+ log( "initization with parent: " + parent );
+ }
+}

Added:
development/laboratory/plus/tools/block/src/main/net/dpml/metro/tools/block/ContainerPartHandler.java
==============================================================================
--- (empty file)
+++
development/laboratory/plus/tools/block/src/main/net/dpml/metro/tools/block/ContainerPartHandler.java
Sun Mar 6 17:34:39 2005
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2005 Stephen J. McConnell
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package net.dpml.metro.tools.block;
+
+import java.io.File;
+import java.net.URI;
+import java.net.URL;
+import java.util.List;
+import java.util.LinkedList;
+
+import net.dpml.metro.tools.part.Part;
+
+import org.apache.tools.ant.Task;
+import org.apache.tools.ant.ProjectComponent;
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Project;
+
+/**
+ * The DPML component buildtime handler for the classic 'block'.
+ *
+ * @author <a href="mailto:dev-dpml AT lists.ibiblio.org";>The Digital Product
Meta Library</a>
+ * @version $Revision: 1.2 $ $Date: 2004/03/17 10:30:09 $
+ */
+public class ContainerPartHandler extends Task implements Part
+{
+ private List m_parts = new LinkedList();
+
+ private Task m_owner;
+
+ public ContainerPartHandler( Task owner )
+ {
+ m_owner = owner;
+ }
+
+ public ComponentPartHandler createComponent()
+ {
+ ComponentPartHandler part = new ComponentPartHandler( m_owner );
+ m_parts.add( part );
+ return part;
+ }
+
+ public ContainerPartHandler createContainer()
+ {
+ ContainerPartHandler part = new ContainerPartHandler( m_owner );
+ m_parts.add( part );
+ return part;
+ }
+
+ /**
+ * Return the set of parts contained within this container.
+ * @return the contained parts
+ */
+ public Part[] getParts()
+ {
+ return (Part[]) m_parts.toArray( new Part[0] );
+ }
+
+ /**
+ * Part preparation.
+ */
+ public void prepare( Part parent ) throws BuildException
+ {
+ log( "initization with parent: " + parent );
+ }
+
+ /**
+ * Task execution.
+ */
+ public void execute()
+ {
+ log( "container execution" );
+ }
+}



  • svn commit: r1962 - in development/laboratory/plus: . test tools/block/src/main/net/dpml/metro/tools/block, mcconnell, 03/06/2005

Archive powered by MHonArc 2.6.24.

Top of Page