Class BuildTemplateWebResourcesEvent

java.lang.Object
com.foreach.across.modules.web.events.BuildTemplateWebResourcesEvent
All Implemented Interfaces:
AcrossEvent, NamedAcrossEvent

public class BuildTemplateWebResourcesEvent extends Object implements NamedAcrossEvent
Event published by a LayoutTemplateProcessorAdapterBean after a named template has been prepared.
Author:
Arne Vandamme
  • Constructor Details

    • BuildTemplateWebResourcesEvent

      public BuildTemplateWebResourcesEvent(String templateName, WebResourceRegistry webResourceRegistry)
  • Method Details

    • getEventName

      public String getEventName()
      Specified by:
      getEventName in interface NamedAcrossEvent
    • applyResourceRules

      public void applyResourceRules(WebResourceRule... rules)
      Apply a set of template specific WebResourceRule instances to the registry.
      Parameters:
      rules - to apply
    • applyResourceRules

      public void applyResourceRules(Collection<WebResourceRule> rules)
      Apply a set of template specific WebResourceRule instances to the registry.
      Parameters:
      rules - to apply
    • add

      @Deprecated public void add(WebResource webResource)
      Deprecated.
      since 3.2.0 - use applyResourceRules(WebResourceRule...) instead
    • add

      @Deprecated public void add(String type, Object data)
      Deprecated.
      since 3.2.0 - use applyResourceRules(WebResourceRule...) instead
      Register a new resource with the default location. Since there is no key, any other resource of the same type with the same data will be replaced.
      Parameters:
      type - Type of the resource, see WebResource for constants.
      data - Data to register.
    • add

      @Deprecated public void add(String type, Object data, String location)
      Deprecated.
      since 3.2.0 - use applyResourceRules(WebResourceRule...) instead
      Registers a resource with the location specified. Since there is no key, any other resource of the same type with the same data will be replaced.
      Parameters:
      type - Type of the resource, see WebResource for constants.
      data - Data to register.
      location - Where the data is available.
    • addWithKey

      @Deprecated public void addWithKey(String type, String key, Object data)
      Deprecated.
      since 3.2.0 - use applyResourceRules(WebResourceRule...) instead
      Registers a resource under the given key. For complex interactions, it is often better to provide a key. Existing resources of this type with the same key will be replaced.
      Parameters:
      type - Type of the resource, see WebResource for constants.
      key - Unique key under which to register a resource.
      data - Data to register.
    • addWithKey

      @Deprecated public void addWithKey(String type, String key, Object data, String location)
      Deprecated.
      since 3.2.0 - use applyResourceRules(WebResourceRule...) instead
      Registers a resource under the given key. For complex interactions, it is often better to provide a key. Existing resources of this type with the same key will be replaced.
      Parameters:
      type - Type of the resource, see WebResource for constants.
      key - Unique key under which to register a resource.
      data - Data to register.
    • removeResource

      @Deprecated public void removeResource(Object data)
      Deprecated.
      since 3.2.0 - use applyResourceRules(WebResourceRule...) instead
      Will remove all registered resources with the given content. Requires that the resource data equals() the requested data.
      Parameters:
      data - Content the resource should have.
    • removeResource

      @Deprecated public void removeResource(String type, Object data)
      Deprecated.
      Will remove all registered resources of that type with the given content.
      Parameters:
      type - Type of the resource, see WebResource for constants.
      data - Content the resource should have.
    • removeResourceWithKey

      @Deprecated public void removeResourceWithKey(String key)
      Deprecated.
      Will remove all resources registered under the key specified.
      Parameters:
      key - Key the resource is registered under.
    • removeResourceWithKey

      @Deprecated public void removeResourceWithKey(String type, String key)
      Deprecated.
      Will remove all resources of that type registered under the key specified.
      Parameters:
      type - Type of the resource, see WebResource for constants.
      key - Key the resource is registered under.
    • addPackage

      @Deprecated public void addPackage(String... packageNames)
      Deprecated.
      since 3.2.0 - use applyResourceRules(WebResourceRule...) instead
      Installs all resources attached to the packages with the names specified. This requires the packages to be registered in the attached WebResourcePackageManager.
      Parameters:
      packageNames - Names of the packages to install.
    • removePackage

      @Deprecated public void removePackage(String... packageNames)
      Deprecated.
      since 3.2.0 - use applyResourceRules(WebResourceRule...) instead
      Will remove all resources of the packages with the specified names.
      Parameters:
      packageNames - Names of the packages.
    • getTemplateName

      public String getTemplateName()
    • getWebResourceRegistry

      public WebResourceRegistry getWebResourceRegistry()