Common template properties:
studio-templates
directory of the project.6.4.2-6.4.5
, 6.4.0-unbounded
.In the Properties list you can create properties that will be entered by users and passed to the template. A property can have the following parameters:
packageName: String
className: String
name: String
uncapitalizedClassName: String
fqn: String
genericIdType: String
- "UUID", "String", "Integer", "Long", "IdProxy", "Embedded"isEmbeddable: boolean
compKeyClassName: String
- composite key class name or nullcompKeyFqn: String
- composite key class FQN or nullisDeepInheritor(String typeFqn): boolean
- checks if the entity is or is inherited from the class with give FQNhasAnnotation(String annotationName): boolean
- checks whether the entity has the given annotationgetAnnotation(String annotationName): AnnotationModel
- returns annotation description objectgetAllAnnotations(): List<AnnotationModel>
- returns descriptions of all annotations of the entitygetParent(): Entity
- returns entity ancestorgetAttribute(String name): EntityAttribute
- returns attribute description object or nullname: String
isDeepInheritor(String typeFqn): boolean
- checks if the attribute type is or is inherited from the class with give FQNhasAnnotation(String annotationName): boolean
- checks whether the attribute has the given annotationgetAnnotation(String annotationName): AnnotationModel
- returns annotation description objectgetAllAnnotations(): List<AnnotationModel>
- returns descriptions of all annotations of the entityallowPutToDataAware(): boolean
- defines whether to add this attribute to a data-aware component (FieldGroup, Table). getEntityType(): Entity
- if the attribute is of entity type, return this entity, otherwise returns null.name: String
getEntity(): Entity
getProperty(String name): ViewProperty
getOrderedRootProperties():List<ViewProperty>
- all view properties including inherited, sorted by their definition in entityname: String
view: View
entity: Entity
isClass: boolean
- returns true if the entity attribute is entitygetSubProperties(): Set<ViewProperty>
- all immediate nested properties defined inline or in a nested viewgetSubProperty(String : propertyName): ViewProperty
- returns a nested property by namejava.lang.String
.java.lang.Boolean
.java.lang.Integer
.java.lang.String
.Collection<String>
.java.lang.String
.table
, groupTable
, treeTable
. If treeTable
is selected, an additional Hierarchical property field will be shown. An entity should be selected in the Related property parameter. An object with the following properties will be passed to the scripts:xmlName : String
- table XML element namedsName : String
- datasource XML element name
id : String
agent : String
reference : String
ancestorScreen : Screen
ancestorRef: String
controllerClassName : String
controllerFqn: String
isBase: boolean
- if it is a screen from an application component.A template contains a set of source items. Source items are generated by Groovy SimpleTemplateEngine scripts. The following common properties will be passed to the scripts along with custom properties specified for the template:
xmlNamespace_window
- xmlns attribute value for screen XMLcopyright: String
classComment: String
api
- an object with the following methods:
processSnippet(String snippetRelativePath, Map<String, Object> binding): String
- processes a snippet and returns a result as StringevaluateScript(String snippetRelativePath, Map<String, Object> binding): String
- evaluates a Groovy script and returns a valuecompareWithCurrentPlatformVersion(String platformVersion): int
- compares the given version with the platform version used by the current project. Returns 0 if they are equal, <0 if the current version is less and >0 if the current version is greater.log(String msg)
- logs a message to Studio consolepluralForm(String word): String
- tries to make a plural form of the given word.The descriptor script runs first and can define shared variables that can be used in other scripts. For example:
<% sharedVar = 'some value' %>