Class ConfluenceWebResourceIntegration

  • All Implemented Interfaces:
    com.atlassian.plugin.webresource.WebResourceIntegration

    public class ConfluenceWebResourceIntegration
    extends Object
    implements com.atlassian.plugin.webresource.WebResourceIntegration
    Confluence implementation of WebResourceIntegration, for use with the static resource caching code.
    • Constructor Detail

      • ConfluenceWebResourceIntegration

        public ConfluenceWebResourceIntegration​(com.atlassian.plugin.PluginAccessor pluginAccessor,
                                                PluginDirectoryProvider pluginDirectoryProvider,
                                                SettingsManager settingsManager,
                                                Counter pluginResourceCounter,
                                                LocaleManager localeManager,
                                                ContextPathHolder contextPathHolder,
                                                I18NBeanFactory i18NBeanFactory,
                                                Supplier<com.atlassian.plugin.webresource.cdn.CDNStrategy> cdnStrategySupplier,
                                                com.atlassian.plugin.event.PluginEventManager pluginEventManager,
                                                DarkFeaturesManager confluenceDarkFeaturesManager,
                                                com.atlassian.sal.api.features.DarkFeatureManager salDarkFeatureManager,
                                                LanguageManager languageManager,
                                                com.atlassian.event.api.EventPublisher eventPublisher)
        Since:
        7.14
    • Method Detail

      • getStaticResourceLocale

        public String getStaticResourceLocale()
        Specified by:
        getStaticResourceLocale in interface com.atlassian.plugin.webresource.WebResourceIntegration
      • getI18nStateHash

        public String getI18nStateHash()
        Specified by:
        getI18nStateHash in interface com.atlassian.plugin.webresource.WebResourceIntegration
      • getPluginAccessor

        public com.atlassian.plugin.PluginAccessor getPluginAccessor()
        Specified by:
        getPluginAccessor in interface com.atlassian.plugin.webresource.WebResourceIntegration
      • getPluginEventManager

        public com.atlassian.plugin.event.PluginEventManager getPluginEventManager()
        Specified by:
        getPluginEventManager in interface com.atlassian.plugin.webresource.WebResourceIntegration
      • getEventPublisher

        @Nonnull
        public com.atlassian.event.api.EventPublisher getEventPublisher()
        Specified by:
        getEventPublisher in interface com.atlassian.plugin.webresource.WebResourceIntegration
      • getDarkFeatureManager

        @Nonnull
        public com.atlassian.sal.api.features.DarkFeatureManager getDarkFeatureManager()
        Specified by:
        getDarkFeatureManager in interface com.atlassian.plugin.webresource.WebResourceIntegration
      • getRequestCache

        public Map<String,​Object> getRequestCache()
        Specified by:
        getRequestCache in interface com.atlassian.plugin.webresource.WebResourceIntegration
      • rebuildResourceUrlPrefix

        public void rebuildResourceUrlPrefix()
        Specified by:
        rebuildResourceUrlPrefix in interface com.atlassian.plugin.webresource.WebResourceIntegration
      • getSystemCounter

        public String getSystemCounter()
        If the system property for dev mode or disabling caches is set, NOCAHCE prefix is returned.

        If the revision number is available from the Build Information, it will be returned.

        Specified by:
        getSystemCounter in interface com.atlassian.plugin.webresource.WebResourceIntegration
        Returns:
        the revision number from the build information
      • getSystemBuildNumber

        public String getSystemBuildNumber()
        Specified by:
        getSystemBuildNumber in interface com.atlassian.plugin.webresource.WebResourceIntegration
      • getHostApplicationVersion

        public String getHostApplicationVersion()
        Specified by:
        getHostApplicationVersion in interface com.atlassian.plugin.webresource.WebResourceIntegration
      • getBaseUrl

        public String getBaseUrl()
        Specified by:
        getBaseUrl in interface com.atlassian.plugin.webresource.WebResourceIntegration
      • getBaseUrl

        public String getBaseUrl​(com.atlassian.plugin.webresource.UrlMode urlMode)
        Returns the base url of the application for the given url mode. For UrlMode.AUTO the relative url is returned if found, otherwise will default to returning the absolute url.

        This method can return null if the base url cannot be determined.

        Specified by:
        getBaseUrl in interface com.atlassian.plugin.webresource.WebResourceIntegration
        Returns:
        the base url of the application for the given url mode
      • getSuperBatchVersion

        public String getSuperBatchVersion()
        Specified by:
        getSuperBatchVersion in interface com.atlassian.plugin.webresource.WebResourceIntegration
      • getTemporaryDirectory

        public File getTemporaryDirectory()
        Specified by:
        getTemporaryDirectory in interface com.atlassian.plugin.webresource.WebResourceIntegration
      • getCDNStrategy

        public com.atlassian.plugin.webresource.cdn.CDNStrategy getCDNStrategy()
        Specified by:
        getCDNStrategy in interface com.atlassian.plugin.webresource.WebResourceIntegration
      • getLocale

        public Locale getLocale()
        Specified by:
        getLocale in interface com.atlassian.plugin.webresource.WebResourceIntegration
      • getSupportedLocales

        public Iterable<Locale> getSupportedLocales()
        Specified by:
        getSupportedLocales in interface com.atlassian.plugin.webresource.WebResourceIntegration
      • getI18nRawText

        public String getI18nRawText​(Locale locale,
                                     String key)
        Specified by:
        getI18nRawText in interface com.atlassian.plugin.webresource.WebResourceIntegration
      • getI18nText

        public String getI18nText​(Locale locale,
                                  String key)
        Specified by:
        getI18nText in interface com.atlassian.plugin.webresource.WebResourceIntegration
      • allowedCondition1Keys

        public Set<String> allowedCondition1Keys()
        Specified by:
        allowedCondition1Keys in interface com.atlassian.plugin.webresource.WebResourceIntegration
      • allowedTransform1Keys

        public Set<String> allowedTransform1Keys()
        Specified by:
        allowedTransform1Keys in interface com.atlassian.plugin.webresource.WebResourceIntegration
      • forbidCondition1AndTransformer1

        public boolean forbidCondition1AndTransformer1()
        Specified by:
        forbidCondition1AndTransformer1 in interface com.atlassian.plugin.webresource.WebResourceIntegration
      • isIncrementalCacheEnabled

        public boolean isIncrementalCacheEnabled()
        Specified by:
        isIncrementalCacheEnabled in interface com.atlassian.plugin.webresource.WebResourceIntegration
      • isDeferJsAttributeEnabled

        public boolean isDeferJsAttributeEnabled()
        Specified by:
        isDeferJsAttributeEnabled in interface com.atlassian.plugin.webresource.WebResourceIntegration