You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by mc...@apache.org on 2003/04/15 05:09:12 UTC
cvs commit: avalon-sandbox/merlin/merlin-extensions/merlin-servlet/src/webapp/BLOCK-INF block.xml
mcconnell 2003/04/14 20:09:12
Modified: merlin/merlin-extensions/merlin-jndi/src/java/org/apache/avalon/merlin/jndi
ServiceFactory.java
merlin/merlin-extensions/merlin-servlet/src/java/org/apache/avalon/merlin/jsp/tag
TargetTag.java
merlin/merlin-extensions/merlin-servlet/src/webapp index.jsp
merlin/merlin-extensions/merlin-servlet/src/webapp/BLOCK-INF
block.xml
Log:
Bringing extensions up-to-date.
Revision Changes Path
1.2 +0 -10 avalon-sandbox/merlin/merlin-extensions/merlin-jndi/src/java/org/apache/avalon/merlin/jndi/ServiceFactory.java
Index: ServiceFactory.java
===================================================================
RCS file: /home/cvs/avalon-sandbox/merlin/merlin-extensions/merlin-jndi/src/java/org/apache/avalon/merlin/jndi/ServiceFactory.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ServiceFactory.java 13 Mar 2003 01:05:23 -0000 1.1
+++ ServiceFactory.java 15 Apr 2003 03:09:12 -0000 1.2
@@ -83,11 +83,6 @@
public Object getObjectInstance(
Object object, final Name name, Context context, final Hashtable environment ) throws Exception
{
- System.out.println("object: " + object );
- System.out.println("name: " + name );
- System.out.println("context: " + context );
- System.out.println("environment: " + environment );
-
if( m_kernel == null )
{
m_kernel = bootstrapKernel( object );
@@ -115,11 +110,6 @@
File system = getFile( "system", reference );
File kernel = getFile( "kernel", reference );
URL block = getURL( "block", reference );
-
- System.out.println("HOME: " + home );
- System.out.println("SYSTEM: " + system );
- System.out.println("BLOCK: " + block );
- System.out.println("KERNEL: " + kernel );
File config = null;
try
1.2 +12 -15 avalon-sandbox/merlin/merlin-extensions/merlin-servlet/src/java/org/apache/avalon/merlin/jsp/tag/TargetTag.java
Index: TargetTag.java
===================================================================
RCS file: /home/cvs/avalon-sandbox/merlin/merlin-extensions/merlin-servlet/src/java/org/apache/avalon/merlin/jsp/tag/TargetTag.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- TargetTag.java 13 Apr 2003 05:42:05 -0000 1.1
+++ TargetTag.java 15 Apr 2003 03:09:12 -0000 1.2
@@ -117,20 +117,19 @@
public void setFeature( String value )
{
- System.out.println( "# FEATURE: " + value );
if( value != null ) m_keyword = value.trim();
m_mode = INSPECTION;
}
public void setExpand( String value )
{
- if( value != null ) m_keyword = value.trim().toLowerCase();
+ setFeature( value );
m_mode = ITERATION;
}
public void setResolve( String value )
{
- if( value != null ) m_keyword = value.trim().toLowerCase();
+ setFeature( value );
m_mode = DELEGATION;
}
@@ -151,7 +150,6 @@
public void setUrl( String url )
{
- System.out.println( "# URL: " + url );
m_source = url;
}
@@ -409,26 +407,21 @@
if( m_adapter != null ) return m_adapter;
- System.out.println( "# ADAPTER/SRC: " + m_source );
-
if( m_source == null )
{
TargetTag tag = (TargetTag) findAncestorWithClass( this, TargetTag.class );
if( tag != null )
{
- System.out.println( "# ADAPTER/ENCLOSING: " + tag.getAdapter() );
return tag.getAdapter();
}
else
{
- System.out.println( "# ADAPTER/ROOT: " + Block.BLOCK_KEY );
return pageContext.findAttribute( Block.BLOCK_KEY );
}
}
else
{
Block block = (Block) pageContext.getServletContext().getAttribute( Block.BLOCK_KEY );
- System.out.println( "# BLOCK: " + block );
if( block == null )
{
final String error =
@@ -441,9 +434,7 @@
{
URL base = block.getURL();
URL ref = new URL( base, m_source );
- System.out.println( "# ADAPTER/RESOLVING: " + ref );
object = ref.getContent();
- System.out.println( "# ADAPTER/CONTENT: " + object );
}
catch( Throwable e )
{
@@ -478,16 +469,22 @@
throw new NullPointerException( error );
}
- // if the keyword is "URL" then we need to some special processing
- // based on the target type
-
try
{
if(( keyword == null ) || (target == null )) return null;
String methodName = "get" + keyword.substring(0,1).toUpperCase()
+ keyword.substring(1,keyword.length());
Method method = target.getClass().getMethod( methodName, new Class[0] );
- return method.invoke( target, new Object[0] );
+ Object object = method.invoke( target, new Object[0] );
+
+ if( object instanceof Object[] )
+ {
+ return Arrays.asList( (Object[]) object )
+ }
+ else
+ {
+ return object;
+ }
}
catch( Throwable e )
{
1.2 +7 -0 avalon-sandbox/merlin/merlin-extensions/merlin-servlet/src/webapp/index.jsp
Index: index.jsp
===================================================================
RCS file: /home/cvs/avalon-sandbox/merlin/merlin-extensions/merlin-servlet/src/webapp/index.jsp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- index.jsp 13 Apr 2003 05:43:04 -0000 1.1
+++ index.jsp 15 Apr 2003 03:09:12 -0000 1.2
@@ -6,9 +6,16 @@
request.setAttribute("urn:merlin:page.title", "Merlin Index" );
pageContext.include("header.jsp");
%>
+
<merlin:target url="/">
<p>BLOCK: <merlin:target feature="this"/></p>
+ <p>Activation: <merlin:target feature="activationPolicy"/></p>
+ <p>Name: <merlin:target feature="name"/></p>
+ <p>Partition: <merlin:target feature="partitionName"/></p>
+ <p>Path: <merlin:target feature="path"/></p>
+ <p>URL: <merlin:target feature="URL"/></p>
</merlin:target>
+
<%
pageContext.include("footer.jsp");
%>
1.3 +9 -3 avalon-sandbox/merlin/merlin-extensions/merlin-servlet/src/webapp/BLOCK-INF/block.xml
Index: block.xml
===================================================================
RCS file: /home/cvs/avalon-sandbox/merlin/merlin-extensions/merlin-servlet/src/webapp/BLOCK-INF/block.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- block.xml 13 Apr 2003 05:42:05 -0000 1.2
+++ block.xml 15 Apr 2003 03:09:12 -0000 1.3
@@ -1,6 +1,12 @@
-<block name="merlin">
- <container name="merlin">
+<block>
+
+ <info>
+ <name>merlin</name>
+ </info>
+
+ <implementation>
<!-- include components and subcontainers here -->
- </container>
+ </implementation>
+
</block>
---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org
For additional commands, e-mail: cvs-help@avalon.apache.org