JOT Templates > JOT JOT Tokens Reference

JOT Tokens Reference

Web Application Tokens:

Web Applications uses custom JOT Tokens to render content with the properties of server-side Java objects. For example, JOT.CustomerName is a JOT Token that references an application specific CustomerName property. JOT Tokens can also reference servlet properties such as Session attributes and Request parameters (from HTML input tags). So JOT.LoginName could be a token that references the LoginName Session attribute.

Logical Tokens:

Logical tokens are used for including or skipping sections of content on a page depending on whether some condition is true or not. The JOT Template example illustrates these tokens.

JOT.If(condition) : Renders page content up to a matching JOT.End or JOT.Else token if condition is true. Example: JOT.If(JOT.PreferredCustomer) ... JOT.End
JOT.ElseIf(condition) : Renders page content up to a matching JOT.End or JOT.Else token if condition is true. Example: JOT.ElseIf(JOT.InactiveCustomer)
JOT.Else : Renders page content up to a matching JOT.End token.
JOT.Boolean(value) : Determines if value is a true condition. For numeric values the result is true for non-zero and false for zero. Example: JOT.If(JOT.Boolean(JOT.OrderCount))
JOT.Not(value) : Determines if value is a false condition. This is the opposite of JOT.Boolean. Example: JOT.If(JOT.Not(JOT.InactiveCustomer))
JOT.True : A true condition. Example (always true): JOT.If(JOT.True)
JOT.False : A false condition. Example (always false): JOT.If(JOT.False)
JOT.Property.Equals(value) : Is a true condition if Property equals value. Example: JOT.If(JOT.LoginId.Equals(JOT.CustomerId))
JOT.Or([terms...]) : Is a true condition if any of the terms are true. Example: JOT.If(JOT.Or([JOT.LoggedIn, JOT.PublicPage, JOT.TestMode]))
JOT.And([terms...]) : Is a true condition if all of the terms are true. Example: JOT.If(JOT.And([JOT.LoggedIn, JOT.SecurePage]))
JOT.Null(content) : Determines if content is null (missing). Example: JOT.If(JOT.Null(JOT.ShippingPreference))
JOT.IfNull(content,alternate) : Renders content, or renders alternate if content is null (missing). Example: JOT.IfNull(JOT.Customer, JOT.NewCustomer)
JOT.IsaProperty(propertyName) : Determines if propertyName is a property. Example: JOT.If(JOT.TripForm.IsaProperty(roundTripChecked))JOT.RoundTripComponent()JOT.End
JOT.IfProperty(propertyName,alternate) : Renders the property if propertyName is a property with non null content, or renders alternate if not. Example: <input type=text name="username" value="JOT.IfProperty(loginName, '')">

Loop Tokens:

This group of tokens are used for repeating sections of page content, such as for each row of a table. The JOT Template example illustrates these tokens.

JOT.Repeat(condition) : Repeats a section of page content up to a matching JOT.End token while condition is true. The condition is usually a JOT.Next token. Example: JOT.Repeat(JOT.PurchasedItems.Next)
JOT.ListName.Next : Advances to the next element in a repeated section of page content. Example: JOT.Repeat(JOT.PurchasedItems.Next)
JOT.ListName.More : Determines if there are any more elements available for a repeated section of page content. Example: JOT.If(JOT.PurchasedItems.More)
JOT.ListName.Element : References the current element in a repeated section of page content. Example: JOT.PurchasedItems.Element.Price
JOT.ListName.Position : References the ordinal position (count) of the current element in a repeated section of page content. Example: Caller number JOT.Caller.Position is JOT.Caller.Name

Content Tokens:

JOT.Content(template) : Renders a JOT Web Component with a specified JOT Template. The JOT Web Components section illustrates the use of this token. Example: JOT.CustomerInfo.Content(/webpages/CustomerInfo.wml)
JOT.Views.Component(className) and JOT.Views.Component(className,template): Renders a JOT Web Component. Example: JOT.Views.Component(com.examples.CustomerInfo)
JOT.Include(resource) : Includes content from a non-template resource such as a file, URL, or Servlet. Example: JOT.Include(/webpages/SomeStaticContent.html)
JOT.WebappURL(path) : Produces an absolute URL with the host name and web application name. Example: <base href=JOT.WebappURL(path1/path2)> produces a URL like: <base href=http://host/myapp:9090/path1/path2>
JOT.URLEncode(content) : Encodes special characters with URL encoding. This is intended for use with the query part of a URL that follows the '?'. Example: http://host/myapp/path1?foo=JOT.URLEncode(I & thou) produces a URL like: http://host/myapp/path1?foo=I+%26+thou
JOT.HTMLText(content) : Replaces HTML markup symbols in with HTML character entities. Example: <input type="checkbox" name="FooX" value="JOT.HTMLText(JOT.FooX)">

© 2007 JOT Object Technologies