Logotype Sitevision Developer
Log in
Log in

Best before

The best before configuration is available in the site settings. When a page is published, the publisher can activate a "best before" reminder with a given time in the future. When that time occurs, a mail text is generated using Velocity and sent to the recipients according to the site configuration. This documentation is for the mail body generation template.

Elements available in the Velocity Context

Name

Type and description

jcrSession

javax.jcr.Session


The JCR Session

sitevisionUtils

senselogic.sitevision.api.Utils


The main entry point to all utility classes

date

String


The formatted time when the best before notification was activated (i.e. typically last published)

url

String


The absolute URL to the page in OFFLINE version, i.e. "the URL to edit the page"

 

Note that there are no "request" available since execution is triggered by the system, not by an explicit client request or such.

Version: The Velocity template is executed in the ONLINE ("published") version.

Current User: The context user during execution will be the user that activated the best before notification.

Default velocity template for a swedish site
vm
#set ($portletContextUtil = $sitevisionUtils.portletContextUtil) #set ($propertyUtil = $sitevisionUtils.propertyUtil) #set ($nodeTypeUtil = $sitevisionUtils.nodeTypeUtil) #set ($currentPage = $portletContextUtil.getCurrentPage()) #set ($pageURL = $propertyUtil.getString($currentPage, 'URL', '')) #set ($displayName = $propertyUtil.getString($currentPage, 'displayName')) #if ($nodeTypeUtil.isArticle($currentPage)) #set ($displayName = $propertyUtil.getString($currentPage, 'articleName', $displayName)) #end Sidan "$!{displayName}" publicerades $!{date} och har passerat sitt bäst före-datum. Länk till sidan: $!{pageURL} Länk för att redigera sidan: $!{url}
Did you find the content on this page useful?