Wiki

Clone wiki

Shampoo / TemplateFiles

__TOC__

Template files

Various aspects of the GUI and messages sent by Shampoo can be customized to your needs. You do not need to re-deploy the application for changes to take effect.

Mail notification template

The update notifications sent by mail to users. The body of the mail is defined by the file notificationLongMessageModel.vm, while the "subject" field is controled by notificationShortMessageModel.vm. Both template files are located by default in the /Shampoo/WEB-INF/conf/ folder. The syntax for editing those files follows the Apache Velocity template rules. The following variables are available for use - this is not a fully comprehensive list:

  • user.username

    Username of the mail recipient.

  • user.password

    Password of the mail recipient.

  • notifications

    The list of the notifications sent to the recipient.

  • notification.friendlyEnglishCaption

    The actual notification message, written in English.

  • notification.actorID

    Who performed the event that triggered this notification.

  • user.timezone

    The mail recipient's current time zone.

  • staticAppName

    Shampoo's friendly name. Unless re-branded, it's most likely just "Shampoo".

  • url

    The base URL of the GUI for this instance of Shampoo.

And some functions:

  • notification.dateStamp.switchTimeZone()

    Converts the notification datestamp to the specified time zone and prints it.

  • notifications.size()

    Prints the number of notifications for the current recipient.

Example

Hey ${user.username},
some recent changes have affected your account or one or several radio station(s) you are currently managing:

#foreach( ${notification} in ${notifications} )
    - ${notification.friendlyEnglishCaption},#if(${notification.actorID}) modification performed by ${notification.actorID}#end on ${notification.dateStamp.switchTimeZone(${user.timezone})}
#end

Have a nice day,
The postman for ${staticAppName} at ${url}

--
This is an automated email, please do not reply.
You are currently signed up to automated email notifications. To discontinue future notifications, login and update your preferences.

Password recovery template

The password recovery messages sent by mail to users. The body of the mail is defined by the file sendPasswordLongMessageModel.vm, while the "subject" field is controled by sendPasswordShortMessageModel.vm. Both template files are located by default in the /Shampoo/WEB-INF/conf/ folder. The syntax follows the Apache Velocity template rules. All variables and functions active for mail notifications are also valid here.

Example

Hey ${user.username},
here is the password currently associated with your account:

${user.password}

Have a nice day,
The postman for ${staticAppName} at ${url}

--
This is an automated email, please do not reply.

GUI header banner template

The header banner located on top of the Shampoo GUI. The content of that header is controled by the file headerGUIModel.vm. The template file is located by default in the /Shampoo/WEB-INF/conf/ folder. It's an HTML file without any body anchor. You might want to adjust the CSS file as well, located at /Shampoo/gwt/default.css. Active variables and functions for the header banner are not available at the time this page is written. Their syntax follows the Apache Velocity template rules.

GUI frontpage template

The "Home/Index" page that is displayed when you first log in the Shampoo GUI. The content of that page is controlled by the file frontpageGUIModel.vm. The template file is located by default in the /Shampoo/WEB-INF/conf/ folder. It's an HTML file without any body anchor. You might want to adjust the CSS file as well, located at /Shampoo/gwt/default.css. Active variables and functions for the fontpage are not available at the time this page is written. Their syntax follows the Apache Velocity template rules.

Updated