Newyse Templates

Newyse Templates

This page has been moved from General Documentation to here (Maxxton Knowledge Base)

For testing purposes, use the contents of AllTags.txt, put them in a Template and wrap them in a Report to verify what the value of each tag is.

Table of Contents

Purpose 

The template module is mentioned to create emailtemplates for all kind of purposes like reservationconfirmations. These templates are generic and contain different tags which will be replaced by specific data for that reservation.

PDF Files 

We're now using the templates too to generate email attachments with pdf or txt files. This requires a more strict template but we've built in some tools to help the user.

To make use of page breaks put the following code in the header of your HTML:

<style>
@media print {
.pagebreak { page-break-after: always; }
}
</style>

Then, at places inside your text where you would want to start a new page use the following DIV-tag:

<div class="pagebreak"> </div>

Velocity Tools 

From Newyse 2011R1 we added Velocity Tools to the templates. This is a set of utilities which help you with certain things. Like parsing a date, mathmetical things etc.

You can read about the different tools here:Tools

  • AlternatorTool - For creating Alternator to easily alternate over a set of values.

  • ClassTool - For simplifying reflective lookup of information about Classes and their fields, methods and constructors.

  • ContextTool - For convenient access to Context data and meta-data.

  • ConversionTool - For converting String values to richer object types.

  • DateTool & ComparisonDateTool - For manipulating, formatting, and comparing dates.

  • DisplayTool - For controlling display of references (e.g. truncating values, "pretty printing" lists, and displaying alternates when a reference is null).

  • EscapeTool - For common escaping needs in Velocity templates (e.g. escaping html, xml, javascript etc.)

  • FieldTool - For (easy) access to static fields in a class, such as string constants.

  • LoopTool - A convenience tool to use with #foreach loops. It wraps a list with a custom iterator to provide greater control, allowing loops to end early, skip ahead and more.

  • LinkTool - For creating and manipulating URIs and URLs. The API for this tool is designed to closely resemble that of the VelocityView tool of the same name.

  • ListTool - For working with arrays and lists, treats both transparently the same.

  • MathTool - For performing math functions.

  • NumberTool - For formatting and converting numbers.

  • RenderTool - To evaluate and render arbitrary strings of VTL, including recursive rendering.

  • ResourceTool - For simplified access to ResourceBundles for internationalization or other dynamic content needs.

  • SortTool - Used to sort collections (or arrays, iterators, etc) on any arbitary set of properties exposed by the objects contained within the collection.

  • XmlTool - For reading/navigating XML files. This uses dom4j under the covers and provides complete XPath support.

  • NF525 audit related tags more details refer url FR-Tickets & Invoices templates

  • Loyalty tags

Customer based templates 

A template can contain plain text and html formatted text, the html format makes it possible to add tables, images, hyperlinks etcetera in the template.

This is a list of tags and loops which are supported for now.

General:

$current_date , the current date

Customer:

Tag

Description

Tag

Description

$customer.customerId

The unique customer id

$customer.title

Title of customer.

$customer.firstname

Customer first name

$customer.middlename

Customer middle name

$customer.lastname

Customer last name

$customer.attentionOf

attention of customer

$customer.account

Account numer of customer

$customer.birthDate

Date of birth of customer

$customer.sex

Sex of customer

$customer.vatNumber

Vat number of customer

$customer.company (returns true or false)

Is customer have company

$customer.companyName

Name of customers company

$customer.department

Department of customer

$customer.ibanNumber

International bank account number of customer.

$customer.owner (returns true or false)

Is this owner

$customer.alternateName

Alternate name of customer

$customer.login

Login of customer

$customer.title

Title of customer.

$customer.language

language of customer

Address:

$customer.address.address1

1 Address of customer

$customer.address.address2

2 address of customer

$customer.address.housenumber

house number of customer

$customer.address.housenumberSuffix

house number suffix

$customer.address.zipcode

Zipcode of customer

$customer.address.city

City of the customer

$customer.address.district

District of the customer

$customer.address.email

Email id of customer

customer.address.countryCode

Country code

$customer.address.countryName

Country Name

$customer.address.mobilePhone

Mobile number

$customer.address.privatePhone

Private number

$customer.address.workPhone

Work phone number

$customer.address.poBox

Po box number

$customer.address.poBoxZipcode

Po box zip code

$customer.address.poBoxCity

Post box city

$customer.address.fax

Fax number

Customer Care - customer-based templates

For Customer Care, it is possible to configure templates for ad-hoc messages through Customer Care. These templates use the same context as the regular customer templates, but don't support all the same tags. 

The most important tag for these kinds of templates is $custom_message, this will be replaced by the text that the users type. 

Tag

Description

Tag

Description

$custom_message

The manual message that is typed by the employee in Customer Care

$customer_firstname

The first name of the customer 

$customer_lastname

The last name of the customer

$customer_title

Customer title of the customer

$customer_middlename

Middle name of the customer 

$customer_email

Email address of the customer

$login_employee_firstname

First name of the current employee (who is sending the email)

$login_employee_middlename

Middle name of the current employee

$login_employee_lastname

Lastname of the current employee

$login_employee_email

Email address of the current employee

Reservation based templates 

A template can contain plain text and html formatted text, the html format makes it possible to add tables, images, hyperlinks etcetera in the template.

This is a list of tags and loops which are supported for now.

General:

$current_date , the current date

Specific accommodation: (better use the new resourcelist and use thise only for infotexts)

#foreach($acco in $accommodationList) or (fakturen)--> ($acco in $parentAccommodationList) Loop on accommodation list.

Tag

Description

Tag

Description

$acco.accommodation_description

Accommodtion description

$acco.accommodation_name

Name of accommodation

$acco.accommodation_object

Accommodation object a.k.a. Unit

$acco.accommodation_start_date

Accommodation start date

$acco.accommodation_end_date

Accommodation end date

$acco.accommodation_object_forced

Accommodation object code

$acco.accommodation_object_infotext

Accommodation object infotext

$acco.accommodation_object_infotext_priority

Accommodation object infotext priority

$acco.accommodation_object_infotext_code

Accommodation object infotext code

$acco.accommodation_object_infotext_addtovoucher

Is accommodation object have infotext add to voucher (return 0 or 1)

$acco.accommodation_object_infotext_addtotravel

Is accommodation object have infotext add to travel (return 0 or 1)

$acco.accommodation_object_infotext_addtoprint

Is accommodation object have infotext add to print (return 0 or 1)

$acco.accommodation_object_infotext_type

Accommodation object infotext type

$acco.accommodation_checkintime

Accommodation checkin time

$acco.real_accommodation_checkintime

Accommodation real checkin time

$acco.accommodation_doorlock_pincode

Doorlock pin code for accommodation

$acco.accommodation_doorlock_pincode_early_checkin

Doorlock pin code for accommodation in case of an early check-in

$acco.accommodation_checkouttime

Checkout time of accommodation

$acco.real_accommodation_checkouttime

Accommodation real checkout time

$acco.accommodation_kind

Accommodation Kind

$acco.accommodation_kind_code

Accommodation kind code

$acco.accommodation_kind_dynamicfield

Accommodation kind dynamic field

$acco.accommodation_representation_name

Accommodation representation name

$acco.accommodation_address1

Address of accommodation

$acco.accommodation_housenumber

Accommodationhouse number

$acco.accommodation_housenumber_suffix

Accommodation house number suffix

$acco.accommodation_zipcode

Zipcode of accommodation

$acco.accommodation_city

City of accommodation

$acco.accommodation_countryname

Country of accommodation

$acco.accommodation_countrycode

Accommodation country code

$acco.accommodation_phonenumber

Accommodation phone number

$acco.accommodation_statename

Accommodation state name

$acco.accommodation_statecode

Accommodation state code

$acco.accommodation_key_housenumber

Alternative Key pickup location house number

$acco.accommodation_key_housenumber_suffix

Alternative Key pickup location house number suffix

$acco.accommodation_key_zipcode

Alternative Key pickup location zip code

$acco.accommodation_key_city

Alternative Key pickup location city

$acco.accommodation_key_countryname

Alternative Key pickup location country

$acco.accommodation_key_latitude

Alternative Key pickup location latitude

$acco.accommodation_key_longitude

Alternative Key pickup location longitude

$acco.accommodation_gas_start_date,

Gas start date

$acco.accommodation_gas_start_value,

Gas start value

$acco.accommodation_gas_end_date,

Gas end date

$acco.accommodation_gas_end_value,

Gas end value

$acco.accommodation_electricity_start_date,

Electricity start date

$acco.accommodation_electricity_start_value,

Electricity start value

$acco.accommodation_electricity_end_date,

Electricity end date

$acco.accommodation_electricity_end_value,

Electricity end value

$acco.accommodation_water_start_date,

Water start date

$acco.accommodation_water_start_value,

Water start value

$acco.accommodation_water_end_date,

Water end date

$acco.accommodation_water_end_value

Water end value

$acco.accommodation_cleansing_start_date,

Accommodation cleansing start date

$acco.accommodation_cleansing_start_value,

Accommodation cleansing start value

$acco.accommodation_cleansing_end_date,

Accommodation cleansing end date

$acco.accommodation_cleansing_end_value,

Accommodation cleansing end value

$acco.accommodation_images,    

Accommodation images

$acco.accommodatoin_dynamic_field

Accommodation dynamic field

$acco.accommodation_object_dynamic_field

Accommodation object dynamic field

$acco.accommodation_object_brand_name

Accommodation object brand name

$acco.accommodation_parent_name

Accommodation parent name

$acco.accommodation_parent_code

Accommodation parent code

$acco.accommodation_parent_id

Accommodation parent id

$acco.accommodation_memos

Accommodation memos

$acco.accommodation_type_memos

Accommodation type memos

$acco.object_description_forced

Object description

$acco.object_short_description_forced

Object short description

$acco.accommodation_is_imply

Accommodation is empty (returm true or false)

$acco.accommodation_object_id

Accommodation object id

$acco.reserved_resource_id

Reserved resource id of resource

$acco.accommodation_short_description

Accommodation short description

$acco.object_preference

Object preference

$acco.object_short_description

Object short description

$acco.object_description

Object description