notify-dpml AT lists.ibiblio.org
Subject: DPML Notify
List archive
svn commit: r1174 - in development/main: central/site central/site/src/docs/products/magic central/site/src/docs/products/transit magic/bootstrap/src/main/net/dpml/magic/bootstrap magic/core magic/core/etc/deliverables/templates magic/spells/checkstyle/etc/deliverables/templates util/cli
- From: mcconnell AT netcompartner.com
- To: notify-dpml AT lists.ibiblio.org
- Subject: svn commit: r1174 - in development/main: central/site central/site/src/docs/products/magic central/site/src/docs/products/transit magic/bootstrap/src/main/net/dpml/magic/bootstrap magic/core magic/core/etc/deliverables/templates magic/spells/checkstyle/etc/deliverables/templates util/cli
- Date: Mon, 13 Dec 2004 19:18:33 +0100
Author: mcconnell
Date: Mon Dec 13 19:18:33 2004
New Revision: 1174
Added:
development/main/magic/bootstrap/src/main/net/dpml/magic/bootstrap/Map.java
(contents, props changed)
Modified:
development/main/central/site/build.xml
development/main/central/site/src/docs/products/magic/navigation.xml
development/main/central/site/src/docs/products/transit/navigation.xml
development/main/magic/bootstrap/src/main/net/dpml/magic/bootstrap/MainTask.java
development/main/magic/bootstrap/src/main/net/dpml/magic/bootstrap/TransitComponentHelper.java
development/main/magic/core/build.xml
development/main/magic/core/etc/deliverables/templates/reactor.template
development/main/magic/core/etc/deliverables/templates/standard.template
development/main/magic/spells/checkstyle/etc/deliverables/templates/checkstyle.template
development/main/util/cli/build.xml
Log:
Update the main bootstrap task (a.k.a. <transit:init>) to include nested map
declarations that associated urn names with plugin uris. These bindings are
used during the magic runtime to automatically load and deploy plugins based
simply of a task urn request.
Modified: development/main/central/site/build.xml
==============================================================================
--- development/main/central/site/build.xml (original)
+++ development/main/central/site/build.xml Mon Dec 13 19:18:33 2004
@@ -61,6 +61,8 @@
token="METRO-PRIVATE-DOCS-PATH"/>
<x:filter key="dpml-metro-tools" feature="api"
token="METRO-TOOLS-DOCS-PATH"/>
+ <x:filter key="dpml-magic-core" feature="plugin"
+ token="MAGIC-CORE-PLUGIN-URI"/>
</target>
<target name="javadoc" depends="prepare"/>
Modified: development/main/central/site/src/docs/products/magic/navigation.xml
==============================================================================
--- development/main/central/site/src/docs/products/magic/navigation.xml
(original)
+++ development/main/central/site/src/docs/products/magic/navigation.xml
Mon Dec 13 19:18:33 2004
@@ -26,6 +26,7 @@
<menu>
<item name="Model" href="model/index.html"/>
+ <item name="Antlib" href="antlib/index.html"/>
<item name="Tasks" href="tasks/index.html"/>
<item name="Plugins" href="plugins/index.html"/>
<item name="Javadoc" href="../../../@MAGIC-DOCS-PATH@/api/index.html"/>
Modified:
development/main/central/site/src/docs/products/transit/navigation.xml
==============================================================================
--- development/main/central/site/src/docs/products/transit/navigation.xml
(original)
+++ development/main/central/site/src/docs/products/transit/navigation.xml
Mon Dec 13 19:18:33 2004
@@ -28,7 +28,6 @@
<item name="Properties" href="properties/index.html"/>
<item name="Protocol Specification" href="protocol.html"/>
<!--<item name="Repository" href="repository.html"/>-->
- <item name="Transit for Ant" href="tasks/index.html"/>
<item name="Javadoc"
href="../../../@TRANSIT-DOCS-PATH@/api/index.html"/>
</menu>
Modified:
development/main/magic/bootstrap/src/main/net/dpml/magic/bootstrap/MainTask.java
==============================================================================
---
development/main/magic/bootstrap/src/main/net/dpml/magic/bootstrap/MainTask.java
(original)
+++
development/main/magic/bootstrap/src/main/net/dpml/magic/bootstrap/MainTask.java
Mon Dec 13 19:18:33 2004
@@ -79,7 +79,7 @@
/**
* List of plugin declarations.
*/
- private List m_plugins = new ArrayList();
+ private List m_mappings = new ArrayList();
//
------------------------------------------------------------------------
// Task
@@ -97,12 +97,11 @@
* Create and return a new plugin definition.
* @return the plugin definition
*/
- public PluginTask createPlugin()
+ public Map createMap()
{
- PluginTask task = new PluginTask();
- task.init();
- m_plugins.add( task );
- return task;
+ Map map = new Map();
+ m_mappings.add( map );
+ return map;
}
/**
@@ -126,26 +125,9 @@
init = true;
}
- PluginTask[] plugins = (PluginTask[]) m_plugins.toArray( new
PluginTask[0] );
- for( int i=0; i<plugins.length; i++ )
- {
- PluginTask plugin = plugins[i];
- //register( plugin );
- }
- }
-
- /*
- private static void register( Project project, PluginTask plugin )
- {
- URI uri = plugin.getURI();
- if( !m_uris.contains( uri ) )
- {
- plugin.setProject( project );
- plugin.init();
- plugin.execute();
- }
+ Map[] maps = (Map[]) m_mappings.toArray( new Map[0] );
+ TransitComponentHelper.register( maps );
}
- */
/**
Added:
development/main/magic/bootstrap/src/main/net/dpml/magic/bootstrap/Map.java
==============================================================================
--- (empty file)
+++
development/main/magic/bootstrap/src/main/net/dpml/magic/bootstrap/Map.java
Mon Dec 13 19:18:33 2004
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2004 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.magic.bootstrap;
+
+import java.net.URI;
+
+/**
+ * Utility class that declares a map beterrn a urn and a plugin uri.
+ *
+ * @author <a href="mailto:dev-dpml AT lists.ibiblio.org";>The Digital Product
Meta Library</a>
+ */
+public class Map
+{
+ private String m_urn;
+ private URI m_uri;
+
+ public void setUrn( String urn )
+ {
+ m_urn = urn;
+ }
+
+ public String getURN()
+ {
+ return m_urn;
+ }
+
+ public void setUri( URI uri )
+ {
+ m_uri = uri;
+ }
+
+ public URI getURI()
+ {
+ return m_uri;
+ }
+}
+
Modified:
development/main/magic/bootstrap/src/main/net/dpml/magic/bootstrap/TransitComponentHelper.java
==============================================================================
---
development/main/magic/bootstrap/src/main/net/dpml/magic/bootstrap/TransitComponentHelper.java
(original)
+++
development/main/magic/bootstrap/src/main/net/dpml/magic/bootstrap/TransitComponentHelper.java
Mon Dec 13 19:18:33 2004
@@ -21,6 +21,7 @@
import java.io.File;
import java.io.InputStream;
import java.util.Vector;
+import java.util.Hashtable;
import java.net.URI;
import net.dpml.transit.util.ElementHelper;
@@ -103,6 +104,29 @@
*/
private static Vector m_uris = new Vector();
+ /**
+ * Table of urn to uri mappings.
+ */
+ private static Hashtable m_mappings = new Hashtable();
+
+ /**
+ * Register the mapping between a urn and a plugin uri.
+ * @param maps a sequence of urn to uri bindings
+ */
+ public static void register( Map[] maps )
+ {
+ for( int i=0; i<maps.length; i++ )
+ {
+ Map map = maps[i];
+ String urn = map.getURN();
+ if( !m_mappings.contains( urn ) )
+ {
+ URI uri = map.getURI();
+ m_mappings.put( urn, uri );
+ }
+ }
+ }
+
//------------------------------------------------------------------------
// state
//------------------------------------------------------------------------
@@ -207,13 +231,14 @@
*/
private URI convertUrnToURI( String urn )
{
- if( urn.startsWith( "artifact:meta:" ) )
+ URI uri = (URI) m_mappings.get( urn );
+ if( null != uri )
{
- return convertToURI( urn );
+ return uri;
}
- else if( urn.equals( "antlib:net.dpml.magic" ) )
+ if( urn.startsWith( "artifact:meta:" ) )
{
- return convertToURI(
"artifact:meta:dpml/magic/dpml-magic-core#SNAPSHOT" );
+ return convertToURI( urn );
}
else
{
Modified: development/main/magic/core/build.xml
==============================================================================
--- development/main/magic/core/build.xml (original)
+++ development/main/magic/core/build.xml Mon Dec 13 19:18:33 2004
@@ -8,6 +8,7 @@
<available classname="junit.framework.TestCase"
property="junit.available"/>
<filter token="PROJECT-PLUGIN-URI" value="${project.plugin.uri}"/>
+ <filter token="PROJECT-PLUGIN-URN" value="antlib:net.dpml.magic"/>
<target name="init" depends="bootstrap.init">
<echo>
Modified:
development/main/magic/core/etc/deliverables/templates/reactor.template
==============================================================================
--- development/main/magic/core/etc/deliverables/templates/reactor.template
(original)
+++ development/main/magic/core/etc/deliverables/templates/reactor.template
Mon Dec 13 19:18:33 2004
@@ -20,7 +20,10 @@
xmlns:transit="antlib:net.dpml.transit"
xmlns:x="antlib:net.dpml.magic">
- <transit:init/>
+ <transit:init>
+ <map urn="@PROJECT-PLUGIN-URN@"
+ uri="@PROJECT-PLUGIN-URI@"/>
+ </transit:init>
<target name="init">
<x:reactor target="init"/>
Modified:
development/main/magic/core/etc/deliverables/templates/standard.template
==============================================================================
--- development/main/magic/core/etc/deliverables/templates/standard.template
(original)
+++ development/main/magic/core/etc/deliverables/templates/standard.template
Mon Dec 13 19:18:33 2004
@@ -20,7 +20,10 @@
xmlns:transit="antlib:net.dpml.transit"
xmlns:x="antlib:net.dpml.magic">
- <transit:init/>
+ <transit:init>
+ <map urn="@PROJECT-PLUGIN-URN@"
+ uri="@PROJECT-PLUGIN-URI@"/>
+ </transit:init>
<target name="info">
<x:info/>
Modified:
development/main/magic/spells/checkstyle/etc/deliverables/templates/checkstyle.template
==============================================================================
---
development/main/magic/spells/checkstyle/etc/deliverables/templates/checkstyle.template
(original)
+++
development/main/magic/spells/checkstyle/etc/deliverables/templates/checkstyle.template
Mon Dec 13 19:18:33 2004
@@ -23,13 +23,13 @@
<target name="checkstyle" depends="prepare"
unless="project.checkstyle.disable" >
<transit:plugin uri="@PLUGIN-URI@"/>
- <transit:plugin uri="@STYLE-PLUGIN-URI@"/>
<mkdir dir="target/checkstyle"/>
<checkstyle xmlns="plugin:net.dpml.magic.checkstyle"
uri="artifact:format:dpml/magic/standard">
<formatter type="xml"
toFile="target/checkstyle/checkstyle_errors.xml"/>
</checkstyle>
<mkdir dir="target/reports/checkstyle"/>
+ <transit:plugin uri="@STYLE-PLUGIN-URI@"/>
<style xmlns="plugin:net.dpml.magic.style"
in="target/checkstyle/checkstyle_errors.xml"
out="target/reports/checkstyle/checkstyle_report.html"
Modified: development/main/util/cli/build.xml
==============================================================================
--- development/main/util/cli/build.xml (original)
+++ development/main/util/cli/build.xml Mon Dec 13 19:18:33 2004
@@ -4,9 +4,8 @@
xmlns:transit="antlib:net.dpml.transit">
<transit:init>
- <plugin uri="dpml/magic/dpml-magic-core#SNAPSHOT">
- <antlib/>
- </plugin>
+ <map urn="antlib:net.dpml.magic"
+ uri="artifact:meta:dpml/magic/dpml-magic-core#SNAPSHOT"/>
</transit:init>
<transit:import uri="artifact:template:dpml/magic/standard"/>
- svn commit: r1174 - in development/main: central/site central/site/src/docs/products/magic central/site/src/docs/products/transit magic/bootstrap/src/main/net/dpml/magic/bootstrap magic/core magic/core/etc/deliverables/templates magic/spells/checkstyle/etc/deliverables/templates util/cli, mcconnell, 12/13/2004
Archive powered by MHonArc 2.6.24.