Index: descriptors/src/test/org/apache/pluto/descriptors/servlet/WebAppDDTest.java =================================================================== --- descriptors/src/test/org/apache/pluto/descriptors/servlet/WebAppDDTest.java (.../vendor/apache/portals/pluto-1.0.1-release) (revision 2521) +++ descriptors/src/test/org/apache/pluto/descriptors/servlet/WebAppDDTest.java (.../branches/apache/portals/PLUTO-219) (revision 2572) @@ -42,6 +42,7 @@ } public void testCollectionsNotNull() { + assertNotNull(dd.getDistributable()); assertNotNull(dd.getContextParams()); assertNotNull(dd.getEjbRefs()); assertNotNull(dd.getEnvEntrys()); Index: descriptors/src/java/org/apache/pluto/descriptors/servlet/DistributableDD.java =================================================================== --- descriptors/src/java/org/apache/pluto/descriptors/servlet/DistributableDD.java (.../vendor/apache/portals/pluto-1.0.1-release) (revision 0) +++ descriptors/src/java/org/apache/pluto/descriptors/servlet/DistributableDD.java (.../branches/apache/portals/PLUTO-219) (revision 2572) @@ -0,0 +1,30 @@ +package org.apache.pluto.descriptors.servlet; + +/** + * Models the <distributable> web.xml element. + * + * @author Elliot Metsger + * @version $Id$ + * @since Feb 28, 2006 + */ +public class DistributableDD { + + private boolean distributable = false; + + public DistributableDD() { + + } + + public Boolean isDistributable() { + return new Boolean(distributable); + } + + public void setDistributable() { + this.distributable = true; + } + + public void setDistributable(boolean distributable) { + this.distributable = distributable; + } + +} Property changes on: descriptors/src/java/org/apache/pluto/descriptors/servlet/DistributableDD.java ___________________________________________________________________ Name: svn:eol-style + native Name: svn:mime-type + text/plain Name: svn:keywords + Id Index: descriptors/src/java/org/apache/pluto/descriptors/servlet/DistributableCastorFieldHandler.java =================================================================== --- descriptors/src/java/org/apache/pluto/descriptors/servlet/DistributableCastorFieldHandler.java (.../vendor/apache/portals/pluto-1.0.1-release) (revision 0) +++ descriptors/src/java/org/apache/pluto/descriptors/servlet/DistributableCastorFieldHandler.java (.../branches/apache/portals/PLUTO-219) (revision 2572) @@ -0,0 +1,50 @@ +package org.apache.pluto.descriptors.servlet; +import org.exolab.castor.mapping.AbstractFieldHandler; + +public class DistributableCastorFieldHandler extends AbstractFieldHandler { + + public DistributableCastorFieldHandler( ) { + + } + + public Object getValue( Object object ) throws IllegalStateException { + // we always return null, because the body of the element is empty. + return null; + } + + public Object newInstance( Object arg0 ) throws IllegalStateException { + // do nothing + return null; + } + + public Object newInstance( Object arg0, Object[] arg1 ) + throws IllegalStateException { + // do nothing + return null; + } + + public void resetValue( Object arg0 ) throws IllegalStateException, + IllegalArgumentException { + // do nothing + } + + public void setValue( Object object, Object value ) + throws IllegalStateException, IllegalArgumentException { + DistributableDD distDD; + Boolean isDistributable; + + if (! (object instanceof DistributableDD)) { + throw new IllegalArgumentException( "Supplied object should be of type DistributableDD"); + } else { + distDD = (DistributableDD)object; + } + + if (! (value instanceof Boolean)) { + throw new IllegalArgumentException( "Supplied value should be of type Boolean"); + } else { + isDistributable = (Boolean)value; + distDD.setDistributable(isDistributable.booleanValue()); + } + } + +} \ No newline at end of file Property changes on: descriptors/src/java/org/apache/pluto/descriptors/servlet/DistributableCastorFieldHandler.java ___________________________________________________________________ Name: svn:eol-style + native Name: svn:mime-type + text/plain Name: svn:keywords + Id Index: descriptors/src/java/org/apache/pluto/descriptors/servlet/DistributableDDCastorFieldHandler.java =================================================================== --- descriptors/src/java/org/apache/pluto/descriptors/servlet/DistributableDDCastorFieldHandler.java (.../vendor/apache/portals/pluto-1.0.1-release) (revision 0) +++ descriptors/src/java/org/apache/pluto/descriptors/servlet/DistributableDDCastorFieldHandler.java (.../branches/apache/portals/PLUTO-219) (revision 2572) @@ -0,0 +1,64 @@ +package org.apache.pluto.descriptors.servlet; + +import org.exolab.castor.mapping.AbstractFieldHandler; + +public class DistributableDDCastorFieldHandler extends AbstractFieldHandler { + + public DistributableDDCastorFieldHandler( ) { + + } + + public Object getValue( Object object ) throws IllegalStateException { + if ( object == null ) { + return null; + } + WebAppDD webDD = (WebAppDD)object; + // check to see if the web-app is distributable + if ( webDD.getDistributable().isDistributable().equals(Boolean.FALSE)) { + // since it is not distributable, return null. That way + // Castor won't place a element in the output + return null; + } else { + // since it is distributable, return the + // DistributableDD object. + return webDD.getDistributable(); + } + } + + public Object newInstance( Object arg0 ) throws IllegalStateException { + // do nothing + return null; + } + + public Object newInstance( Object arg0, Object[] arg1 ) + throws IllegalStateException { + // do nothing + return null; + } + + public void resetValue( Object arg0 ) throws IllegalStateException, + IllegalArgumentException { + // do nothing + } + + public void setValue( Object object, Object value ) + throws IllegalStateException, IllegalArgumentException { + WebAppDD webDD; + DistributableDD distDD; + + if (! (object instanceof WebAppDD)) { + throw new IllegalArgumentException( "Supplied object should be of type WebAppDD"); + } else { + webDD = (WebAppDD)object; + } + + if (! (value instanceof DistributableDD)) { + throw new IllegalArgumentException( "Supplied value should be of type DistributableDD"); + } else { + distDD = (DistributableDD)value; + distDD.setDistributable(true); + } + + webDD.setDistributable(distDD); + } +} \ No newline at end of file Property changes on: descriptors/src/java/org/apache/pluto/descriptors/servlet/DistributableDDCastorFieldHandler.java ___________________________________________________________________ Name: svn:eol-style + native Name: svn:mime-type + text/plain Name: svn:keywords + Id Index: descriptors/src/java/org/apache/pluto/descriptors/servlet/WebAppDD.java =================================================================== --- descriptors/src/java/org/apache/pluto/descriptors/servlet/WebAppDD.java (.../vendor/apache/portals/pluto-1.0.1-release) (revision 2521) +++ descriptors/src/java/org/apache/pluto/descriptors/servlet/WebAppDD.java (.../branches/apache/portals/PLUTO-219) (revision 2572) @@ -34,7 +34,7 @@ private IconDD icon; private String displayName; private String description; - private boolean distributable; + private DistributableDD distributable = new DistributableDD(); private List contextParams = new ArrayList(); private List filters = new ArrayList(); private List filterMappings = new ArrayList(); @@ -81,15 +81,11 @@ this.description = description; } - public boolean isDistributable() { + public DistributableDD getDistributable() { return distributable; } - public void setDistributable() { - this.distributable = true; - } - - public void setDistributable(boolean distributable) { + public void setDistributable(DistributableDD distributable) { this.distributable = distributable; } Index: descriptors/src/conf/org/apache/pluto/descriptors/servlet/web.xml =================================================================== --- descriptors/src/conf/org/apache/pluto/descriptors/servlet/web.xml (.../vendor/apache/portals/pluto-1.0.1-release) (revision 2521) +++ descriptors/src/conf/org/apache/pluto/descriptors/servlet/web.xml (.../branches/apache/portals/PLUTO-219) (revision 2572) @@ -27,7 +27,7 @@ Test Web XML This is a test web.xml file. - + Test Parameter 1 Index: descriptors/src/conf/org/apache/pluto/descriptors/servlet/castor-web-xml-mapping.xml =================================================================== --- descriptors/src/conf/org/apache/pluto/descriptors/servlet/castor-web-xml-mapping.xml (.../vendor/apache/portals/pluto-1.0.1-release) (revision 2521) +++ descriptors/src/conf/org/apache/pluto/descriptors/servlet/castor-web-xml-mapping.xml (.../branches/apache/portals/PLUTO-219) (revision 2572) @@ -1,6 +1,6 @@ + "http://castor.org/mapping.dtd">