You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Constants.java 9.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. /*
  2. * Copyright 2000-2014 Vaadin Ltd.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  5. * use this file except in compliance with the License. You may obtain a copy of
  6. * the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  12. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  13. * License for the specific language governing permissions and limitations under
  14. * the License.
  15. */
  16. package com.vaadin.server;
  17. import com.vaadin.shared.communication.PushMode;
  18. import com.vaadin.ui.declarative.DesignContext;
  19. /**
  20. * Internal constants used by both the client and the server side framework
  21. *
  22. * @since 6.2
  23. *
  24. */
  25. public interface Constants {
  26. static final String NOT_PRODUCTION_MODE_INFO = "\n"
  27. + "=================================================================\n"
  28. + "Vaadin is running in DEBUG MODE.\nAdd productionMode=true to web.xml "
  29. + "to disable debug features.\nTo show debug window, add ?debug to "
  30. + "your application URL.\n"
  31. + "=================================================================";
  32. static final String WARNING_XSRF_PROTECTION_DISABLED = "\n"
  33. + "===========================================================\n"
  34. + "WARNING: Cross-site request forgery protection is disabled!\n"
  35. + "===========================================================";
  36. static final String WARNING_RESOURCE_CACHING_TIME_NOT_NUMERIC = "\n"
  37. + "===========================================================\n"
  38. + "WARNING: resourceCacheTime has been set to a non integer value "
  39. + "in web.xml. The default of 1h will be used.\n"
  40. + "===========================================================";
  41. static final String WARNING_HEARTBEAT_INTERVAL_NOT_NUMERIC = "\n"
  42. + "===========================================================\n"
  43. + "WARNING: heartbeatInterval has been set to a non integer value "
  44. + "in web.xml. The default of 5min will be used.\n"
  45. + "===========================================================";
  46. static final String WARNING_PUSH_MODE_NOT_RECOGNIZED = "\n"
  47. + "===========================================================\n"
  48. + "WARNING: pushMode has been set to an unrecognized value\n"
  49. + "in web.xml. The permitted values are \"disabled\", \"manual\",\n"
  50. + "and \"automatic\". The default of \"disabled\" will be used.\n"
  51. + "===========================================================";
  52. static final String WIDGETSET_MISMATCH_INFO = "\n"
  53. + "=================================================================\n"
  54. + "The widgetset in use does not seem to be built for the Vaadin\n"
  55. + "version in use. This might cause strange problems - a\n"
  56. + "recompile/deploy is strongly recommended.\n"
  57. + " Vaadin version: %s\n"
  58. + " Widgetset version: %s\n"
  59. + "=================================================================";
  60. // Keep the version number in sync with push/build.xml and other locations
  61. // listed in that file
  62. static final String REQUIRED_ATMOSPHERE_RUNTIME_VERSION = "2.2.7.vaadin1";
  63. static final String INVALID_ATMOSPHERE_VERSION_WARNING = "\n"
  64. + "=================================================================\n"
  65. + "Vaadin depends on Atmosphere {0} but version {1} was found.\n"
  66. + "This might cause compatibility problems if push is used.\n"
  67. + "=================================================================";
  68. static final String ATMOSPHERE_MISSING_ERROR = "\n"
  69. + "=================================================================\n"
  70. + "Atmosphere could not be loaded. When using push with Vaadin, the\n"
  71. + "Atmosphere framework must be present on the classpath.\n"
  72. + "If using a dependency management system, please add a dependency\n"
  73. + "to vaadin-push.\n"
  74. + "If managing dependencies manually, please make sure Atmosphere\n"
  75. + REQUIRED_ATMOSPHERE_RUNTIME_VERSION
  76. + " is included on the classpath.\n"
  77. + "Will fall back to using "
  78. + PushMode.class.getSimpleName()
  79. + "."
  80. + PushMode.DISABLED.name()
  81. + ".\n"
  82. + "=================================================================";
  83. static final String PUSH_NOT_SUPPORTED_ERROR = "\n"
  84. + "=================================================================\n"
  85. + "Push is not supported for {0}\n"
  86. + "Will fall back to using "
  87. + PushMode.class.getSimpleName()
  88. + "."
  89. + PushMode.DISABLED.name()
  90. + ".\n"
  91. + "=================================================================";
  92. public static final String WARNING_LEGACY_PROPERTY_TOSTRING = "You are using toString() instead of getValue() to get the value for a Property of type {0}"
  93. + ". This is strongly discouraged and only provided for backwards compatibility with Vaadin 6. "
  94. + "To disable this warning message and retain the behavior, set the init parameter \""
  95. + Constants.SERVLET_PARAMETER_LEGACY_PROPERTY_TOSTRING
  96. + "\" to \"true\". To disable the legacy functionality, set \""
  97. + Constants.SERVLET_PARAMETER_LEGACY_PROPERTY_TOSTRING
  98. + "\" to false."
  99. + " (Note that your debugger might call toString() and trigger this message)."
  100. + " To find out who is calling toString(), enable FINE level logging.";
  101. static final String WARNING_UNKNOWN_LEGACY_PROPERTY_TOSTRING_VALUE = "Unknown value '{0}' for parameter "
  102. + Constants.SERVLET_PARAMETER_LEGACY_PROPERTY_TOSTRING
  103. + ". Supported values are 'false','warning','true'";
  104. static final String CANNOT_ACQUIRE_CLASSLOADER_SEVERE = "\n"
  105. + "=================================================================\n"
  106. + "Vaadin was unable to acquire class loader from servlet container\n"
  107. + "to load your application classes. Setup appropriate security\n"
  108. + "policy to allow invoking Thread.getContextClassLoader() from\n"
  109. + "VaadinService if you're not using custom class loader.\n"
  110. + "NullPointerExceptions will be thrown later."
  111. + "=================================================================";
  112. static final String URL_PARAMETER_THEME = "theme";
  113. static final String SERVLET_PARAMETER_PRODUCTION_MODE = "productionMode";
  114. // Javadocs for VaadinService should be updated if this value is changed
  115. static final String SERVLET_PARAMETER_DISABLE_XSRF_PROTECTION = "disable-xsrf-protection";
  116. static final String SERVLET_PARAMETER_RESOURCE_CACHE_TIME = "resourceCacheTime";
  117. static final String SERVLET_PARAMETER_HEARTBEAT_INTERVAL = "heartbeatInterval";
  118. static final String SERVLET_PARAMETER_CLOSE_IDLE_SESSIONS = "closeIdleSessions";
  119. static final String SERVLET_PARAMETER_PUSH_MODE = "pushMode";
  120. static final String SERVLET_PARAMETER_UI_PROVIDER = "UIProvider";
  121. static final String SERVLET_PARAMETER_LEGACY_PROPERTY_TOSTRING = "legacyPropertyToString";
  122. static final String SERVLET_PARAMETER_SYNC_ID_CHECK = "syncIdCheck";
  123. static final String SERVLET_PARAMETER_SENDURLSASPARAMETERS = "sendUrlsAsParameters";
  124. static final String SERVLET_PARAMETER_PUSH_SUSPEND_TIMEOUT_LONGPOLLING = "pushLongPollingSuspendTimeout";
  125. /**
  126. * Name of system or context property to write declarative syntax with the
  127. * old "v-" prefix or with the new "vaadin-" prefix. The default value
  128. * depends on the Vaadin branch used.
  129. *
  130. * @see DesignContext
  131. * @since 7.5.7
  132. */
  133. static final String SERVLET_PARAMETER_LEGACY_DESIGN_PREFIX = "legacyDesignPrefix";
  134. // Configurable parameter names
  135. static final String PARAMETER_VAADIN_RESOURCES = "Resources";
  136. static final int DEFAULT_BUFFER_SIZE = 32 * 1024;
  137. static final int MAX_BUFFER_SIZE = 64 * 1024;
  138. final String THEME_DIR_PATH = "VAADIN/themes";
  139. static final int DEFAULT_THEME_CACHETIME = 1000 * 60 * 60 * 24;
  140. static final String WIDGETSET_DIR_PATH = "VAADIN/widgetsets";
  141. // Name of the default widget set, used if not specified in web.xml
  142. static final String DEFAULT_WIDGETSET = "com.vaadin.DefaultWidgetSet";
  143. // Widget set parameter name
  144. static final String PARAMETER_WIDGETSET = "widgetset";
  145. /**
  146. * @deprecated As of 7.1, this message is no longer used and might be
  147. * removed from the code.
  148. */
  149. @Deprecated
  150. static final String ERROR_NO_UI_FOUND = "No UIProvider returned a UI for the request.";
  151. static final String DEFAULT_THEME_NAME = "reindeer";
  152. static final String INVALID_SECURITY_KEY_MSG = "Invalid security key.";
  153. // portal configuration parameters
  154. static final String PORTAL_PARAMETER_VAADIN_WIDGETSET = "vaadin.widgetset";
  155. static final String PORTAL_PARAMETER_VAADIN_RESOURCE_PATH = "vaadin.resources.path";
  156. static final String PORTAL_PARAMETER_VAADIN_THEME = "vaadin.theme";
  157. static final String PORTLET_CONTEXT = "PORTLET_CONTEXT";
  158. }