Update of
/cvsroot/xdoclet/xdoclet/modules/ibm/src/xdoclet/modules/ibm/websphere/web
In directory
sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9590/xdoclet/modules/ibm/src/xdoclet/modules/ibm/websphere/web
Modified Files:
WebSphereWebXmlSubTask.java
Log Message:
Documentation and �old code� updated. Some old tags are marked as deprecated
but kept in the code for backward compatibility.
The new websphere tag attributes �websphere.bean.listenerPort� and
�websphere.persistence.datasource� has changed names to
�websphere.mdb.listenerPort� and �websphere.cmp.datasource� to better reflect
their intended use.
Index: WebSphereWebXmlSubTask.java
===================================================================
RCS file:
/cvsroot/xdoclet/xdoclet/modules/ibm/src/xdoclet/modules/ibm/websphere/web/WebSphereWebXmlSubTask.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** WebSphereWebXmlSubTask.java 7 Nov 2004 18:01:10 -0000 1.6
--- WebSphereWebXmlSubTask.java 15 Nov 2004 00:19:34 -0000 1.7
***************
*** 11,78 ****
/**
! * This class is responsible for generating the WebSphere specific deployment
descriptors. It generates <i>
! * ibm-web-bnd.xmi</i> and <i>ibm-web-ext.xmi</i> . The id attributes of
various elements in the deployment descriptors
! * and the <i>web.xml</i> file must be applied as a seperate step with the
task <WebSphereWebXmlIds/> after the
! * deployement descriptors have been generated. <p>
*
! * <i>ibm-web-bnd.xmi</i> is responsible for:</p>
! * <ul>
! * <li> Binding EJB references in <code>web.xml</code> to a JNDI name in
the local namespace</li>
! * <li> Binding resource references in <code>web.xml</code> to a JNDI name
in the local namespace</li>
! * </ul>
! * <p>
*
! * <i>ibm-web-ext.xmi</i> contains IBM specific extensions to the web.xml
file and is responsible for specifying the
! * following:</p>
* <ul>
! * <li> A <i>Reload Interval</i> . Every 'reload interval' seconds, the web
application's files are checked and
! * reloaded if they have been modified</li>
! * <li> A flag specifying whether <i>Reloading</i> is enabled</li>
! * <li> The URI of an error page</li>
! * <li> Enabling or disabling <i>File Serving</i> . If enabled, the
application is allowed to serve static file types
! * such as HTML and GIF. File serving can be disabled if, for example, the
application contains only dynamic
! * components. The default value is true.</li>
! * <li> Enabling or disabling <i>Directory Browsing</i> . If enabled, the
application may browse disk directories.
! * Directory browsing can be disabled if, for example, you want to protect
data. The default value is true.</li>
! * <li> Enabling or disabling the serving of servlets by their classname.
The default value is true</li>
! * <li> Association of responses with a given MIME type to a given target
(servlet?); the idea being to either
! * transform or filter a response.</li>
! * <li> <i>Page List</i> configuration. Page lists allow servlets, which
have been configured to utilise page list
! * support, to refer to resources by names which map onto URIs.</li>
! * <li> <i>JSP Attribute</i> configuration. To quote the IBM documentation
"<i>JSP attributes are used by the servlet
! * that implements JSP processing behavior.</i> ". No doubt IBM have lots
of undocumented parameters to the JSP
! * processing engine that can passed using this feature.</li>
! * <li> <i>File Serving Attribute</i> configuration. To quote the IBM
documentation "<i>File-serving attributes are
! * used by the servlet that implements file-serving behavior.</i> ".
Another means to pass undocumented parameters,
! * this time to the file serving servlet.</li>
! * <li> <i>Invoker Attribute</i> configuration. To quote the IBM
documentation "<i>Invoker attributes are used by the
! * servlet that implements the invocation behavior.</i> ". <span style=
"font-size: 70%">(I wonder if anyone at IBM
! * knows what can be configured here)</span> </li>
! * <li> <i>Servlet Cache</i> configuration.</li>
! * <li> An <i>Additional ClassPath</i> that will be used to reference
resources outside of those specified in the
! * archive. <p>
! *
! * The following help is taken from the IBM documentation:</p> <p>
! *
! * <i>Specify the values relative to the root of the EAR file and separate
the values with spaces. Absolute values
! * that reference files or directories on the hard drive are ignored. To
specify classes that are not in JAR files but
! * are in the root of the EAR file, use a period and forward slash (./).
Consider the following example directory
! * structure in which the file myapp.ear contains a Web module named
mywebapp.war. Additional classes reside in
! * class1.jar and class2.zip. A class named xyz.class is not packaged in a
JAR file but is in the root of the EAR
! * file.</i> </p> <p>
! *
! * <i>myapp.ear/mywebapp.war<br/>
! * myapp.ear/class1.jar<br/>
! * myapp.ear/class2.zip<br/>
! * myapp.ear/xyz.class<br/>
! * </i> </p> <p>
! *
! * <i>Specify <tt>class1.jar class2.zip ./</tt> as the value of the
Additional classpath property. (Name only the
! * directory for .class files.)</i> </p> </li>
* </ul>
! *
*
* @author <a href="mailto:[EMAIL PROTECTED]">Ed Ward</a>
! * @author <a href="mailto:magnuslarsson at
users.sourceforge.net">Magnus Larsson</a>
* @created 22 August 2002
* @version $Revision$
--- 11,42 ----
/**
! * Generates WebSphere specific deployment descriptors for Web modules. The
following files are generated:
! * ibm-web-bnd.xmi and ibm-web-ext.xmi. <p>
*
! * NOTE: Since the WebSphere specific deployment descriptors depend on that
id's are set in the web.xml file you must
! * genererate it with useIds set to true, e.g. <code><deploymentdescriptor
useIds="true"/></code>. </p> <p>
*
! * This Ant task defines the following attributes (the rest of the attributes
in the list below comes from its
! * baseclass):
* <ul>
! * <li> virtualHostName</li>
! * <li> reloadInterval</li>
! * <li> reloadingEnabled</li>
! * <li> defaultErrorPage</li>
! * <li> additionalClassPath</li>
! * <li> fileServingEnabled</li>
! * <li> directoryBrowsingEnabled</li>
! * <li> serveServletsByClassnameEnabled</li>
! * <li> preCompileJSPs</li>
! * <li> autoRequestEncoding</li>
! * <li> autoResponseEncoding</li>
! * <li> autoLoadFilters</li>
* </ul>
! * </p> NOTE: All attributes except "virtualHostName" are IBM specific
WebSphere extensions to the web.xml file and are
! * the same as the attributes that can be found in the IBM WSAD wizard
(v5.1.2) for Web Deployment Descriptors (see tab
! * "Extensions" and section "General")
*
* @author <a href="mailto:[EMAIL PROTECTED]">Ed Ward</a>
! * @author <a href="mailto:ml at callista.se">Magnus Larsson</a>
* @created 22 August 2002
* @version $Revision$
***************
*** 123,184 ****
/**
! * The virtual host name. Used by the container to locate external
resources and EJBs required by a module or
! * application. The value is not mandatory. "A virtual host is a
configuration enabling a single host machine to
! * resemble multiple host machines. This property allows you to bind the
application to a virtual host in order to
! * enable execution on that virtual host."
*/
! private String virtualHostName = "";
/**
! * A Reload Interval . Every 'reload interval' seconds, the web
application's files are checked and reloaded if they
! * have been modified. Specifying a value indicates that reloading is
enabled and the reloadingEnabled flag in the
! * deployment descriptor will be set 'true' accordingly.
*/
! private String reloadInterval = "";
/**
! * Specifies a file name for the default error page. If no other error
page is specified in the application, this
! * error page is used.
*/
private String defaultErrorPage = "";
/**
! * Specifies whether file serving is enabled. File serving allows the
application to serve static file types, such
! * as HTML and GIF. File serving can be disabled if, for example, the
application contains only dynamic components.
! * The default value is true.
*/
private String fileServingEnabled = "true";
/**
! * Specifies whether directory browsing is enabled. Directory browsing
allows the application to browse disk
! * directories. Directory browsing can be disabled if, for example, you
want to protect data. The default value is
! * true.
*/
private String directoryBrowsingEnabled = "true";
/**
! * Specifies whether a servlet can be served by requesting its class
name. Usually, servlets are served only through
! * a URI reference. The class name is the actual name of the servlet on
disk. For example, a file named
! * SnoopServlet.java compiles into SnoopServlet.class. (This is the class
name.) SnoopServlet.class is normally
! * invoked by specifying snoop in the URI. However, if Serve Servlets by
Classname is enabled, the servlet is
! * invoked by specifying SnoopServlet. The default value is true.
*/
private String serveServletsByClassnameEnabled = "true";
/**
! * Specifies an additional class path that will be used to reference
resources outside of those specified in the
! * archive.
*/
! private String additionalClassPath = "";
public WebSphereWebXmlSubTask()
{
}
/**
! * Returns the virtual host name configuration paramater.
! *
! * @return
! * @see #virtualHostName
*/
public String getVirtualHostName()
--- 87,157 ----
/**
! * @see #setVirtualHostName()
*/
! private String virtualHostName = "default_host";
/**
! * @see #setReloadInterval()
*/
! private String reloadInterval = "3";
/**
! * @see #setReloadingEnabled()
! */
! private String reloadingEnabled = "true";
!
! /**
! * @see #setDefaultErrorPage()
*/
private String defaultErrorPage = "";
/**
! * @see #setAdditionalClassPath()
! */
! private String additionalClassPath = "";
!
! /**
! * @see #setFileServingEnabled()
*/
private String fileServingEnabled = "true";
/**
! * @see #setDirectoryBrowsingEnabled()
*/
private String directoryBrowsingEnabled = "true";
/**
! * @see #setServeServletsByClassnameEnabled()
*/
private String serveServletsByClassnameEnabled = "true";
/**
! * @see #setPreCompileJSPs()
*/
! private String preCompileJSPs = "true";
!
! /**
! * @see #setAutoRequestEncoding()
! */
! private String autoRequestEncoding = "false";
!
! /**
! * @see #setAutoResponseEncoding()
! */
! private String autoResponseEncoding = "false";
!
! /**
! * @see #setAutoLoadFilters()
! */
! private String autoLoadFilters = "false";
public WebSphereWebXmlSubTask()
{
+ setUseIds(true);
}
/**
! * @return the virtual host name
! * @see #setVirtualHostName()
*/
public String getVirtualHostName()
***************
*** 189,193 ****
/**
* @return the reload interval
! * @see #reloadInterval
*/
public String getReloadInterval()
--- 162,166 ----
/**
* @return the reload interval
! * @see #setReloadInterval()
*/
public String getReloadInterval()
***************
*** 197,217 ****
/**
- * Returns 'true' if we have a reload interval specified, else 'false' is
returned.
- *
* @return
! * @see #reloadInterval
*/
public String getReloadingEnabled()
{
! if ("".equals(reloadInterval)) {
! return FALSE;
! }
!
! return TRUE;
}
/**
* @return
! * @see #defaultErrorPage
*/
public String getDefaultErrorPage()
--- 170,184 ----
/**
* @return
! * @see #setReloadEnabled()
*/
public String getReloadingEnabled()
{
! return reloadingEnabled;
}
/**
* @return
! * @see #setDefaultErrorPage()
*/
public String getDefaultErrorPage()
***************
*** 222,226 ****
/**
* @return
! * @see #fileServingEnabled
*/
public String getFileServingEnabled()
--- 189,202 ----
/**
* @return
! * @see #setAdditionalClassPath()
! */
! public String getAdditionalClassPath()
! {
! return additionalClassPath;
! }
!
! /**
! * @return
! * @see #setFileServingEnabled()
*/
public String getFileServingEnabled()
***************
*** 231,235 ****
/**
* @return
! * @see #directoryBrowsingEnabled
*/
public String getDirectoryBrowsingEnabled()
--- 207,211 ----
/**
* @return
! * @see #setDirectoryBrowsingEnabled()
*/
public String getDirectoryBrowsingEnabled()
***************
*** 240,244 ****
/**
* @return
! * @see #serveServletsByClassnameEnabled
*/
public String getServeServletsByClassnameEnabled()
--- 216,220 ----
/**
* @return
! * @see #setServeServletsByClassnameEnabled()
*/
public String getServeServletsByClassnameEnabled()
***************
*** 249,264 ****
/**
* @return
! * @see #additionalClassPath
*/
! public String getAdditionalClassPath()
{
! return additionalClassPath;
}
/**
! * Sets the virtual host name configuration parameter.
*
! * @param name the virtual host name
! * @see #virtualHostName
*/
public void setVirtualHostName(String name)
--- 225,269 ----
/**
* @return
! * @see #setPreCompileJSPs()
*/
! public String getPreCompileJSPs()
{
! return preCompileJSPs;
}
/**
! * @return
! * @see #setAutoRequestEncoding()
! */
! public String getAutoRequestEncoding()
! {
! return autoRequestEncoding;
! }
!
! /**
! * @return
! * @see #setAutoResponseEncoding()
! */
! public String getAutoResponseEncoding()
! {
! return autoResponseEncoding;
! }
!
! /**
! * @return
! * @see #setAutoLoadFilters()
! */
! public String getAutoLoadFilters()
! {
! return autoLoadFilters;
! }
!
! /**
! * The virtual host name. "A virtual host is a configuration enabling a
single host machine to resemble multiple
! * host machines. This property allows you to bind the application to a
virtual host in order to enable execution on
! * that virtual host."
*
! * @param name the virtual host name
! * @ant.not-required No. Default is "default_host"
*/
public void setVirtualHostName(String name)
***************
*** 268,302 ****
/**
* @param reloadInterval
! * @see #reloadInterval
*/
public void setReloadInterval(String reloadInterval)
{
! try {
! Integer.parseInt(reloadInterval);
! this.reloadInterval = reloadInterval;
! }
! catch (NumberFormatException e) {
! throw new NumberFormatException(
!
Translator.getString(XDocletModulesIbmWebsphereWebMessages.class,
! XDocletModulesIbmWebsphereWebMessages.INVALID_CONFIG_VALUE,
! new String[]{reloadInterval, "reloadInterval"}));
! }
}
/**
! * We need an implementation of this method else the framework does not
see 'reloadingEnabled' as a java bean
! * property (ie. read-only properties don't seem to work).
*
* @param reloadingEnabled
! * @see #reloadInterval
*/
public void setReloadingEnabled(String reloadingEnabled)
{
}
/**
* @param defaultErrorPage
! * @see #defaultErrorPage
*/
public void setDefaultErrorPage(String defaultErrorPage)
--- 273,305 ----
/**
+ * A Reload Interval. Every 'reload interval' seconds, the web
application's files are checked and reloaded if they
+ * have been modified. Requires that reloadingEnabled is set to true.
+ *
* @param reloadInterval
! * @see #setReloadingEnabled()
! * @ant.not-required No. Default is "3"
*/
public void setReloadInterval(String reloadInterval)
{
! this.reloadInterval = validateIntegerValue(reloadInterval,
"reloadInterval");
}
/**
! * Specifies whether reloading is enabled.
*
* @param reloadingEnabled
! * @ant.not-required No. Default is "true"
*/
public void setReloadingEnabled(String reloadingEnabled)
{
+ this.reloadingEnabled = reloadingEnabled;
}
/**
+ * Specifies a file name for the default error page. If no other error
page is specified in the application, this
+ * error page is used.
+ *
* @param defaultErrorPage
! * @ant.not-required No. Default is ""
*/
public void setDefaultErrorPage(String defaultErrorPage)
***************
*** 306,387 ****
/**
* @param fileServingEnabled
! * @see #fileServingEnabled
*/
public void setFileServingEnabled(String fileServingEnabled)
{
! if (fileServingEnabled == null) {
! fileServingEnabled = "";
! }
!
! if (TRUE.equals(fileServingEnabled) ||
! FALSE.equals(fileServingEnabled) ||
! "".equals(fileServingEnabled)) {
! this.fileServingEnabled = fileServingEnabled;
! }
! else {
! throw new RuntimeException(
! Translator.getString(
! XDocletModulesIbmWebsphereWebMessages.class,
! XDocletModulesIbmWebsphereWebMessages.INVALID_CONFIG_VALUE,
! new String[]{fileServingEnabled, "fileServingEnabled"}));
! }
}
/**
* @param directoryBrowsingEnabled
! * @see #directoryBrowsingEnabled
*/
public void setDirectoryBrowsingEnabled(String directoryBrowsingEnabled)
{
! if (directoryBrowsingEnabled == null) {
! directoryBrowsingEnabled = "";
! }
!
! if (TRUE.equals(directoryBrowsingEnabled) ||
! FALSE.equals(directoryBrowsingEnabled) ||
! "".equals(directoryBrowsingEnabled)) {
! this.directoryBrowsingEnabled = directoryBrowsingEnabled;
! }
! else {
! throw new RuntimeException(
! Translator.getString(
! XDocletModulesIbmWebsphereWebMessages.class,
! XDocletModulesIbmWebsphereWebMessages.INVALID_CONFIG_VALUE,
! new String[]{directoryBrowsingEnabled,
"directoryBrowsingEnabled"}));
! }
}
/**
* @param serveServletsByClassnameEnabled
! * @see
#serveServletsByClassnameEnabled
*/
public void setServeServletsByClassnameEnabled(String
serveServletsByClassnameEnabled)
{
! if (serveServletsByClassnameEnabled == null) {
! serveServletsByClassnameEnabled = "";
! }
! if (TRUE.equals(serveServletsByClassnameEnabled) ||
! FALSE.equals(serveServletsByClassnameEnabled) ||
! "".equals(serveServletsByClassnameEnabled)) {
! this.serveServletsByClassnameEnabled =
serveServletsByClassnameEnabled;
! }
! else {
! throw new RuntimeException(
! Translator.getString(
! XDocletModulesIbmWebsphereWebMessages.class,
! XDocletModulesIbmWebsphereWebMessages.INVALID_CONFIG_VALUE,
! new String[]{serveServletsByClassnameEnabled,
"serveServletsByClassnameEnabled"}));
! }
}
/**
! * @param additionalClassPath
! * @see #additionalClassPath
*/
! public void setAdditionalClassPath(String additionalClassPath)
{
! this.additionalClassPath = additionalClassPath;
}
--- 309,404 ----
/**
+ * Specifies an additional class path that will be used to reference
resources outside of those specified in the
+ * archive.
+ *
+ * @param additionalClassPath
+ * @ant.not-required No. Default is ""
+ */
+ public void setAdditionalClassPath(String additionalClassPath)
+ {
+ this.additionalClassPath = additionalClassPath;
+ }
+
+ /**
+ * Specifies whether file serving is enabled. File serving allows the
application to serve static file types, such
+ * as HTML and GIF. File serving can be disabled if, for example, the
application contains only dynamic components.
+ *
* @param fileServingEnabled
! * @ant.not-required No. Default is "true"
*/
public void setFileServingEnabled(String fileServingEnabled)
{
! this.fileServingEnabled = validateBooleanValue(fileServingEnabled,
"fileServingEnabled");
}
/**
+ * Specifies whether directory browsing is enabled. Directory browsing
allows the application to browse disk
+ * directories. Directory browsing can be disabled if, for example, you
want to protect data.
+ *
* @param directoryBrowsingEnabled
! * @ant.not-required No. Default is "true"
*/
public void setDirectoryBrowsingEnabled(String directoryBrowsingEnabled)
{
! this.directoryBrowsingEnabled =
validateBooleanValue(directoryBrowsingEnabled, "directoryBrowsingEnabled");
}
/**
+ * Specifies whether a servlet can be served by requesting its class
name. Usually, servlets are served only through
+ * a URI reference. The class name is the actual name of the servlet on
disk. For example, a file named
+ * SnoopServlet.java compiles into SnoopServlet.class. (This is the class
name.) SnoopServlet.class is normally
+ * invoked by specifying snoop in the URI. However, if Serve Servlets by
Classname is enabled, the servlet is
+ * invoked by specifying SnoopServlet.
+ *
* @param serveServletsByClassnameEnabled
! * @ant.not-required No. Default is "true"
*/
public void setServeServletsByClassnameEnabled(String
serveServletsByClassnameEnabled)
{
! this.serveServletsByClassnameEnabled =
validateBooleanValue(serveServletsByClassnameEnabled,
"serveServletsByClassnameEnabled");
! }
! /**
! * Specifies wheter JSP pages will be precompiled at deploy time or not.
! *
! * @param preCompileJSPs
! * @ant.not-required No. Default is "true"
! */
! public void setPreCompileJSPs(String preCompileJSPs)
! {
! this.preCompileJSPs = validateBooleanValue(preCompileJSPs,
"preCompileJSPs");
}
/**
! * See IBM WebSphere documentation regarding this attribute.
! *
! * @param autoRequestEncoding
! * @ant.not-required No. Default is "false"
*/
! public void setAutoRequestEncoding(String autoRequestEncoding)
{
! this.autoRequestEncoding = validateBooleanValue(autoRequestEncoding,
"autoRequestEncoding");
! }
!
! /**
! * See IBM WebSphere documentation regarding this attribute.
! *
! * @param autoResponseEncoding
! * @ant.not-required No. Default is "false"
! */
! public void setAutoResponseEncoding(String autoResponseEncoding)
! {
! this.autoResponseEncoding =
validateBooleanValue(autoResponseEncoding, "autoResponseEncoding");
! }
!
! /**
! * See IBM WebSphere documentation regarding this attribute.
! *
! * @param autoLoadFilters
! * @ant.not-required No. Default is "false"
! */
! public void setAutoLoadFilters(String autoLoadFilters)
! {
! this.autoLoadFilters = validateBooleanValue(autoLoadFilters,
"autoLoadFilters");
}
***************
*** 416,425 ****
/**
! * Describe what the method does
*
! * @exception XDocletException Describe the exception
*/
protected void engineStarted() throws XDocletException
{
}
}
--- 433,498 ----
/**
! * TODO: Describe what the method does
*
! * @exception XDocletException
*/
protected void engineStarted() throws XDocletException
{
}
+
+ /**
+ * Helper method that validates if a value can be interpreted as an
integer
+ *
+ * @param integerValue
+ * @param name
+ * @return the value if it is ok or else throws an runtime
exception
+ */
+ private String validateIntegerValue(String integerValue, String name)
+ {
+ try {
+ Integer.parseInt(integerValue);
+ }
+ catch (NumberFormatException e) {
+ throwInvalidConfigValueException(integerValue, name);
+ }
+
+ return integerValue;
+ }
+
+ /**
+ * Helper method that validates if a value can be interpreted as a boolean
+ *
+ * @param booleanValue
+ * @param name
+ * @return the value if it is ok or else throws an runtime
exception
+ */
+ private String validateBooleanValue(String booleanValue, String name)
+ {
+ if (booleanValue == null) {
+ booleanValue = "";
+ }
+
+ if (!(TRUE.equals(booleanValue) ||
+ FALSE.equals(booleanValue) ||
+ "".equals(booleanValue))) {
+ throwInvalidConfigValueException(booleanValue, name);
+ }
+
+ return booleanValue;
+ }
+
+ /**
+ * Helper method for throwing an exception indicating that an
configuration attribute was set incorect.
+ *
+ * @param value
+ * @param name
+ */
+ private void throwInvalidConfigValueException(String value, String name)
+ {
+ throw new RuntimeException(
+ Translator.getString(
+ XDocletModulesIbmWebsphereWebMessages.class,
+ XDocletModulesIbmWebsphereWebMessages.INVALID_CONFIG_VALUE,
+ new String[]{value, name}));
+ }
}
-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE
FREE OODBMS DOWNLOAD - A multidimensional database that combines
robust object and relational technologies, making it a perfect match
for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8
_______________________________________________
xdoclet-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel