public interface WebResourceIntegration
| Modifier and Type | Method and Description |
|---|---|
Set<String> |
allowedCondition1Keys()
Works together with `forbidCondition1AndTransformer1` and temporarily allows for given set of plugins to have
legacy stuff.
|
Set<String> |
allowedTransform1Keys()
Works together with `forbidCondition1AndTransformer1` and temporarily allows for given set of plugins to have
legacy stuff.
|
default boolean |
forbidCondition1AndTransformer1()
If enabled and there's at leas one Condition1 or Transformer1 Web Resource will throw an error and stop working.
|
String |
getBaseUrl()
Returns the base URL for this application.
|
String |
getBaseUrl(UrlMode urlMode)
Returns the base URL for this application in either relative or absolute format, depending on the value of
urlMode. |
default BigPipeConfiguration |
getBigPipeConfiguration() |
CDNStrategy |
getCDNStrategy()
Returns the CDNStrategy for serving resources via CDN.
|
com.atlassian.sal.api.features.DarkFeatureManager |
getDarkFeatureManager()
Used to separate the WRM from the details of how products deal with system properties
|
com.atlassian.event.api.EventPublisher |
getEventPublisher()
Applications must implement this method to get access to the analytic event publisher
|
String |
getHostApplicationVersion()
The version number of the host application, for example "7.0.0-OD-07" or "5.6".
|
String |
getI18nRawText(Locale locale,
String key)
Retrieve the unformatted message text associated with this key.
|
String |
getI18nStateHash()
The locale hash that should be inserted into static resource urls for the current request, if appropriate.
|
String |
getI18nText(Locale locale,
String key)
Retrieve the message text associated with this key.
|
Locale |
getLocale() |
com.atlassian.plugin.PluginAccessor |
getPluginAccessor()
Applications must implement this method to get access to the application's PluginAccessor
|
com.atlassian.plugin.event.PluginEventManager |
getPluginEventManager()
Deprecated.
since v3.3.2
|
Map<String,Object> |
getRequestCache()
This must be a thread-local cache that will be accessible from both the page, and the decorator
|
default String |
getResourceUrlPrefix()
Represents the resource URL prefix used to construct URLs to resources.
|
String |
getStaticResourceLocale()
Deprecated.
since 3.5.22 - This method includes current locale in URL hash which is unnecessary since it's
already in a query parameter. The current behaviour causes unnecessary cache misses of pre-baked resources
since it'll only work for instances with the same locale in which the pre-baker ran.
Use
getI18nStateHash() instead. |
String |
getSuperBatchVersion()
This version number is used for caching URL generation, and needs to be incremented every time the contents
of the superbatch may have changed.
|
Iterable<Locale> |
getSupportedLocales() |
default List<CompleteWebResourceKey> |
getSyncWebResourceKeys()
Synchronous resources will be inlined in the HTML response when
WebResourceSet.writeHtmlTags(Writer, com.atlassian.webresource.api.UrlMode) gets called. |
String |
getSystemBuildNumber()
Represents the last time the system was updated.
|
default String |
getSystemCounter()
Deprecated.
since 5.0 implement
getResourceUrlPrefix() instead |
File |
getTemporaryDirectory()
A reference to the temporary directory the application want the plugin system to use.
|
default boolean |
isCompiledResourceEnabled()
Returns whether "compiled resources" are enabled.
|
default boolean |
isCtCdnMappingEnabled()
Checks if CT-CDN is enable at this moment.
|
default boolean |
isDeferJsAttributeEnabled()
Deprecated.
since 5.0.0, use ResourcePriority.DEFER instead
|
default boolean |
isIncrementalCacheEnabled()
If incremental cache should be used.
|
default void |
rebuildResourceUrlPrefix()
Triggers product-side URL prefix recalculation.
|
default boolean |
usePluginInstallTimeInsteadOfTheVersionForSnapshotPlugins()
If true the plugin install time will be used instead of the plugin version for the SNAPSHOT plugins.
|
com.atlassian.plugin.PluginAccessor getPluginAccessor()
@Deprecated com.atlassian.plugin.event.PluginEventManager getPluginEventManager()
Map<String,Object> getRequestCache()
@Deprecated default String getSystemCounter()
getResourceUrlPrefix() insteaddefault String getResourceUrlPrefix()
default void rebuildResourceUrlPrefix()
getSystemCounter(),
getResourceUrlPrefix()String getSystemBuildNumber()
String getHostApplicationVersion()
getSystemBuildNumber(), which does not necessarily change when the application changes
(at least in JIRA this represents the database build number, not the application version number).String getBaseUrl()
In general, the behavior of this method should be equivalent to calling getBaseUrl(UrlMode) with a urlMode value of UrlMode.AUTO.
String getBaseUrl(UrlMode urlMode)
urlMode.
If urlMode == {@link UrlMode#ABSOLUTE}, this method returns an absolute URL, with URL
scheme, hostname, port (if non-standard for the scheme), and context path.
If urlMode == {@link UrlMode#RELATIVE}, this method returns a relative URL containing
just the context path.
If urlMode == {@link UrlMode#AUTO}, this method may return either an absolute or a
relative URL. Implementations are free to determine which mode to use based on any criteria of their choosing.
For example, an implementation may choose to return a relative URL if it detects that it is running in the
context of an HTTP request, and an absolute URL if it detects that it is not. Or it may choose to always return
an absolute URL, or always return a relative URL. Callers should only use WebResourceManager.UrlMode#AUTO when they are sure that either an absolute or a relative URL will be
appropriate, and should not rely on any particular observed behavior regarding how this value is interpreted,
which may vary across different implementations.
urlMode - specifies whether to use absolute URLs, relative URLs, or allow the concrete implementation to
decideString getSuperBatchVersion()
@Deprecated String getStaticResourceLocale()
getI18nStateHash() instead.String getI18nStateHash()
File getTemporaryDirectory()
CDNStrategy getCDNStrategy()
Locale getLocale()
Iterable<Locale> getSupportedLocales()
String getI18nRawText(Locale locale, String key)
locale - locale in which to look up keyskey - key for the i18ned messageString getI18nText(Locale locale, String key)
locale - locale in which to look up keyskey - key for the i18ned messageSet<String> allowedCondition1Keys()
Set<String> allowedTransform1Keys()
default boolean forbidCondition1AndTransformer1()
default boolean isIncrementalCacheEnabled()
Please note that if it's enabled the size of the cache should be big enough. It caches the transformed content of the individual JS / CSS files, and there are lots of such files. The size defined by `plugin.webresource.incrementalcache.size` system property.
See https://extranet.atlassian.com/display/~apetrushin/Incremental+build+Cache+for+Context+Batch for details.
@Deprecated default boolean isDeferJsAttributeEnabled()
default BigPipeConfiguration getBigPipeConfiguration()
@ExperimentalApi default List<CompleteWebResourceKey> getSyncWebResourceKeys()
WebResourceSet.writeHtmlTags(Writer, com.atlassian.webresource.api.UrlMode) gets called.
For example, analytics or AMD loader should be available for every other scripts.
Important note. Only JS files will be taken from specified web-resources and
other types of resources will be ignored. Warning will be logged in such case.
Any dependencies of specified web-resources will be also treated as sync and will be included
before those web-resources so be careful.
It's guaranteed that sync web-resources will be included only once, hence they will be also
excluded from other batches.default boolean usePluginInstallTimeInsteadOfTheVersionForSnapshotPlugins()
It's needed to simplify development and flush the cache when updated SNAPSHOT plugin installed.
default boolean isCtCdnMappingEnabled()
default boolean isCompiledResourceEnabled()
@Nonnull com.atlassian.event.api.EventPublisher getEventPublisher()
@Nonnull com.atlassian.sal.api.features.DarkFeatureManager getDarkFeatureManager()
Copyright © 2024 Atlassian. All rights reserved.