KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > web > spi > webmodule > WebFrameworkProvider


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.modules.web.spi.webmodule;
21
22 import java.io.File JavaDoc;
23 import java.util.Set JavaDoc;
24
25 import org.netbeans.modules.web.api.webmodule.*;
26 import org.openide.filesystems.FileObject;
27
28 /**
29  * Through this class the IDE obtains information about the web framework and also calls
30  * actions, which proceed the framework specific things.
31  * @author Petr Pisl
32  */

33
34
35 public abstract class WebFrameworkProvider {
36     private String JavaDoc name;
37     private String JavaDoc description;
38
39     /**
40      * The constructor for the provider.
41      * @param name Name of the Web Framework. It's used for displaying in the new Web Application wizard and customizer.
42      * @param description Basic description of the framework. It's used as tooltip in the Web Application wizard and customizer.
43      */

44     public WebFrameworkProvider(String JavaDoc name, String JavaDoc description){
45         this.name = name;
46         this.description = description;
47     }
48     
49     /**
50      * Returns the name for the framework.
51      * @return the name
52      */

53     public String JavaDoc getName(){
54         return this.name;
55     }
56     
57     /**
58      * Returns the user description of the framework.
59      * @return the description
60      */

61     public String JavaDoc getDescription(){
62         return this.description;
63     }
64     
65     /**
66      * It is called from the IDE, when user create new web application
67      * or when the framework is added to already existing web application.
68      * @param wm the WebModule, which is extended.
69      * @return It's list of created files with the framework and should be opened in the editor.
70      */

71     public abstract Set JavaDoc extend(WebModule wm);
72     
73     /**
74      * Through this method the IDE find out, whether a web module has this framework.
75      * @param wm The Web Module
76      * @return True, if the Web Module has already the framework, otherwise else.
77      */

78     public abstract boolean isInWebModule (WebModule wm);
79     
80     /**
81      * Obtaining all configuration files, which are offered with the framework. The files
82      * are then displayed under the configuration nodes in the logical view.
83      * @param wm The Web Module for which the configuration files are returned.
84      * @return Array of the configuration files, which will be displayed under the Configuration Node in the logical view.
85      */

86     public abstract File JavaDoc[] getConfigurationFiles(WebModule wm);
87     
88     /**
89      * This method returns configuration panel for the framework. The configuration
90      * panel is displayed in the New Web Application wizard (when user select the framework)
91      * or when user adds the framework through project properties. A panel is also obtained for
92      * customizing the framework. It can be two different panels, one for adding and one for customize
93      * already added framework.
94      * @param customize It's false when the method is called before adding the framework to the web medule and true when the framework
95      * is already added.
96      * @return The panel for configuration the framework.
97      */

98     public abstract FrameworkConfigurationPanel getConfigurationPanel(WebModule wm);
99     
100     
101     /**
102      * Returns the part of the request's URL that calls the web component.
103      * This path starts with a "/" character and includes either the servlet name
104      * or a path to the servlet/jsp. Includes as well the mapping, but does not include
105      * any extra path information or a query string.
106      * The method can return null. Then common servlet path is used.
107      * <br/>
108      * JSF Example: There is index.jsp directly in the document base. Normaly the URL
109      * for accessing this page in browser should be http://server:port/contextpath/index.jsp.
110      * The servletpath is /index.jsp.
111      * Because the index.jsp includes jsf tags, should be called with appropriate JSF servlet
112      * mapping. If the mapping is /faces/*, then the right url is
113      * http://server:port/contextpath/faces/index.jsp and this method should returns /faces/index.jsp.
114      * @param fo arbitrary FileObject. Should be a jsp file.
115      * @return A string that contains the servletPath including mapping as well. Can return null.
116      *
117      */

118     public String JavaDoc getServletPath(FileObject file){
119         return null;
120     }
121 }
122
Popular Tags