org.netbeans.api.web.webmodule 1.9

org.netbeans.modules.web.spi.webmodule
Class WebFrameworkProvider

java.lang.Object
  extended by org.netbeans.modules.web.spi.webmodule.WebFrameworkProvider

public abstract class WebFrameworkProvider
extends Object

Encapsulates a web framework.

This class allows providing support for web frameworks. It can be used to extend a web module with a web framework, to find out whether a web module is already extender by a web framework, or to retrieve a web framework's specific configuration files.

Instances of this class are registered in the j2ee/webtier/framework in the module layer.


Constructor Summary
WebFrameworkProvider(String name, String description)
          Creates a new web framework with a name and description.
 
Method Summary
 WebModuleExtender createWebModuleExtender(WebModule wm, ExtenderController controller)
          Creates a web module extender for this framework and the given web module.
 Set extend(WebModule wm)
          Deprecated. This method has been replaced with createWebModuleExtender.
abstract  File[] getConfigurationFiles(WebModule wm)
          Returns the configuration files belonging to this framework.
 FrameworkConfigurationPanel getConfigurationPanel(WebModule wm)
          Deprecated. This method has been replaced with createWebModuleExtender.
 String getDescription()
          Returns the description of this web framework.
 String getName()
          Returns the name of this web framework.
 String getServletPath(org.openide.filesystems.FileObject file)
          Returns the path of the request URL to a given file .
abstract  boolean isInWebModule(WebModule wm)
          Finds out if a given web module has already been extended with this framework.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebFrameworkProvider

public WebFrameworkProvider(String name,
                            String description)
Creates a new web framework with a name and description.

Parameters:
name - the short name of this web framework (e.g., "Struts"); never null.
description - the description of this web framework (e.g., "An open source framework based on the MVC pattern"); can be null.
Throws:
NullPointerException - if the name parameter is null.
Method Detail

getName

public String getName()
Returns the name of this web framework.

Returns:
the name; never null.

getDescription

public String getDescription()
Returns the description of this web framework. Defaults to the name if a null description parameter was passed to the constructor.

Returns:
the description; never null.

extend

@Deprecated
public Set extend(WebModule wm)
Deprecated. This method has been replaced with createWebModuleExtender.

Extends a web module with this web frameworks. For example it might be called in order to add the web framework to a newly created web application or in order to add the web framework to an existing application.

Parameters:
wm - the WebModule to be extended; never null.
Returns:
the list of new files created in the web module as the result of extending it with this framework; never null.

isInWebModule

public abstract boolean isInWebModule(WebModule wm)
Finds out if a given web module has already been extended with this framework.

Parameters:
wm - the web module; never null.
Returns:
true if the web module has already been extended with this framework, false otherwise.

getConfigurationFiles

public abstract File[] getConfigurationFiles(WebModule wm)
Returns the configuration files belonging to this framework.

Parameters:
wm - the web module for which the configuration files are returned; never null.
Returns:
an array containing the configuration files; never null.

getConfigurationPanel

@Deprecated
public FrameworkConfigurationPanel getConfigurationPanel(WebModule wm)
Deprecated. This method has been replaced with createWebModuleExtender.

Returns a configuration panel for this web framework. The panel is used to allow the user configure the way the web module will be extended. The configuration panel might be displayed to the user when creating a new web application or when editing the properties of an existing application.

Parameters:
wm - the web module to be configured.
Returns:
a configuration panel for this web framework.

createWebModuleExtender

public WebModuleExtender createWebModuleExtender(WebModule wm,
                                                 ExtenderController controller)
Creates a web module extender for this framework and the given web module. This method needs to be implemented instead of the deprecated extend(org.netbeans.modules.web.api.webmodule.WebModule) and getConfigurationPanel(org.netbeans.modules.web.api.webmodule.WebModule) methods. It needs to be implemented even if this web framework doesn't support extending a web module (it would just return null in this case).

Parameters:
wm - the web module to be extended; can be null, e.g., if the method is called while creating a new web application, in which case the module doesn't exist yet.
controller - an instance of ExtenderController allowing the newly created extender to communicate with its environment. See the ExtenderController for details. Never null.
Returns:
a new web module extender; can be null if the framework doesn't support extending (either web modules in general of the particular web module passed in the wm parameter.

getServletPath

public String getServletPath(org.openide.filesystems.FileObject file)
Returns the path of the request URL to a given file . This path starts with a "/" character and includes either the servlet name or a path to the servlet/JSP. Includes the servlet mapping, but does not include any extra path information or a query string. The method can return null.

JSF Example: consider an index.jsp file in the document base. Normaly the URL for accessing this page in browser should be http://server:port/contextpath/index.jsp. The servlet path is /index.jsp.

However, because the index.jsp file includes JSF tags, its URL should include the appropriate JSF servlet mapping. If the mapping is /faces/*, then the URL is http://server:port/contextpath/faces/index.jsp and this method should return /faces/index.jsp.

Parameters:
file - an arbitrary FileObject, usually a JSP file; never null.
Returns:
a string that contains the servlet path including the mapping; can be null.

org.netbeans.api.web.webmodule 1.9

Built on September 25 2007.  |  Portions Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.