if (session != null) {
PortletApplicationContext2 context = PortletApplicationContext2
.getApplicationContext(session);
- context.applicationToAjaxAppMgrMap.remove(application);
context.removeApplication(application);
}
}
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
/**
* 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()
/**
* 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()
/**
* 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()
/**
* 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()
/**
* 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()
* 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()
/**
* 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")
-/*
+/*
@ITMillApache2LicenseForJavaFiles@
*/
/**
* 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@
/**
* Creates a new Web Application Context.
- *
+ *
*/
WebApplicationContext() {
/**
* Gets the application context base directory.
- *
+ *
* @see com.vaadin.service.ApplicationContext#getBaseDirectory()
*/
public File getBaseDirectory() {
/**
* Gets the http-session application is running in.
- *
+ *
* @return HttpSession this application context resides in.
*/
public HttpSession getHttpSession() {
/**
* Gets the applications in this context.
- *
+ *
* @see com.vaadin.service.ApplicationContext#getApplications()
*/
public Collection<Application> getApplications() {
/**
* Gets the application context for an HttpSession.
- *
+ *
* @param session
* the HTTP session.
* @return the application context for HttpSession.
* 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) {
* 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) {
/**
* Sends a notification that a transaction is starting.
- *
+ *
* @param application
* The application associated with the transaction.
* @param request
/**
* Sends a notification that a transaction has ended.
- *
+ *
* @param application
* The application associated with the transaction.
* @param request
/**
* 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() {
/**
* Gets communication manager for an application.
- *
+ *
* If this application has not been running before, a new manager is
* created.
- *
+ *
* @param application
* @return CommunicationManager
*/