~>\t/<~ | |
WhatWhyWhereDownloadInstallRunHowQuickstartHTMLXMLCustom TagsOverlaysAlternate SyntaxExamplesReferenceTagsviewhtmlctrltagneticconfigJavaScript LibsJavadocWhenWhoSF Project Link |
viewscriptcontextname: js, scriptcontext: org.tagnetic.core.scriptcontext.implementer.javascript.JavaScriptContext
Defines the set of tags that are considered part of the "View" in a MVC design.
These tags and any script that they use will be "run" or executed at the time that
the source files are transformed into the destination files. No context about a particular
user's data, session or request should be used as part of these tags. For tags that
deal with that sort of information, use the ctrl tags.
defineclassname: org.tagnetic.core.tags.define.DefineDefines a variable for use in scripting. The value can be specified in the body of
the tag. Both of these examples define a script variable foo with the value
of bar:
name REQUIREDThe name of the variable.
valueThe value of the variable.
valueisvarA boolean value "true" or "false") indicating that the variable value is not a literal
(string, boolean, or number literal), but the name of an existing variable.
defclassname: org.tagnetic.core.tags.define.DefineIncludeAllows a short-hand way to declare many simple variables as attributes of the def tag. Only supports values that are literals. Use the view:define tag for non-literal values. Example: <view:def color="blue" shape="round"/> will create two script variables, color with a value of blue and shape with a value of round. outclassname: org.tagnetic.core.tags.define.OutPrints out a script variable. There are a few forms the out tag can take:
(To support these multiple syntaxes, a name attribute is not formally declared on this tag. Instead the dynamic attributes are used to figure out the name of the script variable.) includeclassname: org.tagnetic.core.tags.define.DefineIncludeIncludes the contents of a page that is specified by the path attribute.
pathThe path to the file to include. This path should be relative to the page that is
using the include tag.
newscopeBy default, the include tag creates a new script scope for the
tags used in the body of the include tag, as well as the file that is included
as part of the include tag. This can be changed on a tag by tag basis by including
this attribute on the particular include tag.
includeparamclassname: org.tagnetic.core.tags.define.IncludeParamUsed inside a page that is included by another page. It allows the included page to specify a script variable that is required by the included page. If the page that includes the included file does not define that variable, an exception will be generated, unless a default value is specified as part of this tag. A default value is specified in the body of the tag. Examples: <view:includeparam name="foo"/> (Will throw exception if foo is not defined) <view:includeparam name="foo">defaultValue</view:includeparam> (If foo is not defined by the including page, then foo's value will be defaultValue.) name REQUIREDThe name of the script variable.
resourcebundleclassname: org.tagnetic.core.tags.resource.BundleSpecifies a Java Resource Bundle to be used in the page. Use the view:res tag
to output a specific resource, based on the currently defined locale. Locales
are defined in a tagneticconfig file's compilation child elements.
name REQUIREDThe name to identify this bundle. Used in the view:res tag to limit the search
scope when trying to print out a resource.
base REQUIREDThe Java package/class name that is the base of the resource bundle.
resclassname: org.tagnetic.core.tags.resource.ResourceOutPrints out a resource value, based on the currently defined locale. The resource must be located in a bundle that was defined with the view:resourcebundle tag. The bundle attribute of this tag can be used to specify a specifc bundle to use to find the resource. If no bundle name is specified, then all resource bundles that were defined as part of the page will be searched. There are a few forms the out tag can take:
(To support these multiple syntaxes, a name attribute is not formally declared on this tag. Instead the dynamic attributes are used to figure out the name of the resource key.) bundleA name of a bundle, to limit the search scope for finding the resource. This name
should match the value given in the name attribute of the view:resourcebundle
tag.
chooseclassname: org.tagnetic.core.tags.logic.ChooseA wrapper tag that is required if the view:elsif and/or view:else tags are to be used with a view:if tag. Example: <view:choose> <view:if><view:test>value == 'one'</view:test> Value is one. </view:if> <view:elseif><view:test>value == 'two'</view:test> Value is two. </view:elseif> <view:else> Value is not one or two. </view:else> </view:choose> ifclassname: org.tagnetic.core.tags.logic.IfOnly includes the body of the tag if a view:test expression evaluates to true in the scripting language. There are two ways to use this tag:
elseifclassname: org.tagnetic.core.tags.logic.ElseIfUsed as part of an if/elseif/else set. It should have a nested view:test tag. See view:choose example. elseclassname: org.tagnetic.core.tags.logic.ElseUsed as part of an if/elseif/else set. The body of the tag is included in the page output when the associated if/elseif tests fail. See view:choose example. testclassname: org.tagnetic.core.tags.logic.TestUsed as a child of view:if or view:elseif. The body of the view:test tag is a script expression that should be interpreted as a true/false result. The boolean result is communicated to the parent view:if or view:elseif tag. See view:choose example for usage. The body of the tag does *not* have to be XML escaped (for instance, < does not have to be written as <). This means the source document that has this tag will not validate as valid XML. If you want have the source validate, then declare an overlay in your tagnetic config file that will XML unescape the body of the tag before it is sent to the script engine. Make sure to set the priority to 0 so that the overlay executes before the normal view:test tag handler. <tags nsprefix="view" scriptcontextname="js" scriptcontext="org.tagnetic.core.scriptcontext.implementer.javascript.JavaScriptContext"> <tag name="test" classname="org.tagnetic.core.tags.XmlUnEscapeTag" priority="0"/> </tags>If you use the overlay, then you can write the script in XML escaped format. For instance, the script expression "value < 5" would be written as: <view:test>value < 5</view:test>. scriptclassname: org.tagnetic.core.tags.ScriptTagThe body of the tag does *not* have to be XML escaped (for instance, < does not have to be written as <). This means the source document that has this tag will not validate as valid XML. If you want have the source validate, then declare an overlay in your tagnetic config file that will XML unescape the body of the tag before it is sent to the script engine. Make sure to set the priority to 0 so that the overlay executes before the normal view:script tag handler. <tags nsprefix="view" scriptcontextname="js" scriptcontext="org.tagnetic.core.scriptcontext.implementer.javascript.JavaScriptContext"> <tag name="script" classname="org.tagnetic.core.tags.XmlUnEscapeTag" priority="0"/> </tags> If you use the overlay, then you can write the script in XML escaped format. For
instance, the script expression "value = ' foreachclassname: org.tagnetic.core.tags.logic.ForEachAllows iteration over simple integer increment count, a script array, or the properties in a script object. Each successful iteration will output the body of the tag.
objectThe script variable name that is a reference to either an array or object. See examples
in the general tag description above for more information.
varThe script variable that will hold a reference to the value/object that is at the current
index in the array for array iteration, or a reference to the value of the current object
member for object iteration. If no value is given, then no variable will be set.
See examples in the general tag description above for more information.
startAn integer literal or a script variable that evaluates to an integer value. Specifies the
start position for the foreach tag in integer or array iteration. See examples in the general
tag description above for more information.
endAn integer literal or a script variable that evaluates to an integer value. Specifies the
end position for the foreach tag in integer or array iteration. See examples in the general
tag description above for more information.
stepAn integer literal or a script variable that evaluates to an integer value. Specifies the
step amount that should be used in integer or array iteration. See examples in the general
tag description above for more information.
loopstatusvarThe variable name for a script object that contains information about the current iteration.
If this attribute is not set, then a default name will be used: loopStatus.
The object has the following properties:
xmldatasourceclassname: org.tagnetic.core.tags.datasource.XmlDataSourceLoads XML into a script variable. If javascript is the script language, then the E4X language extensions are used to manipulate the data in script. var REQUIREDThe script variable name that will hold the XML content.
pathThe path to the XML file. The path is considered relative to the page that is using the
xmldatasource tag.
tagcollectionclassname: org.tagnetic.tagneto.tags.view.TagCollectionInserts the collection of tags that match the name attribute. It essentially dumps the tags that are collected by the TagCollector class. The TagCollector class is used in HtmlTags.xml to collect script, link and style tags. You do not need to use the tagcollection tag if you want the collected tags to be inserted as children of the HTML HEAD element. The TagCollector class automatically puts in a post file filter that uses the TagCollection class to insert all collected tags in the HEAD element. However, if you want more control over where the tags are outputted, use this tag. Once the collection of tags with the specified tag name is outputted with this tag, they will not be dumped as part of the post file filter process in the HEAD area. name REQUIREDThe name of the type of collected tag to output, for instance script or link.
noparseclassname: org.tagnetic.core.tags.NoParseTagInstructs the parser not to parse any tags in the body of the tag.
htmlescapeclassname: org.tagnetic.tagneto.tags.html.HtmlEscapeTagHTML-escapes some characters in the body of the tag:
|