1 Template

Class Ax.freemarker.Template


Constructor Summary

Method
Description
JSFreemarker(Ax.text.String text)
Creates a new Freemarker engine instance.

Method Summary

Modifier and Type
Method
Description
void 
__process(Map data, Writer out)
Processes the data in the JSON in the template.
Ax.text.String 
process(Ax.text.String name,Object data)
Processes the data in an Object.
long 
process(Ax.text.String name, Object data, Ax.io.File file)
Ax.text.String 
process(Map data)
Processes the data in the JSON in the template.
long 
process(Map data, Ax.io.File file)
Processes the data in the JSON in the template.
Ax.freemarker.Template 
setDateFormat(Ax.text.String dateFormat)
Sets the date format to use.
Ax.freemarker.Template 
setLanguage(Ax.text.String lang)
Sets the language to use, like en-US | en-GB | es_ES .
Ax.freemarker.Template 
setNumberFormat(Ax.text.String numberFormat)
Sets the number format to use, like 0.

Constructor Detail

Ax.freemarker.Template.JSFreemarker

Ax.freemarker.Template.JSFreemarker(
	string text
						)
Info:
Creates a new Freemarker engine instance.
Parameters:
text - template to use

Method Detail

Ax.freemarker.Template.__process

null Ax.freemarker.Template.__process(
	object data,
	object out
)
Info:
Processes the data in the JSON in the template.
Parameters:
data - map(JSON) with the data
out - 
Returns:
null

Ax.freemarker.Template.process

string Ax.freemarker.Template.process(
	string name,
	object data
)
Info:
Processes the data in an Object. It also gives the data a name, that is used in the template to refer it. Object can be a JSResultSet.
Parameters:
name - name to give to the data object
data - data to process
Returns:
string

Example
Copy
var tables = Ax.db.executeQuery("SELECT * FROM systables WHERE tabid  10");
 
		var fm = new Ax.freemarker.Template(`
		?xml version="1.0" encoding="UTF-8"?
		
		   #list rs as row
		   \${row["tabid"]}\${row["tabname"]}
Example
Copy
Example
Copy

Ax.freemarker.Template.process

long Ax.freemarker.Template.process(
	string name,
	object data,
	file file
)
Parameters:
name - 
data - 
file - 
Returns:
long

Ax.freemarker.Template.process

string Ax.freemarker.Template.process(
	object data
)
Info:
Processes the data in the JSON in the template.
Parameters:
data - map(JSON) with the data
Returns:
string

Ax.freemarker.Template.process

long Ax.freemarker.Template.process(
	object data,
	file file
)
Info:
Processes the data in the JSON in the template.
Parameters:
data - map(JSON) with the data
file - the file were data will be written
Returns:
long

Ax.freemarker.Template.setDateFormat

object Ax.freemarker.Template.setDateFormat(
	string dateFormat
)
Info:
Sets the date format to use.
Parameters:
dateFormat - date format
Returns:
object

Ax.freemarker.Template.setLanguage

object Ax.freemarker.Template.setLanguage(
	string lang
)
Info:
Sets the language to use, like en-US | en-GB | es_ES .
Parameters:
lang - language
Returns:
object

Ax.freemarker.Template.setNumberFormat

object Ax.freemarker.Template.setNumberFormat(
	string numberFormat
)
Info:
Sets the number format to use, like 0.#### .
Parameters:
numberFormat - number format
Returns:
object