]> source.dussan.org Git - vaadin-framework.git/commitdiff
Minor corrections for Portlet 2.0 and some javadoc
authorHenri Sara <henri.sara@itmill.com>
Thu, 26 Nov 2009 11:31:49 +0000 (11:31 +0000)
committerHenri Sara <henri.sara@itmill.com>
Thu, 26 Nov 2009 11:31:49 +0000 (11:31 +0000)
svn changeset:10065/svn branch:6.2

src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java
src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java
src/com/vaadin/terminal/gwt/server/PortletApplicationContext2.java
src/com/vaadin/terminal/gwt/server/WebApplicationContext.java

index fb01e13419db0cde0116fd6c80be8847af53bebe..0cfb04bb9123ca3d6f4fadc3daede6e17635d6b6 100644 (file)
@@ -749,7 +749,6 @@ public abstract class AbstractApplicationPortlet extends GenericPortlet
         if (session != null) {
             PortletApplicationContext2 context = PortletApplicationContext2
                     .getApplicationContext(session);
-            context.applicationToAjaxAppMgrMap.remove(application);
             context.removeApplication(application);
         }
     }
@@ -813,21 +812,19 @@ public abstract class AbstractApplicationPortlet extends GenericPortlet
         final BufferedWriter page = new BufferedWriter(new OutputStreamWriter(
                 response.getPortletOutputStream(), "UTF-8"));
 
-        // TODO this is broken, not set as no servlet
-        String requestWidgetset = (String) request
-                .getAttribute(AbstractApplicationServlet.REQUEST_WIDGETSET);
-
+        // TODO check
+        String requestWidgetset = getApplicationOrSystemProperty(
+                PARAMETER_WIDGETSET, null);
         String sharedWidgetset = getPortalProperty(
                 PORTAL_PARAMETER_VAADIN_WIDGETSET, request.getPortalContext());
-        if (requestWidgetset == null && sharedWidgetset == null) {
-            requestWidgetset = getApplicationOrSystemProperty(
-                    PARAMETER_WIDGETSET, DEFAULT_WIDGETSET);
-        }
+
         String widgetset;
         if (requestWidgetset != null) {
             widgetset = requestWidgetset;
-        } else {
+        } else if (sharedWidgetset != null) {
             widgetset = sharedWidgetset;
+        } else {
+            widgetset = DEFAULT_WIDGETSET;
         }
 
         // TODO Currently, we can only load widgetsets and themes from the
index 26abd0fa3e631e85536578b632d3fb803bc2fc3c..59a1827f62d7fe4d44b130ef6f9ed53288897ac0 100644 (file)
@@ -109,6 +109,9 @@ public abstract class AbstractApplicationServlet extends HttpServlet implements
     /**
      * If the attribute is present in the request, a html fragment will be
      * written instead of a whole page.
+     *
+     * It is set to "true" by the {@link ApplicationPortlet} (Portlet 1.0) and
+     * read by {@link AbstractApplicationServlet}.
      */
     public static final String REQUEST_FRAGMENT = ApplicationServlet.class
             .getName()
@@ -116,6 +119,10 @@ public abstract class AbstractApplicationServlet extends HttpServlet implements
     /**
      * This request attribute forces widgetsets to be loaded from under the
      * specified base path; e.g shared widgetset for all portlets in a portal.
+     * 
+     * It is set by the {@link ApplicationPortlet} (Portlet 1.0) based on
+     * {@link Constants.PORTAL_PARAMETER_VAADIN_RESOURCE_PATH} and read by
+     * {@link AbstractApplicationServlet}.
      */
     public static final String REQUEST_VAADIN_STATIC_FILE_PATH = ApplicationServlet.class
             .getName()
@@ -123,6 +130,10 @@ public abstract class AbstractApplicationServlet extends HttpServlet implements
     /**
      * This request attribute forces widgetset used; e.g for portlets that can
      * not have different widgetsets.
+     *
+     * It is set by the {@link ApplicationPortlet} (Portlet 1.0) based on
+     * {@link ApplicationPortlet.PORTLET_PARAMETER_WIDGETSET} and read by
+     * {@link AbstractApplicationServlet}.
      */
     public static final String REQUEST_WIDGETSET = ApplicationServlet.class
             .getName()
@@ -130,6 +141,10 @@ public abstract class AbstractApplicationServlet extends HttpServlet implements
     /**
      * This request attribute indicates the shared widgetset (e.g. portal-wide
      * default widgetset).
+     *
+     * It is set by the {@link ApplicationPortlet} (Portlet 1.0) based on
+     * {@link Constants.PORTAL_PARAMETER_VAADIN_WIDGETSET} and read by
+     * {@link AbstractApplicationServlet}.
      */
     public static final String REQUEST_SHARED_WIDGETSET = ApplicationServlet.class
             .getName()
@@ -137,6 +152,10 @@ public abstract class AbstractApplicationServlet extends HttpServlet implements
     /**
      * If set, do not load the default theme but assume that loading it is
      * handled e.g. by ApplicationPortlet.
+     *
+     * It is set by the {@link ApplicationPortlet} (Portlet 1.0) based on
+     * {@link Constants.PORTAL_PARAMETER_VAADIN_THEME} and read by
+     * {@link AbstractApplicationServlet}.
      */
     public static final String REQUEST_DEFAULT_THEME = ApplicationServlet.class
             .getName()
@@ -145,6 +164,10 @@ public abstract class AbstractApplicationServlet extends HttpServlet implements
      * This request attribute is used to add styles to the main element. E.g
      * "height:500px" generates a style="height:500px" to the main element,
      * useful from some embedding situations (e.g portlet include.)
+     *
+     * It is typically set by the {@link ApplicationPortlet} (Portlet 1.0) based
+     * on {@link ApplicationPortlet.PORTLET_PARAMETER_STYLE} and read by
+     * {@link AbstractApplicationServlet}.
      */
     public static final String REQUEST_APPSTYLE = ApplicationServlet.class
             .getName()
index c3c319724d5cf89baaf72c73d726920491d7f6f8..fce8ac405e2d22edb980d800be1b9e495b8c86f5 100644 (file)
@@ -32,9 +32,10 @@ import com.vaadin.service.ApplicationContext;
 
 /**
  * TODO Write documentation, fix JavaDoc tags.
- * 
- * TODO is implementing HttpSessionBindingListener correct/useful?
- * 
+ *
+ * This is automatically registered as a {@link HttpSessionBindingListener} when
+ * {@link PortletSession#setAttribute()} is called with the context as value.
+ *
  * @author peholmst
  */
 @SuppressWarnings("serial")
index 2e114a38dc8a327dfa8e7cb7cc11a7beae2faaa2..109095e90736d2ab918d8cf421fd1a8330a3a3e9 100644 (file)
@@ -1,4 +1,4 @@
-/* 
+/*
 @ITMillApache2LicenseForJavaFiles@
  */
 
@@ -27,6 +27,9 @@ import com.vaadin.service.ApplicationContext;
 /**
  * Web application context for Vaadin applications.
  * 
+ * This is automatically added as a {@link HttpSessionBindingListener} when
+ * added to a {@link HttpSession}.
+ *
  * @author IT Mill Ltd.
  * @version
  * @VERSION@
@@ -49,7 +52,7 @@ public class WebApplicationContext implements ApplicationContext,
 
     /**
      * Creates a new Web Application Context.
-     * 
+     *
      */
     WebApplicationContext() {
 
@@ -57,7 +60,7 @@ public class WebApplicationContext implements ApplicationContext,
 
     /**
      * Gets the application context base directory.
-     * 
+     *
      * @see com.vaadin.service.ApplicationContext#getBaseDirectory()
      */
     public File getBaseDirectory() {
@@ -71,7 +74,7 @@ public class WebApplicationContext implements ApplicationContext,
 
     /**
      * Gets the http-session application is running in.
-     * 
+     *
      * @return HttpSession this application context resides in.
      */
     public HttpSession getHttpSession() {
@@ -80,7 +83,7 @@ public class WebApplicationContext implements ApplicationContext,
 
     /**
      * Gets the applications in this context.
-     * 
+     *
      * @see com.vaadin.service.ApplicationContext#getApplications()
      */
     public Collection<Application> getApplications() {
@@ -89,7 +92,7 @@ public class WebApplicationContext implements ApplicationContext,
 
     /**
      * Gets the application context for an HttpSession.
-     * 
+     *
      * @param session
      *            the HTTP session.
      * @return the application context for HttpSession.
@@ -112,8 +115,8 @@ public class WebApplicationContext implements ApplicationContext,
      * Adds a transaction listener to this context. The transaction listener is
      * called before and after each each HTTP request related to this session
      * except when serving static resources.
-     * 
-     * 
+     *
+     *
      * @see com.vaadin.service.ApplicationContext#addTransactionListener(com.vaadin.service.ApplicationContext.TransactionListener)
      */
     public void addTransactionListener(TransactionListener listener) {
@@ -124,7 +127,7 @@ public class WebApplicationContext implements ApplicationContext,
      * Removes a transaction listener from this context. The transaction
      * listener is called before and after each each HTTP request related to
      * this session except when serving static resources.
-     * 
+     *
      * @see com.vaadin.service.ApplicationContext#removeTransactionListener(com.vaadin.service.ApplicationContext.TransactionListener)
      */
     public void removeTransactionListener(TransactionListener listener) {
@@ -134,7 +137,7 @@ public class WebApplicationContext implements ApplicationContext,
 
     /**
      * Sends a notification that a transaction is starting.
-     * 
+     *
      * @param application
      *            The application associated with the transaction.
      * @param request
@@ -151,7 +154,7 @@ public class WebApplicationContext implements ApplicationContext,
 
     /**
      * Sends a notification that a transaction has ended.
-     * 
+     *
      * @param application
      *            The application associated with the transaction.
      * @param request
@@ -233,11 +236,11 @@ public class WebApplicationContext implements ApplicationContext,
 
     /**
      * Get the web browser associated with this application context.
-     * 
+     *
      * Because application context is related to the http session and server
      * maintains one session per browser-instance, each context has exactly one
      * web browser associated with it.
-     * 
+     *
      * @return
      */
     public WebBrowser getBrowser() {
@@ -246,10 +249,10 @@ public class WebApplicationContext implements ApplicationContext,
 
     /**
      * Gets communication manager for an application.
-     * 
+     *
      * If this application has not been running before, a new manager is
      * created.
-     * 
+     *
      * @param application
      * @return CommunicationManager
      */