## text.vm demo foo = bar hello.whoever = Hello {0}! world = World appname = Showcase ## Error.vm error.header = There has been an error! error.sorry = There has been an error! ## Default.vm css.name = CSS Layout css.issuesHeader = Known Issues css.issues = This layout fails in IE4.5/Mac. That browser has poor support for CSS absolute positioning, yet it recognizes and executes the CSS @import statement used to hide CSS from broken browsers. Currently, there is no known solution. css.niftyHeader = Nifty Layout Techniques css.nifty = All sorts of nifty layout can be accomplished using cascading style sheets (CSS). Check out bluerobot.com and the Layout Reservoir ## Print.vm print.name = Print Layout ## Simple.vm simple.name = Simple Layout ## Table.vm table.name = Table Layout ## index.vm index.greeting = Hi index.explanation = This is a demo application meant to showcase the abilities of \ the various tools provided by the VelocityTools library, as well \ as some best practices for using them with the VelocityView servlets. index.start = To begin, choose a tool from the menu. index.asterisk = With the exception of the way we abuse the RenderTool and \ Velocimacros. They've been stretched pretty far in order to allow the content \ to be very rapidly developed and more user-interactive than is usually needed. \ This has entailed the loss of some performance and much clarity. As such, the \ way we use these two facilities should probably not be considered a best practice. :) ## layoutmenu.vm layouts.header = Choose a layout layouts.css = CSS Layout layouts.simple = Simple Layout layouts.table = Table Layout layouts.print = Print Layout ## toolmenu.vm tools.header = Choose a tool tools.alternator = AlternatorTool tools.browser = BrowserTool tools.class = ClassTool tools.context = ContextTool tools.convert = ConversionTool tools.cookies = CookieTool tools.date = DateTool tools.display = DisplayTool tools.esc = EscapeTool tools.field = FieldTool tools.import = ImportTool tools.link = LinkTool tools.lists = ListTool tools.math = MathTool tools.loop = LoopTool tools.number = NumberTool tools.pager = PagerTool tools.params = ParameterTool tools.render = RenderTool tools.text = ResourceTool tools.search = SearchTool tools.sorter = SortTool tools.xml = XmlTool ## demo common resources demo.function = Function demo.result = Demo Result demo.nullResult = null demo.clear = Clear All demo.description = Description demo.descriptionMissing = [TODO: add description] demo.try = Try it! demo.tryAgain = Try Again! demo.tryAnything = Try any code out here. demo.thisPage = This page demonstrates functions of the {0} demo.mainExampleHeader = Example Display demo.mainResultsIntro = Your code returned the following results demo.toString = Returns a customized string representation of the tool. # alternator.vm resources alternator.intro = The example at the bottom is a good \ demonstration of the difference between an automatic {0} and a manual one. \

Please see the javadoc for {0} to understand how they work and the methods \ you can call on them. \

Also note that the varargs methods here only work fully with Velocity 1.6 \ (which supports vararg method calls). The old non-vararg versions are still \ available (as seen in the demo below). But they are \ deprecated (and thus not listed below) to discourage those extending this \ tool or using it outside Velocity templates from depending on those methods. alternator.getAutoAlternateDefault = Returns true if Alternators created by this tool will auto-alternate by default. alternator.make = Returns a new, default Alternator that alternates over the specified values. alternator.make_booleanObjectVarArgs = Returns a new Alternater that alternates of the specified values using the specified auto-alternate setting. alternator.auto = Returns a new, automatically alternating Alternator that alternates over the specified values. alternator.auto_ObjectVarArgs.param1 = ['b','c','a'] alternator.manual = Returns a new, manually alternating Alternator that alternates over the specified values. alternator.manual_ObjectVarArgs.param1 = ['red','green'] alternator.custom = $alternator.make(['b','c','a']) # class.vm resources class.intro = By default, the ClassTool is set to inspect \ java.lang.Object, though you may set the "inspect" \ property in your ClassTool configuration to point to any class on the classpath. \ Also, a new ClassTool instance can be created for any class you wish \ by a call to one of the inspect() methods. \ By default, the safeMode property is set to true unless you \ configure it to be false. \ When true, safeMode will restrict ClassTool (or any instances it creates) to \ only inspecting classes, methods, fields and constructors that were declared public. class.getAnnotations = Returns a list of the Annotations of the class being inspected. class.getConstructors = Returns a list of ConstructorSubs for each constructor declared in the inspected class. class.getFields = Returns a list of FieldSubs for each field declared in the inspected class. class.getFullName = Returns the fully qualified name of the class being inspected. class.getMethods = Returns a list of MethodSubs for each method declared in the inspected class. class.getName = Returns the simple name of the class being inspected. class.getPackage = Returns the package name of the class being inspected. class.getShowDeprecated = Returns the current showDeprecated setting. class.getSafeMode = Returns the current safeMode setting. class.getType = Returns the actual Class being inspected. class.getTypes = Returns a Set of all Classes that are part of the signatures (i.e. parameters or return types) of the inspected Class's methods, constructors and fields. class.inspectSuper = Returns a new ClassTool instance that inspects the immediate superclass of the class being inspected. class.inspect_Class = Returns a new ClassTool instance that inspects the specified Class. class.inspect_Class.param1 = $class.class class.inspect_Object = Returns a new ClassTool instance that inspects the Class of the specified object. class.inspect_Object.param1 = $class class.inspect_String = Returns a new ClassTool instance that inspects the Class for the specified class name \ or null if no class can be found for the specified name. class.inspect_String.param1 = 'org.apache.velocity.tools.generic.ClassTool' class.isAbstract = Returns true if the class being inspected is abstract. class.isFinal = Returns true if the class being inspected is final. class.isInterface = Returns true if the class being inspected is an interface. class.isPrivate = Returns true if the class being inspected is private. class.isProtected = Returns true if the class being inspected is protected. class.isPublic = Returns true if the class being inspected is public. class.isStatic = Returns true if the class being inspected is static. class.isStrict = Returns true if the class being inspected is declared strict. class.supportsNewInstance = Returns true if a new instance of the class being inspected can be created via $class.type.newInstance(). class.toString = Returns the result of $class.type.toString(). # context.vm resources context.intro = This tool exists to provide access to the current context and various attributes of it. context.getThis = Returns the ViewContext currently being analyzed by this tool. context.contains = Returns true if there is a value available in the current request context for the specified key. context.get = Returns the value for the specified key in the current request context. context.getKeys = Returns a java.util.Set of the keys available in the current request context context.getToolbox = Returns a java.util.Map of the tools available in the current request context and their context keys. context.getValues = Returns a java.util.Set of the values available in the current request context. # display.vm resources display.intro = This tool provides a variety of methods for controlling the output \ displayed by various references in your templates. display.list = Formats a collection or array into the form "A, B and C". display.list_Object.param1 = ['A','B','C'] display.list_ObjectString = Formats a collection or array into a string delimited by the second argument display.list_ObjectStringString = Formats a collection or array into a string delimited by the second argument, except the last two arguments are delimited by the third argument display.truncate = Limits the string output of the specified value to the configured max length in characters (default is 30 characters). If the string gets curtailed, the configured suffix (default is "...") is used as the ending of the truncated string. display.truncate_Objectint = Limits the string output of the second argument to the specified number of characters. If the string gets curtailed, the configured suffix (default is "...") is used as the ending of the truncated string. display.truncate_ObjectString = Limits the string output of the first argument to the configured max length in characters (default is 30 characters). If the string gets curtailed, the specified suffix is used as the ending of the truncated string. display.truncate_ObjectintString = Limits the string output of the second argument to the specified number of characters. If the string gets curtailed, the specified suffix is used as the ending of the truncated string. display.alt = Returns the configured default value ("null" by default) if the specified value is null. display.alt_ObjectObject = Returns the second argument if first argument specified is null. display.cell = Truncates or pads the string value of the specified object as necessary to ensure that the returned string's length equals the default cell size. display.cell_Objectint = Truncates or pads the string value of the specified object as necessary to ensure that the returned string's length equals the specified cell size. display.cell_ObjectString = Truncates or pads the string value of the specified object as necessary to ensure that the returned string's length equals the default cell size. If truncation is necessary, the specified suffix will replace the end of the string value to indicate that. display.cell_ObjectintString = Truncates or pads the string value of the specified object as necessary to ensure that the returned string's length equals the specified cell size. If truncation is necessary, the specified suffix will replace the end of the string value to indicate that. display.message = Uses java.text.MessageFormat to format the specified String with the specified arguments. If there are no arguments, then the String is returned directly. display.message_StringObjectVarArgs.param1 = 'foo {1} {0}' display.message_StringObjectVarArgs.param2 = ['bar', 2] display.space = Returns a string of spaces of the specified length. display.space_int.param1 = 4 display.capitalize = Changes the first character of the string value of the specified object to upper case and returns the resulting string. display.uncapitalize = Changes the first character of the string value of the specified object to lower case and returns the resulting string. display.measure = Returns the measurements of the string value of the specified object. display.getCellLength = Returns the configured default cell size. display.getCellSuffix = Returns the configured default suffix used when cell contents need truncating. display.getDefaultAlternate = Returns the configured default alternate used by alt(Object). display.getListDelimiter = Returns the configured default delimiter used between items by the list formatting methods. display.getListFinalDelimiter = Returns the configured default delimiter used between the last two items by the list formatting methods. display.getTruncateLength = Returns the configured default length used by truncate(Object). display.getTruncateSuffix = Returns the configured default suffix used by the truncate methods. # field.vm resources field.intro = This tool allows easy access to public static fields in classes, such as string constants. field.get_String = Returns the value of the field with the specified name, if found. field.get_String.param1 = 'java.lang.Boolean.FALSE' field.in_Class = Loads all public static fields in the specified class. field.in_Class.param1 = $date.class field.in_Object = Loads all public static fields in the Class of the specified object. field.in_Object.param1 = 1 field.in_String = Looks for a class with the specified name; if found, loads all public static fields. field.in_String.param1 = 'java.lang.Float' field.custom = $field.in($field).INCLUDE_KEY # loop.vm resources loop.intro = This tool is a convenience tool to use with #foreach loops. It wraps a \ list to let you prematurely stop iterating, skip iterations, sync iteration over \ multiple lists in the same loop, easily \ determine if you are on the first or last iteration, get the number of iterations \ completed, automatically stop before or exclude particular elements and easily \ do all the above even with complex, nested loops. # xml.vm resources xml.intro = Tool for reading/navigating XML files. This uses dom4j under the \ covers to provide complete XPath support for traversing XML files. \ Most of the methods below will do nothing, as the default tool does not \ have any XML content to work with. For demo's sake, there is a file.xml \ in the classpath that is automatically loaded for you to work with, \ and we have turned of safe mode, so you can do things like \ $xml.read('tools.xml'). \ Still, the full demo at the bottom will likely be the most useful for you. xml.read_Object.param1 = ''file.xml'' xml.read_Object = Returns null if safe mode is on; otherwise \ this will accept url pointing to an XML document. It will then parse that document \ and return a new instance with that document's root element as its node. xml.parse_Object.param1 = ''that'' xml.parse_Object = Accepts XML strings. If the XML is valid, it will return a \ new XmlTool instance with the XML's root as its internal node. xml.get_Object.param1 = ''bar[2]'' xml.get_Object = This will first attempt to find an attribute with the \ specified name and return its value. If no such attribute \ exists or its value is null, this will attempt to convert \ the given value to a Number and get the result of get(Number). If the number conversion fails, \ then this will convert the object to a string. If that string \ does not start contain a '/', it appends the result of getPath() and a '/' to the front of it. \ Finally, it delegates the string to the find(String) method and returns the result of that. xml.getName = Asks get(Object) for "name". If none, this will return the result of getNodeName(). xml.getNodeName = Returns the name of the root node. If the internal Node \ list has more than one Node, it will only return the name of the first node in the list. xml.attr_Object.param1 = ''x'' xml.attr_Object = Returns the value of the specified attribute for the first/sole \ Node in the internal Node list for this instance, if that Node is an Element. If it is a non-Element node type or \ there is no value for that attribute in this element, then this will return null. xml.attributes = Returns a Map of all attributes for the first/sole \ Node held internally by this instance. If that Node is not an Element, this will return null. xml.isEmpty = Returns true if there are no Nodes internally held by this instance. xml.size = Returns the number of Nodes internally held by this instance. xml.iterator = Returns an Iterator that returns new XmlTool instances for each Node held internally by this instance. xml.getFirst = Returns a new instance that wraps only the first Node from this instance's internal Node list. xml.getLast = Returns a new instance that wraps only the last Node from this instance's internal Node list. xml.get_Number.param1 = 0 xml.get_Number = Returns a new instance that wraps the specified Node from this instance's internal Node list. xml.node = Returns the first/sole Node from this instance's internal Node list, if any. xml.find_Object.param1 = ''/*/a[@*]'' xml.find_Object = Converts the specified object to a String and calls find(String) with that. xml.find_String.param1 = ''@baz'' xml.find_String = Performs an XPath selection on the current set of \ Nodes held by this instance and returns a new instance that wraps those results. \ If the specified value is null or this instance does not currently hold any nodes, then this will return \ null. If the specified value, when converted to a string, does not contain a '/' character, then \ it has "//" prepended to it. This means that a call to $xml.find("a") is equivalent to calling \ $xml.find("//a"). The full range of XPath selectors is supported here. xml.getParent = Returns a new XmlTool instance that wraps the parent Element of the first/sole Node \ being wrapped by this instance. xml.getPath = Returns the XPath that identifies the first/sole Node represented by this instance. xml.parents = Returns a new XmlTool instance that wraps the parent Elements of each of the Nodes \ being wrapped by this instance. This does not return all ancestors, just the immediate parents. xml.children = Returns a new XmlTool instance that wraps all the \ child Elements of all the current internally held nodes that are Elements themselves. xml.getText = Returns the concatenated text content of all the internally held \ nodes. Obviously, this is most useful when only one node is held. xml.toString = If this instance has no XML Nodes, then this returns the result of super.toString(). Otherwise, \ it returns the XML (as a string) of all the internally held nodes \ that are not Attributes. For attributes, only the value is used. xml.custom = $xml.find(''*[@name]'').attributes()