PageRenderSubscriber

Part of the Publishing SPI . A component to receive notifaction that a domain object or a standalone list of domain objects has been rendered.

API

PageRenderSubscriber.java
interface PageRenderSubscriber {
  void onRendering(PageType pageType)     (1)
  void onRenderedDomainObject(Bookmark bookmark)     (2)
  void onRenderedCollection(Supplier<List<Bookmark>> bookmarkSupplier)     (3)
  void onRenderedValue(Object value)     (4)
}
1 onRendering(PageType)

Called just before the rendering process starts.However, if PageType#OTHER , then NO onRenderedXxx method will be called.

2 onRenderedDomainObject(Bookmark)

Indicates that the domain object represented by the Bookmark has been rendered.

3 onRenderedCollection(Supplier)

Indicates that a standalone list of domain objects (each represented by a Bookmark has been rendered.

4 onRenderedValue(Object)

Indicates that a value has been rendered.

Members

onRendering(PageType)

Called just before the rendering process starts.However, if PageType#OTHER , then NO onRenderedXxx method will be called.

Determines which of the onRenderedXxx callbacks (if any) will next be called:

  • if PageType#DOMAIN_OBJECT , then will call #onRenderedDomainObject(Bookmark) next

  • if PageType#COLLECTION , then will call #onRenderedCollection(Supplier) next

  • if PageType#VALUE , then will call #onRenderedValue(Object) next

Also, if any of the pages fail to render (eg due to an authorization exception), then - again - NO onRenderedXxx method will be called

Implementations could use this to start a stopwatch, for example, or to reset caches.

onRenderedDomainObject(Bookmark)

Indicates that the domain object represented by the Bookmark has been rendered.

onRenderedCollection(Supplier)

Indicates that a standalone list of domain objects (each represented by a Bookmark has been rendered.

onRenderedValue(Object)

Indicates that a value has been rendered.